[
  {
    "path": ".github/ISSUE_TEMPLATE/0bdsim-bug-report.md",
    "content": "---\nname: bdsim bug report\nabout: Create a report to help us improve bdsim, the Python based block diagram simulator\ntitle: \"[bdsim BUG]\"\nlabels: ''\nassignees: ''\n\n---\n\nFor bugs with the graphical tool `bdedit` please use the `bdedit` bug report template.\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nPlease provide a complete minimal stand-alone Python example.\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, for instance a problem with a SCOPE block, please add screenshots to help explain your problem.\n\n**Operating environment (please complete the following information):**\n - OS: [e.g. MacOS]\n - Version [e.g. Ventura]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/1bdedit-bug-report.md",
    "content": "---\nname: bdedit bug report\nabout: Create a report to help us improve bdedit, the graphical editor for block diagrams.\ntitle: \"[bdedit BUG]\"\nlabels: ''\nassignees: petercorke\n\n---\n\n**`bdedit` is an experimental editor for block diagrams that can be used in conjunction with `bdsim`. It is not a drop-in replacement for Simulink, if you want something reliable and supported buy it from The MathWorks.**\n\n**Before you post a bug please check that PyQt5 is properly installed on your computer, see the notes on the [wiki](https://github.com/petercorke/bdsim/wiki/Getting-going-with-PyQt5).  If you cannot run the PyQt5 test example then you need to resolve that yourself, please don't post it here.**\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Operating environment  (please complete the following information):**\n - OS: [e.g. MacOS]\n - Version [e.g. Ventura]\n\n**Your version of PyQT\n - please include the output of running `pip list | grep -I qt`\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/workflows/master.yml",
    "content": "\n# This workflow will install Python dependencies, run tests and lint with a variety of Python versions\n# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions\n\nname: build\n\non:\n  push:\n    branches: [ master, future ]\n#   pull_request:\n#     branches: [ master ]\n\njobs:\n  # Run tests on different versions of python\n  unittest:\n    runs-on: ${{ matrix.os }}\n    strategy:\n      matrix:\n        os: [windows-latest, ubuntu-latest, macos-13]\n        python-version: [\"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n\n    steps:\n    - uses: actions/checkout@v4\n    - name: Set up Python ${{ matrix.python-version }}\n      uses: actions/setup-python@v5\n      with:\n        python-version: ${{ matrix.python-version }}\n    - name: Install dependencies\n      run: |\n        python -m pip install --upgrade pip\n        pip install .[dev]\n\n    - name: Test with pytest\n      env:\n        MPLBACKEND: TkAgg\n      run: |\n        pytest --capture=no --ignore=W605 --timeout=50 --timeout_method=thread\n\n  codecov:\n    # If all tests pass:\n    # Run coverage and upload to codecov\n    needs: unittest\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    - name: Set up Python 3.10\n      uses: actions/setup-python@v5\n      with:\n        python-version: \"3.10\"\n    - name: Install dependencies\n      run: |\n        python -m pip install --upgrade pip\n    - name: Run coverage\n      run: |\n        pip install .[dev]\n        coverage run --omit='tests/*.py' -m pytest\n        coverage report\n        coverage xml \n    - name: upload coverage to Codecov\n      uses: codecov/codecov-action@v4\n      with:\n        file: ./coverage.xml\n\n  sphinx:\n    # If the above worked:\n    # Build docs and upload to GH Pages\n    needs: unittest\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v4\n    - name: Set up Python 3.10\n      uses: actions/setup-python@v5\n      with:\n        python-version: \"3.10\"\n    - name: Install dependencies\n      run: |\n        python -m pip install --upgrade pip\n        pip install .[dev,docs]\n        pip install git+https://github.com/petercorke/sphinx-autorun.git\n        pip install sympy\n        sudo apt-get install graphviz\n    - name: Build docs\n      run: |\n        cd docs\n        make html\n        # Tell GitHub not to use jekyll to compile the docs\n        touch build/html/.nojekyll\n        cd ../\n    - name: Commit documentation changes\n      run: |\n        git clone https://github.com/petercorke/bdsim.git --branch gh-pages --single-branch gh-pages\n        cp -r docs/build/html/* gh-pages/\n        cd gh-pages\n        git config --local user.email \"action@github.com\"\n        git config --local user.name \"GitHub Action\"\n        git add .\n        git commit -m \"Update documentation\" -a || true\n        # The above command will fail if no changes were present, so we ignore\n        # that.\n    - name: Push changes\n      uses: ad-m/github-push-action@master\n      with:\n        branch: gh-pages\n        directory: gh-pages\n        github_token: ${{ secrets.GITHUB_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/publish.yml",
    "content": "# This workflows will upload a Python Package using Twine when a release is created\n# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries\n\n# name: Upload Python Package\n\non:\n  release:\n    types: [created]\n  workflow_dispatch:\n\njobs:\n  deploy:\n\n    runs-on: ${{ matrix.os }}\n    strategy:\n      max-parallel: 2\n      matrix:\n        os: [ubuntu-latest]\n        python-version: ['3.10']\n\n    steps:\n    - uses: actions/checkout@v2\n    - name: Set up Python\n      uses: actions/setup-python@v2\n      with:\n        python-version: ${{ matrix.python-version }}\n    - name: Install dependencies\n      run: |\n        python -m pip install --upgrade pip\n        pip install -U setuptools wheel twine\n    - name: Build and publish\n      env:\n        TWINE_USERNAME: __token__\n        TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD_BDSIM }}\n      run: |\n        python setup.py sdist bdist_wheel\n        ls ./dist/*.whl\n        twine upload dist/*.gz\n        twine upload dist/*.whl\n"
  },
  {
    "path": ".gitignore",
    "content": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\nuntitled*.py\n\n# docs\n*.pdf\n*.dot\n\n\n# MATLAB\n*.m\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\npip-wheel-metadata/\nshare/python-wheels/\n*.egg-info/\n.installed.cfg\n*.egg\nMANIFEST\n\n*.json\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.nox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n*.py,cover\n.hypothesis/\n.pytest_cache/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\ndb.sqlite3\ndb.sqlite3-journal\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# IPython\nprofile_default/\nipython_config.py\n\n# pyenv\n.python-version\n\n# pipenv\n#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.\n#   However, in case of collaboration, if having platform-specific dependencies or dependencies\n#   having no cross-platform support, pipenv may install dependencies that don't work, or not\n#   install all needed dependencies.\n#Pipfile.lock\n\n# PEP 582; used by e.g. github.com/David-OConnor/pyflow\n__pypackages__/\n\n# Celery stuff\ncelerybeat-schedule\ncelerybeat.pid\n\n# SageMath parsed files\n*.sage.py\n\n# Environments\n.env\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mkdocs documentation\n/site\n\n# mypy\n.mypy_cache/\n.dmypy.json\ndmypy.json\n\n# Pyre type checker\n.pyre/\n.idea/\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nThis is a small-scale private project with a team size of about 0.01. I'd be delighted if you'd like to use and apply the tool, or even to contribute.\n\n## Communicating\nGitHub Issues is a convenient means to discuss bugs or possible contributions.\n\n## Bug notifications\nIf you're using bdsim and encounter errors with the latest version from GitHub then please report it through GitHib Issues.  Be sure to include:\n\n* a description of what the issue is, and the stack trace you get\n* the version of Python and numpy that you are using\n* a runnable code example that demonstrates the issue\n\n## Specific contributions needed\n\n* The numerical integrator from SciPy has some limitations.  It cannot handle:\n  *  hybrid continuous-discrete systems, \n  *  events associated with strong non-linearities or discontinuous inputs,\n  *  allow the state vector to be updated (ie. as would be required to renormalize a unit-quaternion state).\n* Extend to support bond graphs, or a hybrid of bond graphs and block diagrams.\n* There are many more blocks that could be created but of immediate interest are:\n  * real-time blocks that interface to ADCs, DACs and PWM channels for use on a RaspberryPi\n  * vision blocks that interface to cameras, displays and OpenCV operators\n\n## Other contributions\n\nThese are welcome but it'd be great to discuss through GitHub Issues before you start.  You will be acknowledged as the author, but by contributing you are agreeing to your work being shared under the MIT Licence.  Contributions should have unit tests and good quality documentation.\n\n## Feature requests\nThese are unlikely to be implemented by me, it's a time thing...\n\n## Any contributions you make will be under the MIT Software License\nIn short, when you submit code changes, your submissions are understood to be under the same [MIT License](http://choosealicense.com/licenses/mit/) that covers the project. \n\n## Code of conduct\n\nSo far there isn't one, but if there were it would embed principles from the [Contributor Covenant Code Of Conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct).\n\n"
  },
  {
    "path": "Icons.qrc",
    "content": ""
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2020 Peter Corke\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "Makefile",
    "content": ".FORCE:\n\nBLUE=\\033[0;34m\nBLACK=\\033[0;30m\n\nhelp:\n\t@echo \"$(BLUE) make test - run all unit tests\"\n\t@echo \" make coverage - run unit tests and coverage report\"\n\t@echo \" make docs - build Sphinx documentation\"\n\t@echo \" make docupdate - upload Sphinx documentation to GitHub pages\"\n\t@echo \" make dist - build dist files\"\n\t@echo \" make upload - upload to PyPI\"\n\t@echo \" make clean - remove dist and docs build files\"\n\t@echo \" make help - this message$(BLACK)\"\n\ntest:\n\tpytest\n\ncoverage:\n\tcoverage run --source='bdsim' -m pytest\n\tcoverage report\n\tcoverage html\n\topen htmlcov/index.html\n\ndocs: .FORCE\n\t(cd docs; make html)\n\nview:\n\topen docs/build/html/index.html\n\ndist: .FORCE\n\t#$(MAKE) test\n\tpython -m build\n\nupload: .FORCE\n\ttwine upload dist/*\n\ninstall:\n\tpip install -e .\n\nclean: .FORCE\n\t# (cd docsrc; make clean)\n\t-rm -r *.egg-info\n\t-rm -r dist build\n"
  },
  {
    "path": "README.md",
    "content": "[![A Python Robotics Package](https://raw.githubusercontent.com/petercorke/robotics-toolbox-python/master/.github/svg/py_collection.min.svg)](https://github.com/petercorke/robotics-toolbox-python)\n[![QUT Centre for Robotics Open Source](https://github.com/qcr/qcr.github.io/raw/master/misc/badge.svg)](https://qcr.github.io)\n\n[![PyPI version](https://badge.fury.io/py/bdsim.svg)](https://badge.fury.io/py/bdsim)\n![Python Version](https://img.shields.io/pypi/pyversions/bdsim.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n[![Build Status](https://github.com/petercorke/bdsim/workflows/build/badge.svg?branch=master)](https://github.com/petercorke/bdsim/actions?query=workflow%3Abuild)\n[![Coverage](https://codecov.io/gh/petercorke/bdsim/branch/master/graph/badge.svg)](https://codecov.io/gh/petercorke/bdsim)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/bdsim)](https://pypistats.org/packages/bdsim)\n[![GitHub stars](https://img.shields.io/github/stars/petercorke/bdsim.svg?style=social&label=Star)](https://GitHub.com/petercorke/bdsim/stargazers/)\n\n<table style=\"border:0px\">\n<tr style=\"border:0px\">\n<td style=\"border:0px\">\n<img src=\"https://github.com/petercorke/bdsim/raw/master/figs/BDSimLogo_NoBackgnd@2x.png\" width=\"300\"></td>\n<td style=\"border:0px\">\nA Python block diagram simulation package</a>\n<ul>\n<li><a href=\"https://github.com/petercorke/bdsim\">GitHub repository </a></li>\n<li><a href=\"https://petercorke.github.io/bdsim\">Documentation</a></li>\n<li><a href=\"https://github.com/petercorke/bdsim/wiki\">Wiki (examples and details)</a></li>\n<li><a href=\"installation#\">Installation</a></li>\n<li>Dependencies: numpy, scipy, matplotlib, <a href=\"https://github.com/petercorke/ansitable\">ansitable</a>, ffmpeg (if rendering animations as a movie)</li>\n</ul>\n</td>\n</tr>\n</table>\n\n`bdsim` is Python 3 package that enables modelling and simulation of continuous-time, discrete-time or hybrid dynamic systems.  Systems are conceptualized in block diagram form, but represented in terms of Python objects. \n\n  <table>\n  <tr>\n  <td>\n  <img width=450 src=\"https://github.com/petercorke/bdsim/raw/master/figs/bd1-sketch.png\">\n  </td>\n  <td style=\"padding-left: 20px;\">\n  <pre style=\"font-size:10px;\">\n  # define the blocks\n  demand = bd.STEP(T=1, name='demand')\n  sum = bd.SUM('+-')\n  gain = bd.GAIN(10)\n  plant = bd.LTI_SISO(0.5, [2, 1])\n  scope = bd.SCOPE(styles=['k', 'r--'])\n  # connect the blocks\n  bd.connect(demand, sum[0], scope[1])\n  bd.connect(plant, sum[1])\n  bd.connect(sum, gain)\n  bd.connect(gain, plant)\n  bd.connect(plant, scope[0])\n  </pre>\n  </td>\n  </tr>\n  </table>\n\nKey features include:\n\n* The block diagram can be created easily using Python code, rather than drawing boxes and wires. This enables use of your favourite IDE, standard version control tools and development workflows.\n* Wires can communicate *any* Python type such as scalars, lists, dicts, NumPy arrays, objects, and functions. For robotics and vision applications using the [Spatial Maths Toolbox for Python](https://github.com/petercorke/spatialmath-python) wires could send values such as `SE3`, `UnitQuaternion` or `Twist3` objects.\n* Over 70 blocks for linear, nonlinear functions, display blocks, as well as continuous- and discrete-time dynamics\n  * Easy to add your own block, it's simply a class\n  * Subsystems are supported, and a subsystem can be independently instantiated multiple times in a system.  Subsystems can also be nested.\n  * Blocks from other toolboxes are automatically discovered and included. There are blocks for some functions in the  [Robotics Toolbox for Python](https://github.com/petercorke/robotics-toolbox-python) (such as arm, ground and aerial robots) and [Machine Vision Toolbox for Python](https://github.com/petercorke/machinevision-toolbox-python) (such as cameras). These are defined in the `blocks` folder of those toolboxes.\n* The diagram can be executed in a headless configuration, particularly useful on an embedded computer like a RaspberryPi.\n* A [python-based graphical editor](bdedit-the-graphical-editing-tool)\n  * allows graphical creation of block diagrams\n  * the diagram is stored in a human readable/editable JSON file with extension `.bd`\n  * creates good-quality graphics for inclusion in publications\n  * can launch `bdsim` to import and execute the model\n  * automatically discovers all bsdim and toolbbox blocks and adds them to the block library menu\n  * icons can be easily created using any image creation tool or a LaTeX expression \n\n# Getting started\n\nWe first sketch the dynamic system we want to simulate as a block diagram, for example this simple first-order system\n\n![block diagram](https://github.com/petercorke/bdsim/raw/master/figs/bd1-sketch.png)\n\nwhich we can express concisely with `bdsim` as (see [`bdsim/examples/eg1.py`](https://github.com/petercorke/bdsim/blob/master/examples/eg1.py))\n\n```python\n     1  #!/usr/bin/env python3\n     2  import bdsim\t\n     4  sim = bdsim.BDSim()  # create simulator\n     5  bd = sim.blockdiagram()  # create an empty block diagram\n     6\t\n     7\t# define the blocks\n     8\tdemand = bd.STEP(T=1, name='demand')\n     9\tsum = bd.SUM('+-')\n    10\tgain = bd.GAIN(10)\n    11\tplant = bd.LTI_SISO(0.5, [2, 1], name='plant')\n    12\tscope = bd.SCOPE(styles=['k', 'r--'])\n    13\t\n    14\t# connect the blocks\n    15\tbd.connect(demand, sum[0], scope[1])\n    17\tbd.connect(sum, gain)\n    18\tbd.connect(gain, plant)\n    19\tbd.connect(plant, sum[1], scope[0])\n    20\t\n    21\tbd.compile()          # check the diagram\n    22\n    23\tsim.report(bd)   # list the system\n    24  out = sim.run(bd, 5)   # simulate for 5s\n```\nwhich is just 15 lines of executable code.\n\nThe red block annotations on the hand-drawn diagram are used as the names of the variables holding references to the block instance. The blocks can also have user-assigned names, see lines 8 and 11, which are used in diagnostics and as labels in plots.\n\nAfter the blocks are created their input and output ports need to be connected. In `bdsim` all wires are point to point, a *one-to-many* connection is implemented by *many* wires,\nfor example\n```\nbd.connect(source, dest1, dest2, ...)\n```\ncreates individual wires from `source` -> `dest1`, `source` -> `dest2` and so on.\nPorts are designated using Python indexing notation, for example `block[2]` is port 2 (the third port) of `block`.  Whether it is an input or output port depends on context.\nIn the example above an index on the first argument refers to an output port, while on the second (or subsequent) arguments it refers to an input port.  If a block has only a single input or output port then no index is required, 0 is assumed.\n\nA group of ports can be denoted using slice notation, for example \n```\nbd.connect(source[2:5], dest[3:6)\n```\nwill connect `source[2]` -> `dest[3]`, `source[3]` -> `dest[4]`, `source[4]` -> `dest[5]`.\nThe number of wires in each slice must be consistent.  You could even do a cross over by connecting `source[2:5]` to `dest[6:3:-1]`.\n\nLine 21 assembles all the blocks and wires, instantiates subsystems, checks connectivity to create a flat wire list, and then builds the dataflow execution plan.\n\nLine 23 generates a report, in tabular form, showing a summary of the block diagram:\n\n```\n┌────────┬──────────┬────────┬────────┬─────────────┐\n│ block  │   type   │ inport │ source │ source type │\n├────────┼──────────┼────────┼────────┼─────────────┤\n│demand@ │ step     │        │        │             │\n├────────┼──────────┼────────┼────────┼─────────────┤\n│gain.0  │ gain     │ 0      │ sum.0  │ float64     │\n├────────┼──────────┼────────┼────────┼─────────────┤\n│plant   │ lti_siso │ 0      │ gain.0 │ float64     │\n├────────┼──────────┼────────┼────────┼─────────────┤\n│scope.0 │ scope    │ 0      │ plant  │ float64     │\n│        │          │ 1      │ demand │ int         │\n├────────┼──────────┼────────┼────────┼─────────────┤\n│sum.0   │ sum      │ 0      │ demand │ int         │\n│        │          │ 1      │ plant  │ float64     │\n└────────┴──────────┴────────┴────────┴─────────────┘\n```\n\nLine 24 runs the simulation for 5 seconds \nusing the default variable-step RK45 solver and saves output values at least every 0.05s.  It\ncauses the following output\n\n```\n>>> Start simulation: T = 5.00, dt = 0.050\n  Continuous state variables: 1\n     x0 =  [0.]\n  Discrete state variables:   0\n\nno graphics backend specified: Qt5Agg found, using instead of MacOSX\n\nbdsim ◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉◉ 100.0% - 0s\n\n<<< Simulation complete\n  block diagram evaluations: 784\n  block diagram exec time:   0.075 ms\n  time steps:                123\n  integration intervals:     2\n```\n\nThis provides a summary of the number of states for the complete system: the number of continuous states, the number\nof discrete states, and the initial value of the state vectors.\n\nDuring execution a progress bar is updated and scope blocks pops up a graphical window\n\n![bdsim output](https://github.com/petercorke/bdsim/raw/master/figs/Figure_1.png)\n\nThe simulation results are in a container object (`BDStruct`)\n```\n>>> out\nt      = ndarray:float64 (123,)\nx      = ndarray:float64 (123, 1)\nxnames = ['plantx0'] (list)\nynames = [] (list)            \n```\nwhich contains an array of time values, an array of state values, and a list of the\nnames of the state variables.\n\nBy default the `.run()` method at line 24 blocks blocks the script until all figure\nwindows are closed (by pressing the operating system close button or typing \"q\"), or the\nscript is killed with SIGINT. If you want to continue the script with the figures still\nactive then the `hold=False` option should be set.\n\nIf we wished to also record additional outputs, we can add them as _watched_ signals\n```\nout = sim.run(bd, watch=[demand, sum])  # simulate for 5s\n```\nand now the output is\n```\n>>> out\nt      = ndarray:float64 (123,)\nx      = ndarray:float64 (123, 1)\nxnames = ['plantx0'] (list)\ny0     = ndarray:float64 (123,)\ny1     = ndarray:int64 (123,)\nynames = ['plant[0]', 'demand[0]'] (list)\n```\nwhere\n\n- `t` the time vector: ndarray, shape=(M,)\n- `x` is the state vector: ndarray, shape=(M,N), one row per timestep\n- `xnames` is a list of the names of the states corresponding to columns of `x`, eg. \"plant.x0\"\n\nThe `watch` argument is a list of outputs to log, in this case `plant` defaults\nto output port 0.  This information is saved in additional variables `y0`, `y1`\netc.  `ynames` is a list of the names of the watched variables.\n\nAn alternative system report, created by `sim.report(bd, type=\"lists\")` is more detailed\n```\nBlocks::\n\n┌───┬─────────┬─────┬──────┬────────┬─────────┬───────┐\n│id │    name │ nin │ nout │ nstate │ ndstate │ type  │\n├───┼─────────┼─────┼──────┼────────┼─────────┼───────┤\n│ 0 │  demand │   0 │    1 │      0 │       0 │ step  │\n│ 1 │   sum.0 │   2 │    1 │      0 │       0 │ sum   │\n│ 2 │  gain.0 │   1 │    1 │      0 │       0 │ gain  │\n│ 3 │   plant │   1 │    1 │      1 │       0 │ LTI   │\n│ 4 │ scope.0 │   2 │    0 │      0 │       0 │ scope │\n└───┴─────────┴─────┴──────┴────────┴─────────┴───────┘\n\nWires::\n\n┌───┬──────┬──────┬──────────────────────────┬─────────┐\n│id │ from │  to  │       description        │  type   │\n├───┼──────┼──────┼──────────────────────────┼─────────┤\n│ 0 │ 0[0] │ 1[0] │ demand[0] --> sum.0[0]   │ int     │\n│ 1 │ 0[0] │ 4[1] │ demand[0] --> scope.0[1] │ int     │\n│ 2 │ 3[0] │ 1[1] │ plant[0] --> sum.0[1]    │ float64 │\n│ 3 │ 1[0] │ 2[0] │ sum.0[0] --> gain.0[0]   │ float64 │\n│ 4 │ 2[0] │ 3[0] │ gain.0[0] --> plant[0]   │ float64 │\n│ 5 │ 3[0] │ 4[0] │ plant[0] --> scope.0[0]  │ float64 │\n└───┴──────┴──────┴──────────────────────────┴─────────┘\n```\nIn the first table we can see key information about each block, its `id` (used internally), name, the number of input and output ports, the number of\ncontinuous- and discrete-time states, and the type which is the block class.  Note that the name is auto-generated based on the type, except if it has\nbeen set explicitly as for the blocks `demand` and `plant`.\n\nThe second table shows all wires in point-to-point form, showing the start and end block and port (the block is represented here by its `id`) and the type of the object sent along the wire.\n\nTo save figures we need to make two modifications, changing line 4 to\n```\n     4  sim = bdsim.BDSim(hold=False)  # create simulator\n```\nwhich prevents `.run()` from blocking and then deleting all the figures.\nThen, after the `.run()` we add \n```\n     25 scope.savefig()  # save scope figure\n```\nIf the filename is not given it defaults to the block name, in this case `scope.0.pdf`.\n\n\nThe output can be pickled and written to a file\n\n```[shell]\nexamples/eg1.py -o\npython -mpickle bd.out\nt      = ndarray:float64 (123,)\nx      = ndarray:float64 (123, 1)\nxnames = ['plantx0'] (list)\ny0     = ndarray:float64 (123,)\ny1     = ndarray:int64 (123,)\nynames = ['plant[0]', 'demand[0]'] (list)\n```\n\nby default the results are written to `bd.out`, use the option `--out FILE` to set it\nto a specific value.\n\nThe block parameters can also be overridden from the command line without having to \nedit the code.  To increase the loop gain we could write:\n```[shell]\nexamples/eg1.py --set gain.0:K=20\n```\n\nMore details on this Wiki about:\n\n- [Adding blocks](https://github.com/petercorke/bdsim/wiki/Adding-blocks)\n- [Connecting blocks](https://github.com/petercorke/bdsim/wiki/Connecting-blocks)\n- [Running the simulation](https://github.com/petercorke/bdsim/wiki/Running)\n- [Command line options](https://github.com/petercorke/bdsim/wiki/Runtime-options)\n\n## Other examples\n\nIn the folder `bdsim/examples` you can find a few other runnable examples:\n\n- [`eg1.py`](https://github.com/petercorke/bdsim/blob/master/examples/eg1.py) the example given above\n- [`waveform.py`](https://github.com/petercorke/bdsim/blob/master/examples/waveform.py) two signal generators connected to two scopes\n\nExamples from Chapter four of _Robotics, Vision & Control 2e (2017)_:\n\n- [`rvc4_2.py`](https://github.com/petercorke/bdsim/blob/master/examples/rvc4_2.py) Fig 4.2 - a car-like vehicle with bicycle kinematics driven by a rectangular pulse steering signal\n- [`rvc4_4.py`](https://github.com/petercorke/bdsim/blob/master/examples/rvc4_4.py) Fig 4.4 - a car-like vehicle driving to a point\n\n![RVC Figure 4.4](https://github.com/petercorke/bdsim/raw/master/figs/rvc4_4.gif)\n\n- [`rvc4_6.py`](https://github.com/petercorke/bdsim/blob/master/examples/rvc4_6.py) Fig 4.6 - a car-like vehicle driving to/along a line\n\n![RVC Figure 4.6](https://github.com/petercorke/bdsim/raw/master/figs/rvc4_6.gif)\n\n- [`rvc4_8.py`](https://github.com/petercorke/bdsim/blob/master/examples/rvc4_8.py) Fig 4.8 - a car-like vehicle using pure-pursuit trajectory following\n\n![RVC Figure 4.6](https://github.com/petercorke/bdsim/raw/master/figs/rvc4_8.gif)\n\n- [`rvc4_11.py`](https://github.com/petercorke/bdsim/blob/master/examples/rvc4_11.py) Fig 4.11 a car-like vehicle driving to a pose\n\n![RVC Figure 4.11](https://github.com/petercorke/bdsim/raw/master/figs/rvc4_11.gif)\n\nFigs 4.8 (pure pursuit) and Fig 4.21 (quadrotor control) are yet to be done.\n\n# A more concise way\n\nWiring, and some simple arithmetic blocks like `GAIN`, `SUM` and `PROD` can be implicitly generated by overloaded Python operators.  This strikes a nice balance between block diagram coding and Pythonic programming.\n\n```\n     1  #!/usr/bin/env python3\n     2\n     3  import bdsim\n     4\n     5  sim = bdsim.BDSim()  # create simulator\n     6  bd = sim.blockdiagram()  # create an empty block diagram\n     7\n     8  # define the blocks\n     9  demand = bd.STEP(T=1, name='demand')\n    10  plant = bd.LTI_SISO(0.5, [2, 1], name='plant')\n    11  scope = bd.SCOPE(styles=['k', 'r--'], movie='eg1.mp4')\n    12\n    13  # connect the blocks using Python syntax\n    14  scope[0] = plant\n    15  scope[1] = demand\n    16  plant[0] = 10 * (demand - plant)\n    17\n    18  bd.compile()   # check the diagram\n    19  bd.report()    # list all blocks and wires\n    20\n    22  out = sim.run(bd, 5, watch=[plant,])  # simulate for 5s\n```\nThis requires fewer lines of code and the code is more readable. Importantly, it results in in *exactly the same* block diagram in terms of blocks and wires\n```\nWires::\n\n┌───┬──────┬──────┬──────────────────────────────┬─────────┐\n│id │ from │  to  │         description          │  type   │\n├───┼──────┼──────┼──────────────────────────────┼─────────┤\n│ 0 │ 1[0] │ 2[0] │ plant[0] --> scope.0[0]      │ float64 │\n│ 1 │ 0[0] │ 2[1] │ demand[0] --> scope.0[1]     │ int     │\n│ 2 │ 0[0] │ 3[0] │ demand[0] --> _sum.0[0]      │ int     │\n│ 3 │ 1[0] │ 3[1] │ plant[0] --> _sum.0[1]       │ float64 │\n│ 4 │ 3[0] │ 4[0] │ _sum.0[0] --> _gain.0(10)[0] │ float64 │\n│ 5 │ 4[0] │ 1[0] │ _gain.0(10)[0] --> plant[0]  │ float64 │\n└───┴──────┴──────┴──────────────────────────────┴─────────┘\n```\nThe implicitly created blocks have names prefixed with an underscore.\n\n# bdedit: the graphical editing tool\n\n![block diagram](https://github.com/petercorke/bdsim/raw/master/figs/eg1-bdedit.png)\n\n`bdedit` is a multi-platform PyQt5-based graphical tool to create, edit, render and execute block diagram models.\n\nFrom the examples folder\n```\n% bdedit eg1.bd\n```\nwill create a display like that shown above.  Pushing the run button, top left (triangle in circle) will spawn `bdrun` as a subprocess which will:\n\n* parse the JSON file\n* instantiate all blocks and wires\n* compile and run the diagram\n\n<a href=\"https://www.youtube.com/watch?v=1qM5D0jekjc\"><img width=100 style=\"vertical-align:middle\" src=\"https://cdn.mos.cms.futurecdn.net/8gzcr6RpGStvZFA2qRt4v6-1920-80.jpg.webp\"> <span style=\"\">Screencast showing bdedit usage.</span></a>\n\n\n# Article\n\nI published [this article on LinkedIn](https://www.linkedin.com/pulse/journey-toward-open-source-block-diagram-simulation-peter-corke/?trackingId=wrJYinHUgAHDq63Nv65PnA%3D%3D), which describes the thought process behind bdsim.\n\n# Limitations\n\nThere are lots!  The biggest is that `bdsim` is based on a very standard variable-step integrator from the scipy library.  For discontinuous inputs (step, square wave, triangle wave, piecewise constant) the transitions get missed.  This also makes it inaccurate to simulate hybrid discrete-continuous time systems.  We really need a better integrator, perhaps [`odedc`](https://help.scilab.org/docs/6.1.0/en_US/odedc.html) from SciLab could be integrated.\n\n\n"
  },
  {
    "path": "bdsim/__init__.py",
    "content": "# from bdsim.bdsim import *\n# from bdsim.blockdiagram import *\n# from bdsim.components import *\n# from bdsim.graphics import GraphicsBlock\n# from bdsim.bdrun import bdrun, bdload\n\nfrom .run_sim import *\nfrom .run_realtime import *\nfrom .blockdiagram import *\nfrom .components import *\nfrom .graphics import GraphicsBlock\nfrom .bdrun import bdrun, bdload\n\ntry:\n    import importlib.metadata\n\n    __version__ = importlib.metadata.version(\"bdsim\")\nexcept:\n    pass\n"
  },
  {
    "path": "bdsim/bdedit/Icons.py",
    "content": "# -*- coding: utf-8 -*-\n\n# Resource object code\n#\n# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)\n#\n# WARNING! All changes made in this file will be lost!\n\nfrom PyQt5 import QtCore\n\nqt_resource_data = b\"\\\n\\x00\\x00\\x0e\\xc4\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x64\\x00\\x00\\x00\\x64\\x08\\x06\\x00\\x00\\x00\\x70\\xe2\\x95\\x54\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc3\\x00\\x00\\x0e\\xc3\\x01\\xc7\\x6f\\\n\\xa8\\x64\\x00\\x00\\x0e\\x59\\x49\\x44\\x41\\x54\\x78\\x5e\\xed\\xdd\\x05\\x8c\\\n\\x34\\x49\\x19\\x06\\xe0\\x1f\\x77\\x77\\x77\\x77\\x77\\x38\\xdc\\xdd\\xed\\x70\\\n\\x08\\x12\\x24\\x40\\xb0\\x40\\xd0\\x10\\x0e\\x77\\x77\\x87\\x10\\x3c\\x38\\x07\\\n\\x1c\\x76\\x38\\x1c\\xee\\xee\\xee\\x0e\\xef\\xc3\\x6d\\x91\\x61\\xd2\\x5d\\xd3\\\n\\x3d\\xdb\\xdd\\xd3\\xcb\\xcd\\x9b\\xbc\\xd9\\xbd\\xbd\\xdd\\x7f\\xaa\\xeb\\xab\\\n\\xfa\\xbc\\xaa\\xf7\\x6d\\xb1\\xc5\\x16\\x5b\\x6c\\xb1\\xc5\\x16\\x5b\\x6c\\x31\\\n\\x02\\x0e\\xb7\\xf3\\x75\\x2f\\xe0\\x24\\xe1\\xe9\\x76\\x78\\xa2\\xf0\\x98\\x0b\\\n\\x3c\\x52\\xf8\\xb7\\xf0\\xf7\\xe1\\xef\\x76\\xbe\\xfe\\x2c\\xfc\\xd6\\x0e\\x7f\\\n\\x1a\\xee\\x09\\xcc\\x51\\x20\\x87\\x0f\\x8f\\x1b\\x9e\\x3f\\xbc\\x50\\x78\\xc1\\\n\\xf0\\x0c\\xe1\\xb1\\xc3\\x23\\x87\\x26\\xff\\x08\\xa1\\xdf\\x43\\xcf\\x80\\xff\\\n\\xda\\xe1\\x3f\\x77\\xf8\\x8f\\x90\\x90\\xfe\\x12\\xfe\\x26\\xfc\\x5a\\xf8\\x89\\\n\\xf0\\xe3\\xe1\\xa7\\xc3\\xdf\\x86\\x7e\\x7f\\x56\\x98\\x8b\\x40\\x8e\\x18\\x9e\\\n\\x2a\\xbc\\x5c\\x78\\xd9\\xf0\\xec\\x21\\x01\\x94\\x1d\\x70\\xd4\\xb0\\x4c\\x7e\\\n\\x5f\\x14\\x21\\xfd\\x29\\xfc\\x43\\x68\\xf7\\xfc\\x3a\\xfc\\x7c\\xf8\\x9e\\xf0\\\n\\xc0\\xf0\\x47\\x21\\x01\\x6e\\x1c\\x9b\\x16\\xc8\\x89\\xc3\\x8b\\x87\\x97\\x0f\\\n\\xed\\x88\\x93\\x85\\x27\\x08\\x09\\x81\\x00\\xc6\\x02\\x01\\x51\\x6d\\x3f\\x0f\\\n\\x09\\xe3\\x93\\xe1\\xbb\\xc2\\x8f\\x86\\xbf\\x08\\x37\\x86\\x4d\\x09\\xe4\\xa4\\\n\\xa1\\x9d\\x70\\xd5\\xf0\\xbc\\xe1\\xc9\\xc3\\xe3\\x85\\x63\\x0a\\xa1\\x0d\\x76\\\n\\xc6\\xaf\\xc2\\xef\\x87\\x87\\x84\\x04\\xf3\\xbe\\xf0\\x7b\\xe1\\xe4\\x98\\x5a\\\n\\x20\\xa7\\x08\\xaf\\x1c\\xee\\x17\\x9e\\x27\\x64\\xa0\\x8f\\x15\\xce\\x05\\x76\\\n\\xcd\\x77\\xc2\\xcf\\x84\\xef\\x08\\xdf\\x1d\\xfe\\x38\\x9c\\x0c\\x53\\x09\\x84\\\n\\x0d\\xb8\\x54\\x78\\xed\\x90\\x30\\x4e\\x1f\\x1e\\x2d\\x9c\\x2b\\xd8\\x9a\\xaf\\\n\\x87\\xef\\x0f\\xdf\\x1a\\x1e\\x14\\xb2\\x41\\xa3\\x83\\xb7\\x32\\x36\\xce\\x11\\\n\\xde\\x32\\xbc\\x55\\x78\\x95\\xf0\\x94\\x21\\x4f\\x69\\xce\\xe0\\xcd\\x71\\xb3\\\n\\xcf\\x1a\\x5a\\x3c\\xd4\\xe9\\x2f\\xc3\\xd1\\xed\\xcb\\x98\\x3b\\xc4\\xa4\\xb3\\\n\\x13\\x37\\x0e\\xaf\\x16\\x8a\\x1d\\x86\\x58\\x00\\xc5\\x20\\xff\\x39\\xe4\\xd2\\\n\\xfe\\x75\\xe7\\x67\\xec\\x8f\\x89\\xb4\\x1b\\xed\\xbe\\x63\\xec\\xfc\\x6c\\xb7\\\n\\x60\\x63\\x18\\xfe\\xb7\\x84\\xaf\\x09\\xed\\x96\\xbf\\x87\\xa3\\x60\\x0c\\x81\\\n\\xf8\\x37\\xad\\xa8\\xab\\x87\\xb7\\x0d\\x2f\\x1a\\x9a\\xa4\\xbe\\x28\\xee\\x2a\\\n\\x4f\\xe8\\x87\\xe1\\x4f\\x42\\xc6\\x97\\xcb\\x6a\\xa5\\x52\\x2b\\xd4\\x08\\xa1\\\n\\x98\\x34\\xc2\\xf6\\x39\\xc8\\x4b\\xe3\\xad\\x89\\x67\\x8c\\xc5\\x6a\\xe7\\x38\\\n\\x9c\\x30\\x34\\xbe\\x75\\x9e\\xdb\\xe7\\x7d\\x28\\x7c\\x61\\xf8\\xf6\\xd0\\x38\\\n\\x06\\xc7\\xd0\\x02\\xb1\\x22\\x19\\x6e\\xbb\\xe2\\x6e\\x21\\xf5\\xd4\\x67\\x57\\\n\\x10\\x82\\x15\\xcf\\x90\\x7e\\x3b\\xe4\\xe9\\xd0\\xe5\\x5f\\x09\\xbf\\x11\\x5a\\\n\\xa9\\x22\\x70\\x42\\x58\\x05\\x82\\xb1\\x2b\\x09\\x42\\x60\\x79\\x96\\xf0\\x8c\\\n\\xa1\\x78\\xe7\\xb4\\x21\\x4f\\x4f\\xfc\\xd3\\x67\\x0e\\xec\\x8c\\x6f\\x86\\x4f\\\n\\x0f\\x5f\\x1d\\xca\\x00\\x0c\\x1a\\x5c\\x0e\\x29\\x10\\x0f\\xe7\\x41\\x6f\\x11\\\n\\xde\\x27\\x3c\\x7a\\xd8\\xf5\\xdf\\xb7\\x13\\x44\\xce\\x84\\x20\\xa2\\x16\\x4d\\\n\\x7f\\x30\\xe4\\xed\\x0c\\x69\\x4c\\x8d\\xe9\\x02\\xe1\\x25\\x43\\x59\\x00\\x82\\\n\\x32\\xe6\\x3e\\x71\\x0f\\x01\\x88\\xfc\\x0f\\x08\\x5f\\x11\\x72\\x97\\x67\\x11\\\n\\x54\\x2e\\x82\\xbd\\x38\\x5b\\xf8\\xd8\\xd0\\xea\\x35\\xe8\\x2e\\xf4\\x20\\x8c\\\n\\xe5\\xa7\\xc2\\xe7\\x84\\xd7\\x0c\\x8f\\x13\\x4e\\x01\\xaa\\xec\\x7a\\xe1\\x8b\\\n\\x42\\x82\\xa7\\x0e\\x8d\\xa7\\x69\\x9c\\xcb\\xb4\\x80\\x3c\\xe7\\x23\\x43\\xbb\\\n\\xce\\x62\\x9c\\x0d\\x0c\\x86\\x37\\x62\\x1b\\xdb\\xd2\\x4d\\x0f\\xd0\\x44\\x3a\\\n\\x99\\x2a\\x7a\\x76\\xc8\\xf8\\xaf\\x63\\x67\\x86\\x00\\x07\\xe0\\x4a\\x21\\xdb\\\n\\x60\\x77\\x1a\\x97\\x09\\x6f\\x1a\\xf3\\x32\\x3d\\xef\\x13\\x42\\x3b\\x6d\\x0a\\\n\\x8f\\x75\\x25\\x0c\\xc2\\x60\\x1e\\x1d\\x76\\x15\\x86\\xdf\\x63\\x94\\x19\\xc6\\\n\\x1b\\x86\\xbc\\xa1\\x39\\x80\\xda\\x62\\xfb\\x8c\\xcb\\xae\\xed\\xf3\\x3c\\x8f\\\n\\x08\\x4f\\x1d\\x6e\\x22\\xd3\\xf0\\x5f\\xb0\\x0f\\x8c\\xf6\\x43\\xc2\\xae\\x6a\\\n\\x8a\\xc1\\x96\\x0e\\xbf\\x7f\\xc8\\xf8\\xcf\\x11\\xa7\\x09\\x1f\\x16\\x8a\\xd8\\\n\\x65\\x8b\\x9b\\x9e\\x63\\x99\\x5c\\x70\\x76\\x93\\xa3\\x30\\xb4\\xa3\\xd4\\x19\\\n\\xc7\\x0f\\xef\\x19\\xca\\x9e\\x36\\x0d\\x72\\x99\\x56\\xd2\\x87\\x43\\xee\\xf0\\\n\\x51\\xc2\\x39\\x83\\x1a\\xbb\\x41\\xc8\\xb9\\xe8\\xba\\x53\\xc4\\x46\\x77\\x08\\\n\\xa7\\xb2\\x81\\xff\\x03\\x76\\xe3\\x26\\xa1\\x55\\xd4\\x55\\xdf\\xbe\\x24\\x94\\\n\\x56\\xdf\\xd8\\x0a\\xea\\x09\\xea\\x47\\x06\\x5a\\x30\\xd8\\xf4\\x3c\\xcb\\x34\\\n\\x0f\\x5c\\xe2\\x6b\\x84\\x93\\xdb\\x13\\x46\\x58\\x2d\\xa1\\x8b\\x57\\x62\\xa0\\\n\\x0c\\xfe\\x99\\xc2\\x8d\\xea\\xd8\\x35\\x60\\x62\\x79\\x8f\\xcf\\x08\\xbb\\x3c\\\n\\xab\\xdd\\x24\\xf7\\x75\\xb1\\x70\\x32\\xf0\\xa8\\x78\\x46\\xe2\\x83\\xa6\\x41\\\n\\x2d\\xd2\\x43\\x30\\x78\\xb2\\xba\\xb3\\xf0\\x42\\x76\\x01\\x71\\x47\\x17\\xa1\\\n\\xfc\\x31\\x7c\\x62\\xc8\\xd9\\x19\\x1d\\x5c\\xd3\\x7b\\x84\\x3f\\x08\\x9b\\x06\\\n\\xb3\\xcc\\xa7\\x86\\xff\\x0f\\xc2\\x80\\x33\\x87\\x4f\\x0b\\x9b\\x9e\\x73\\x99\\\n\\x82\\xc5\\x3b\\x85\\xa3\\xbb\\xf2\\x57\\x0c\\x15\\x70\\x56\\x19\\x3a\\x2b\\x89\\\n\\xcd\\xf0\\x10\\x5d\\x85\\x21\\xc5\\x71\\xa3\\x9d\\xaf\\x73\\x85\\xcc\\xb5\\x94\\\n\\x49\\xd3\\x33\\x2f\\xd2\\xfc\\x48\\x46\\x2a\\x39\\x8c\\x06\\xe5\\x55\\x5b\\x51\\\n\\x52\\xad\\x69\\x10\\x85\\x5c\\xc5\\x83\\xc3\\x73\\x86\\x7d\\x76\\x06\\x61\\xf8\\\n\\x7b\\xb5\\x6e\\x0e\\xc3\\x1c\\x05\\x23\\x23\\x21\\xe5\\xf2\\xb1\\x70\\x95\\x33\\\n\\x23\\x96\\x11\\xc9\\x2b\\x53\\x8f\\x02\\x39\\xaa\\xcf\\x86\\xb5\\x81\\x58\\x19\\\n\\xdf\\x0d\\xb9\\xb6\\x7d\\x0d\\x78\\x11\\x48\\xe1\\x2b\\xc3\\x39\\x0a\\x45\\x8a\\\n\\xff\\x3a\\xa1\\xc4\\x62\\xcd\\xa6\\x98\\x27\\x82\\x93\\x9e\\x19\\x1c\\x02\\xc0\\\n\\xe7\\x87\\xd2\\x0a\\x4d\\x1f\\x8e\\x06\\x20\\x1f\\xf4\\xc0\\x70\\x9d\\x38\\x63\\\n\\x59\\x20\\xc8\\x71\\xb8\\x57\\x38\\x37\\xc1\\x88\\xea\\x05\\x8f\\x0c\\x78\\x6d\\\n\\x81\\x8a\\x4d\\x9e\\x12\\x0a\\x18\\x07\\xc5\\xcd\\x42\\x09\\xb8\\xa6\\x0f\\x2d\\\n\\x34\\xb8\\xb7\\x85\\xeb\\x46\\xe0\\x4d\\x02\\x29\\x94\\x72\\xbf\\x75\\x38\\x17\\\n\\xc1\\x88\\xa5\\xa4\\x4a\\x94\\x78\\x45\\xe9\\x4d\\x63\\x2e\\xa4\\xbe\\xaf\\x1b\\\n\\x0e\\x06\\x35\\x05\\xbb\\xa3\\x34\\x96\\x35\\xd1\\xd6\\x55\\xaf\\xb8\\x7e\\xb8\\\n\\x2e\\x6a\\x02\\x29\\xd4\\xe8\\xe6\\xf7\\xe6\\x22\\x18\\x0b\\x95\\xc7\\x59\\x53\\\n\\x5d\\x6c\\xee\\x93\\x43\\x05\\xb3\\x41\\x20\\xf2\\x94\\x42\\x68\\xfa\\xb0\\x42\\\n\\xaa\\xea\\x05\\xe1\\x6e\\x12\\x85\\x5d\\x04\\x52\\x28\\x65\\x3e\\x07\\xa1\\xe8\\\n\\x98\\x79\\x55\\x48\\x35\\x35\\x8d\\xb3\\x50\\xd9\\xf7\\x0a\\xe1\\x4a\\xac\\x32\\\n\\xbc\\x52\\x24\\xba\\x44\\x24\\xdc\\xda\\x40\\x87\\xf2\\xbb\\x5f\\x1e\\xb2\\x31\\\n\\xab\\x30\\x44\\x4c\\xa2\\x61\\x42\\xea\\x5e\\x55\\x72\\x93\\x82\\x21\\x08\\x8b\\\n\\x43\\x79\\xd9\\x3c\\xb4\\x41\\x90\\xa8\\x28\\xb6\\xeb\\x67\\x27\\x88\\x55\\x71\\\n\\x87\\xea\\xd9\\x8b\\xc3\\xae\\x6d\\x3d\\x6d\\x6e\\x60\\x9f\\x1d\\xb2\\x48\\x55\\\n\\x46\\x1e\\xe0\\xa6\\x04\\x23\\xf8\\x7b\\x6d\\x58\\xdb\\x25\\xe6\\xef\\x0d\\xe1\\\n\\x4a\\xfb\\xba\\x6a\\x87\\x08\\x6c\\xd4\\xa0\\xdb\\x24\\xeb\\xc3\\xd4\\xbd\\x5f\\\n\\x1f\\x76\\x2d\\xb5\\x6a\\x3c\\x18\\x12\\x16\\xcd\\x4b\\x43\\x8b\\x62\\x13\\xf6\\\n\\x85\\x51\\x27\\x10\\xbb\\xc4\\x7c\\x34\\xc1\\xfc\\x29\\x15\\x6b\\x9b\\x5d\\x1b\\\n\\x3c\\x09\\x65\\x55\\xf6\\x61\\x51\\xda\\x8b\\x54\\x07\\x79\\x63\\x38\\xc4\\x24\\\n\\xaf\\xbb\\x43\\x96\\x29\\xcf\\x36\\xb5\\x50\\x94\\x22\\x24\\x5b\\xd5\\x7b\\x9a\\\n\\xc6\\x84\\xba\\x67\\x04\\xd6\\xd5\\x6c\\x77\\x6d\\x87\\xe8\\x3e\\x97\\x48\\xf4\\\n\\xb5\\x0d\\x82\\x23\\xc1\\xcf\\x28\\x2d\\x31\\x6b\\xe2\\x8e\\xe1\\x17\\x42\\xb9\\\n\\xa4\\xa9\\x04\\x23\\x2a\\xe7\\xde\\xd6\\x1a\\xe9\\xd4\\xf0\\x57\\xcd\\x67\\x55\\\n\\x20\\xe7\\x0b\\x49\\xbe\\xed\\x77\\x48\\x9d\\xba\\xe2\\x8b\\x8f\\x0d\\xab\\x8b\\\n\\xa7\\xd7\\x15\\x76\\xec\\xb3\\x42\\xf6\\xef\\xa6\\xe1\\x14\\x82\\xb1\\x43\\xb4\\\n\\x2f\\x99\\x97\\x26\\x98\\x47\\x7d\\x61\\x6a\\x42\\xad\\x58\\x25\\x90\\x5a\\xf5\\\n\\xcb\\x07\\xf3\\xc1\\x75\\x8c\\x8c\\x0d\\x3b\\x51\\xba\\x82\\x77\\xa5\\x28\\xd6\\\n\\x15\\x1e\\x5e\\xab\\xce\\x73\\xc3\\xb1\\xed\\x8b\\x1d\\x52\\x13\\x08\\x58\\xe0\\\n\\xba\\xfd\\x5b\\x51\\x13\\x88\\x6a\\x59\\x4d\\x20\\xb6\\xa7\\x2e\\x0d\\x11\\xfa\\\n\\x14\\xd0\\xbd\\x28\\x83\\xcc\\x30\\xea\\xf4\\xe8\\x03\\xad\\xac\\xb2\\xb4\\xf7\\\n\\x0b\\xc7\\x12\\x8a\\x52\\xb6\\xf9\\xa8\\xa9\\x6f\\x6a\\xeb\\xdc\\x87\\x7e\\xdb\\\n\\x8c\\x9a\\x40\\x78\\x05\\x35\\x57\\xd6\\x6a\\xf8\\xd2\\xa1\\xdf\\x4e\\x0a\\x82\\\n\\x79\\x7c\\xa8\\x43\\x84\\x2b\\xd9\\x07\\x77\\x0f\\xa5\\x80\\x6e\\x13\\x8e\\x21\\\n\\x18\\x99\\x6a\\xea\\xb5\\x0d\\x72\\x60\\xe6\\xb5\\x15\\x6d\\x02\\x11\\x2b\\xd0\\\n\\xc3\\xb5\\x40\\x46\\x7e\\xc9\\x8a\\xd8\\x04\\x08\\x45\\xad\\xfb\\xae\\x21\\x1b\\\n\\xe1\\x04\\x54\\x57\\x48\\x05\\xc9\\x2a\\xbc\\x33\\x1c\\x3a\\xcd\\xff\\xe5\\xb0\\\n\\x66\\xd8\\x05\\xda\\xe6\\xb5\\x35\\x8d\\xd2\\x26\\x10\\xbe\\xbd\\x80\\xa7\\xe6\\\n\\xa2\\x09\\x08\\x4d\\xcc\\x26\\xe1\\xf3\\xa5\\x2e\\xae\\x15\\xde\\x3e\\xac\\xad\\\n\\xce\\x65\\x28\\x36\\x49\\xf1\\xab\\x97\\x0f\\x25\\x14\\x19\\x0b\\x01\\x62\\x1b\\\n\\xcc\\x27\\xad\\x23\\xb6\\x6b\\x44\\x4d\\x20\\xf2\\xfe\\x6d\\x90\\x26\\x20\\x90\\\n\\xb9\\x1c\\x37\\x26\\x18\\x09\\x50\\xa7\\xb2\\x4c\\x70\\x1f\\x38\\x44\\xa4\\x5b\\\n\\x44\\x5f\\xd5\\x6e\\x05\\xa3\\x19\\x9c\\x40\\x6a\\x69\\x14\\x02\\x91\\x29\\x6e\\\n\\x44\\x9b\\x40\\xb8\\x67\\xb5\\x43\\x35\\x72\\x56\\x56\\xa3\\x28\\x75\\x4e\\x20\\\n\\x98\\x47\\x85\\xa5\\x03\\xb1\\x2b\\xd4\\x6f\\xf4\\x25\\x8b\\xa9\\x78\\x72\\xeb\\\n\\x0a\\xc6\\x7c\\x98\\x97\\x5a\\xd6\\xc2\\xbc\\xf2\\xb6\\x1a\\xd1\\x26\\x90\\x55\\\n\\xdd\\xe0\\x3e\\xb0\\xb6\\x35\\x37\\x89\\x62\\x5f\\x6e\\x17\\x4a\\x8f\\x0b\\x12\\\n\\xbb\\x42\\xae\\x49\\xb2\\xf0\\x4d\\xe1\\x3a\\x6e\\x32\\x97\\xd7\\xbc\\xd4\\x8e\\\n\\x4b\\xb0\\x23\\xe6\\xb7\\x11\\x6d\\x93\\x2e\\x8d\\x5e\\x33\\xe8\\x52\\x04\\x73\\\n\\xdb\\x1d\\xcb\\x20\\x18\\x36\\x42\\x23\\xb5\\xa8\\xbd\\x8f\\x7d\\x71\\x64\\x81\\\n\\x9b\\xfc\\xb8\\xb0\\xaf\\x50\\x2c\\x56\\x7d\\x05\\x6d\\x30\\xaf\\x8e\\x45\\x34\\\n\\xa2\\x4d\\x20\\xfe\\xa0\\xb6\\x43\\xca\\x0d\\x09\\x7b\\x01\\x04\\x23\\x27\\xc7\\\n\\xbe\\xe8\\x70\\xef\\x03\\x1e\\xdc\\x47\\xc2\\xd6\\x15\\xdd\\x80\\x55\\x02\\x31\\\n\\xaf\\xbd\\x05\\x42\\xcf\\xd5\\x3c\\x2c\\x46\\x4b\\x95\\x6c\\xaf\\xc0\\x2a\\xbf\\\n\\x74\\x78\\xe1\\xff\\xfc\\x57\\x3f\\x94\\x23\\x0a\\x5d\\x21\\xd5\\x5e\\x9b\\x1b\\\n\\x73\\xde\\x6a\\x9f\\xdb\\x04\\x52\\xba\\xbe\\xdb\\xe0\\xef\\x6a\\x2a\\x6d\\x2e\\\n\\x20\\x08\\xb6\\x40\\xc3\\x1e\\xf5\\xc5\\xd5\\xed\\x0a\\x2a\\xce\\x19\\xc9\\xfd\\\n\\xc3\\xda\\x5c\\x2c\\x83\\x8d\\xa8\\xcd\\x8d\\xc5\\xdc\\xba\\x83\\xda\\x04\\x52\\\n\\xba\\x29\\xda\\x40\\xc2\\x73\\xef\\x60\\x27\\x8c\\xfb\\x86\\x6c\\x41\\xdf\\x56\\\n\\x1c\\xae\\x73\\x51\\x71\\x54\\x5e\\x1f\\x70\\x6b\\x6b\\x1e\\xaa\\x79\\x6d\\x4d\\\n\\x37\\xb5\\x09\\xc4\\x16\\xad\\x6d\\x3b\\x31\\x4a\\xd7\\x0a\\xe1\\xd4\\x20\\x08\\\n\\xa9\\x11\\x29\\x12\\xc7\\x25\\xfa\\x40\\x6d\\x87\\xcb\\xcc\\x75\\xee\\x2b\\x88\\\n\\x82\\x55\\x02\\x31\\xaf\\xbd\\x05\\x22\\x51\\xb6\\x2a\\xb8\\x99\\xd3\\x95\\x18\\\n\\x50\\xd4\\x13\\x97\\x57\\x6a\\x44\\x8a\\xa4\\x2b\\xd8\\x09\\x2e\\xf2\\x5d\\x42\\\n\\x7f\\xbf\\xae\\x30\\xd8\\x5d\\xf5\\x8e\\x9a\\xf6\\x60\\x63\\x5a\\x6d\\x52\\x9b\\\n\\x40\\xe8\\xcf\\x9a\\xa7\\xc0\\x2d\\x96\\x8f\\xd9\\xd4\\xb9\\xc0\\x65\\x10\\x86\\\n\\x6a\\x1c\\xf5\\x74\\x09\\x3f\\xe8\\x08\\x0b\\x8f\\x10\\x34\\x72\\xb0\\x31\\xeb\\\n\\x0a\\xa2\\xc0\\x7c\\x98\\x97\\x9a\\xf6\\x30\\xaf\\xad\\xf9\\xae\\x36\\x81\\x68\\\n\\x1c\\xa8\\xb9\\xb5\\xfe\\x4e\\x6a\\x7e\\xb4\\xbe\\xd5\\x8e\\x20\\x08\\x29\\x0f\\\n\\xa9\\x0f\\xbb\\xa3\\x0f\\x14\\xb0\\x9c\\x5d\\x7f\\x66\\xb8\\x5b\\x41\\x14\\xe8\\\n\\x7f\\xa6\\x39\\xda\\xe6\\x15\\xb8\\xc5\\xad\\x35\\x9d\\xb6\\x3f\\xf4\\x07\\xe5\\\n\\xdc\\x60\\x1b\\x08\\x64\\x53\\xe7\\x04\\x09\\x82\\xf7\\xe3\\x88\\x9c\\x94\\x47\\\n\\x1f\\x07\\xe3\\x03\\x21\\x3b\\xe1\\xdc\\xca\\x50\\x82\\x28\\xd0\\x72\\x5b\\x53\\\n\\xe5\\xe6\\x93\\x40\\x24\\x21\\x1b\\xd1\\x26\\x10\\xa9\\x75\\xc9\\xc3\\x9a\\x61\\\n\\xa7\\xa3\\x9d\\xd1\\x9e\\x12\\x8b\\x76\\x42\\x97\\x49\\xad\\x5f\\x6c\\x19\\x6e\\\n\\x84\\xb8\\x79\\x28\\xd8\\xdb\\x8d\\x9d\\xa8\\x41\\xcd\\xbc\\xd6\\xa1\\xc8\\x7e\\\n\\x28\\x60\\xf5\\x56\\x59\\x40\\x0d\\xd4\\xaa\\x81\\x1a\\x88\\xab\\xf5\\xe1\\x81\\\n\\x41\\x18\\xda\\xfb\\xfb\\xda\\x09\\x29\\x1e\\x0d\\xdb\\x97\\x09\\x95\\x73\\xc7\\\n\\x10\\x44\\x81\\x23\\x18\\x35\\x67\\x82\\xcd\\x62\\x0e\\x5a\\x51\\x13\\x48\\xb9\\\n\\x28\\xb2\\x0d\\x32\\x96\\xce\\x0d\\xb6\\xa6\\x01\\x06\\x84\\x74\\xb5\\x4e\\x45\\\n\\xee\\x6c\\x1f\\xd8\\x45\\xba\\x06\\x9f\\x14\\x8e\\x29\\x08\\xa0\\xaa\\x1c\\x50\\\n\\xaa\\x95\\xbd\\x75\\xa7\\x38\\xd2\\xd1\\x8a\\x9a\\x40\\x34\\x2f\\x50\\x5b\\x6d\\\n\\xf0\\xb7\\x56\\xad\\x44\\xdc\\xd8\\x90\\x4b\\xea\\x93\\x4f\\x72\\x4f\\x0a\\x3b\\\n\\xe1\\x68\\xc4\\xd8\\x82\\x28\\xb8\\x48\\xe8\\xd6\\xa1\\x5a\\xca\\x49\\x8f\\xdb\\\n\\xda\\x02\\xf1\\x87\\x74\\x5d\\x5b\\x3c\\xe2\\x83\\x55\\xbe\\xe4\\x88\\xe6\\x02\\\n\\xee\\xba\\x5d\\x44\\x18\\x63\\xd9\\x89\\x36\\xb8\\xc8\\x93\\x97\\xd5\\x26\\x10\\\n\\xf6\\x98\\x6d\\xae\\x96\\x03\\x6a\\x02\\xb1\\x3b\\xd4\\x88\\x6b\\x6a\\x8b\\xdb\\\n\\x6b\\x65\\xe8\\xa6\\xd8\\x24\\xd8\\x89\\x7b\\x87\\xd2\\x1d\\xea\\x19\\x53\\x0a\\\n\\x02\\xa8\\x6f\\xf3\\xd0\\x5a\\x78\\x0a\\xec\\x0e\\xf3\\x59\\xad\\x23\\xd5\\x04\\\n\\xc2\\x45\\x3b\\x28\\xd4\\xb3\\xda\\x06\\x29\\x02\\x57\\xe0\\x09\\xac\\xba\\x82\\\n\\x9e\\x1d\\x12\\x6a\\xea\\xec\\x84\\xd6\\xa0\\xa9\\x05\\x51\\xa0\\xe6\\xc2\\xce\\\n\\x49\\x2c\\xb6\\x41\\x0f\\x1b\\x37\\xbd\\x9a\\xa8\\xac\\x09\\x04\\x74\\x25\\x3a\\\n\\x33\\xd8\\xe6\\xfe\\x16\\xb5\\xe5\\x84\\x50\\xd7\\xdc\\x56\\xcd\\x2e\\xf5\\x81\\\n\\x4e\\x13\\xaa\\xc9\\xce\\xd8\\x94\\x20\\x40\\x74\\xee\\xa0\\x52\\xcd\\x7e\\x98\\\n\\x3f\\x77\\xbc\\xa8\\xad\\x54\\xb1\\x4a\\x20\\x1e\\x94\\x2d\\xe1\\x1d\\xb4\\x81\\\n\\xb1\\xd5\\xe5\\xd8\\xd5\\x15\\xed\\x53\\xb9\\x6b\\x82\\x1d\\x2b\\x2d\\xae\\xd3\\\n\\x64\\x6a\\x3b\\xd1\\x04\\xb7\\x5a\\x78\\xfe\\x9a\\xb7\\xa9\\x19\\xc4\\x3c\\x0e\\\n\\x72\\xe5\\xac\\x13\\xb5\\xab\\x4e\\x50\\x09\\x76\\xa4\\xaa\\xfb\\x78\\x42\\xcb\\\n\\x10\\xf0\\x35\\xfd\\xdb\\x8b\\x74\\x45\\x07\\xcf\\x6e\\x2e\\xe0\\xea\\x8a\\x8b\\\n\\x56\\x5d\\xc0\\x23\\x3b\\xd0\\xe9\\x04\\x55\\x17\\x08\\x74\\x9e\\x17\\x76\\x39\\\n\\x63\\xe8\\x06\\x9d\\x75\\x51\\x13\\x88\\x43\\xf8\\xfe\\xff\\x9c\\x84\\x01\\x32\\\n\\xc4\\x76\\xa8\\xe7\\x6f\\x1a\\x37\\x0e\\x7e\\xc6\\x10\\xba\\x9e\\xc2\\xd5\\x7a\\\n\\x23\\x9f\\xb3\\x0e\\x9a\\x04\\x32\\xd7\\x4b\\x04\\xd8\\x0a\\x46\\x9c\\xd3\\x53\\\n\\x72\\x7e\\x6d\\x74\\x9f\\xfc\\xa0\\xa7\\x70\\x41\\x12\\xb1\\xeb\\x39\\xf5\\x07\\\n\\x85\\xeb\\xa4\\xe5\\x17\\x05\\xc2\\x35\\xbc\\x73\\x38\\x37\\x41\\x14\\x50\\xcd\\\n\\x0f\\x0f\\x2d\\xc2\\xc5\\x39\\x58\\xa6\\xe7\\x18\\xe5\\x9c\\x3a\\x48\\xcc\\xd9\\\n\\x25\\x26\\xbe\\xe9\\xc3\\x51\\xf2\\xac\\xdc\\xe4\\xd0\\xb7\\xe6\\x6e\\xf2\\x79\\\n\\x4e\\x0f\\xdd\\xf9\\x7e\\xae\\x90\\x59\\x56\\x12\\x16\\xe4\\xd5\\x54\\x95\\x79\\\n\\x72\\x44\\x61\\x94\\x9b\\x1c\\x40\\x14\\xca\\xd7\\xa7\\x13\\x9b\\x06\\x50\\xa8\\\n\\x00\\x63\\x20\\xe7\\x0a\\xf7\\x42\\x23\\x44\\x57\\x58\\x24\\xe2\\x2e\\x9d\\x2b\\\n\\xd2\\x4a\\xb5\\x85\\x89\\xb2\\x1c\\x52\\xfc\\xa3\\xd6\\x8c\\x78\\x0a\\x5d\\x6f\\\n\\x03\\x7a\\x59\\xd8\\xe7\\x36\\xa0\\xb9\\x43\\xd0\\xa7\\x6b\\x85\\xab\\xdd\\xf4\\\n\\xcc\\x8b\\x34\\x3f\\x6f\\x0e\\x47\\xbd\\x0d\\x08\\xd8\\x86\\xc3\\xe2\\x7d\\x59\\\n\\xc6\\x6f\\x71\\x71\\xbb\\x9b\\x9e\\x73\\x99\\x8e\\xfa\\x39\\xeb\\x38\\x49\\x89\\\n\\x5b\\x11\\x46\\xf9\\x53\\xe5\\xab\\x69\\x30\\x8b\\xb4\\x53\\xf6\\xfa\\x8d\\x72\\\n\\xc6\\xad\\xcc\\xd0\\xe7\\x46\\xb9\\x72\\x97\\xef\\x64\\xf0\\xae\\x28\\x2f\\x3b\\\n\\x59\\xa5\\xba\\x90\\xae\\xd5\\xe7\\x74\\x58\\xba\\x73\\xd1\\x0b\\x08\\x26\\x05\\\n\\x7d\\x2a\\x8f\\xa4\\xfa\\xb5\\xca\\xb8\\x15\\x3a\\xdc\\xbf\\x97\\x6e\\x25\\x35\\\n\\x4e\\xb5\\x1e\\x97\\x02\\x34\\x3d\\xcf\\x32\\xcd\\x83\\xe0\\x78\\x1d\\x0f\\x73\\\n\\x10\\x48\\x35\\x3b\\xb3\\xc7\\xd7\\x6e\\x1a\\xe0\\x32\\x79\\x5f\\x92\\x6b\\x2e\\\n\\xb3\\x99\\x44\\xb7\\xee\\x02\\x12\\xa5\\xb2\\x0e\\x6e\\x1f\\xea\\xa2\\x05\\x50\\\n\\x26\\xc3\\x29\\xae\\x5a\\xc5\\x70\\x54\\x58\\x41\\x02\\xc6\\x07\\x87\\xab\\xa2\\\n\\xd5\\xc2\\x72\\xb3\\xf5\\x03\\xc2\\x75\\x23\\xfa\\xb1\\xe1\\x50\\xa6\\xa0\\x4f\\\n\\xe7\\x4d\\xed\\x66\\x86\\x45\\x96\\x7a\\xcc\\xaa\\x8a\\xe1\\xe8\\x60\\x13\\xd4\\\n\\x43\\xd6\\xb9\\xfb\\x9d\\xfb\\x2c\\xd8\\xac\\xde\\x6c\\x30\\x21\\x24\\x0a\\xa9\\\n\\xe1\\x3d\\x7b\\xf7\\x7b\\x01\\x7b\\xc2\\xf3\\x72\\x85\\x6a\\xd7\\x87\\x40\\xde\\\n\\xc8\\x57\\x43\\x67\\x37\\x38\\x09\\x9b\\x52\\x63\\xd4\\x93\\x37\\xc7\\xa9\\x34\\\n\\x96\\xa3\\x07\\x5d\\xed\\xa2\\xe7\\x9d\\xd5\\xdb\\x11\\x0a\\x44\\xb0\\x43\\xbd\\\n\\x3f\\x64\\xe8\\xdb\\x82\\xda\\xb0\\xf8\\xfe\\x10\\xb5\\x0a\\x19\\x88\\x2e\\x9e\\\n\\x14\\x12\\x18\\x35\\x35\\xf8\\xfb\\x43\\x86\\xd4\\x77\\x06\\x45\\xff\\x0e\\xf1\\\n\\x86\\x1d\\xc6\\xd4\\xfb\\x9e\\xe4\\xce\\xfa\\x1c\\x96\\x59\\x05\\x3d\\xc9\\xe5\\\n\\x0d\\x3b\\xbe\\x9a\\x4c\\x63\\x96\\x2c\\xec\\xaa\\x6e\\xca\\x58\\x1f\\x13\\xea\\\n\\x07\\x1e\\xf4\\x0d\\x3b\\x43\\x1b\\x20\\x0f\\x25\\xe7\\x43\\x17\\xbb\\xed\\xad\\\n\\x76\\xd7\\x56\\x13\\xac\\x3e\\xde\\x98\\xe3\\xc5\\x84\\x23\\xe2\\xe5\\x4a\\x2e\\\n\\xbf\\x83\\x6a\\xd5\\xf9\\x46\\xcf\\x45\\x05\\xca\\x23\\xc9\\xc1\\x51\\x29\\xfa\\\n\\x78\\x7d\\x35\\x26\\x42\\x58\\xf7\\x1d\\x54\\xc6\\x21\\x2e\\x51\\x98\\x52\\x09\\\n\\x34\\xe6\\xc1\\x30\\xb4\\x40\\xc0\\xbf\\x49\\x1d\\xf0\\xc7\\xdd\\x24\\xea\\x62\\\n\\xfa\\xae\\xf5\\xf6\\x45\\x14\\xd5\\xc0\\x01\\x90\\xaa\\x59\\x7c\\x4b\\x1b\\x35\\\n\\xa7\\x4a\\x27\\x5b\\x40\\x45\\x5a\\xa1\\x04\\x2f\\x13\\xeb\\xb3\\x18\\x68\\x6e\\\n\\x39\\xf5\\x67\\x2c\\x26\\xdf\\x42\\x71\\xdc\\x1b\\xd6\\x79\\x6e\\x3b\\x55\\xfd\\\n\\x83\\x8a\\xf3\\x16\\x50\\xe3\\x18\\x1c\\x63\\x08\\xa4\\xc0\\xea\\x5b\\x7c\\x8f\\\n\\xa1\\xd5\\x3a\\x84\\xe1\\x23\\x24\\x93\\x43\\x18\\x76\\x0a\\xd7\\xd4\\xcf\\xec\\\n\\x4e\\x02\\x41\\xea\\x12\\x87\\xf0\\x7a\\x08\\x5b\\x55\\x50\\x04\\x2e\\xb1\\xa8\\\n\\x1c\\x3b\\x98\\x8a\\x5a\\xc6\\x98\\x02\\x29\\x10\\x9d\\xdb\\x2d\\xee\\x8d\\xf7\\\n\\x6e\\x74\\xab\\x76\\x8a\\xcf\\xdd\\x2d\\xec\\x50\\x1d\\x32\\x1c\\x0e\\xc2\\x50\\\n\\x46\\xe6\\x15\\x8e\\x8a\\x29\\x5c\\x35\\x3a\\xdf\\x43\\x95\\x40\\x8b\\x61\\x65\\\n\\x44\\x6b\\xc7\\xbe\\x36\\x0d\\x3b\\xf0\\x8b\\xa1\\x0b\\x04\\x34\\x6f\\xbc\\x2e\\\n\\xac\\xf5\\xa7\\x0d\\x86\\xa9\\x7c\\x67\\xc6\\x50\\x84\\xce\\xbd\\x64\\x08\\x8b\\\n\\x51\\xa6\\xef\\xe7\\x94\\x46\\x61\\x97\\x78\\x79\\xef\\x0d\\xdd\\xcd\\x85\\x9f\\\n\\x0b\\x8d\\x7f\\x12\\x6c\\x4a\\x75\\x30\\xb2\\x7a\\x82\\xbd\\x4f\\x9d\\xfb\\xc9\\\n\\xe0\\xae\\xba\\x0e\\x6a\\x2c\\xb0\\x07\\x9c\\x05\\x8e\\x83\\xc9\\x97\\xc5\\x3e\\\n\\x30\\xe4\\xe1\\x4d\\x8e\\x4d\\xeb\\x72\\x2d\\x46\\xbc\\x30\\xf6\\x45\\xb3\\x19\\\n\\x17\\x95\\x27\\xd4\\x27\\x2e\\x58\\x07\\x9c\\x00\\x49\\x51\\x4d\\x7b\\x5c\\x69\\\n\\x71\\x8f\\x54\\xce\\xaa\\x8b\\x2c\\x47\\xc7\\x5c\\x8c\\xab\\x9d\\x21\\x3e\\xd0\\\n\\x23\\x2c\\x8d\\xa2\\x54\\x6a\\xc7\\x14\\x7b\\x43\\xad\\x11\\xd0\\x3a\\xe3\\x65\\\n\\x9c\\xed\\x02\\x6a\\x92\\x6d\\xa0\\x96\\xb8\\xac\\x87\\x84\\x2e\\xae\\xb4\\x1b\\\n\\x74\\x14\\x8e\\xe6\\x39\\xf5\\xc1\\x1c\\xbd\\x1d\\x63\\x22\\x0c\\x3b\\xc6\\xcb\\\n\\x53\\xca\\x3b\\x6b\\xfd\\x8c\\x23\\x80\\x04\\x48\\x40\\x85\\x05\\x56\\x7e\\xa1\\\n\\x09\\x16\\x64\\x72\\x24\\xa8\\xa4\\x92\\x01\\x70\\x05\\x93\\xc3\\x48\\xa5\\xdb\\\n\\x70\\x56\\x98\\xa3\\x40\\xda\\x20\\x8e\\x51\\x0a\\x96\\x5d\\x2e\\x6a\\x4d\\x00\\\n\\x58\\x3c\\x36\\x13\\x6f\\x92\\xa9\\x22\\xe4\\xdd\\x71\\x24\\x44\\xfc\\xbe\\xdf\\\n\\x62\\x8b\\x2d\\xb6\\xd8\\x62\\x8b\\x2d\\xb6\\x98\\x0a\\xfb\\xf6\\xfd\\x1b\\x7a\\\n\\x3c\\x86\\x67\\xee\\xbb\\xee\\x69\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\\n\\x42\\x60\\x82\\\n\\x00\\x00\\x25\\x17\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\xb2\\x00\\x00\\x00\\xb2\\x08\\x02\\x00\\x00\\x00\\x69\\xe8\\x02\\x3f\\\n\\x00\\x00\\x01\\x35\\x69\\x43\\x43\\x50\\x49\\x43\\x43\\x20\\x50\\x72\\x6f\\x66\\\n\\x69\\x6c\\x65\\x00\\x00\\x78\\x9c\\x63\\x60\\x60\\x32\\x61\\x80\\x82\\xdc\\xbc\\\n\\x92\\xa2\\x20\\x77\\x27\\x85\\x88\\xc8\\x28\\x05\\xf6\\x7b\\x0c\\x6c\\x0c\\x2c\\\n\\x0c\\x82\\x0c\\xda\\x0c\\x16\\x89\\xc9\\xc5\\x05\\x0c\\x98\\x80\\x11\\xc1\\xfc\\\n\\x76\\x0d\\xc2\\xbb\\xac\\x8b\\x45\\x1d\\x21\\xc0\\x95\\x92\\x5a\\x9c\\x0c\\xa4\\\n\\xff\\x00\\x71\\x65\\x52\\x76\\x41\\x09\\xd0\\xe8\\x0a\\x20\\x5b\\xa4\\xbc\\x04\\\n\\xcc\\xee\\x01\\xb1\\x93\\x0b\\x8a\\x40\\xec\\x05\\x40\\xb6\\x68\\x11\\xd0\\x81\\\n\\x40\\xf6\\x0e\\x90\\x78\\x3a\\x84\\x7d\\x06\\xc4\\x4e\\x82\\xb0\\x1f\\x80\\xd8\\\n\\x45\\x21\\x41\\xce\\x40\\xf6\\x17\\x20\\xdb\\x21\\x1d\\x89\\x9d\\x84\\xc4\\x86\\\n\\xda\\x0b\\x02\\xf2\\xc5\\x20\\x8f\\x7b\\xba\\x3a\\x9b\\x19\\x5a\\x9a\\x99\\xe9\\\n\\x1a\\xe9\\x1a\\x2a\\x24\\xe5\\x24\\x26\\x67\\x2b\\x14\\x27\\x27\\xe6\\xa4\\xa6\\\n\\x90\\xe1\\x2b\\x02\\x00\\x14\\xc6\\x10\\x16\\xb3\\x18\\x10\\x1b\\x33\\x30\\x30\\\n\\x2d\\x41\\x88\\x21\\xc2\\xb3\\x24\\xb5\\xa2\\x04\\xc4\\x72\\x29\\xca\\x2f\\x48\\\n\\xca\\xaf\\xd0\\x51\\xf0\\xcc\\x4b\\xd6\\x43\\xd1\\x9f\\xbf\\x88\\x81\\xc1\\xe2\\\n\\x2b\\xd0\\x8c\\x09\\x08\\xb1\\xa4\\x99\\x0c\\x0c\\xdb\\x5b\\x19\\x18\\x24\\x6e\\\n\\x21\\xc4\\x54\\x80\\x61\\xc7\\xdf\\xc2\\xc0\\xb0\\xed\\x7c\\x72\\x69\\x51\\x19\\\n\\xd4\\x19\\x52\\x40\\x7c\\x94\\xf1\\x0c\\x73\\x12\\xeb\\x64\\x8e\\x6c\\xee\\x6f\\\n\\x02\\x0e\\xa2\\x81\\xd2\\x26\\x8a\\x1f\\x35\\x27\\x18\\x49\\x58\\x4f\\x72\\x63\\\n\\x0d\\x2c\\x8b\\x7d\\x9b\\x5d\\x50\\xc5\\xda\\xb9\\x69\\x56\\xcd\\x9a\\xcc\\xfd\\\n\\x75\\x97\\x0f\\xbe\\x34\\xff\\xff\\x1f\\x00\\x81\\x49\\x5c\\xa9\\xc6\\xc2\\x24\\\n\\x8e\\x00\\x00\\x23\\x9d\\x49\\x44\\x41\\x54\\x78\\x9c\\xed\\x7d\\x79\\x74\\x14\\\n\\x55\\xfe\\xef\\xf7\\xde\\xaa\\x5e\\x92\\x74\\x56\\x02\\x21\\x40\\x82\\x09\\x09\\\n\\x24\\x20\\x61\\x40\\xa2\\x6c\\x13\\xe1\\x08\\x8e\\x22\\x22\\xb8\\xa0\\x1c\\x1d\\\n\\x67\\x64\\x66\\xde\\x19\\xfc\\xe9\\x1c\\x70\\x3c\\x8a\\x8c\\x0a\\xe8\\x30\\xa8\\\n\\x38\\xa3\\x8e\\x07\\x75\\x5c\\xdf\\x3c\\xdc\\x1f\\x8c\\x4f\\x07\\x65\\x11\\xd1\\\n\\x04\\x09\\x61\\x58\\x4d\\x24\\x0c\\x10\\xc8\\x4a\\x42\\xf6\\x90\\xa4\\xf7\\xaa\\\n\\xfa\\xbe\\x3f\\xbe\\xe9\\xb2\\x49\\x3a\\x49\\x27\\xe9\\x2d\\xa1\\x3e\\x27\\xc7\\\n\\x23\\xdd\\xd5\\x55\\x75\\xef\\xfd\\xd4\\xe7\\xbb\\xd4\\xf7\\xde\\xcb\\x10\\x11\\\n\\x86\\x0a\\x14\\x45\\x41\\x44\\x44\\x64\\x8c\\x09\\x82\\xd0\\xf5\\xdb\\xf6\\xf6\\\n\\xf6\\xe6\\xe6\\xe6\\xba\\xba\\xba\\xc6\\xc6\\xc6\\x96\\x96\\x96\\xd6\\xd6\\xd6\\\n\\x4b\\x97\\x2e\\x59\\xad\\x56\\x87\\xc3\\x61\\xb7\\xdb\\x19\\x63\\x00\\x60\\x34\\\n\\x1a\\x0d\\x06\\x83\\xc9\\x64\\x8a\\x8c\\x8c\\x8c\\x89\\x89\\x89\\x8d\\x8d\\x1d\\\n\\x36\\x6c\\xd8\\xf0\\xe1\\xc3\\xa3\\xa3\\xa3\\xc3\\xc3\\xc3\\xbb\\x5e\\x54\\x92\\\n\\x24\\x00\\x60\\x8c\\x71\\xce\\xe9\\x0c\\x43\\x00\\x6c\\xb0\\xd3\\x02\\x11\\x15\\\n\\x45\\x01\\x80\\x4e\\x3c\\xb0\\xd9\\x6c\\x17\\x2e\\x5c\\x38\\x7d\\xfa\\x74\\x69\\\n\\x69\\x69\\x71\\x71\\x71\\x59\\x59\\xd9\\xc5\\x8b\\x17\\x6b\\x6b\\x6b\\x5b\\x5b\\\n\\x5b\\xad\\x56\\x2b\\x8d\\xa5\\x97\\x30\\x18\\x0c\\x61\\x61\\x61\\xc3\\x86\\x0d\\\n\\x4b\\x4c\\x4c\\x4c\\x4c\\x4c\\x4c\\x4f\\x4f\\x4f\\x4f\\x4f\\x4f\\x4b\\x4b\\x4b\\\n\\x4b\\x4b\\x1b\\x39\\x72\\xa4\\xfb\\x91\\x8a\\xa2\\x28\\x8a\\x42\\xfc\\x18\\xd4\\\n\\x14\\x19\\xac\\xb4\\x40\\x44\\x59\\x96\\x3b\\xa9\\xc2\\x85\\x0b\\x17\\x8e\\x1f\\\n\\x3f\\x7e\\xf8\\xf0\\xe1\\xa3\\x47\\x8f\\x16\\x17\\x17\\x57\\x55\\x55\\x39\\x9d\\\n\\x4e\\x8f\\x3f\\x67\\x2e\\xf4\\x7a\\x15\\xe2\\x9c\\x47\\x98\\x4c\\xa6\\xf1\\xe3\\\n\\xc7\\x4f\\x9c\\x38\\xf1\\xda\\x6b\\xaf\\x9d\\x3e\\x7d\\xfa\\xa4\\x49\\x93\\xa2\\\n\\xa2\\xa2\\xd4\\x6f\\x65\\x59\\x06\\x80\\x41\\x2a\\x21\\x83\\x8c\\x16\\xc4\\x06\\\n\\xce\\x39\\xe7\\x9c\\x3e\\x69\\x6e\\x6e\\x2e\\x28\\x28\\xf8\\xf6\\xdb\\x6f\\xf3\\\n\\xf2\\xf2\\x4e\\x9e\\x3c\\xd9\\xde\\xde\\xee\\x7e\\xbc\\x7a\\x24\\xba\\xa0\\x9e\\\n\\xc7\\xfb\\x8b\\xd2\\xb8\\xaa\\x34\\xa2\\xff\\xca\\xb2\\xdc\\xe9\\x24\\xa3\\x46\\\n\\x8d\\xba\\xe6\\x9a\\x6b\\xe6\\xce\\x9d\\x3b\\x77\\xee\\xdc\\xc9\\x93\\x27\\xeb\\\n\\x74\\x3a\\xfa\\x7c\\x30\\xf2\\x63\\xd0\\xd0\\x82\\x3a\\x57\\xd5\\x86\\x0b\\x17\\\n\\x2e\\xec\\xdd\\xbb\\xf7\\x8b\\x2f\\xbe\\xc8\\xcf\\xcf\\xbf\\x78\\xf1\\xa2\\x7a\\\n\\x18\\xf1\\x00\\xdd\\xe0\\xbf\\x5b\\x22\\xa2\\x10\\xed\\x3a\\x59\\xa5\\x89\\x13\\\n\\x27\\xce\\x9b\\x37\\x6f\\xf1\\xe2\\xc5\\xb3\\x67\\xcf\\x8e\\x88\\x88\\x50\\x9b\\\n\\xa0\\x1e\\x1f\\xe2\\x08\\x75\\x5a\\x90\\x8c\\xab\\x6c\\x68\\x68\\x68\\xd8\\xb9\\\n\\x73\\xe7\\xf6\\xed\\xdb\\x73\\x73\\x73\\x5b\\x5a\\x5a\\xe8\\x43\\x95\\x0a\\xe4\\\n\\x72\\x06\\xeb\\x56\\x55\\xaf\\xd3\\x9d\\x22\\x29\\x29\\x29\\x37\\xdf\\x7c\\xf3\\\n\\xd2\\xa5\\x4b\\xe7\\xce\\x9d\\x2b\\x8a\\x22\\x74\\xe1\\x77\\x88\\x02\\x43\\x15\\\n\\x8a\\xa2\\x48\\x92\\xa4\\xfe\\x73\\xef\\xde\\xbd\\x2b\\x56\\xac\\x48\\x48\\x48\\\n\\x50\\xef\\x5c\\x10\\x04\\x41\\x10\\x42\\x50\\x99\\x89\\x1f\\xa2\\x28\\xba\\x0b\\\n\\xc3\\xa4\\x49\\x93\\x9e\\x7d\\xf6\\xd9\\x92\\x92\\x12\\xb5\\x45\\x92\\x24\\xa9\\\n\\xa1\\x53\\xa8\\x21\\x14\\x69\\x21\\xcb\\xb2\\x4a\\x88\\x96\\x96\\x96\\x2d\\x5b\\\n\\xb6\\x64\\x67\\x67\\xab\\xfd\\x1b\\xb2\\x6c\\xf0\\x88\\x4e\\xfc\\x30\\x99\\x4c\\\n\\xcb\\x97\\x2f\\xdf\\xb3\\x67\\x8f\\xda\\xd8\\xd0\\x24\\x47\\x68\\xd1\\xc2\\x5d\\\n\\x21\\x2a\\x2a\\x2a\\x1e\\x7f\\xfc\\xf1\\x31\\x63\\xc6\\x50\\x87\\x32\\xc6\\x44\\\n\\x51\\x1c\\x2c\\x6c\\xe8\\x0a\\xce\\xb9\\xbb\\xe1\\x98\\x39\\x73\\xe6\\x07\\x1f\\\n\\x7c\\x60\\xb1\\x58\\xa8\\xb1\\xa1\\x46\\x8e\\x50\\xa1\\x85\\x3b\\x21\\xce\\x9e\\\n\\x3d\\xfb\\xf0\\xc3\\x0f\\xc7\\xc6\\xc6\\x52\\x0f\\x0a\\x82\\x30\\x28\\xdc\\x34\\\n\\x6f\\x40\\x11\\xb5\\xda\\x9c\\x8c\\x8c\\x8c\\xd7\\x5e\\x7b\\xad\\xbd\\xbd\\x9d\\\n\\x1a\\xee\\x6e\\x34\\x83\\x8b\\x90\\xa0\\x85\\xbb\\x42\\xac\\x5e\\xbd\\xda\\x64\\\n\\x32\\x51\\xaf\\x0d\\x22\\x63\\xd1\\x57\\xb8\\x8b\\xc7\\xf8\\xf1\\xe3\\xdf\\x7c\\\n\\xf3\\x4d\\xea\\x04\\x59\\x96\\x29\\xf4\\x0d\\x2e\\x82\\x4c\\x0b\\x59\\x96\\x49\\\n\\x3c\\x9b\\x9b\\x9b\\xd7\\xaf\\x5f\\xef\\xae\\x10\\x43\\x95\\x10\\xee\\x70\\x27\\\n\\x47\\x76\\x76\\xf6\\xe7\\x9f\\x7f\\x4e\\xdd\\x12\\x74\\x9b\\x12\\x34\\x5a\\xb8\\\n\\x5b\\x8d\\xad\\x5b\\xb7\\x8e\\x1b\\x37\\x8e\\x7a\\xe7\\x0a\\x21\\x84\\x3b\\xdc\\\n\\xc9\\x71\\xcb\\x2d\\xb7\\x1c\\x3b\\x76\\x8c\\xba\\x25\\x88\\x36\\x25\\x38\\xb4\\\n\\x50\\x1b\\x7c\\xf4\\xe8\\xd1\\x05\\x0b\\x16\\x50\\x8f\\x5c\\x81\\x84\\x70\\x87\\\n\\x9a\\x90\\xd5\\xeb\\xf5\\x8f\\x3d\\xf6\\xd8\\xa5\\x4b\\x97\\x30\\x78\\xb2\\x11\\\n\\x68\\x5a\\xa8\\x22\\x61\\xb5\\x5a\\xd7\\xae\\x5d\\xab\\xd7\\xeb\\x61\\x68\\x39\\\n\\x95\\x03\\x84\\x2a\\x1b\\x13\\x26\\x4c\\xf8\\xf2\\xcb\\x2f\\xa9\\xd3\\x02\\x2f\\\n\\x1b\\x01\\xa5\\x85\\xea\\x49\\xec\\xdf\\xbf\\x7f\\xea\\xd4\\xa9\\x9d\\x3a\\x42\\\n\\x03\\x81\\x42\\x71\\xfa\\xff\\x95\\x2b\\x57\\x36\\x37\\x37\\x63\\xc0\\x65\\x23\\\n\\x70\\xb4\\x70\\x3a\\x9d\\x88\\x28\\x49\\xd2\\x53\\x4f\\x3d\\x45\\x54\\x18\\xd4\\\n\\x79\\x08\\x7f\\x43\\xb5\\x29\\x69\\x69\\x69\\x3b\\x77\\xee\\x44\\x44\\x45\\x51\\\n\\x02\\x16\\xa4\\x04\\x82\\x16\\x8a\\xa2\\x10\\x27\\xce\\x9e\\x3d\\x3b\\x6f\\xde\\\n\\x3c\\x70\\xa5\\x87\\x83\\xdd\\xf3\\x83\\x00\\xaa\\x6c\\x3c\\xf9\\xe4\\x93\\xea\\\n\\x73\\x15\\x80\\x21\\xf3\\x3b\\x2d\\x54\\x8e\\x6f\\xdf\\xbe\\x3d\\x3e\\x3e\\x1e\\\n\\x34\\x91\\xe8\\x23\\x54\\xd9\\x98\\x3f\\x7f\\x7e\\x59\\x59\\x19\\xba\\x74\\xd7\\\n\\xaf\\xf0\\x2f\\x2d\\x54\\xd1\\x5b\\xbb\\x76\\x2d\\x35\\x52\\xf3\\x24\\xfa\\x07\\\n\\x92\\x8d\\xc4\\xc4\\xc4\\xaf\\xbf\\xfe\\x1a\\xfd\\xef\\x6a\\xf8\\x91\\x16\\x24\\\n\\x77\\xcd\\xcd\\xcd\\xb7\\xde\\x7a\\x2b\\x68\\xe1\\xc6\\x80\\x41\\x4f\\x94\\x20\\\n\\x08\\xaf\\xbc\\xf2\\x0a\\x22\\x52\\x81\\xa0\\x9f\\xc6\\xce\\x5f\\xb4\\x20\\xa1\\\n\\x3b\\x73\\xe6\\x4c\\x56\\x56\\x16\\xb8\\xd9\\x48\\x0d\\x03\\x81\\x5a\\xe2\\xf5\\\n\\x87\\x3f\\xfc\\x81\\xfa\\xd9\\x4f\\x4e\\xa8\\x5f\\x68\\x41\\x9c\\xc8\\xcd\\xcd\\\n\\xa5\\x0a\\x58\\x8d\\x13\\x3e\\x84\\x1a\\xbe\\xde\\x76\\xdb\\x6d\\x6a\\xca\\xcb\\\n\\xe7\\x23\\xe8\\x7b\\x5a\\x10\\x27\\x3e\\xfb\\xec\\x33\\x2a\\x9f\\xd7\\x9c\\x09\\\n\\x7f\\x80\\x0a\\x45\\x67\\xcd\\x9a\\x55\\x57\\x57\\x87\\x7e\\x60\\x86\\x8f\\x69\\\n\\x41\\x9c\\xf8\\xe7\\x3f\\xff\\x49\\x5a\\xa7\\x39\\x13\\xfe\\x03\\x69\\x46\\x66\\\n\\x66\\xe6\\xf9\\xf3\\xe7\\xd1\\xd7\\xcc\\xf0\\x25\\x2d\\x88\\x13\\x6f\\xbf\\xfd\\\n\\x36\\xb8\\x85\\x55\\x1a\\xfc\\x07\\x62\\x46\\x6a\\x6a\\xea\\xb9\\x73\\xe7\\xd0\\\n\\xa7\\x81\\xab\\xcf\\x68\\x41\\xf7\\xf4\\xc6\\x1b\\x6f\\xc0\\x60\\x2b\\x7e\\x1f\\\n\\xd4\\x20\\x1b\\xad\\x32\\xc3\\x57\\x9a\\xe1\\x1b\\x5a\\x10\\x27\\xde\\x7b\\xef\\\n\\x3d\\xd0\\x38\\x11\\x70\\xf8\\x83\\x19\\x3e\\xa0\\x85\\xea\\x4f\\xc0\\x15\\xff\\\n\\x72\\x3c\\x58\\x20\\x6b\\x32\\x6e\\xdc\\xb8\\xea\\xea\\x6a\\xf4\\x45\\xd4\\x3a\\\n\\x50\\x5a\\x10\\x27\\xf6\\xec\\xd9\\xc3\\x5d\\x08\\x76\\x17\\x5d\\xa1\\x20\\x66\\\n\\x64\\x67\\x67\\x37\\x37\\x37\\x0f\\x3c\\xd3\\x35\\x20\\x5a\\x90\\x5e\\x15\\x14\\\n\\x14\\x98\\x4c\\x26\\xed\\xed\\x57\\xd0\\x41\\xcc\\x98\\x3f\\x7f\\xbe\\xd3\\xe9\\\n\\x54\\x6b\\x18\\x02\\x4d\\x0b\\x52\\xaa\\xb2\\xb2\\xb2\\xd1\\xa3\\x47\\x83\\x16\\\n\\x8b\\x86\\x06\\x88\\x19\\xf7\\xdf\\x7f\\x3f\\x0e\\x2c\\x30\\xe9\\x27\\x2d\\xe8\\\n\\xbd\\x68\\x5b\\x5b\\xdb\\xf4\\xe9\\xd3\\x41\\xcb\\x59\\x85\\x12\\x88\\x19\\xcf\\\n\\x3c\\xf3\\xcc\\x40\\x98\\xd1\\x4f\\x5a\\xd0\\xf5\\xee\\xb9\\xe7\\x1e\\xd0\\x72\\\n\\xdb\\x21\\x06\\x35\\x3b\\xbe\\x7d\\xfb\\xf6\\x7e\\x33\\xa3\\x3f\\xb4\\xa0\\x2b\\\n\\x3d\\xf7\\xdc\\x73\\xe0\\xca\\xc2\\x6a\\x08\\x29\\x50\\x8e\\x20\\x32\\x32\\xb2\\\n\\xb8\\xb8\\x18\\xfb\\x15\\x98\\xf4\\x99\\x16\\xe4\\x66\\x7e\\xfd\\xf5\\xd7\\x34\\\n\\x41\\x4a\\x0b\\x47\\x43\\x13\\x64\\xd6\\xb3\\xb2\\xb2\\x2c\\x16\\x4b\\x3f\\x8a\\\n\\x33\\xfa\\x46\\x0b\\xf2\\x6f\\x6b\\x6a\\x6a\\x46\\x8f\\x1e\\xad\\x85\\x1e\\x21\\\n\\x0e\\x32\\x25\\xbf\\xfd\\xed\\x6f\\xb1\\xef\\xa6\\xa4\\x6f\\xb4\\x20\\xa9\\x58\\\n\\xb4\\x68\\x11\\x68\\x6e\\xe6\\x60\\x00\\x31\\xe3\\xa3\\x8f\\x3e\\xc2\\x3e\\x66\\\n\\x3f\\xfb\\x40\\x0b\\x3a\\xef\\x96\\x2d\\x5b\\x40\\x73\\x33\\x07\\x09\\x48\\xd1\\\n\\xe3\\xe2\\xe2\\xca\\xcb\\xcb\\xb1\\x2f\\x4e\\x86\\xb7\\xb4\\x20\\x4e\\x9c\\x3c\\\n\\x79\\x32\\x3c\\x3c\\x5c\\x73\\x29\\x06\\x11\\x48\\xd4\\x6f\\xbc\\xf1\\xc6\\x4e\\\n\\xcb\\xc8\\xf8\\x80\\x16\\x74\\x46\\x45\\x51\\xe6\\xcc\\x99\\x03\\x9a\\xf9\\x18\\\n\\x6c\\x20\\x69\\x7f\\xfd\\xf5\\xd7\\xd1\\x6b\\x27\\xc3\\x2b\\x5a\\x10\\xcb\\x5e\\\n\\x7b\\xed\\x35\\xd0\\x38\\x31\\x08\\x41\\xef\\xaa\\xe2\\xe2\\xe2\\x2a\\x2a\\x2a\\\n\\xbc\\x9c\\x83\\xd4\\x3b\\x2d\\x28\\xfa\\xa8\\xac\\xac\\x8c\\x8e\\x8e\\xd6\\x5e\\\n\\x9a\\x0f\\x52\\xd0\\xc3\\x7c\\xe7\\x9d\\x77\\xa2\\x77\\xbe\\x67\\xef\\xb4\\xa0\\\n\\xb3\\x2c\\x5b\\xb6\\x0c\\x34\\xa9\\x18\\xcc\\xa0\\xb1\\xa3\\xe9\\xce\\xbd\\x32\\\n\\xa3\\x17\\x5a\\xd0\\xef\\xf7\\xed\\xdb\\x07\\xda\\xcb\\xb0\\x41\\x0e\\x1a\\xbe\\\n\\xcc\\xcc\\x4c\\xab\\xd5\\xda\\xeb\\xfb\\xd5\\x5e\\x68\\x21\\xcb\\xb2\\xc3\\xe1\\\n\\x98\\x36\\x6d\\x1a\\x68\\xb4\\x18\\xfc\\x20\\xc1\\x78\\xf1\\xc5\\x17\\xb1\\x37\\\n\\xdf\\xb3\\x27\\x5a\\x90\\x54\\x50\\x29\\x9e\\x66\\x3e\\x86\\x00\\xc8\\x35\\x1c\\\n\\x3e\\x7c\\x78\\x5d\\x5d\\x5d\\xcf\\xa5\\x3a\\xdd\\xd2\\x82\\x7e\\xd6\\xd6\\xd6\\\n\\x36\\x76\\xec\\x58\\x2d\\xcf\\x3d\\x64\\x40\\x8f\\xf7\\x23\\x8f\\x3c\\x82\\x3d\\\n\\x7a\\x18\\xdd\\xd2\\x82\\x44\\xe6\\xa5\\x97\\x5e\\x02\\x4d\\x2a\\x86\\x10\\x68\\\n\\x9d\\xf2\\xc8\\xc8\\xc8\\xca\\xca\\xca\\x1e\\x82\\x55\\xcf\\xb4\\x50\\xa5\\x22\\\n\\x29\\x29\\x49\\x93\\x8a\\x21\\x06\\xca\\x6e\\xad\\x5a\\xb5\\xaa\\x07\\xc1\\xf0\\\n\\x4c\\x0b\\x92\\x8a\\xbf\\xfd\\xed\\x6f\\xa0\\x49\\xc5\\x90\\x03\\x79\\x18\\x26\\\n\\x93\\xa9\\xbc\\xbc\\xbc\\x3b\\xc1\\xf0\\x40\\x0b\\x92\\x0a\\xb3\\xd9\\x9c\\x9c\\\n\\x9c\\xac\\x49\\xc5\\x90\\x04\\x09\\xc6\\xea\\xd5\\xab\\xbb\\x13\\x0c\\x0f\\xb4\\\n\\xa0\\xe3\\xd4\\x79\\x1f\\xc1\\x6e\\x82\\x06\\xdf\\x83\\x3c\\x8c\\xf8\\xf8\\xf8\\\n\\x86\\x86\\x06\\x8f\\x21\\x89\\x67\\xb5\\x90\\x24\\x89\\x72\\x15\\x1a\\x2d\\x86\\\n\\x2a\\x68\\x64\\xff\\xfa\\xd7\\xbf\\xa2\\xa7\\x1c\\x46\\x67\\x5a\\x68\\x69\\xcd\\\n\\x2b\\x04\\x6a\\xd2\\xd3\\x6e\\xb7\\xf7\\xae\\x16\\x44\\x8b\\xbb\\xee\\xba\\x0b\\\n\\xb4\\x5a\\x9b\\xa1\\x0e\\x62\\xc6\\x8e\\x1d\\x3b\\xba\\x96\\x62\\x5c\\x46\\x0b\\\n\\x72\\x4a\\xcb\\xcb\\xcb\\x69\\x7b\\x2d\\xed\\x65\\xe9\\xd0\\x06\\xd9\\x91\\x25\\\n\\x4b\\x96\\x60\\x97\\xc2\\xad\\xcb\\x68\\x41\\x36\\xe6\\x85\\x17\\x5e\\x00\\x4d\\\n\\x2a\\xae\\x00\\xd0\\x63\\x1f\\x11\\x11\\x41\\xeb\\x3a\\xba\\x33\\xe3\\x27\\x5a\\\n\\x90\\x47\\x2a\\x49\\x12\\x2d\\xbb\\xac\\x39\\x9b\\x57\\x02\\xe8\\xe1\\xef\\xfa\\\n\\xf2\\xec\\x27\\x5a\\x10\\x59\\x8e\\x1c\\x39\\xa2\\xd5\\xda\\x5c\\x39\\xa0\\x87\\\n\\x7f\\xda\\xb4\\x69\\x9d\\x5e\\xb5\\xff\\x14\\x6b\\xd0\\xf6\\xc0\\xff\\xfa\\xd7\\\n\\xbf\\xdc\\x37\\x98\\xd4\\x30\\xb4\\xa1\\x28\\x0a\\x63\\xec\\xc4\\x89\\x13\\x45\\\n\\x45\\x45\\x8c\\x31\\x75\\x8b\\xe8\\x0e\\x5a\\x20\\xa2\\x20\\x08\\xb2\\x2c\\x7f\\\n\\xf1\\xc5\\x17\\xe0\\xa2\\x88\\x86\\x21\\x0f\\x1a\\x77\\x45\\x51\\x3e\\xff\\xfc\\\n\\x73\\x70\\x1f\\xf7\\x4e\\x16\\xc4\\xcb\\xcd\\xc7\\x35\\x0c\\x19\\x90\\x65\\xc8\\\n\\xce\\xce\\x76\\x4f\\x77\\x76\\x84\\x1b\\x8a\\xa2\\x70\\xce\\x69\\x83\\x02\\x51\\\n\\x14\\x3b\\x6d\\x0d\\x1d\\x9a\\x08\\xf1\\xf7\\x35\\xc1\\xdd\\xc2\\xd9\\x7b\\x90\\\n\\x1d\\xf9\\xe1\\x87\\x1f\\xce\\x9e\\x3d\\x3b\\x7e\\xfc\\x78\\x62\\x02\\xa8\\x61\\\n\\x08\\x22\\x6a\\xd3\\x40\\xae\\x4c\\x50\\x3c\\xb2\\x65\\xcb\\x16\\x35\\x1e\\x61\\\n\\xc4\\x09\\xce\\xf9\\x85\\x0b\\x17\\x26\\x4c\\x98\\x60\\x36\\x9b\\x19\\x0b\\xf5\\\n\\x8d\\xd7\\xe9\\x0e\\x23\\x23\\x23\\xe7\\xcc\\x99\\x43\\xdb\\x5a\\x85\\x8e\\xd5\\\n\\x53\\x1f\\xb3\\xa3\\x47\\x8f\\xd6\\xd4\\xd4\\x84\\x7e\\x67\\x02\\x00\\xb9\\x95\\\n\\x4b\\x97\\x2e\\xa5\\x80\\x83\\x73\\x2e\\x82\\xcb\\x82\\xe4\\xe7\\xe7\\x9b\\xcd\\\n\\x66\\x3a\\x22\\xd8\\xf7\\xd9\\x0b\\x38\\xe7\\xb2\\x2c\\x67\\x67\\x67\\xaf\\x5e\\\n\\xbd\\x7a\\xe7\\xce\\x9d\\xa2\\x28\\x86\\x8e\\x8f\\xcc\\x39\\x77\\x3a\\x9d\\x33\\\n\\x67\\xce\\x4c\\x49\\x49\\x79\\xf5\\xd5\\x57\\x05\\x41\\x08\\x7d\\x8b\\x4c\\xc4\\\n\\x2d\\x28\\x28\\x68\\x6f\\x6f\\x37\\x99\\x4c\\x3f\\xf9\\x16\\x00\\x90\\x9b\\x9b\\\n\\x0b\\xa1\\xf4\\xd8\\xf5\\x0a\\x83\\xc1\\xf0\\xd5\\x57\\x5f\\xbd\\xfc\\xf2\\xcb\\\n\\xc1\\xbe\\x11\\x0f\\x38\\x7d\\xfa\\x74\\x7a\\x7a\\x3a\\xb8\\x7a\\x3c\\xc4\\x41\\\n\\xee\\x45\\x4d\\x4d\\x4d\\x61\\x61\\xe1\\xac\\x59\\xb3\\x14\\x45\\x11\\x01\\x40\\\n\\x10\\x04\\x44\\x2c\\x28\\x28\\x00\\xff\\x84\\xa6\\x9c\\xf3\\x8e\\xdc\\x99\\x4f\\\n\\x81\\x88\\x26\\x93\\x49\\x10\\x04\\x0a\\xb1\\x7c\\x7b\\xf2\\x7e\\x83\\x94\\x2c\\\n\\x3a\\x3a\\x7a\\xe0\\xa7\\x52\\x95\\x3b\\x00\\x12\\x4e\\xaa\\x76\\xf0\\xe0\\xc1\\\n\\x59\\xb3\\x66\\x21\\xa2\\x48\\x16\\xa4\\xaa\\xaa\\xaa\\xb8\\xb8\\x18\\xfc\\xc3\\\n\\x6e\\x1a\\x33\\x7f\\x58\\x59\\xaa\\x39\\x03\\x80\\xd0\\x31\\x7c\\x34\\x84\\x3e\\\n\\xa1\\xa9\\x2c\\xcb\\x46\\xa3\\x51\\xa7\\xd3\\xb5\\xb5\\xb5\\x0d\\xfc\\x6c\\xde\\\n\\xe0\\xe0\\xc1\\x83\\x40\\xab\\x6f\\xd1\\x50\\xfd\\xf8\\xe3\\x8f\\x56\\xab\\x95\\\n\\x73\\xee\\xdb\\xc7\\x8e\\x96\\xf7\\x5a\\xb8\\x70\\xe1\\xb2\\x65\\xcb\\xf6\\xef\\\n\\xdf\\xff\\xc6\\x1b\\x6f\\x0c\\x0a\\xdf\\x25\\xe8\\xa0\\x81\\x58\\xbe\\x7c\\x79\\\n\\x66\\x66\\x66\\x6c\\x6c\\x6c\\x43\\x43\\xc3\\xb3\\xcf\\x3e\\x0b\\xfe\\x4c\\x33\\\n\\xd2\\x99\\x7f\\xf8\\xe1\\x07\\x87\\xc3\\xa1\\xd7\\xeb\\x39\\xd1\\xe2\\xf8\\xf1\\\n\\xe3\\xe0\\x87\\xba\\x1b\\x44\\xe4\\x9c\\x9f\\x3c\\x79\\xb2\\xb6\\xb6\\x36\\x25\\\n\\x25\\x05\\x06\\x95\\xef\\x12\\x44\\x50\\xbf\\x2d\\x5b\\xb6\\xec\\xbd\\xf7\\xde\\\n\\x7b\\xf8\\xe1\\x87\\xef\\xbf\\xff\\xfe\\x29\\x53\\xa6\\x74\\x64\\x14\\xfc\\x76\\\n\\x45\\x00\\x28\\x2d\\x2d\\x2d\\x2f\\x2f\\x07\\x35\\xf9\\x4d\\xb4\\xf0\\x07\\x24\\\n\\x49\\x2a\\x29\\x29\\xa9\\xae\\xae\\x0e\\x80\\x43\\xee\\x3d\\xe7\\xbc\\xcc\\xe4\\\n\\x06\\x6b\\x7f\\x35\\x0a\\x71\\xef\\xbc\\xf3\\xce\\x8b\\x17\\x2f\\x4e\\x9e\\x3c\\\n\\x39\\x37\\x37\\xb7\\xba\\xba\\xda\\xaf\\xb1\\x2e\\x11\\x51\\x96\\xe5\\xff\\xfe\\\n\\xf7\\xbf\\x00\\xc0\\x29\\xba\\xa3\\x7f\\xf8\\x43\\xa3\\x68\\x00\\xf4\\x7a\\x7d\\\n\\x00\\x74\\xc2\\xfb\\x5e\\xf3\\xd2\\x05\\xf6\\x95\\x97\\xd0\\x0f\\x10\\x1d\\xaf\\\n\\xbb\\xee\\xba\\xe7\\x9e\\x7b\\xae\\xaa\\xaa\\xaa\\xae\\xae\\x0e\\xfc\\x1c\\xd7\\\n\\xd0\\x15\\x4f\\x9e\\x3c\\x09\\xa4\\x16\\x4d\\x4d\\x4d\\x24\\x1d\\xfe\\xbb\\x2a\\\n\\x65\\x51\\xbd\\x65\\x06\\xf3\\xf4\\xd7\\x3d\\x28\\x2d\\xfb\\xc0\\x03\\x0f\\xe4\\\n\\xe6\\xe6\\xd2\\x3a\\xa1\\xbd\\x5e\\xe8\\x93\\x4f\\x3e\\x79\\xe6\\x99\\x67\\xa0\\\n\\x7b\\xbb\\x49\\x67\\xb8\\xee\\xba\\xeb\\xae\\xbe\\xfa\\x6a\\x6f\\x4e\\xe8\\x73\\\n\\x90\\x37\\x9d\\x9b\\x9b\\x7b\\xcb\\x2d\\xb7\\x64\\x64\\x64\\xfc\\xe6\\x37\\xbf\\\n\\xa1\\xf7\\x12\\xfe\\xbe\\xee\\xa9\\x53\\xa7\\x80\\x68\\x51\\x56\\x56\\xd6\\xda\\\n\\xda\\x0a\\x3d\\xd2\\x82\\x31\\x60\\x9c\\xf5\\xf9\\x8f\\x01\\xe3\\x0c\\x11\\x75\\\n\\x7a\\x9d\\x4e\\x27\\x22\\xa2\\xfa\\x61\\x37\\xc7\\x33\\xc6\\x19\\x20\\x74\\xfd\\\n\\x63\\x9c\\x75\\x47\\x0e\\x1a\\xb3\\xd4\\xd4\\xd4\\x9c\\x9c\\x1c\\x8a\\x57\\x45\\\n\\x51\\xec\\x9a\\xc2\\xe7\\x9c\\x8b\\xa2\\x48\\x9b\\xf3\\xce\\x9e\\x3d\\x7b\\xca\\\n\\x94\\x29\\xea\\x6f\\xc9\\x35\\xa6\\x5f\\xa9\\xf6\\x45\\x10\\x84\\xbd\\x7b\\xf7\\\n\\xbe\\xf5\\xd6\\x5b\\xe0\\x5a\\x50\\x86\\xbe\\x55\\x8f\\xa4\\x1f\\x76\\x77\\x39\\\n\\x2f\\xd1\\xd1\\x64\\x76\\xd9\\x27\\x00\\x10\\x19\\x19\\xf9\\xfc\\xf3\\xcf\\x13\\\n\\xcb\\x23\\x22\\x22\\x6c\\x36\\x5b\\xcf\\x03\\x04\\x00\\xc0\\x80\\x09\\xac\\xf3\\\n\\x1f\\xf7\\x96\\xd0\\x74\\x72\\xda\\xe2\\x4a\\x04\\x00\\x92\\x8a\\x9e\\x62\\x04\\\n\\x06\\x88\\x00\\xfd\\xd2\\x12\\xa7\\xc3\\x79\\xfd\\x9c\\xb9\\x29\\x63\\x52\\x19\\\n\\x67\\xf3\\xe7\\x2e\\xd8\\xfb\\xdd\\xd7\\x74\\x0b\\xdd\\xdf\\x1d\\x30\\xce\\x0c\\\n\\x91\\x3a\\x44\\x84\\x8e\\xee\\x62\\xb2\\x43\\x71\\x5a\\x7b\\x71\\x4d\\x6c\\x36\\\n\\x9b\\xc3\\xe1\\x90\\x5d\\x80\\xcb\\x43\\x62\\xf2\\xed\\x55\\x8b\\x60\\x36\\x9b\\\n\\x2d\\x16\\x4b\\x47\\xe3\\x18\\x43\\x44\\x77\\xd7\\x87\\x3e\\x91\\x65\\x79\\xc6\\\n\\x8c\\x19\\x74\\x98\\xfb\\x7b\\x2f\\xf5\\x48\\xea\\x31\\xb5\\xd3\\x3c\\xda\\x7e\\\n\\xc6\\x19\\x07\\xd6\\x6d\\x6b\\x15\\x40\\x44\\x40\\x00\\x00\\x26\\x74\\x8c\\x1f\\\n\\x3d\\x35\\x4e\\xd9\\x69\\x8a\\x32\\xad\\x5b\\xff\\xb4\\x53\\x92\\x0e\\x1c\\x3c\\\n\\xf0\\xe1\\xc7\\x1f\\x72\\x91\\x23\\x2a\\xea\\x61\\x1e\\x7a\\x4e\\x46\\x94\\xfb\\\n\\xaf\\xf7\\xd4\\x39\\xe5\\xe5\\xe5\\x66\\xb3\\x59\\x04\\x80\\xb2\\xb2\\x32\\xe8\\\n\\x59\\x27\\x11\\x22\\x13\\xc3\\xb8\\x9e\\x43\\x5f\\x2f\\xca\\x00\\x10\\xce\\x34\\\n\\x9e\\x7c\\xe2\\xc5\\x47\\x11\\x50\\x14\\xc5\\xa8\\xe4\\x70\\xc6\\x98\\xe7\\xf3\\\n\\x70\\x40\\x19\\x13\\x26\\xc7\\x4e\\xf9\\x55\\x9a\\x31\\x46\\x87\\x0a\\x00\\x03\\\n\\x05\\x99\\xc0\\x50\\x91\\xf1\\xdc\\xee\\xea\\x23\\x6f\\x9c\\x56\\x9c\\x08\\x88\\\n\\x02\\x78\\x38\\x01\\x25\\xb5\\x8c\\x46\\xe3\\xbd\\xf7\\xde\\x3b\\x72\\xe4\\xc8\\\n\\xbc\\xbc\\xbc\\xfc\\xfc\\x7c\\x1a\\x2a\\x2a\\x30\\x49\\x4b\\x4b\\x5b\\xb4\\x68\\\n\\x11\\x22\\x7e\\xf2\\xc9\\x27\\x4e\\xa7\\x93\\x04\\x99\\x0e\\x88\\x8e\\x8e\\x5e\\\n\\xba\\x74\\x69\\x52\\x52\\x52\\x71\\x71\\xf1\\x17\\x5f\\x7c\\xe1\\x74\\x3a\\xe9\\\n\\x73\\xbd\\x5e\\x6f\\xb7\\xdb\\x01\\x00\\x11\\xb3\\xb2\\xb2\\x8c\\x46\\xe3\\xe9\\\n\\xd3\\xa7\\xef\\xbe\\xfb\\xee\\x98\\x98\\x98\\x03\\x07\\x0e\\x1c\\x38\\x70\\x20\\\n\\x22\\x22\\x62\\xf9\\xf2\\xe5\\xf1\\xf1\\xf1\\x87\\x0e\\x1d\\xfa\\xf6\\xdb\\x6f\\\n\\x3b\\x79\\xb2\\x8c\\x81\\xe4\\xec\\x85\\xcd\\x91\\xa3\\xc2\\x74\\xe1\\xba\\x96\\\n\\xd2\\x36\\xc5\\x35\\xa2\\x44\\x13\\x59\\xb2\\xfd\\xcf\\xca\\xff\\x89\\x32\\xc4\\\n\\xc8\\xb2\\x6c\\x96\\xbc\\xca\\x5b\\xe8\\x22\\xc4\\xd1\\xd9\\xf1\\x86\\x28\\x1d\\\n\\x43\\x04\\x06\\x0a\\x02\\x63\\xac\\xad\\xda\\x52\\x7d\\xa4\\x91\\xc6\\x82\\x61\\\n\\xef\\x03\\xd8\\xd4\\xd4\\x54\\x57\\x57\\x27\\x02\\x40\\x45\\x45\\x45\\xb7\\x47\\\n\\x31\\x10\\x74\\xfc\\xfa\\x0d\\x53\\x52\\xe7\\x8f\\x54\\x24\\xec\\x9f\\x85\\x95\\\n\\x29\\x9d\\x05\\x80\\x80\\x02\\xef\\x5e\\x6c\\x19\\x28\\x12\\x88\\x06\\x81\\x31\\\n\\xa6\\x38\\x15\\x04\\xc6\\x00\\x0d\\x82\\x62\\x91\\x04\\x81\\xe1\\xb5\\x0f\\x67\\\n\\xc8\\x76\\xf9\\xd8\\x3f\\xce\\x80\\xc0\\x1c\\x1d\\x87\\x5f\\x06\\xca\\xe0\\xe6\\\n\\xe6\\xe6\\x1a\\x8d\\x46\\x51\\x14\\x37\\x6d\\xda\\xb4\\x71\\xe3\\xc6\\x27\\x9f\\\n\\x7c\\x92\\xea\\x04\\x96\\x2c\\x59\\xb2\\x6d\\xdb\\xb6\\xa6\\xa6\\xa6\\xda\\xda\\\n\\xda\\x07\\x1f\\x7c\\x70\\xe4\\xc8\\x91\\xc7\\x8e\\x1d\\xa3\\x5f\\xa5\\xa7\\xa7\\\n\\xef\\xda\\xb5\\x2b\\x26\\x26\\xe6\\xf4\\xe9\\xd3\\xeb\\xd7\\xaf\\x3f\\x72\\xe4\\\n\\xc8\\xa2\\x45\\x8b\\x1a\\x1a\\x1a\\x00\\xe0\\xcb\\x2f\\xbf\\xcc\\xcf\\xcf\\xbf\\\n\\xf3\\xce\\x3b\\x01\\x60\\xd5\\xaa\\x55\\xcb\\x97\\x2f\\x2f\\x2e\\x2e\\xd6\\xeb\\\n\\xf5\\xb1\\xb1\\xb1\\xcf\\x3f\\xff\\xfc\\xfa\\xf5\\xeb\\x17\\x2e\\x5c\\x18\\x15\\\n\\x15\\x05\\x00\\x9b\\x36\\x6d\\xda\\xb4\\x69\\xd3\\xda\\xb5\\x6b\\x55\\x67\\x85\\\n\\x31\\x40\\x84\\x31\\xd7\\x8e\\x88\\xba\\x2a\\x0c\\x65\\xec\\x7c\\xbb\\x0c\\x50\\\n\\x86\\x51\\x53\\x87\\x25\\xe7\\x24\\x08\\x3a\\xde\\x54\\xd2\\x5a\\xb2\\xfb\\x82\\\n\\xd3\\x26\\xbb\\xf7\\xb0\\xc0\\x05\\x9b\\xcd\\xc6\\x18\\x33\\x18\\xe3\\x7b\\x4d\\\n\\xf6\\x70\\x91\\x67\\x2c\\x4e\\x1a\\x31\\x39\\x16\\x14\\xb4\\x2b\\x82\\x02\\xcc\\\n\\xc8\\x25\\x62\\x41\\xe9\\x37\\x35\\xfb\\x9e\\x3c\\x8e\\x36\\xb9\\x67\\x86\\x92\\\n\\xd4\\x59\\x2c\\x96\\xca\\xca\\x4a\\x11\\x00\\xaa\\xaa\\xaa\\x3c\\x0f\\x13\\x67\\\n\\xa8\\xe0\\xe8\\x19\\xf1\\x93\\x96\\x8d\\xb5\\x36\\xd9\\x05\\x7d\\x3f\\x43\\x35\\\n\\x0e\\xde\\xfd\\x90\\x01\\x20\\x4a\\x16\\x19\\x18\\x70\\x0e\\x16\\x59\\x5c\\x31\\\n\\xa6\\x64\\xce\\xf0\\x9a\\x0d\\xff\\x9d\\x56\\x69\\x09\\xe7\\xcd\\xf6\\xe4\\x1b\\\n\\x12\\x8f\\xbc\\x53\\x02\\x92\\x72\\x8f\\x00\\x46\\x80\\x52\\xb8\\xec\\xbc\\x4e\\\n\\xa7\\xd3\\x60\\x30\\xbc\\xfe\\xfa\\xeb\\xe4\\x0d\\x3c\\xfd\\xf4\\xd3\\x1b\\x36\\\n\\x6c\\xf8\\xf4\\xd3\\x4f\\x0b\\x0b\\x0b\\xa3\\xa3\\xa3\\xdf\\x7d\\xf7\\xdd\\xdd\\\n\\xbb\\x77\\xdf\\x7e\\xfb\\xed\\x76\\xbb\\x3d\\x27\\x27\\x67\\xef\\xde\\xbd\\xa4\\\n\\x99\\x8a\\xa2\\xac\\x5b\\xb7\\xce\\x64\\x32\\x0d\\x1f\\x3e\\x5c\\x51\\x94\\xc9\\\n\\x93\\x27\\x17\\x16\\x16\\xae\\x5c\\xb9\\x92\\x1c\\xd2\\xd6\\xd6\\x56\\xb3\\xd9\\\n\\x4c\\xe7\\x6f\\x6b\\x6b\\x13\\x45\\x71\\xed\\xda\\xb5\\xbb\\x77\\xef\\x16\\x04\\\n\\x61\\xdb\\xb6\\x6d\\xeb\\xd7\\xaf\\x5f\\xb3\\x66\\xcd\\xf3\\xcf\\x3f\\x0f\\x00\\\n\\xaf\\xbe\\xfa\\xea\\x9a\\x35\\x6b\\x36\\x6f\\xde\\xdc\\xd2\\xd2\\x42\\x5d\\xe7\\\n\\x30\\xcb\\x23\\xe6\\x44\\xde\\xfe\\xcf\\x39\\x8a\\x2c\\x63\\x17\\x12\\x23\\x80\\\n\\xe2\\x44\\xc5\\x81\\x92\\x4d\\x46\\x05\\x87\\x4f\\x8c\\x19\\x39\\x35\\x8e\\x77\\\n\\x0d\\xd7\\x18\\x73\\xc9\\x47\\x4f\\x40\\x00\\x74\\xa2\\xd3\\x22\\xdb\\x5a\\x1c\\\n\\x92\\xc2\\xd2\\x23\\x9a\\x22\\x44\\xa9\\xb0\\x25\\x0e\\x38\\x0a\\x51\\x7a\\x8b\\\n\\x55\\x76\\x02\\x00\\xb0\\x11\\x80\\x97\\x00\\xec\\xdd\\x9f\\x87\\x4c\\xed\\xc5\\\n\\x8b\\x17\\x45\\x00\\xa0\\x27\\xa3\\x3b\\x77\\xc6\\xd1\\x26\\x29\\x4e\\x45\\x17\\\n\\x2e\\x42\\xd7\\xc6\\xf9\\x02\\x1c\\x40\\x01\\xe0\\x00\\xc8\\x40\\x16\\xd0\\x29\\\n\\xcb\\x28\\x23\\x20\\x30\\x84\\x36\\x49\\x57\\x6f\\x0b\\x73\\x28\\x82\\x80\\xe8\\\n\\x60\\x7c\\xac\\xa4\\xfc\\x19\\x31\\x1b\\xc0\\x0e\\xf0\\x2b\\x80\\x6b\\x2f\\x37\\\n\\x25\\x7a\\xbd\\x5e\\x92\\x24\\xe2\\x04\\x00\\xbc\\xf0\\xc2\\x0b\\x4f\\x3c\\xf1\\\n\\xc4\\xed\\xb7\\xdf\\x5e\\x58\\x58\\x98\\x93\\x93\\x13\\x1b\\x1b\\xfb\\xc4\\x13\\\n\\x4f\\xd8\\xed\\x76\\x51\\x14\\xf3\\xf2\\xf2\\x4a\\x4b\\x4b\\x69\\xf7\\x5e\\x70\\\n\\xe5\\x98\\xc7\\x8d\\x1b\\x77\\xf6\\xec\\xd9\\xa2\\xa2\\xa2\\xb1\\x63\\xc7\\x92\\\n\\x5b\\x4a\\xa1\\xbc\\xfa\\xf4\\x47\\x44\\x44\\xd4\\xd5\\xd5\\xed\\xde\\xbd\\x5b\\\n\\xa7\\xd3\\x39\\x9d\\xce\\xbc\\xbc\\xbc\\x85\\x0b\\x17\\xbe\\xf2\\xca\\x2b\\xf4\\\n\\xed\\xae\\x5d\\xbb\\x1e\\x7a\\xe8\\xa1\\x84\\x84\\x84\\xe6\\xe6\\xe6\\x8e\\x1b\\\n\\x42\\x1c\\xb7\\x68\\x24\\x2a\\x68\\xae\\xb5\\x31\\xb1\\x4b\\xc7\\x21\\x28\\x4e\\\n\\x72\\xc0\\x19\\x30\\x70\\x5a\\x25\\x87\\x19\\x98\\x00\\x4c\\xf4\\x64\\x20\\xbd\\\n\\x80\\x6c\\x47\\x2e\\x30\\xce\\x19\\x03\\xfe\\xbf\\x52\\x4a\\x12\\xc2\\xdb\\xfe\\\n\\x50\\x38\\xcb\\x29\\x1b\\xce\\xff\\xf5\\xc7\\x1f\\xff\\xcf\\xf9\\x04\\x80\\x45\\\n\\x0c\\xb2\\x01\\xfe\\x04\\xe0\\xe8\\xb8\\xbe\\x07\\x10\\x2b\\x6b\\x6a\\x6a\\x44\\\n\\x49\\x92\\x9a\\x9a\\x9a\\xc0\\x13\\x2d\\x50\\x41\\x60\\x70\\xf1\\x78\\x53\\xde\\\n\\x33\\x85\\xe3\\x17\\x27\\xc9\\x4e\\xc5\\x1f\\x61\\x5a\\x3b\\x40\\x24\\x80\\x15\\\n\\x80\\x33\\xd0\\x29\\x10\\x93\\x64\\x32\\xc6\\x19\\x64\\xbb\\x1c\\x01\\xf8\\xef\\\n\\x96\\x94\\xaf\\x2e\\x5d\\xa5\\x30\\x08\\x33\\x21\\x37\\xe9\\x0e\\xfd\\xbb\\xca\\\n\\x22\\xe3\\x51\\xce\\x16\\x03\\xcc\\x03\\x68\\xf4\\xc4\\xd2\\xb0\\xb0\\x30\\xab\\\n\\xd5\\xca\\x18\\xb3\\xdb\\xed\\xf5\\xf5\\xf5\\xe3\\xc6\\x8d\\x03\\x80\\xd4\\xd4\\\n\\x54\\x45\\x51\\x6a\\x6b\\x6b\\xc9\\xc9\\xa0\\xd2\\x76\\x6a\\x2f\\xe7\\xfc\\xa9\\\n\\xa7\\x9e\\x4a\\x49\\x49\\x39\\x75\\xea\\xd4\\x99\\x33\\x67\\xf2\\xf2\\xf2\\x36\\\n\\x6f\\xde\\x7c\\xee\\xdc\\x39\\x7a\\xbd\\x77\\x59\\x6f\\x20\\x52\\x3d\\x18\\xfd\\\n\\x8f\\x5e\\xaf\\xe7\\x9c\\x1b\\x8d\\x46\\x8a\\x11\\xa8\\xec\\xe3\\xa7\\x9f\\x30\\\n\\x00\\x80\\xca\\xbc\\xfa\\x19\\xf7\\x0a\\xe1\\x23\\x0c\\x1e\\xc2\\x01\\x04\\x7b\\\n\\x8b\\x24\\xd9\\xe5\\x0e\\xa7\\x9a\\x33\\xc6\\xc0\\x38\\x4c\\xc7\\x75\\xdd\\x38\\\n\\x5e\\xbd\\x41\\x76\\xa0\\xb3\\x4d\\x92\\x1d\\xb2\\x82\\xec\\xe3\\xca\\xb1\\xc3\\\n\\x04\\x7b\\x2b\\x37\\x4c\\xfa\\x73\\x61\\xc6\\xbf\\x2b\\x6f\\x15\\x58\\x9c\\x8c\\\n\\x3f\\x47\\xb8\\xcd\\xd5\\x69\\x3d\\x5f\\xa1\\xa6\\xa6\\x46\\xb4\\xd9\\x6c\\x14\\\n\\x9d\\x7a\\x06\\x02\\x00\\x14\\x7d\\x58\\x56\\xf4\\x61\\x59\\x7f\\x6e\\xd6\\x0b\\\n\\xcc\\x02\\xf8\\x1a\\x20\\x03\\xc0\\x02\\x50\\x01\\x90\\x90\\x15\\x3b\\x75\\x45\\\n\\xba\\x29\\x31\\x0c\\x5c\\x0d\\x60\\x0c\\x1c\\x66\\xe9\\xec\\x8e\\xaa\\xe2\\xed\\\n\\xe5\\xc0\\xe0\\x84\\x82\\x7b\\x05\\x48\\x02\\x18\\xed\\xa9\\x79\\xf4\\x88\\xd3\\\n\\xf0\\xab\\xd5\\x87\\x4e\\xa7\\x13\\xdc\\xc6\\xd5\\x3d\\xac\\xe0\\x9c\\x57\\x54\\\n\\x54\\xe4\\xe4\\xe4\\xcc\\x98\\x31\\xe3\\x86\\x1b\\x6e\\xb8\\xfb\\xee\\xbb\\x8b\\\n\\x8b\\x8b\\x6f\\xbd\\xf5\\xd6\\x3d\\x7b\\xf6\\x78\\xbc\\x5b\\x62\\x95\\x9a\\x0d\\\n\\x53\\xcf\\xd3\\x99\\x43\\x32\\xea\\x22\\xc4\\xaa\\xaf\\x5a\\xbe\\x5a\\x79\\x28\\\n\\x26\\x2d\\x42\\x76\\x5e\\xee\\x96\\x31\\x00\\x05\\x92\\x66\\x8d\\x18\\x9e\\x19\\\n\\xe3\\x30\\x3b\\x29\\x38\\x57\\x24\\xe5\\xd8\\x5b\\x25\\xb2\\x43\\xea\\x9f\\x26\\\n\\x73\\x81\\xa5\\xfd\\x62\\x74\\x74\\xb2\\xc9\\xa8\\xe0\\x0f\\xca\\x68\\xd9\\x09\\\n\\xa6\\x30\\xe5\\xe4\\x43\\x19\\xdf\\xb5\\x39\\x2b\\x72\\x6b\\x19\\x67\\x33\\x15\\\n\\x7c\\x10\\xe0\\x29\\x80\\xda\\xde\\x98\\x51\\x5f\\x5f\\x2f\\x5a\\xad\\xd6\\xf6\\\n\\xf6\\xf6\\xae\\x0d\\x73\\x07\\x39\\x19\\xfd\\xb8\\xd7\\x9e\\x21\\x00\\xc8\\x00\\\n\\xb7\\x00\\x4c\\x07\\x98\\x0a\\xf0\\x67\\x00\\x00\\xa8\\x2d\\x6c\\xde\\xb5\\xea\\\n\\x3f\\x6e\\xd1\\x1a\\x00\\x80\\xea\\xa5\\x73\\x04\\x06\\xd0\\x0e\\x50\\x0c\\x30\\\n\\xf6\\xf2\\xb6\\x91\\xaf\\x40\\xcf\\x2e\\x00\\x24\\x24\\x24\\x24\\x26\\x26\\x16\\\n\\x16\\x16\\x02\\x40\\x61\\x61\\x21\\xe7\\xfc\\xea\\xab\\xaf\\xde\\xb7\\x6f\\x1f\\\n\\x1d\\x46\\xb5\\x04\\x00\\xc0\\x18\\x7b\\xee\\xb9\\xe7\\xf6\\xec\\xd9\\xb3\\x6f\\\n\\xdf\\xbe\\x82\\x82\\x82\\x8d\\x1b\\x37\\x96\\x97\\x97\\xaf\\x5a\\xb5\\x8a\\x68\\\n\\xe1\\x9e\\x0c\\xed\\x94\\x18\\xed\\x9a\\x27\\xf5\\xd0\\x81\\x0c\\x4e\\xef\\xa8\\\n\\xec\\xae\\xf9\\xa7\\x3f\\xaf\\xbc\\xf5\\xcd\\x99\\x61\\xb1\\x06\\xd9\\xa9\\x88\\\n\\x46\\xe1\\xf0\\x96\\xff\\x16\\xbe\\x7f\\xde\\xeb\\xce\\xf3\\x80\\x93\\x9f\\x94\\\n\\xa7\\xde\\x30\\x52\\x17\\xa1\\x63\\xa8\\x30\\x60\\x92\\x02\\x7a\\x93\\x4e\\xd4\\\n\\x73\\x04\\x44\\x84\\x03\\x00\\x07\\x00\\x3c\\x06\\x71\\x9d\\xd0\\xd4\\xd4\\x24\\\n\\xb6\\xb7\\xb7\\x3b\\x1c\\x8e\\x9e\\x8f\\xf3\\x07\\x27\\x00\\x40\\x61\\xc0\\x39\\\n\\x7b\\x16\\xe0\\x04\\xc0\\x5f\\x11\\xce\\x29\\x28\\x00\\x28\\x9c\\x01\\x00\\xfe\\\n\\x14\\xad\\x75\\x80\\x09\\x0c\\x65\\xa4\\xb4\\x83\\x08\\x20\\x77\\x69\\x9e\\x2c\\\n\\xcb\\xa2\\x28\\xbe\\xff\\xfe\\xfb\\xeb\\xd6\\xad\\x03\\x80\\x37\\xde\\x78\\xc3\\\n\\x6c\\x36\\x7f\\xfa\\xe9\\xa7\\x8c\\xb1\\x83\\x07\\x0f\\x16\\x16\\x16\\xbe\\xf7\\\n\\xde\\x7b\\xb7\\xdd\\x76\\x5b\\x7d\\x7d\\xfd\\x8a\\x15\\x2b\\xc6\\x8d\\x1b\\xf7\\\n\\xfd\\xf7\\xdf\\x03\\x80\\x24\\x49\\xf3\\xe6\\xcd\\x7b\\xf0\\xc1\\x07\\x17\\x2c\\\n\\x58\\x50\\x56\\x56\\x96\\x99\\x99\\x39\\x6a\\xd4\\xa8\\x0f\\x3f\\xfc\\x90\\xce\\\n\\xa9\\xd3\\xe9\\xd4\\xc4\\xa2\\x28\\x8a\\xee\\x5b\\x2d\\x09\\x82\\xe0\\xfe\\x4f\\\n\\xcf\\x15\\xf3\\x08\\xa2\\x5e\\x54\\xba\\x04\\x11\\x24\\x81\\xad\\x55\\x96\\x96\\\n\\x8a\\xf6\\xa8\\xe4\\x70\\x6c\\x47\\x45\\x51\\xca\\xbf\\xaf\\x65\\x02\\xe3\\xfd\\\n\\x7d\\x02\\x11\\xa0\\xfd\\xa2\\xb5\\xf0\\x83\\xd2\\xee\\x0e\\xa0\\x87\\xb0\\xe7\\\n\\x78\\x86\\x98\\xdd\\xd6\\xd6\\x26\\x5a\\xad\\xd6\\x60\\x55\\x95\\x21\\x00\\xca\\\n\\x68\\x03\\xd8\\x01\\x90\\xef\\x8a\\xe8\\x3c\\x74\\x0a\\x39\\xe3\\x6e\\x89\\x1a\\\n\\xf4\\x44\\x79\\x7a\\xb3\\x83\\x88\\x87\\x0e\\x1d\\x8a\\x89\\x89\\x69\\x6e\\x6e\\\n\\x5e\\xbe\\x7c\\xf9\\x85\\x0b\\x17\\xc8\\x94\\xdc\\x75\\xd7\\x5d\\xdb\\xb6\\x6d\\\n\\x3b\\x7e\\xfc\\x78\\x5b\\x5b\\xdb\\xf7\\xdf\\x7f\\x9f\\x9f\\x9f\\x4f\\x96\\x85\\\n\\x31\\xb6\\x70\\xe1\\xc2\\xf7\\xdf\\x7f\\x7f\\xdf\\xbe\\x7d\\x56\\xab\\x35\\x22\\\n\\x22\\xe2\\xb3\\xcf\\x3e\\xdb\\xb4\\x69\\x13\\xd9\\x9a\\x86\\x86\\x86\\x4b\\x97\\\n\\x2e\\xd1\\xf9\\x2f\\x5d\\xba\\x54\\x5f\\x5f\\xaf\\x5e\\xce\\x6c\\x36\\xd7\\xd5\\\n\\xd5\\xa9\\x0a\\x61\\xb7\\xdb\\x9b\\x9a\\x9a\\xba\\xf6\\x24\\xca\\xa8\\x78\\x4a\\\n\\x31\\x21\\x03\\xc6\\x80\\xeb\\x18\\xe3\\xc0\\x04\\x60\\x1c\\x74\\x61\\x22\\xca\\\n\\xa8\\x78\\xec\\x01\\xef\\x40\\xe9\\xe3\\xce\\x17\\x72\\x9d\\xd0\\xfb\\x6a\\x06\\\n\\xab\\xd5\\x2a\\xda\\xed\\xf6\\xe0\\x14\\x40\\x30\\x00\\x84\\xa4\\xeb\\xe2\\x47\\\n\\xcf\\x1d\\xd9\\x6c\\x97\\xd9\\x8e\\x2a\\x2c\\x69\\xf3\\x6c\\xf4\\x7a\\xeb\\x25\\\n\\x1a\\x8c\\x2d\\x5b\\xb6\\xbc\\xf5\\xd6\\x5b\\xcd\\xcd\\xcd\\x29\\x29\\x29\\xc3\\\n\\x87\\x0f\\x2f\\x2e\\x2e\\x6e\\x6f\\x6f\\x67\\x8c\\x49\\x92\\xc4\\x18\\x3b\\x73\\\n\\xe6\\x4c\\x56\\x56\\xd6\\xcf\\x7e\\xf6\\x33\\x59\\x96\\x8b\\x8a\\x8a\\xc2\\xc3\\\n\\xc3\\x55\\x27\\xb1\\xb1\\xb1\\xf1\\xe6\\x9b\\x6f\\x4e\\x4d\\x4d\\x4d\\x48\\x48\\\n\\xa8\\xae\\xae\\xa6\\x9c\\x2f\\x3d\\xf7\\x37\\xdf\\x7c\\x33\\xb1\\x07\\x00\\x9e\\\n\\x7e\\xfa\\xe9\\x8d\\x1b\\x37\\xaa\\x97\\x7b\\xe7\\x9d\\x77\\x3e\\xf9\\xe4\\x13\\\n\\xb2\\xbf\\x00\\xf0\\xcd\\x37\\xdf\\x64\\x66\\x66\\x36\\x36\\x36\\x7a\\x5f\\xb3\\\n\\x82\\x97\\xb3\\x7b\\xe0\\x92\\x8c\\x97\\x3f\\x3c\\xfd\\xc6\\x65\\xb4\\x08\\x64\\\n\\xd5\\x21\\x39\\x2b\\x13\\x16\\x27\\xcd\\x7b\\x76\\x2a\\x63\\x78\\x81\\xb1\\x69\\\n\\x77\\x5e\\x55\\xff\\x50\\x41\\xed\\x89\\xe6\\x7e\\xfb\\x31\\x66\\xb3\\xd9\\x6c\\\n\\x36\\x73\\xce\\x4b\\x4b\\x4b\\x4b\\x4b\\x4b\\xc1\\x15\\x85\\x83\\xcb\\x0f\\x55\\\n\\x14\\xe5\\xc4\\x89\\x13\\x00\\xc0\\x18\\xb3\\x58\\x2c\\x94\\xd5\\x56\\x5f\\xe0\\\n\\x9d\\x3f\\x7f\\xfe\\xfc\\xf9\\xf3\\x70\\x79\\x89\\x61\\x63\\x63\\xa3\\x7a\\xfe\\\n\\xb6\\xb6\\x36\\xf7\\x2a\\x29\\xf5\\x0c\\x04\\xbb\\xdd\\x4e\\x2f\\x39\\x87\\xc0\\\n\\x74\\x0a\\x59\\x96\\x83\\x31\\xfd\\x86\\x01\\x2a\\x28\\x1a\\x85\\xa9\\xbf\\x4d\\\n\\x57\\x1c\\x72\\x7b\\x93\\x04\\xf5\\x76\\x53\\x94\\xee\\x67\\xbf\\x4a\\x1b\\xd0\\\n\\x59\\x19\\x53\\xe3\\x4f\\x7a\\xa7\\xe5\\xfe\\xd4\\x52\\x0e\\x94\\xf2\\x10\\x44\\\n\\x05\\xd5\\x0f\\xe8\\x98\\x8c\\xcb\\x39\\x55\\x57\\xb8\\xc7\\x29\\xee\\x87\\x75\\\n\\x49\\x6c\\x77\\xf6\\x24\\x86\\x52\\x85\\x91\\x18\\xf8\\xd2\\x64\\x32\\x14\\xc6\\\n\\x18\\xbd\\x3e\\x42\\x74\\x38\\x20\\xda\\x20\\x39\\x14\\x66\\xb7\\x2b\\x61\\xc3\\\n\\xf4\\x30\\x00\\x2d\\x55\\x1b\\xd2\\x9d\\x86\\x77\\x0a\\x2b\\x3a\\x7d\\xeb\\xf1\\\n\\x57\\x9d\\x42\\x8f\\xee\\xbe\\xea\\xee\\x93\\xc1\\x0b\\x4e\\x19\\x3d\\x08\\x38\\\n\\xd9\\x19\\x03\\x19\\x59\\xa4\\xce\\xf9\\x5c\\xe6\\xd1\\x55\\x29\\xc5\\xc8\\x18\\\n\\xf8\\xc2\\x2e\\x6a\\xf0\\x09\\xb8\\xc1\\x60\\x08\\x8a\\x39\\x44\\x04\\x0e\\xe0\\\n\\x50\\xf8\\x79\\x8b\\xe9\\x82\\x2d\\x1c\\x29\\x68\\xd3\\x10\\x02\\x30\\x18\\x0c\\\n\\xa2\\x5e\\xaf\\x0f\\x96\\x97\\xc4\\x18\\x3a\\x40\\x7c\\xb1\\x22\\x0b\\x15\\x34\\\n\\x1a\\xfa\\xa9\\xc1\\xa1\\x36\\xc5\\xde\\xcb\\x9b\\x21\\x4b\\x2a\\xdb\\x15\\x60\\\n\\x0c\\x10\\x98\\xc0\\x04\\x7d\\xa8\\xf8\\xaa\\x46\\xa3\\x51\\x8c\\x88\\x88\\xd0\\\n\\xe9\\x74\\x56\\xab\\x35\\xc0\\xd7\\xa6\\x57\\x44\\x3a\\x3d\\xe8\\x50\\x41\\x40\\\n\\xa1\\xef\\xe5\\x68\\xe8\\x5a\\x7f\\x21\\xa4\\x66\\xf3\\xd1\\xcd\\xd0\\x8d\\xf5\\\n\\x7a\\xb0\\xfb\\x21\\xa1\\x40\\x6c\\x22\\x74\\x78\\x78\\xb8\\x18\\x11\\x11\\x61\\\n\\x30\\x18\\x02\\x79\\x6d\\xea\\x0a\\x7b\\x9b\\x53\\x71\\x2a\\x4c\\x64\\x8a\\x03\\\n\\x11\\x81\\xeb\\x99\\x6c\\xa3\\x92\\x2a\\x6f\\xab\\xc0\\x04\\x41\\x88\\x8e\\x8e\\\n\\xa6\\x89\\x65\\xa1\\x33\\xf7\\x84\\xa6\\x67\\xc5\\xc4\\xc4\\x50\\x5e\\xa4\\x67\\\n\\xb8\\x53\\x27\\x14\\x68\\x41\\x88\\x8e\\x8e\\x16\\x8d\\x46\\x63\\x64\\x64\\x64\\\n\\x7d\\x7d\\x7d\\xe0\\xe6\\x56\\x23\\x30\\xce\\x1c\\xed\\xce\\xd3\\x5f\\x54\\x66\\\n\\x3f\\x34\\x41\\xb6\\xc9\\x8c\\x33\\xc9\\x26\\x9f\\xfc\\xbf\\x65\\x00\\x5e\\xf1\\\n\\x82\\xee\\xb3\\xaa\\xaa\\x6a\\xd2\\xa4\\x49\\x2f\\xbe\\xf8\\xa2\\xfa\\x82\\x23\\\n\\x14\\x40\\x09\\xb4\\x84\\x84\\x84\\xad\\x5b\\xb7\\xf6\\x7c\\x1c\\x20\\xca\\x0e\\\n\\x85\\x71\\x40\\x04\\x2e\\x30\\xde\\xdf\\x72\\x16\\x9f\\x23\\x2e\\x2e\\x4e\\x34\\\n\\x1a\\x8d\\xb1\\xb1\\xb1\\x41\\xb9\\xfc\\xd9\\x1d\\x55\\x53\\x7e\\x9d\\x0a\\x9c\\\n\\x89\\x61\\x42\\xcd\\xd1\\xa6\\xd2\\x7d\\x17\\xc1\\xbb\\x00\\x95\\x82\\xc9\\xc2\\\n\\xc2\\xc2\\xdb\\x6e\\xbb\\xcd\\xfd\\xc5\\x44\\xe8\\x40\\x9d\\x49\\x10\\x3a\\x32\\\n\\xe6\\x3d\\x12\\x12\\x12\\x44\\xda\\x21\\x13\\x82\\x91\\x8d\\x61\\x22\\x53\\x4b\\\n\\x7b\\xa8\\xa0\\xb7\\x1f\\xa5\\x06\\x6a\\x72\\x7a\\x30\\x42\\xb6\\xcb\\x24\\x1b\\\n\\x4c\\x60\\x22\\xb9\\x9c\\x21\\x60\\x4a\\x12\\x13\\x13\\x39\\x00\\x24\\x24\\x24\\\n\\x40\\x50\\x92\\x74\\xd8\\xe3\\x3f\\xaf\\x04\\xb8\\x37\\x39\\x04\\x6c\\x08\\x29\\\n\\xdc\\xe8\\xd1\\xa3\\x39\\x00\\x8c\\x19\\x33\\x26\\xd8\\xf7\\x13\\x64\\xb8\\x17\\\n\\xe7\\x05\\x08\\x0c\\x00\\x80\\x0a\\xde\\x10\\x81\\x73\\xd6\\xef\\x52\\x59\\x1f\\\n\\x02\\x11\\x05\\x41\\x48\\x48\\x48\\xe0\\x00\\x40\\x93\\x86\\xaf\\x4c\\x90\\x46\\\n\\xd2\\x14\\x92\\xc0\\x4f\\x37\\xf5\\x53\\x21\\x4b\\xff\\xa0\\x4e\\x5b\\x4a\\x4a\\\n\\x4a\\xe2\\x00\\x90\\x94\\x94\\x04\\x57\\xea\\x5a\\x9c\\x14\\xc2\\x64\\x67\\x67\\\n\\x67\\x64\\x64\\x5c\\x99\\x3d\\xa0\\x82\\x68\\x91\\x98\\x98\\x38\\x6c\\xd8\\x30\\\n\\x0e\\x00\\xa9\\xa9\\xa9\\xf4\\xe6\\x30\\x70\\xee\\x05\\x02\\x00\\xc8\\x12\\xa2\\\n\\x8c\\xa4\\xa2\\x82\\x8e\\x07\\xd8\\xb7\\xa1\\x74\\x64\\x62\\x62\\xe2\\x47\\x1f\\\n\\x7d\\x34\\x75\\xea\\xd4\\x0d\\x1b\\x36\\x3c\\xfe\\xf8\\xe3\\x70\\x05\\xef\\xa2\\\n\\x42\\xa3\\x9f\\x9c\\x9c\\xac\\xd7\\xeb\\x39\\x00\\x8c\\x1e\\x3d\\x7a\\xc4\\x88\\\n\\x11\\x81\\xbf\\x0f\\x45\\x42\\xc5\\xa5\\xa2\\x5c\\xc7\\x03\\xec\\x84\\x53\\x9e\\\n\\x26\\x21\\x21\\xa1\\xbd\\xbd\\xfd\\xcd\\x37\\xdf\\x7c\\xf4\\xd1\\x47\\x7f\\xff\\\n\\xfb\\xdf\\x87\\x85\\x85\\x05\\xf2\\xf1\\xe0\\xae\\x92\\x55\\x04\\xc0\\x60\\x4b\\\n\\x15\\xb5\\x9a\\x6a\\xe5\\x39\\xad\\x40\\x95\\x96\\x96\\x06\\x01\\x7d\\x50\\x10\\\n\\x00\\x24\\xab\\xa4\\x48\\xc8\\x38\\x43\\x19\\x75\\xe1\\x22\\x17\\x03\\x1a\\xa1\\\n\\x91\\xc9\\x38\\x71\\xe2\\xc4\\xef\\x7e\\xf7\\x3b\\x92\\x8d\\x92\\x92\\x12\\x87\\\n\\xc3\\x11\\xa0\\xb4\\x1e\\x02\\x00\\x08\\x7a\\x01\\x69\\xf6\\x9c\\x8c\\xb2\\x3d\\\n\\x24\\x32\\x1c\\x34\\x43\\x9f\\x53\\xbe\\x25\\x33\\x33\\x13\\x02\\x18\\xa3\\x52\\\n\\xaf\\x3b\\x2d\\x92\\xd3\\x22\\x51\\x39\\x96\\xde\\x24\\xea\\x22\\x04\\x08\\x78\\\n\\xdc\\x4e\\xaf\\x09\\xc3\\xc2\\xc2\\x1e\\x7f\\xfc\\xf1\\xf5\\xeb\\xd7\\xcb\\xb2\\\n\\x1c\\xa0\\x4e\\x40\\x04\\x00\\x7d\\x94\\x0e\\x65\\x04\\xce\\x14\\xa7\\xe2\\xb4\\\n\\xca\\x00\\xc1\\x8c\\xd2\\x89\\x09\\x93\\x26\\x4d\\x02\\x35\\x58\\xbe\\xe6\\x9a\\\n\\x6b\\x02\\x7a\\x0b\\xe4\\x5b\\xd8\\x15\\x4b\\xbd\\x8d\\xeb\\x98\\x22\\x29\\x86\\\n\\x28\\x5d\\x64\\x62\\x18\\x63\\x01\\x7d\\x37\\xc0\\x18\\x93\\x65\\x39\\x3c\\x3c\\\n\\xfc\\x4f\\x7f\\xfa\\xd3\\xe6\\xcd\\x9b\\x0f\\x1c\\x38\\x40\\x46\\x24\\x00\\x97\\\n\\x46\\x04\\xc6\\x98\\x29\\xc1\\x88\\x32\\x72\\xce\\x64\\x87\\x62\\x6d\\xec\\x61\\\n\\x16\\xa0\\xdf\\xc1\\x5c\\x2b\\xe0\\x66\\x64\\x64\\x00\\x40\\xc7\\xd6\\x21\\xb4\\\n\\xd8\\x43\\x20\\x33\\xb5\\x34\\x13\\xa4\\xa5\\xdc\\xcc\\x45\\xae\\x48\\xa8\\x37\\\n\\x89\\x23\\xb2\\x62\\x10\\x81\\x8b\\x7d\\x5f\\x45\\xa3\\x5f\\x7f\\x5c\\xe0\\x8c\\\n\\xb3\\x09\\x19\\x13\\x76\\x7c\\xb9\\xc3\\x66\\xb7\\x01\\x83\\xbf\\xff\\xfd\\x95\\\n\\xe9\\xd9\\xd3\\x19\\x67\\x82\\x28\\xf8\\xf7\\xd2\\x22\\x63\\x9c\\x45\\x8c\\x34\\\n\\x46\\x8d\\x09\\x97\\xec\\x32\\xd7\\x31\\x6b\\xb3\\xdd\\xd2\\xe0\\xc5\\x0a\\x16\\\n\\xfe\\x1b\\x0e\\xc6\\x00\\x60\\xfc\\xf8\\xf1\\xc3\\x87\\x0f\\xef\\x98\\x65\\x09\\\n\\x00\\x13\\x27\\x4e\\x4c\\x48\\x48\\xa0\\x7f\\x07\\xf2\\x6e\\x6a\\x0e\\x37\\x02\\\n\\x4d\\xf8\\xb7\\xc9\\x93\\xef\\x4b\\x0d\\x8f\\x37\\xc8\\x0e\\x05\\x15\\x0c\\xc0\\\n\\x9f\\x22\\x2b\\x8a\\xac\\x24\\xc4\\x8d\\x3c\\x53\\x7c\\x36\\x32\\x2c\\xea\\xd7\\\n\\xf7\\x3d\\xa0\\x63\\x86\\x92\\x53\\xe7\\x50\\x41\\x59\\x92\\xfd\\x7b\\x69\\x09\\\n\\x51\\xc1\\x89\\x77\\x8d\\x35\\xc6\\xea\\x65\\xa7\\x22\\x18\\x84\\xc6\\x33\\x6d\\\n\\x4e\\x8b\\xcc\\x78\\xd0\\x8c\\x08\\x8d\\xfb\\xb4\\x69\\xd3\\x48\\x41\\x45\\x2a\\\n\\x85\\x8d\\x8a\\x8a\\x9a\\x32\\x65\\xca\\x9e\\x3d\\x7b\\x02\\xe7\\x5e\\x28\\x08\\\n\\x00\\x15\\xdf\\xd7\\x99\\x2f\\x5a\\xf5\\x51\\x3a\\xa7\\x55\\x8e\\xb9\\xca\\xb4\\\n\\x64\\xeb\\xec\\xd3\\xff\\xaf\\xb2\\xb6\\xa8\\xc5\\x5a\\x6f\\x93\\x1c\\x8a\\x5f\\\n\\xfb\\x88\\x0a\\x7d\\xff\\x73\\xee\\x40\\xde\\x9a\\xdc\\x8e\\xf9\\xd1\\x00\\xa6\\\n\\x28\\x43\\x74\\x72\\x84\\x1f\\xaf\\x0a\\x20\\x86\\x09\\x51\\xa3\\xc3\\x93\\xaf\\\n\\x4f\\x98\\xb0\\x78\\x8c\\xa3\\x5d\\x62\\x0c\\xb8\\xc0\\x4a\\xbf\\xb9\\x08\\xe0\\\n\\x9a\\x9f\\x1e\\x0c\\x90\\x4a\\xcd\\x9e\\x3d\\xbb\\xe3\\x26\\xc1\\x35\\xaf\\x72\\\n\\xf6\\xec\\xd9\\x81\\xa4\\x05\\x95\\x24\\x59\\x9b\\x1c\\x27\\xde\\x3b\\x97\\xb3\\\n\\x2e\\xcb\\x5c\\x6b\\x73\\x5a\\xa4\\xc8\\xd1\\xe1\\x33\\x1f\\x9d\\x28\\x3b\\x14\\\n\\xfa\\x0b\\x40\\x1f\\x51\\x35\\xb8\\xfa\\x4f\\x45\\x96\\xbd\\x58\\x1a\\x64\\x40\\\n\\x17\\x14\\x0d\\x5c\\x30\\x08\\x8c\\x83\\xa3\\x5d\\x52\\x9c\\x8a\\x21\\x4a\\x5f\\\n\\x7f\\xb2\\xe5\\xdc\\xae\\x6a\\x2a\\x88\\xf7\\xe7\\xa5\\xbb\\xbf\\x27\\x52\\x08\\\n\\x51\\x9c\\x31\\x63\\x06\\xd0\\x6a\\x52\\xe0\\xb2\\x2b\\x39\\x39\\x39\\x10\\xd8\\\n\\x5c\\x27\\x2a\\xc8\\x38\\x3b\\xf1\\xbf\\xcf\\x45\\x8f\\x8d\\x98\\x72\\x7f\\xaa\\\n\\xbd\\xcd\\x29\\x59\\x65\\xa7\\x59\\x62\\x1c\\x18\\x63\\x5c\\xe8\\x6d\\x29\\x35\\\n\\x5f\\xdd\\x06\\xfc\\xd4\\x64\\x26\\xb0\\x6e\\x97\\xe8\\xf2\\x11\\x64\\x87\\x22\\\n\\xd9\\x64\\xf2\\xa2\\x8c\\x31\\x7a\\x5b\\x8b\\xe3\\xbb\\xa7\\x7e\\x90\\x6c\\x32\\\n\\xe3\\x41\\x4b\\x5d\\x90\\xbf\\x39\\x61\\xc2\\x84\\x8e\\xa4\\x05\\xd1\\x82\\x1e\\\n\\x97\\x6b\\xae\\xb9\\x66\\xc4\\x88\\x11\\x75\\x75\\x75\\x3e\\x5f\\xcb\\xb7\\x5b\\\n\\x60\\x87\\x76\\xe5\\xae\\x2f\\x6c\\x3e\\xd7\\x96\\xf5\\xab\\x71\\x51\\x63\\xc2\\\n\\xb9\\xc0\\x50\\x46\\xcf\\xb3\\x0e\\x87\\x04\\x18\\x67\\x8c\\x03\\xe3\\x4c\\xb6\\\n\\xcb\\x95\\x07\\xeb\\xbf\\xdf\\xf8\\x63\\x53\\x49\\x9b\\x9f\\x26\\x7f\\x7b\\x09\\\n\\x9a\\x3b\\xf3\\xf3\\x9f\\xff\\x5c\\x14\\x45\\x59\\x96\\x05\\x41\\xe8\\x50\\x0b\\\n\\x59\\x96\\x23\\x23\\x23\\x73\\x72\\x72\\xb6\\x6f\\xdf\\x1e\\x38\\x5a\\xa8\\x60\\\n\\x50\\xb8\\xb5\\xf4\\xd4\\xbf\\x2a\\xc7\\xcc\\x88\\x1f\\x31\\x39\\x26\\x7a\\xac\\\n\\xc9\\x18\\xad\\x13\\xf4\\x81\\xce\\x7b\\x06\\x02\\x08\\xb2\\x5d\\xb1\\x34\\xda\\\n\\x9b\\xcf\\xb5\\x55\\x1f\\x69\\xac\\x39\\xda\\x04\\x7e\\x5b\\x10\\xc0\\x7b\\xd0\\\n\\x8c\\xa9\\x5f\\xfc\\xe2\\x17\\x3f\\x7d\\x44\\x93\\x6a\\x68\\xcf\\x99\\x77\\xde\\\n\\x79\\x07\\x82\\x34\\x5d\\xce\\xfb\\x75\\x02\\x87\\x18\\x82\\xde\\x70\\x72\\x21\\\n\\xe2\\xe2\\xe2\\xea\\xeb\\xeb\\xd1\\xb5\\x0f\\xd5\\x65\\x9b\\x52\\x55\\x54\\x54\\\n\\xd0\\xd2\\x41\\xc1\\xa9\\xaf\\x57\\x97\\x95\\x1c\\xd2\\xfb\\xb0\\xd2\\x42\\x9c\\\n\\xbc\\x2f\\x2b\\x66\\xfa\\x15\\x34\\x31\\x73\\xf1\\xe2\\xc5\\xe8\\xb6\\x71\\xb2\\\n\\xba\\x2c\\x1c\\x53\\x14\\x25\\x29\\x29\\x69\\xd6\\xac\\x59\\x2c\\x58\\x5b\\xc3\\\n\\x61\\xc7\\xca\\x92\\x38\\x38\\xf6\\x7e\\xeb\\x27\\x10\\x29\\x6b\\x82\\xa1\\xe3\\\n\\x3c\\x21\\xe2\\x92\\x25\\x4b\\xa0\\xeb\\x86\\x97\\xaa\\x1d\\xf9\\xc7\\x3f\\xfe\\\n\\x01\\x43\\x62\\xda\\xb5\\x06\\x6f\\xa0\\x96\\xde\\x54\\x57\\x57\\xab\\x46\\xe3\\\n\\x27\\x23\\xa2\\x0a\\x48\\x55\\x55\\x55\\x44\\x44\\x04\\x04\\xcb\\x8e\\x68\\x08\\\n\\x2c\\x68\\xad\\x9f\\x3b\\xee\\xb8\\x83\\x66\\x61\\xa9\\x64\\xf8\\x89\\x16\\x2a\\\n\\x33\\x96\\x2c\\x59\\xc2\\x18\\xd3\\x04\\xe3\\x4a\\x00\\x8d\\xf2\\xb6\\x6d\\xdb\\\n\\x54\\x73\\xe1\\x81\\x16\\xf4\\xc5\\xf6\\xed\\xdb\\xe1\\x0a\\x2e\\x52\\xba\\x72\\\n\\x40\\x43\\x3c\\x66\\xcc\\x98\\xf6\\xf6\\x76\\x77\\x0b\\xd2\\x99\\x16\\x54\\xe9\\\n\\x6a\\x36\\x9b\\xc7\\x8e\\x1d\\x0b\\x1a\\x33\\x86\\x3a\\xc8\\x82\\xac\\x5a\\xb5\\\n\\xaa\\x93\\x54\\x74\\xa6\\x85\\xfa\\xf5\\xda\\xb5\\x6b\\xd5\\x9f\\x69\\x18\\xaa\\\n\\x60\\x8c\\xe9\\x74\\xba\\xa2\\xa2\\x22\\xf7\\xd0\\xd4\\x33\\x2d\\xe8\\xeb\\x92\\\n\\x92\\x12\\xa3\\xd1\\x18\\x52\\x0b\\x04\\x68\\xf0\\x2d\\xc8\\xab\\xb8\\xf1\\xc6\\\n\\x1b\\xbb\\x72\\xc2\\x03\\x2d\\xd0\\xe5\\x91\\xde\\x7d\\xf7\\xdd\\xa0\\x45\\xaa\\\n\\x43\\x17\\xe4\\x21\\xec\\xd8\\xb1\\x03\\x2f\\x8f\\x41\\x7a\\xa1\\x05\\xad\\x66\\\n\\xaa\\xb9\\x17\\x43\\x12\\x94\\xd9\\x9c\\x3c\\x79\\xb2\\xd3\\xe9\\x74\\xf7\\x34\\\n\\x7b\\xa2\\x05\\xa9\\x8a\\xa2\\x28\\xf3\\xe7\\xcf\\x07\\xcd\\xc3\\x18\\x8a\\x20\\\n\\x23\\xf0\\xfe\\xfb\\xef\\x7b\\x94\\x8a\\x6e\\x69\\x41\\x87\\x7e\\xf7\\xdd\\x77\\\n\\xa0\\x09\\xc6\\x90\\x03\\x49\\x45\\x7a\\x7a\\xba\\xcd\\x66\\xa3\\xd8\\xd3\\x5b\\\n\\x5a\\xa0\\xcb\\x0d\\x21\\xc1\\xd0\\x3c\\x8c\\xa1\\x04\\x1a\\xcd\\x37\\xdf\\x7c\\\n\\xb3\\x3b\\xa9\\xe8\\x89\\x16\\xf4\\x83\\xdc\\xdc\\x5c\\xd0\\x04\\x63\\x08\\x81\\\n\\xa4\\x22\\x33\\x33\\xd3\\x62\\xb1\\x90\\xab\\xd0\\x37\\x5a\\xa8\\x82\\xb1\\x60\\\n\\xc1\\x02\\xd0\\x04\\x63\\xa8\\x80\\xc6\\xf1\\xc3\\x0f\\x3f\\xec\\x41\\x2a\\x7a\\\n\\xa1\\x05\\xfd\\xec\\xe8\\xd1\\xa3\\xa2\\x28\\xd2\\xde\\x2d\\xc1\\x6e\\x94\\x86\\\n\\x01\\x81\\x38\\x91\\x9d\\x9d\\x4d\\x3b\\x83\\xf6\\x30\\xf4\\x3d\\xd1\\x42\\x65\\\n\\xc6\\x03\\x0f\\x3c\\x00\\x9a\\x60\\x0c\\x7e\\x90\\x33\\xb0\\x6f\\xdf\\xbe\\x9e\\\n\\xa5\\xa2\\x77\\x5a\\x90\\xf9\\xa9\\xac\\xac\\x8c\\x89\\x89\\xd1\\x04\\x63\\x50\\\n\\x83\\x9e\\xea\\xbb\\xee\\xba\\xab\\x57\\x4e\\xf4\\x4e\\x0b\\xf5\\x14\\x2f\\xbd\\\n\\xf4\\x12\\x68\\x82\\x31\\x68\\x41\\x15\\x77\\x91\\x91\\x91\\x65\\x65\\x65\\xb4\\\n\\x7b\\xfb\\x40\\x69\\xa1\\x28\\x8a\\x24\\x49\\x0e\\x87\\x63\\xfa\\xf4\\xe9\\xa0\\\n\\x31\\x63\\x70\\x82\\x46\\x6d\\xf3\\xe6\\xcd\\xde\\x48\\x85\\x57\\xb4\\x50\\x4f\\\n\\x74\\xe8\\xd0\\x21\\xda\\x74\\x23\\xd8\\x6d\\xd4\\xd0\\x37\\xa8\\x9e\\xa6\\x24\\\n\\x49\\x92\\x24\\x75\\x17\\x94\\xf6\\x99\\x16\\x2a\\x33\\x1e\\x7d\\xf4\\x51\\xd0\\\n\\xd2\\xe1\\x83\\x0a\\x54\\x68\\x27\\x8a\\xe2\\xe1\\xc3\\x87\\xd1\\x3b\\xa9\\xe8\\\n\\x03\\x2d\\xc8\\x20\\x59\\x2c\\x96\\x8e\\x65\\x31\\xb4\\x04\\xd7\\x20\\x01\\x3d\\\n\\xc3\\xeb\\xd6\\xad\\xf3\\x9e\\x13\\x7d\\xa0\\x05\\xba\\xb2\\x5b\\x47\\x8e\\x1c\\\n\\xd1\\xe9\\x74\\x94\\x2c\\x0b\\x76\\x93\\x35\\xf4\\x02\\x32\\x1f\\xb3\\x67\\xcf\\\n\\xf6\\xde\\x7c\\xf4\\x99\\x16\\xe8\\xaa\\xdd\\x7a\\xe1\\x85\\x17\\x40\\x33\\x25\\\n\\x21\\x0f\\x5a\\x83\\x36\\x32\\x32\\xf2\\xf4\\xe9\\xd3\\xe8\\xa9\\xd6\\xc6\\x67\\\n\\xb4\\x40\\x97\\x10\\xdd\\x72\\xcb\\x2d\\xa0\\x45\\x25\\x21\\x0c\\xc6\\x18\\x3d\\\n\\xb7\\x5b\\xb7\\x6e\\xc5\\xbe\\x98\\x8f\\x7e\\xd2\\x82\\x5e\\xc5\\xd6\\xd7\\xd7\\\n\\x6b\\x65\\xc0\\xa1\\x0c\\xe2\\xc4\\xca\\x95\\x2b\\xb1\\x4b\\xf9\\xae\\x5f\\x68\\\n\\x81\\x2e\\xea\\x1d\\x38\\x70\\x80\\x36\\xb4\\xd2\\x9c\\x8c\\x50\\x03\\xa9\\xf8\\\n\\xcc\\x99\\x33\\x1d\\x0e\\x47\\x9f\\x5c\\x8a\\x01\\xd1\\x02\\x5d\\x04\\x7c\\xeb\\\n\\xad\\xb7\\x40\\x73\\x32\\x42\\x0c\\xa4\\xdf\\xa3\\x46\\x8d\\xaa\\xa8\\xa8\\xc0\\\n\\x3e\\xba\\x14\\x03\\xa5\\x85\\xca\\x8c\\x3f\\xfe\\xf1\\x8f\\xa0\\x31\\x23\\x64\\\n\\x40\\x49\\xee\\xb0\\xb0\\xb0\\xfd\\xfb\\xf7\\x63\\xdf\\x5d\\x0a\\x1f\\xd0\\x82\\\n\\x92\\xe2\\x88\\xb8\\x74\\xe9\\x52\\xd0\\x98\\x11\\x02\\x50\\xa7\\x88\\x7e\\xf0\\\n\\xc1\\x07\\xd8\\x2f\\x97\\xc2\\x07\\xb4\\x40\\x57\\x8e\\xcb\\x6c\\x36\\xd3\\x0a\\\n\\x6d\\x5a\\x60\\x12\\x5c\\xd0\\xfe\\x5c\\x9b\\x36\\x6d\\x1a\\x20\\x27\\x06\\x4a\\\n\\x0b\\x74\\x99\\xae\\x86\\x86\\x86\\x89\\x13\\x27\\x82\\xa6\\x19\\xc1\\x03\\xf5\\\n\\xfc\\x9a\\x35\\x6b\\x10\\xd1\\xe1\\x70\\x0c\\x70\\x58\\x07\\x4a\\x0b\\x74\\x19\\\n\\xb0\\xf3\\xe7\\xcf\\x5f\\x75\\xd5\\x55\\xa0\\x69\\x46\\x30\\x40\\x3a\\xb1\\x62\\\n\\xc5\\x0a\\x1a\\x8e\\x7e\\x84\\x1e\\xbe\\xa7\\x05\\xba\\x98\\x71\\xe6\\xcc\\x19\\\n\\x8d\\x19\\x81\\x07\\xe9\\xc4\\xbd\\xf7\\xde\\x8b\\x3e\\xe2\\x04\\xfa\\x8a\\x16\\\n\\xe8\\x32\\x66\\x2a\\x33\\x34\\x6b\\x12\\x18\\x50\\x3f\\xdf\\x77\\xdf\\x7d\\xe8\\\n\\x2a\\xa5\\xf3\\xc9\\x68\\xfa\\x8c\\x16\\xe8\\xa6\\x19\\xb4\\xf9\\x99\\xc6\\x0c\\\n\\x7f\\x83\\x7a\\xf8\\xd7\\xbf\\xfe\\x35\\xf9\\xfe\\xfd\\x4b\\x51\\x78\\x84\\x2f\\\n\\x69\\x81\\x6e\\x7e\\x46\\x56\\x56\\x16\\x68\\xcc\\xf0\\x1b\\xd4\\x58\\xf4\\x91\\\n\\x47\\x1e\\x41\\x9f\\xea\\x04\\xc1\\xc7\\xb4\\x40\\x17\\x33\\x9a\\x9a\\x9a\\xe6\\\n\\xcc\\x99\\x03\\x1a\\x33\\xfc\\x00\\x75\\x7b\\xce\\x0d\\x1b\\x36\\xa0\\xef\\xfc\\\n\\x09\\x77\\xf8\\x9e\\x16\\xe8\\x62\\x46\\x7b\\x7b\\xfb\\x3d\\xf7\\xdc\\x03\\xae\\\n\\x99\\x4c\\xc1\\xee\\xcc\\x21\\x02\\x12\\x09\\x41\\x10\\xde\\x7e\\xfb\\x6d\\x44\\\n\\xec\\x6e\\xca\\xf9\\x00\\xe1\\x17\\x5a\\xa0\\x5b\\x2a\\x7e\\xcd\\x9a\\x35\\xd4\\\n\\x1e\\xed\\x5d\\xeb\\xc0\\x41\\xd2\\x1b\\x1f\\x1f\\xbf\\x7b\\xf7\\x6e\\x1c\\x70\\\n\\xce\\xaa\\x07\\xf8\\x8b\\x16\\xe8\\xca\\x81\\x22\\xe2\\x3b\\xef\\xbc\\x13\\x16\\\n\\x16\\x06\\x9a\\x41\\x19\\x00\\x54\\x67\\x62\\xda\\xb4\\x69\\xa7\\x4e\\x9d\\x42\\\n\\x7f\\x72\\x02\\xfd\\x4a\\x0b\\x74\\x7b\\x6f\\x92\\x9f\\x9f\\x9f\\x9e\\x9e\\x0e\\\n\\x9a\\x41\\xe9\\x17\\x54\\xa1\\xfd\\xe5\\x2f\\x7f\\xd9\\xda\\xda\\x8a\\x7e\\xe6\\\n\\x04\\xfa\\x9b\\x16\\x04\\x6a\\x43\\x43\\x43\\xc3\\x1d\\x77\\xdc\\x41\\xcd\\xd3\\\n\\xf2\\x5d\\xde\\x83\\x24\\xd6\\x68\\x34\\xfe\\xfd\\xef\\x7f\\xa7\\xfe\\xf4\\x61\\\n\\x20\\xda\\x1d\\x02\\x41\\x0b\\x74\\x7b\\xc3\\xfb\\xf2\\xcb\\x2f\\xd3\\x6a\\xf3\\\n\\xa2\\x28\\x6a\\xb2\\xd1\\x33\\xd4\\x88\\x23\\x2b\\x2b\\xab\\xa0\\xa0\\x00\\xfd\\\n\\x13\\x74\\x78\\x44\\x80\\x68\\x81\\x6e\\xae\\xc6\\xe1\\xc3\\x87\\xaf\\xbd\\xf6\\\n\\x5a\\x6a\\xb9\\x26\\x1b\\xdd\\x41\\xf5\\xc3\\x1e\\x7a\\xe8\\xa1\\xb6\\xb6\\x36\\\n\\x1c\\x40\\xf1\\x44\\x3f\\x10\\x38\\x5a\\x10\\xc8\\xa0\\xd8\\xed\\xf6\\x75\\xeb\\\n\\xd6\\xd1\\x0b\\x1e\\x4d\\x36\\x3a\\x41\\x7d\\x54\\x32\\x32\\x32\\x28\\xe2\\xc0\\\n\\xc0\\x72\\x02\\x03\\x4f\\x0b\\x74\\x33\\x8d\\x05\\x05\\x05\\xd7\\x5f\\x7f\\x3d\\\n\\x75\\x81\\x46\\x0e\\x00\\x50\\xe7\\x72\\x0a\\x82\\xb0\\x7a\\xf5\\xea\\x4b\\x97\\\n\\x2e\\x61\\x00\\x0d\\x87\\x3b\\x82\\x40\\x0b\\x44\\x54\\x14\\x85\\x64\\x43\\x51\\\n\\x94\\x2d\\x5b\\xb6\\x8c\\x1c\\x39\\x92\\xfa\\xe5\\x8a\\xb5\\x29\\xee\\x6b\\xef\\\n\\x5f\\x7f\\xfd\\xf5\\xf9\\xf9\\xf9\\xd4\\x51\\x01\\x16\\x09\\x15\\xc1\\xa1\\x05\\\n\\x41\\xcd\\xe4\\xd7\\xd4\\xd4\\x3c\\xfc\\xf0\\xc3\\x06\\x83\\xa1\\x53\\x07\\x5d\\\n\\x09\\x70\\x6f\\xef\\xb8\\x71\\xe3\\xde\\x7d\\xf7\\x5d\\xea\\x9c\\xa0\\x88\\x84\\\n\\x8a\\x60\\xd2\\x82\\xa0\\x3e\\x10\\xc7\\x8e\\x1d\\x5b\\xb6\\x6c\\x99\\x7b\\x67\\\n\\x0d\\x6d\\xb3\\xe2\\x4e\\x88\\xb8\\xb8\\xb8\\x8d\\x1b\\x37\\x36\\x37\\x37\\xa3\\\n\\x9b\\x6f\\x1e\\x44\\x04\\x9f\\x16\\xe8\\x96\\xf5\\x42\\xc4\\xdc\\xdc\\x5c\\x5a\\\n\\xc4\\x8d\\x30\\x24\\x7d\\x0e\\xf7\\xf5\\x20\\x62\\x63\\x63\\x1f\\x7b\\xec\\x31\\\n\\x2a\\xde\\xc7\\xe0\\x59\\x8d\\x4e\\x08\\x09\\x5a\\x10\\x64\\x59\\x56\\x3b\\x65\\\n\\xef\\xde\\xbd\\x4b\\x97\\x2e\\x55\\xb3\\x7b\\x82\\x20\\x0c\\x81\\x57\\x2a\\x24\\\n\\x0f\\x2a\\x21\\x12\\x12\\x12\\x3a\\x11\\x22\\x88\\x56\\xa3\\x13\\x42\\x88\\x16\\\n\\x04\\xf7\\xde\\xf9\\xcf\\x7f\\xfe\\xb3\\x62\\xc5\\x8a\\x98\\x98\\x18\\xea\\x47\\\n\\x7a\\xc8\\x06\\xa3\\x78\\x70\\xce\\xdd\\xdf\\x07\\x65\\x64\\x64\\x6c\\xde\\xbc\\\n\\x99\\x36\\x98\\xc4\\x10\\x23\\x04\\x21\\xe4\\x68\\x41\\x90\\x24\\x49\\xb5\\xaf\\\n\\x15\\x15\\x15\\x7f\\xf9\\xcb\\x5f\\xa8\\xb2\\x9c\\x40\\xcf\\x5c\\xe8\\xf3\\x83\\\n\\xd8\\xa0\\xde\\xa7\\xc1\\x60\\x58\\xb4\\x68\\xd1\\xf6\\xed\\xdb\\x6d\\x36\\x9b\\\n\\xda\\xcc\\x50\\x23\\x04\\x81\\x61\\x08\\xef\\x2d\\x49\\x5d\\x46\\xaa\\xeb\\x70\\\n\\x38\\xbe\\xf9\\xe6\\x9b\\x8f\\x3f\\xfe\\x78\\xe7\\xce\\x9d\\xf5\\xf5\\xf5\\x74\\\n\\x00\\x7d\\x85\\x88\\x81\\xde\\xe6\\xb9\\x7b\\xd0\\xbc\\x2e\\xda\\x88\\x5a\\xed\\\n\\xdb\\xcc\\xcc\\xcc\\x3b\\xee\\xb8\\xe3\\x9e\\x7b\\xee\\xa1\\x45\\x63\\x00\\x40\\\n\\x96\\xe5\\x50\\x5e\\xb9\\x30\\xa4\\x69\\x41\\x70\\x27\\x07\\x00\\xd4\\xd7\\xd7\\\n\\xef\\xdc\\xb9\\xf3\\xb3\\xcf\\x3e\\xcb\\xcd\\xcd\\x6d\\x6e\\x6e\\x56\\x0f\\x13\\\n\\x45\\xd1\\x9d\\xef\\x81\\xbc\\x43\\xda\\x8f\\x87\\x76\\x2a\\x97\\x65\\x59\\xfd\\\n\\x3c\\x2d\\x2d\\xed\\xa6\\x9b\\x6e\\x5a\\xb2\\x64\\x49\\x4e\\x4e\\x0e\\xa5\\x74\\\n\\xa9\\x2d\\xa1\\x4c\\x08\\xc2\\x20\\xa0\\x05\\x41\\x95\\x04\\x95\\x1f\\xb5\\xb5\\\n\\xb5\\x79\\x79\\x79\\xbb\\x76\\xed\\xca\\xcb\\xcb\\x2b\\x29\\x29\\x71\\x3f\\x98\\\n\\x4c\\x8c\\x9f\\x58\\x42\\x23\\xca\\x5c\\xa0\\x95\\x1d\\xd4\\x6f\\x0d\\x06\\x43\\\n\\x56\\x56\\xd6\\x82\\x05\\x0b\\x6e\\xba\\xe9\\xa6\\xe9\\xd3\\xa7\\x53\\xa1\\x09\\\n\\x00\\xc8\\xb2\\x1c\\xb4\\x7d\\x87\\xfb\\x8e\\x41\\x43\\x0b\\x15\\xf4\\x44\\xaa\\\n\\x6f\\x17\\x01\\xc0\\x6a\\xb5\\x16\\x15\\x15\\xed\\xdf\\xbf\\xff\\xc0\\x81\\x03\\\n\\x27\\x4e\\x9c\\x28\\x2b\\x2b\\xeb\\xd4\\x28\\xf7\\x0c\\x01\\x7d\\xe5\\x25\\x57\\\n\\xdc\\x19\\xe0\\x7e\\xf5\\x4e\\x87\\x85\\x85\\x85\\x65\\x64\\x64\\x64\\x67\\x67\\\n\\xcf\\x9d\\x3b\\x77\\xc6\\x8c\\x19\\x54\\xf8\\x4e\\xa0\\x83\\x43\\x5f\\x1e\\x3a\\\n\\x61\\xf0\\xd1\\x42\\x45\\x57\\xfd\\x00\\x00\\x8b\\xc5\\x72\\xee\\xdc\\xb9\\x13\\\n\\x27\\x4e\\x1c\\x3f\\x7e\\xbc\\xa8\\xa8\\xa8\\xa4\\xa4\\xa4\\xba\\xba\\xda\\xe1\\\n\\x70\\xf8\\xf6\\xd2\\xd1\\xd1\\xd1\\x29\\x29\\x29\\x69\\x69\\x69\\xd3\\xa6\\x4d\\\n\\xcb\\xca\\xca\\x9a\\x3c\\x79\\x72\\x72\\x72\\xb2\\xfb\\x01\\x92\\x24\\xa9\\x4e\\\n\\x86\\x6f\\x2f\\x1d\\x18\\x0c\\x62\\x5a\\xa8\\xa0\\x47\\x5f\\x51\\x94\\xae\\x89\\\n\\x73\\xab\\xd5\\x5a\\x57\\x57\\x57\\x5a\\x5a\\x5a\\x55\\x55\\x55\\x56\\x56\\x56\\\n\\x5e\\x5e\\x5e\\x5b\\x5b\\xdb\\xd8\\xd8\\xd8\\xd2\\xd2\\xd2\\xda\\xda\\x6a\\x36\\\n\\x9b\\x69\\xad\\x31\\x77\\x01\\xa0\\xe5\\x85\\x04\\x41\\xd0\\xeb\\xf5\\x51\\x51\\\n\\x51\\x51\\x51\\x51\\x71\\x71\\x71\\xf1\\xf1\\xf1\\xa3\\x46\\x8d\\xba\\xea\\xaa\\\n\\xab\\x92\\x93\\x93\\xc7\\x8e\\x1d\\x9b\\x9c\\x9c\\x1c\\x1f\\x1f\\xdf\\xe9\\x36\\\n\\xc8\\xc7\\x74\\x97\\xb1\\xc1\\x8b\\xa1\\x40\\x0b\\x77\\xa8\\x14\\x01\\xb7\\x32\\\n\\x96\\xae\\x70\\x38\\x1c\\x36\\x9b\\xcd\\xe1\\x70\\x98\\xcd\\x66\\x9b\\xcd\\x46\\\n\\x11\\x23\\xb9\\x23\\xa2\\x28\\x1a\\x8d\\xc6\\xb0\\xb0\\xb0\\xb0\\xb0\\x30\\xa3\\\n\\xd1\\x68\\x30\\x18\\xba\\x7b\\x47\\x43\\x3c\\x60\\x6e\\xf0\\x63\\xc3\\x02\\x8b\\\n\\xff\\x0f\\x81\\x99\\x66\\x42\\x17\\xac\\xab\\x60\\x00\\x00\\x00\\x00\\x49\\x45\\\n\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x06\\x3d\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x64\\x00\\x00\\x00\\x64\\x08\\x06\\x00\\x00\\x00\\x70\\xe2\\x95\\x54\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc1\\x00\\x00\\x0e\\xc1\\x01\\xb8\\x91\\\n\\x6b\\xed\\x00\\x00\\x05\\xd2\\x49\\x44\\x41\\x54\\x78\\x5e\\xed\\x9c\\xd7\\xaa\\\n\\x2c\\x45\\x14\\x86\\xb7\\x39\\x1c\\x0c\\x18\\x41\\x0c\\x88\\x01\\x44\\x14\\x11\\\n\\x11\\xc1\\x7c\\x21\\xde\\x0b\\x5e\\x8b\\x5e\\xf9\\x04\\x3e\\x84\\x4f\\xe1\\x03\\\n\\x28\\x82\\x07\\x3c\\xc7\\x9c\\x15\\x45\\xcc\\x01\\x73\\x02\\x73\\xce\\xf9\\xf8\\\n\\x7f\\x38\\x05\\x65\\x33\\xf6\\xee\\xde\\xd3\\x55\\xf3\\x77\\xcd\\xfa\\xe1\\x63\\\n\\xce\\xde\\x67\\x76\\xf7\\xaa\\xfa\\x6b\\xad\\xaa\\xee\\xa9\\x9e\\xad\\x01\\xda\\\n\\x37\\x13\\xfe\\x10\\x37\\x88\\xe6\\xb5\\xac\\xf1\\xae\\xfc\\x2d\\x6e\\x16\\x4d\\\n\\x6b\\x59\\xc3\\x9d\\x69\\xde\\x94\\x65\\x8d\\x76\\xa7\\x69\\x53\\xba\\x8d\\x75\\\n\\x53\\x37\\xbe\\x44\\xb3\\xa6\\x74\\x1b\\xea\\xa6\\x6e\\x7c\\x39\\x4d\\x9a\\xd2\\\n\\x6d\\xa4\\x9b\\xba\\xf1\\xfd\\xb5\\xe4\\xe7\\x9b\\x44\\x33\\xca\\x1b\\x07\\x6e\\\n\\xea\\xc6\\x77\\xa3\\xe8\\x9a\\xd2\\x54\\xa6\\xe4\\x0d\\x03\\x37\\x2d\\x8b\\xaf\\\n\\x69\\x53\\xf2\\x46\\x81\\x9b\\xfe\\x2f\\xbe\\x66\\x4d\\xc9\\x1b\\x04\\x6e\\xea\\\n\\x8b\\xaf\\x49\\x53\\xf2\\xc6\\x80\\x9b\\xb6\\x8b\\xaf\\x39\\x53\\xf2\\x86\\x80\\\n\\x9b\\x86\\xc4\\xd7\\x94\\x29\\x79\\x23\\xc0\\x4d\\x43\\xe3\\x6b\\xc6\\x94\\xbc\\\n\\x01\\xe0\\xa6\\x31\\xf1\\x35\\x61\\x4a\\x1e\\x3c\\xb8\\x69\\x6c\\x7c\\xb3\\x37\\\n\\x25\\x0f\\x1c\\xdc\\xb4\\x93\\xf8\\x66\\x6d\\x4a\\x1e\\x34\\xb8\\x69\\xa7\\xf1\\\n\\xcd\\xd6\\x94\\x3c\\x60\\x70\\xd3\\x2a\\xf1\\xcd\\xd2\\x94\\x3c\\x58\\x70\\xd3\\\n\\xaa\\xf1\\xcd\\xce\\x94\\x3c\\x50\\x70\\xd3\\x14\\xf1\\xcd\\xca\\x94\\x3c\\x48\\\n\\x70\\xd3\\x54\\xf1\\xcd\\xc6\\x94\\x3c\\x40\\x70\\xd3\\x94\\xf1\\xcd\\xc2\\x94\\\n\\x3c\\x38\\x70\\xd3\\xd4\\xf1\\xd9\\x9b\\x92\\x07\\x06\\x6e\\x2a\\x11\\x9f\\xb5\\\n\\x29\\x79\\x50\\xe0\\xa6\\x52\\xf1\\xd9\\x9a\\x92\\x07\\x04\\x6e\\x2a\\x19\\x9f\\\n\\xa5\\x29\\x79\\x30\\xe0\\xa6\\xd2\\xf1\\xd9\\x99\\x92\\x07\\x02\\x6e\\xea\\xc6\\\n\\x57\\x0b\\x4c\\x9a\\x7c\\x2f\\xf1\\x7e\\x8b\\xd7\\x3e\\x71\\xf2\\x5c\\x43\\xfe\\\n\\xa6\\xa6\\xba\\xf1\\xd5\\xd4\\x9f\\xe2\\xa0\\x7f\\xff\\x39\\x8d\\xc2\\x90\\xd5\\\n\\x35\\x69\\x7f\\xec\\xbf\\x78\\x0d\\x99\\xa8\\x85\\x0c\\xa9\\xad\\xa2\\xfd\\x11\\\n\\x19\\x62\\xa6\\x30\\xc4\\x4c\\x8e\\x25\\x8b\\xe3\\x1f\\x2a\\x76\\x2d\\x5e\\xfb\\\n\\xc4\\x63\\x6c\\x3f\\x8a\\x5f\\x04\\xd7\\x06\\x35\\x54\\xb4\\x3f\\x1c\\x0d\\x61\\\n\\x19\\x79\\xa2\\x38\\x4d\\x9c\\xc0\\x2f\\x7a\\xf4\\xbd\\x78\\x47\\x7c\\x22\\x7e\\\n\\x17\\xdd\\x58\\x4b\\x68\\xe3\\x0c\\x21\\x33\\xce\\x13\\x97\\x2d\\x5e\\xfb\\xf4\\\n\\x91\\xb8\\x5f\\x3c\\x2f\\x7e\\x12\\x5c\\x17\\x94\\xd6\\xc6\\x19\\x72\\xb4\\xb8\\\n\\x52\\x5c\\x2f\\xae\\xe0\\x17\\x3d\\x7a\\x43\\xdc\\x26\\xee\\x15\\xdf\\x09\\xb2\\\n\\xa4\\xb4\\x8a\\xf6\\x87\\xe3\\xa4\\x4e\\x4c\\x87\\x8b\\xe3\\xc4\\x29\\xdb\\x40\\\n\\x69\\x23\\xa3\\x0e\\x10\\xa5\\x07\\x4a\\x15\\xc5\\x2a\\xcb\\x4c\\x61\\x88\\x99\\\n\\xc2\\x10\\x33\\x85\\x21\\x66\\x0a\\x43\\xcc\\x14\\x86\\x98\\x29\\x0c\\x31\\x53\\\n\\x18\\x62\\xa6\\x30\\xc4\\x4c\\x61\\x88\\x99\\xc2\\x10\\x33\\x85\\x21\\x66\\x0a\\\n\\x43\\xcc\\x14\\x86\\x98\\x29\\x0c\\x31\\x53\\x18\\x62\\xa6\\x30\\xc4\\x4c\\x61\\\n\\x88\\x99\\xc2\\x10\\x33\\x85\\x21\\x66\\x0a\\x43\\xcc\\x14\\x86\\x98\\x29\\x0c\\\n\\x31\\x53\\x89\\x8d\\x72\\xec\\x91\\x3a\\x4c\\x9c\\x2a\\xd8\\x79\\x78\\xac\\x18\\\n\\x63\\x3c\\xfb\\xac\\xce\\x11\\x17\\x2f\\x5e\\xfb\\xf4\\xb1\\x78\\x54\\xbc\\x22\\\n\\xc6\\xec\\x5c\\x64\\x1f\\x30\\x8f\\xa4\\xb1\\xe3\\xf1\\x7d\\xf1\\x8d\\x60\\x9f\\\n\\xf0\\x10\\xcd\\x6e\\xe7\\x22\\x86\\xd0\\xa9\\x67\\x89\\xcb\\xc5\\xb9\\x82\\x0d\\\n\\x6d\\x07\\x8b\\x21\\xe2\\x7d\\x98\\x78\\x92\\x60\\xb3\\x5c\\x9f\\x7e\\x10\\x6c\\\n\\x27\\xfd\\x42\\xd0\\xa1\\x74\\xf2\\x76\\xe2\\x7d\\xec\\x72\\xfc\\x40\\x3c\\x28\\\n\\x5e\\x17\\xe9\\xef\\x87\\x68\\x76\\x86\\xf0\\xff\\x74\\xea\\xc9\\xe2\\x12\\x71\\\n\\x95\\xb8\\x48\\xd0\\xb9\\xe9\\x79\\xbc\\xbe\\x63\\xa4\\xbf\\x67\\xe7\\xfb\\x21\\\n\\xfc\\xa2\\x47\\x64\\x04\\x3b\\xdf\\x7f\\x13\\x7d\\xbb\\xdf\\x53\\x1b\\x78\\xff\\\n\\xb7\\xe2\\x2d\\xc1\\x9e\\xe0\\xa7\\xc4\\x7b\\x02\\x83\\x86\\xee\\x9e\\x9f\\x9d\\\n\\x21\\x49\\x47\\x88\\x33\\x05\\x86\\x5c\\x2b\\xce\\x17\\x98\\x42\\x06\\xd5\\x9c\\\n\\xbb\\x52\\xfc\\xbc\\x7e\\x2d\\x30\\xe3\\x09\\x71\\xbb\\xc0\\x8c\\x31\\xe5\\x0a\\\n\\x15\\x35\\xa4\\x64\\xc7\\x50\\xd3\\xdf\\x16\\x0f\\x88\\xbb\\xc4\\x6b\\x82\\x12\\\n\\x93\\x3f\\xf3\\x5d\\x5a\\xb9\\x19\\xbf\\x8a\\x14\\xcf\\x6e\\xc1\\xbc\\x83\\x41\\\n\\x63\\xcc\\x28\\xae\\x92\\x86\\x50\\x02\\x7e\\x16\\xd4\\xf8\\x67\\xc4\\xdd\\x82\\\n\\x91\\xf9\\xa9\\xa8\\xf5\\x70\\x0d\\xe2\\x5c\\x94\\xb4\\xe7\\x04\\x66\\x3c\\x2e\\\n\\xde\\x14\\x94\\xba\\x1a\\x8f\\x2f\\x8c\\x52\\xe9\\xd2\\x41\\x36\\xf0\\x50\\xcd\\\n\\xbb\\x82\\xd5\\x10\\x93\\xe8\\xcb\\xe2\\x33\\xc1\\xc8\\xa4\\xb3\\x4a\\x65\\x0a\\\n\\xc7\\xe5\\x1c\\xcc\\x19\\x18\\xc0\\xf9\\x1f\\x13\\x64\\xea\\x57\\xa2\\xe6\\xa0\\\n\\x18\\xac\\x1a\\xb5\\x1c\\x53\\x98\\x34\\xe9\\x14\\x46\\xe7\\x7d\\x82\\xd1\\x4a\\\n\\x09\\x29\\x59\\xb6\\x38\\x36\\x59\\xc0\\x13\\x56\\x94\\x28\\x06\\x03\\x65\\xea\\\n\\x73\\x61\\x55\\xa6\\x72\\xd5\\x9a\\x5c\\x53\\xa6\\x24\\x53\\x1e\\x16\\x2f\\x89\\\n\\x2f\\x05\\x9d\\x33\\x95\\x31\\x1c\\x07\\x18\\xfd\\x9c\\x8f\\x09\\xfc\\x49\\xb1\\\n\\x57\\x90\\x99\\x98\\x41\\xf9\\xb2\\x55\\x2d\\x43\\x92\\x98\\x53\\xb8\\x10\\xc3\\\n\\x94\\x3b\\x04\\xa6\\x50\\x3e\\xd2\\xf3\\x81\\xab\\x18\\x93\\xfe\\x16\\x33\\x38\\\n\\x0f\\xe6\\x33\\x67\\xf0\\x74\\x15\\x4f\\x5a\\x51\\xba\\xec\\xe6\\x8c\\xae\\x6a\\\n\\x1b\\x42\\x87\\xb0\\xcc\\xa4\\xb3\\x1e\\x11\\x0f\\x89\\x94\\x29\\x53\\xd4\\x74\\\n\\x8e\\xc1\\xea\\x8e\\x8b\\x3d\\x4c\\x67\\xce\\x78\\x41\\xb0\\x9a\\xaa\\xf5\\x50\\\n\\xe8\\x4a\\xaa\\x6d\\x08\\x4a\\xe5\\x8b\\x25\\x28\\xf3\\x09\\x17\\x68\\x4c\\xb4\\\n\\xe9\\xe2\\x6c\\x27\\x99\\xc2\\xfb\\x39\\x6e\\x5a\\xd5\\x31\\x5f\\xdc\\x23\\x5e\\\n\\x14\\x5c\\x85\\x4f\\x61\\x76\\x15\\xad\\xc3\\x10\\x44\\xe7\\x31\\x92\\x99\\x70\\\n\\xa9\\xf1\\x98\\xc2\\xd2\\x38\\xad\\xbc\\xc6\\x0a\\x43\\x98\\xc0\\x29\\x4d\\x7b\\\n\\x04\\x99\\x87\\xc9\\x64\\x9e\\x7d\\x99\\xca\\xb5\\x2e\\x43\\x10\\x1d\\x9f\\x32\\\n\\x05\\x53\\xe8\\x44\\xca\\x0b\\x23\\x9a\\x89\\x77\\x48\\x96\\xf0\\x9e\\x74\\x1c\\\n\\xcc\\xe0\\x3a\\x87\\x79\\xe3\\x55\\x91\\x8e\\x33\\x2b\\x95\\xbc\\x75\\x32\\x54\\\n\\xdc\\xb7\\x3a\\x46\\x9c\\x21\\x2e\\x15\\xd7\\x08\\xee\\xf2\\x72\\x9b\\x25\\xbf\\\n\\x21\\x99\\x9f\\x37\\xc5\\x44\\xa6\\x91\\x19\\xac\\xa6\\x30\\x94\\x6b\\x0d\\xee\\\n\\xe0\\x8e\\x31\\x75\\xac\\x8a\\xf6\\xc7\\x3a\\x33\\x24\\x89\\xc9\\x96\\xd2\\x42\\\n\\x89\\xa1\\xdc\\x30\\x11\\x33\\xda\\x99\\xfc\\xfb\\xca\\x17\\x1d\\x43\\xd9\\xe3\\\n\\xa2\\xf3\\x69\\xc1\\x52\\xfa\\x59\\xc1\\xb7\\x3a\\x94\\xbe\\xc6\\x59\\xab\\x68\\\n\\x58\\x4e\\x29\\x31\\xd2\\x0e\\x14\\x17\\x88\\x5b\\x04\\xc6\\x30\\xca\\x31\\x05\\\n\\xf2\\x18\\xf8\\x99\\xf9\\x06\\xe3\\x6e\\x15\\xdc\\xc0\\xe4\\x6b\\x38\\x6a\\x0c\\\n\\xb0\\x3c\\x0e\\x98\\x54\\x0e\\x19\\x92\\x44\\xe3\\x98\\x80\\x3f\\x14\\x8c\\x78\\\n\\x2e\\xe6\\x30\\x85\\x2f\\x97\\xa1\\x34\\xa5\\x0e\\xc0\\x0c\\xca\\x14\\x2b\\x28\\\n\\x32\\x8a\\xe5\\x33\\xcb\\xe8\\x31\\xb7\\xd0\\x6d\\xe5\\x64\\x48\\x12\\x77\\x84\\\n\\xd3\\x2d\\xf2\\x74\\xef\\x2b\\xcd\\x09\\x69\\xc9\\x9c\\x5f\\xf1\\x33\\x81\\x73\\\n\\x71\\x69\\x7b\\x3b\\x64\\x8c\\x1c\\x26\\xf5\\x65\\x4a\\x9f\\x1a\\xf2\\xa9\\x23\\\n\\xdf\\x7b\\x72\\xb5\\x38\\x5b\\xf0\\xd1\\x30\\xd7\\x19\\x64\\x05\\x66\\xb0\\x2a\\\n\\x4b\\x73\\x46\\x2d\\x15\\xed\\x0f\\x57\\x43\\x10\\x1f\\x64\\x1d\\x25\\x4e\\x17\\\n\\xd7\\x89\\x0b\\x05\\x1f\\x0d\\x93\\x1d\\x77\\x0a\\x4a\\x16\\xf7\\xa6\\x6a\\x7c\\\n\\xe1\\x4c\\xae\\x8d\\x35\\x04\\x51\\x52\\xc9\\x0a\\x3e\\x6d\\xe4\\xcb\\x66\\xc8\\\n\\x1c\\x6e\\xdd\\x53\\xc6\\xd2\\x87\\x4b\\xdd\\xf8\\x4a\\x6b\\xa3\\x0d\\x41\\x98\\\n\\x72\\xbc\\x38\\x52\\x90\\x35\\x2c\\x75\\x53\\x66\\xd4\\x36\\x03\\x6d\\xbc\\x21\\\n\\x88\\xcc\\xc0\\x0c\\xce\\xcd\\xc4\\xbe\\xce\\x1b\\x85\\x61\\x88\\x99\\x8a\\xf6\\\n\\x87\\xe3\\xb2\\x77\\xa3\\x15\\x86\\x98\\x29\\x0c\\x31\\x53\\x18\\x62\\xa6\\x9d\\\n\\x4c\\xea\\xa1\\xff\\x2a\\x26\\xf5\\x96\\x15\\x86\\x98\\x29\\x0c\\x09\\x85\\x42\\\n\\xa1\\x50\\xa8\\x09\\x6d\\x6d\\xfd\\x03\\x55\\x05\\x7f\\xb7\\x68\\xfd\\x50\\x93\\\n\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x10\\x3b\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x64\\x00\\x00\\x00\\x64\\x08\\x06\\x00\\x00\\x00\\x70\\xe2\\x95\\x54\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc3\\x00\\x00\\x0e\\xc3\\x01\\xc7\\x6f\\\n\\xa8\\x64\\x00\\x00\\x0f\\xd0\\x49\\x44\\x41\\x54\\x78\\x5e\\xed\\xdd\\x05\\xac\\\n\\x2c\\x49\\x19\\x05\\xe0\\xc5\\xdd\\xdd\\xdd\\xdd\\x25\\xb8\\x6b\\xf0\\xe0\\x41\\\n\\x82\\xbb\\x26\\x10\\x02\\xc1\\x02\\x81\\xc5\\xdd\\x5d\\x17\\x97\\x45\\x82\\x2c\\\n\\xb0\\xb8\\x5b\\x70\\x77\\x77\\xf7\\xf3\\x91\\x5b\\x64\\x18\\xba\\x7b\\xaa\\x7b\\\n\\xba\\x7b\\xe6\\xb2\\x73\\x92\\x93\\xf7\\xee\\xbd\\x33\\xdd\\x55\\xf5\\xd7\\xaf\\\n\\x55\\xd5\\x7d\\xc0\\x0e\\x3b\\xec\\xb0\\xc3\\x0e\\x3b\\xec\\xb0\\xc3\\x0e\\x13\\\n\\xe0\\x70\\x7b\\xff\\xee\\x07\\x9c\\x24\\x3c\\xdd\\x1e\\x4f\\x14\\x1e\\x73\\x81\\\n\\x47\\x0a\\xff\\x1a\\xfe\\x2e\\xfc\\xed\\xde\\xbf\\x3f\\x0d\\xbf\\xb9\\xc7\\x9f\\\n\\x84\\xfb\\x02\\xdb\\x28\\x90\\xc3\\x87\\xc7\\x0d\\xcf\\x1f\\x5e\\x28\\xbc\\x60\\\n\\x78\\x86\\xf0\\xd8\\xe1\\x91\\x43\\x83\\x7f\\x84\\xd0\\xe7\\x50\\x1f\\xf0\\x9f\\\n\\x7b\\xfc\\xc7\\x1e\\xff\\x1e\\x12\\xd2\\x9f\\xc3\\x5f\\x87\\x5f\\x0d\\x3f\\x1e\\\n\\x7e\\x2c\\xfc\\x54\\xf8\\x9b\\xd0\\xe7\\xb7\\x0a\\xdb\\x22\\x90\\x23\\x86\\xa7\\\n\\x0a\\x2f\\x17\\x5e\\x36\\x3c\\x7b\\x48\\x00\\x45\\x03\\x8e\\x1a\\x96\\xc1\\xef\\\n\\x8b\\x22\\xa4\\x3f\\x86\\xbf\\x0f\\x69\\xcf\\xaf\\xc2\\xcf\\x87\\xef\\x0a\\x0f\\\n\\x09\\x7f\\x18\\x12\\xe0\\xc6\\xb1\\x69\\x81\\x9c\\x38\\xbc\\x78\\x78\\xf9\\x90\\\n\\x46\\x9c\\x2c\\x3c\\x41\\x48\\x08\\x04\\x30\\x15\\x08\\x88\\x69\\xfb\\x59\\x48\\\n\\x18\\x9f\\x08\\xdf\\x11\\x7e\\x38\\xfc\\x79\\xb8\\x31\\x6c\\x4a\\x20\\x27\\x0d\\\n\\x69\\xc2\\x55\\xc3\\xf3\\x86\\x27\\x0f\\x8f\\x17\\x4e\\x29\\x84\\x36\\xd0\\x8c\\\n\\x5f\\x86\\xdf\\x0b\\x3f\\x17\\x12\\xcc\\x7b\\xc2\\xef\\x86\\xb3\\x63\\x6e\\x81\\\n\\x9c\\x22\\xbc\\x72\\x78\\x99\\xf0\\x3c\\x21\\x07\\x7d\\xac\\x70\\x5b\\x40\\x6b\\\n\\xbe\\x1d\\x7e\\x3a\\x7c\\x7b\\xf8\\xce\\xf0\\x47\\xe1\\x6c\\x98\\x4b\\x20\\x7c\\\n\\xc0\\x25\\xc3\\x6b\\x85\\x84\\x71\\xfa\\xf0\\x68\\xe1\\xb6\\x82\\xaf\\xf9\\x5a\\\n\\xf8\\xde\\xf0\\xe0\\xf0\\xd0\\x90\\x0f\\x9a\\x1c\\xa2\\x95\\xa9\\x71\\x8e\\xf0\\\n\\xe6\\xe1\\x2d\\xc2\\xab\\x84\\xa7\\x0c\\x45\\x4a\\xdb\\x0c\\xd1\\x9c\\x30\\xfb\\\n\\xac\\xa1\\xc9\\xc3\\x9c\\xfe\\x22\\x9c\\xdc\\xbf\\x4c\\xa9\\x21\\x06\\x9d\\x9f\\\n\\xb8\\x61\\x78\\xb5\\x50\\xee\\x30\\xc6\\x04\\x28\\x0e\\xf9\\x4f\\xa1\\x90\\xf6\\\n\\x2f\\x7b\\xbf\\xe3\\x7f\\x0c\\x24\\x6d\\xa4\\x7d\\xc7\\xd8\\xfb\\xdd\\xba\\xe0\\\n\\x63\\x38\\xfe\\x37\\x87\\x07\\x85\\xb4\\xe5\\x6f\\xe1\\x24\\x98\\x42\\x20\\xae\\\n\\x69\\x46\\x5d\\x3d\\xbc\\x75\\x78\\xd1\\xd0\\x20\\xf5\\x45\\x09\\x57\\x45\\x42\\\n\\x3f\\x08\\x7f\\x1c\\x72\\xbe\\x42\\x56\\x33\\x95\\x59\\x61\\x46\\x08\\xc5\\xa0\\\n\\x11\\xb6\\xfb\\xa0\\x28\\x4d\\xb4\\x26\\x9f\\xd1\\x16\\xb3\\x5d\\xe0\\x70\\xc2\\\n\\x50\\xfb\\x86\\xf4\\xdb\\xfd\\x3e\\x10\\x3e\\x3f\\x7c\\x5b\\xa8\\x1d\\xa3\\x63\\\n\\x6c\\x81\\x98\\x91\\x1c\\x37\\xad\\xb8\\x4b\\xc8\\x3c\\xf5\\xd1\\x0a\\x42\\x30\\\n\\xe3\\x39\\xd2\\x6f\\x85\\x22\\x1d\\xb6\\xfc\\xcb\\xe1\\xd7\\x43\\x33\\x55\\x06\\\n\\x4e\\x08\\xab\\x40\\x30\\xb4\\x92\\x20\\x24\\x96\\x67\\x09\\xcf\\x18\\xca\\x77\\\n\\x4e\\x1b\\x8a\\xf4\\xe4\\x3f\\x7d\\xc6\\x80\\x66\\x7c\\x23\\x7c\\x6a\\xf8\\xca\\\n\\x50\\x05\\x60\\xd4\\xe4\\x72\\x4c\\x81\\xe8\\x9c\\x8e\\xde\\x2c\\xbc\\x4f\\x78\\\n\\xf4\\xb0\\xf6\\xfa\\x34\\x41\\xe6\\x4c\\x08\\x32\\x6a\\xd9\\xf4\\xfb\\x43\\xd1\\\n\\xce\\x98\\xce\\x54\\x9b\\x2e\\x10\\x5e\\x22\\x54\\x05\\x20\\x28\\x6d\\xee\\x93\\\n\\xf7\\x10\\x80\\xcc\\xff\\xd1\\xe1\\xcb\\x42\\xe1\\xf2\\x56\\x24\\x95\\x8b\\xe0\\\n\\x2f\\xce\\x16\\x1e\\x18\\x9a\\xbd\\x1a\\x5d\\x43\\x1d\\xe1\\x2c\\x3f\\x19\\x3e\\\n\\x2b\\xbc\\x66\\x78\\x9c\\x70\\x0e\\x30\\x65\\xd7\\x0d\\x5f\\x10\\x12\\x3c\\x73\\\n\\xa8\\x3d\\x4d\\xed\\x5c\\xa6\\x09\\xa4\\x9f\\x0f\\x0f\\x69\\x9d\\xc9\\xb8\\x35\\\n\\xd0\\x18\\xd1\\x08\\x35\\xa6\\xd2\\x4d\\x1d\\x68\\x22\\x9b\\xcc\\x14\\x3d\\x33\\\n\\xe4\\xfc\\x87\\xf8\\x99\\x31\\x20\\x00\\xb8\\x52\\xc8\\x37\\xd0\\x4e\\xed\\x32\\\n\\xe0\\x4d\\x6d\\x5e\\xa6\\xfe\\x3e\\x2e\\xa4\\x69\\x73\\x44\\xac\\x2b\\xa1\\x11\\\n\\x1a\\xf3\\xc8\\xb0\\x56\\x18\\x3e\\xc7\\x29\\x73\\x8c\\x37\\x08\\x45\\x43\\xdb\\\n\\x00\\x66\\x8b\\xef\\xd3\\x2e\\x5a\\xdb\\xa7\\x3f\\x0f\\x0b\\x4f\\x1d\\x6e\\xa2\\\n\\xd2\\xf0\\x1f\\xf0\\x0f\\x9c\\xf6\\x83\\xc2\\x5a\\x33\\xc5\\x61\\x2b\\x87\\xdf\\\n\\x2f\\xe4\\xfc\\xb7\\x11\\xa7\\x09\\x1f\\x12\\xca\\xd8\\x55\\x8b\\x9b\\xfa\\xb1\\\n\\x4c\\x21\\x38\\xbf\\x29\\x50\\x18\\x3b\\x50\\xaa\\xc6\\xf1\\xc3\\x7b\\x84\\xaa\\\n\\xa7\\x4d\\x8d\\x5c\\xa6\\x99\\xf4\\xc1\\x50\\x38\\x7c\\x94\\x70\\x9b\\xc1\\x8c\\\n\\x5d\\x3f\\x14\\x5c\\xd4\\x6a\\x8a\\xdc\\xe8\\xb6\\xe1\\x5c\\x3e\\xf0\\xbf\\xc0\\\n\\x6f\\xdc\\x28\\x34\\x8b\\x6a\\xed\\xed\\x8b\\x42\\x65\\xf5\\x8d\\xcd\\xa0\\x9e\\\n\\x60\\x7e\\x54\\xa0\\x25\\x83\\x4d\\xfd\\x59\\xa6\\x71\\x10\\x12\\x5f\\x23\\x9c\\\n\\xdd\\x9f\\x70\\xc2\\xd6\\x12\\x6a\\xa2\\x12\\x0d\\xe5\\xf0\\xcf\\x14\\x6e\\xd4\\\n\\xc6\\x0e\\x80\\x81\\x15\\x3d\\x3e\\x2d\\xac\\xe9\\x2b\\x6d\\x52\\xfb\\xba\\x58\\\n\\x38\\x1b\\x44\\x54\\x22\\x23\\xf9\\x41\\x53\\xa3\\x16\\xa9\\x13\\x1c\\x9e\\xaa\\\n\\xee\\x56\\x44\\x21\\x03\\xa0\\xdd\\x26\\x93\\xbc\\xa3\\x46\\x28\\x7f\\x08\\x1f\\\n\\x1f\\x0a\\x76\\x26\\x87\\xd0\\xf4\\xee\\xe1\\xf7\\xc3\\xa6\\xc6\\x2c\\xf3\\xc9\\\n\\xe1\\x7e\\x16\\x46\\x81\\xf6\\x9f\\x39\\x7c\\x4a\\xd8\\xd4\\xcf\\x65\\x4a\\x16\\\n\\x6f\\x1f\\x4e\\x1e\\xca\\x5f\\x31\\xb4\\x80\\xb3\\xca\\xd1\\x99\\x49\\x7c\\x86\\\n\\x4e\\xec\\x77\\x61\\x14\\xf0\\x9b\\x2a\\xd7\\x4a\\x26\\x4d\\x7d\\x5e\\xa4\\xf1\\\n\\x51\\x8c\\xb4\\xe4\\x30\\x19\\x2c\\xaf\\x52\\x45\\x45\\xb5\\xa6\\x46\\x14\\x0a\\\n\\x15\\x3f\\x12\\x9e\\x33\\xfc\\x7f\\x11\\x46\\x81\\x8a\\x84\\x92\\xcb\\x47\\xc3\\\n\\x55\\xc1\\x8c\\x5c\\x46\\x26\\x6f\\x99\\x7a\\x12\\xa8\\x51\\x7d\\x26\\xec\\x6a\\\n\\x88\\x99\\xf1\\x9d\\x50\\x68\\xdb\\xc7\\x81\\x13\\x9c\\x8a\\x2c\\x8d\\x9a\\x13\\\n\\x1c\\xb6\\x02\\x64\\x9f\\xb6\\x2a\\xf1\\x5f\\x3b\\x54\\x58\\xec\\xf2\\x29\\xc6\\\n\\x89\\xe0\\x94\\x67\\xaa\\x51\\x3b\\x83\\x25\\x80\\xb7\\x0a\\x2f\\x15\\x6a\\x50\\\n\\x13\\x34\\x42\\x81\\xf0\\x49\\xe1\\x4b\\x43\\xc2\\xa9\\x81\\x36\\x58\\x57\\xbf\\\n\\x73\\xa8\\xe8\\xc7\\xfe\\x2a\\xb5\\x4f\\x0d\\x21\\xad\\x3c\\x4a\\xb1\\x51\\x15\\\n\\x59\\x99\\x5f\\x1f\\x56\\x81\\x10\\xb4\\xd1\\x38\\x5c\\x24\\x64\\xca\\x9a\\x42\\\n\\x79\\xbf\\x93\\x93\\xb0\\x28\\xb6\\x1d\\xc9\\xd7\\x46\\xc3\\x4d\\x42\\x05\\xb8\\\n\\xc5\\x19\\xb0\\x4c\\xd1\\xc5\\x5b\\xc3\\x3e\\x19\\x38\\x61\\x30\\x01\\xcf\\x0d\\\n\\x95\\x53\\x94\\xd6\\xfd\\x9f\\x80\\xa6\\x84\\xf5\\x7c\\x3e\\x4e\\x41\\x91\\x20\\\n\\x44\\x8d\\xe7\\x0b\\x6b\\x8b\\x84\\x06\\x5b\\xa9\\xc4\\x12\\xaf\\x2c\\xbd\\x69\\\n\\x3c\\x0a\\x99\\xef\\xeb\\x84\\xa3\\x81\\x4a\\x1b\\xa4\\xb2\\xb1\\xac\\x89\\x66\\\n\\x8d\\xf5\\x8a\\xeb\\x85\\xb5\\x28\\xc2\\x78\\x4e\\x48\\x18\\xae\\x43\\xcd\\xd9\\\n\\x5e\\xf7\\xe3\\x83\\xa6\\xc0\\xb9\\x43\\x15\\x5e\\x33\\xb7\\x98\\x5f\\xf7\\x7f\\\n\\x46\\x48\\x28\\xb5\\x56\\x03\\x4c\\x54\\x11\\x67\\x97\\xe9\\x72\\x9f\\x27\\x86\\\n\\x16\\xcc\\x46\\x81\\xcc\\x53\\x09\\xa1\\xe9\\x66\\x85\\x66\\xda\\xf3\\xc2\\xda\\\n\\x42\\xe1\\xa2\\x30\\x8a\\xa9\\x28\\x34\\x48\\x3a\\xa1\\x1c\\xcf\\xc6\\x8f\\x05\\\n\\xb3\\x5a\\x94\\x44\\x18\\xcc\\xc7\\xb2\\x2f\\xa4\\x9d\\x12\\x58\\xda\\x59\\x2b\\\n\\x14\\x3b\\x66\\x5e\\x11\\x2a\\x9b\\x2c\\x5e\\x6b\\x99\\x96\\x7d\\xaf\\x10\\xae\\\n\\x0d\\x2a\\xfc\\x98\\xb0\\xac\\x8c\\x35\\xd1\\xec\\xb0\\x9f\\xc9\\x66\\xb7\\x1a\\\n\\xe8\\x2c\\xbb\\x4d\\x0b\\x96\\x85\\x51\\x68\\xb0\\x0c\\x9a\\x59\\x2b\\x11\\x5d\\\n\\xb7\\xdc\\xe2\\x9e\\xca\\x36\\x26\\x0d\\x13\\xb3\\x2c\\x8c\\x42\\x42\\x79\\x7a\\\n\\xd8\\x47\\x53\\x6c\\xdc\\xb0\\xaa\\xd9\\xa5\\x25\\x96\\xa0\\x1f\\x1c\\xd6\\x5e\\\n\\xb3\\x15\\x2a\\x9f\\xab\\xf2\\x0e\\xab\\x67\\x2f\\x0c\\x6b\\xb7\\xf5\\x08\\x03\\\n\\xad\\x21\\x14\\x33\\xd5\\x46\\x83\\xa6\\x8a\\xcc\\xbe\\xcb\\x94\\x87\\x76\\xa6\\\n\\xe4\\x0f\\xae\\x63\\xd0\\xda\\x84\\x51\\x68\\x92\\x58\\x4e\\xa8\\x0d\\x57\\x25\\\n\\x7f\\xaf\\x0a\\xbb\\xb4\\xc4\\xf8\\xbd\\x3e\\x5c\\xe9\\x5f\\x57\\x85\\x7b\\x12\\\n\\x1b\\x6b\\xd0\\x6d\\x83\\xe1\\x66\\xd6\\xbd\\x5f\\x17\\xd6\\x2e\\xb5\\xda\\x78\\\n\\xa0\\x13\\x65\\x60\\xda\\x40\\x2b\\xc4\\xfd\\x2a\\xa8\\x77\\x0d\\x6d\\xc7\\xe9\\\n\\x2b\\x14\\xdf\\xb7\\x96\\xee\\xfb\\xae\\xe3\\x9a\\x5d\\xda\\xa6\\x3d\\x84\\xa6\\\n\\x7d\\xb5\\x1b\\xf8\\x68\\x1c\\x81\\x88\\x0c\\xdb\\xfa\\xa3\\xdd\\x96\\x8a\\x6d\\\n\\x9b\\x1d\\x0c\\x0d\\x67\\xc7\\xf9\\x07\\x37\\x6a\\xa2\\x19\\xfc\\x86\\xd0\\x20\\\n\\xf7\\x81\\x28\\xe7\\xd9\\x21\\x2d\\x59\\x35\\x63\\xd1\\x67\\x9e\\x10\\x1a\\xdc\\\n\\xda\\x48\\x88\\x30\\x68\\x86\\xc2\\x60\\xed\\x3d\\x68\\x07\\x3f\\xc2\\xbc\\xf5\\\n\\x81\\xa5\\x08\\xc5\\x56\\xeb\\x3d\\x4d\\xd7\\x46\\xd7\\x96\\x58\\x0f\\x36\\xbf\\\n\\x62\\xe8\\xf7\\x85\\x5d\\xb6\\x91\\x76\\x3c\\x20\\x1c\\x02\\x51\\x14\\x33\\xb2\\\n\\x18\\xed\\x74\\xd1\\x67\\xd4\\xc6\\x6a\\x84\\xe2\\xef\\x06\\xd5\\xe0\\x76\\xb5\\\n\\xbf\\xd0\\xb5\\xb5\\x83\\xff\\x20\\xc4\\x21\\x78\\x44\\x28\\x9f\\x69\\xba\\x3e\\\n\\x6a\\x87\\xb4\\x60\\xf0\\x7a\\x89\\x2d\\x9f\\xb6\\xec\\x37\\x5d\\x1c\\x75\\xc2\\\n\\x82\\x93\\x64\\x6e\\x28\\x0c\\x1a\\xc7\\xdd\\x14\\xf5\\x34\\xd1\\x67\\x14\\xf8\\\n\\xba\\x6a\\x64\\x7e\\xef\\xba\\xb5\\x25\\x73\\xd7\\x74\\x7f\\xc2\\x5b\\x27\\xaa\\\n\\x13\\xd4\\x48\\x00\\xbb\\xfa\\x21\\x5a\\x1d\\x5c\\x9a\\xbf\\x67\\x48\\x03\\x9a\\\n\\x2e\\x8c\\x3a\\xcb\\x76\\xda\\x5a\\xb3\\x0e\\x0c\\x02\\x4d\\x61\\xfe\\x6a\\x85\\\n\\x22\\xae\\xb7\\xdb\\x63\\x59\\xfd\\xfd\\x5c\\xae\\x57\\x7b\\x2d\\xf7\\x55\\x5d\\\n\\x70\\xbd\\x75\\x60\\x4d\\x9e\\x06\\x74\\x4d\\x02\\xb9\\xda\\x1d\\xc3\\x41\\x78\\\n\\x71\\xd8\\x95\\x0c\\x0a\\x85\\xa9\\xe9\\x18\\x30\\xe3\\xfb\\xd8\\x7a\\x9d\\xa6\\\n\\x29\\xcb\\x83\\x48\\x33\\xe4\\x36\\xfe\\x5e\\x7b\\x2d\\x76\\xdd\\x12\\xc1\\x18\\\n\\x20\\xd8\\xae\\xe8\\x51\\xd2\\xcb\\x2c\\x0e\\x82\\x64\\xa6\\x6b\\x91\\xff\\xb3\\\n\\xa1\\x4d\\xd4\\x63\\x40\\xb4\\x47\\x28\\x3a\\x54\\x6b\\x66\\x44\\x37\\x34\\xa1\\\n\\x38\\x60\\x3e\\x89\\x30\\x44\\x7b\\xb5\\xc2\\xa0\\x69\\x16\\x92\\x06\\x3b\\xda\\\n\\x25\\xdc\\x2e\\xb4\\xb5\\xa9\\xe9\\x7e\\xc8\\xe9\\xd3\\xa2\\xde\\x10\\x83\\x4b\\\n\\xf6\\xba\\x3a\\x26\\xaa\\xb0\\x6f\\x77\\x2c\\xb0\\xfd\\x1c\\x36\\xc7\\x5d\\x3b\\\n\\xa0\\x62\\x7f\\x33\\xee\\xc6\\xa1\\xa4\\xcf\\xcf\\xb5\\xdf\\x95\\xf0\\x8e\\xbd\\\n\\x9f\\x4a\\xf1\\x95\\x5f\\x6d\\xba\\x27\\xba\\xef\\x87\\xc2\\xde\\x65\\x14\\x65\\\n\\x0d\\x9b\\xc6\\x9a\\x2e\\x5a\\xf8\\xda\\x50\\x81\\x6d\\x4c\\x88\\x8e\\x64\\xe6\\\n\\x7d\\x84\\x22\\x2c\\x57\\x7d\\xed\\x13\\xad\\x3d\\x36\\x9c\\x62\\x73\\x9b\\x5c\\\n\\xc9\\x41\\x9f\\xa6\\xfb\\x16\\x2a\\xd2\\xb6\\x16\\x4f\\xdb\\x12\\x43\\x19\\x7a\\\n\\x5b\\x99\\x1d\\x74\\x4a\\x86\\x3e\\xf6\\x71\\x63\\x19\\xad\\x32\\x84\\x88\\x87\\\n\\x4f\\xd1\\x81\\x2e\\x30\\x35\\xc2\\x48\\x1b\\xaa\\x1d\\x12\\xed\\x32\\x3d\\x65\\\n\\x40\\xf8\\x0c\\xd7\\xb6\\x8f\\x98\\x79\\x1c\\x13\\xc2\\xde\\xa2\\xa5\\x6d\\x50\\\n\\xd1\\x68\\x9d\\xc8\\x6d\\x02\\xb1\\x6d\\x5f\\x62\\xd5\\x06\\xdb\\x2d\\x25\\x3a\\\n\\xec\\xf8\\xd8\\x28\\x42\\xe1\\xb4\\x99\\xa3\\x32\\x90\\x6d\\x20\\x84\\xc2\\x36\\\n\\xf8\\x3e\\x7f\\xc8\\x47\\x11\\xf6\\x14\\xc2\\x00\\xe3\\x61\\x5c\\xba\\xaa\\x16\\\n\\xc6\\x55\\x22\\xd9\\x88\\x36\\x81\\xac\\xda\\x0d\\xee\\x86\\x66\\xc2\\x54\\x20\\\n\\x14\\x26\\xd3\\x00\\xca\\x53\\x4a\\x06\\x3c\\x04\\xbe\\x67\\xad\\x46\\x31\\xd3\\\n\\xf5\\xec\\x9c\\x9c\\x42\\x18\\xe0\\x5e\\xc6\\x45\\x28\\xdd\\x06\\x66\\xd9\\xf8\\\n\\x36\\xa2\\x6d\\xd0\\x95\\xd1\\xbb\\xec\\xab\\x01\\x9a\\x42\\x3b\\x16\\x61\\xd0\\\n\\xbe\\x12\\x2a\\x99\\x28\\x99\\x1b\\xd4\\xbe\\x42\\xf1\\x79\\xa1\\xfb\\x4b\\x42\\\n\\x11\\x95\\x8d\\x6c\\x43\\x05\\x5b\\x0b\\x93\\x95\\x36\\xb6\\xc1\\xb8\\xb6\\xe6\\\n\\x6e\\x6d\\x02\\xf1\\x85\\x2e\\x0d\\x71\\xc3\\xae\\x59\\x30\\x16\\x0c\\x1e\\xa1\\\n\\x18\\x4c\\x67\\x31\\x4a\\x5e\\x54\\x03\\x9f\\xe3\\xf0\\xed\\x12\\xa1\\x19\\xc2\\\n\\xd1\\x39\\xb0\\x4a\\x20\\xc6\\xb5\\xb7\\x40\\xd8\\xb9\\x2e\\x9b\\xcc\\x69\\x4d\\\n\\xa5\\xf6\\x4d\\xf8\\x62\\xf8\\xee\\x90\\xef\\xea\\x03\\x02\\xb4\\xcc\\xfa\\x85\\\n\\x7f\\xff\\x34\\x0f\\x98\\xdb\\xae\\xb1\\x31\\xe6\\xad\\xfe\\xb9\\x4d\\x20\\x25\\\n\\x21\\x6c\\x83\\xef\\x8d\\x1d\\x32\\x76\\x41\\x39\\xc4\\x63\\x37\\xfa\\x1e\\x5d\\\n\\x10\\x79\\xc9\\x0d\\x4a\\xf2\\x38\\x07\\xf8\\x88\\xae\\xb1\\x31\\x99\\x5b\\x35\\\n\\xa8\\x4d\\x20\\xec\\x75\\x57\\xe8\\x46\\xc2\\x73\\xec\\x60\\xa7\\xa5\\x32\\x78\\\n\\xbb\\x25\\xad\\x5f\\xaf\\x0a\\x6d\\x17\\xe1\\x73\\x4e\\x49\\xd9\\x14\\x6e\\x3d\\\n\\x44\\xd2\\x39\\x07\\x84\\xb5\\x5d\\x11\\xaa\\x71\\x35\\xbe\\x8d\\x68\\x13\\x08\\\n\\xd3\\xd0\\xa5\\x76\\x72\\x94\\xda\\x15\\xc2\\xa1\\x30\\xcb\\x08\\xc3\\x56\\x9d\\\n\\x5b\\x86\\xec\\x6e\\xad\\x30\\x0a\\x7c\\x9e\\x10\\x95\\x78\\xee\\x16\\xaa\\x59\\\n\\xf5\\xbd\\x46\\x5f\\xac\\x12\\x88\\x71\\xed\\x2d\\x90\\x52\\x0e\\x6f\\x83\\x9b\\\n\\x4e\\xf9\\x48\\x0c\\x6a\\x6f\\xd9\\xd6\\x20\\xde\\x21\\x34\\x01\\x86\\x0e\\xa4\\\n\\xef\\x11\\xe6\\x6d\\xc2\\x22\\x94\\xa9\\xcc\\x6d\\x99\\x00\\x5d\\xd6\\x83\\x8f\\\n\\x69\\xf5\\x85\\x6d\\x02\\x91\\xdc\\x74\\x45\\x0a\\x6c\\xb9\\x7a\\xcc\\x14\\x9b\\\n\\x89\\x09\\x43\\x15\\xd7\\xc6\\x39\\xa5\\x6a\\x9d\\xec\\x12\\x06\\x5f\\x57\\xd8\\\n\\x06\\xdf\\x37\\x6b\\x99\\x3e\\xd7\\x55\\x89\\x98\\x42\\x28\\xc6\\xc3\\xb8\\x74\\\n\\x59\\x0f\\xe3\\xaa\\x22\\xdc\\x88\\x36\\x81\\xc8\\x64\\xbb\\xc2\\x5a\\xdf\\x53\\\n\\xb2\\x18\\x7b\\xdf\\x6a\\x11\\xc6\\x9d\\x42\\x03\\xd7\\x25\\x08\\x20\\x04\\x25\\\n\\x1c\\xbb\\x3a\\x24\\x64\\xab\\x84\\x82\\xd6\\x79\\x5c\\x7f\\x0a\\xa1\\xd8\\xff\\\n\\xcc\\x72\\xb4\\x8d\\x2b\\x08\\x8b\\x1d\\x74\\x6a\\x44\\xdb\\x17\\x7d\\x81\\x40\\\n\\xba\\x3a\\x48\\x20\\x63\\x9e\\x13\\x34\\x38\\x0a\\x7e\\x06\\xcb\\x43\\x07\\x6a\\\n\\x84\\x41\\xf5\\xe5\\x19\\xf7\\x0d\\x15\\x3b\\x6b\\x92\\x47\\xd7\\xbd\\x57\\x58\\\n\\x84\\xd2\\x35\\x78\\x7d\\x61\\xcb\\x6d\\x97\\x29\\xd7\\x36\\x02\\x51\\x0c\\xed\\\n\\x0d\\x07\\xf7\\x4b\\xf8\\xdb\\xc4\\x31\\xd7\\x43\\x0c\\xd2\\xba\\xeb\\x21\\xd6\\\n\\xc2\\xad\\x87\\xf8\\xbd\\xbf\\x37\\x7d\\x6f\\x91\\x3e\\xa3\\x0a\\xb0\\x2f\\xd6\\\n\\x43\\xc0\\xde\\x57\\xe6\\xa0\\xe9\\xc2\\xa8\\xd2\\x6b\\xff\\xd2\\x18\\xe0\\xc0\\\n\\x6b\\x57\\x0c\\xd1\\xe7\\x14\\x09\\xdb\\x56\\x0c\\xfb\\x5c\\xc7\\x1e\\xb1\\x31\\\n\\x57\\x0c\\xad\\x0a\\x36\\xdd\\x0b\\xd7\\x5a\\x31\\x5c\\xb5\\xa6\\x2e\\x5a\\x78\\\n\\x75\\xd8\\x5a\\x06\\xa8\\x84\\xa4\\x4f\\x01\\x91\\x89\\xac\\x19\\x48\\x9f\\xd1\\\n\\x71\\x42\\x5c\\x9e\\xd9\\x7e\\x26\\x94\\x3e\\x6b\\xea\\x34\\xaa\\xac\\xd1\\xaf\\\n\\x03\\xa6\\xca\\x19\\xf7\\x2e\\x0d\\x57\\xc5\\x16\\x35\\x0e\\xc2\\xa5\\xc3\\x9a\\\n\\x5d\\x27\\xeb\\x9c\\x12\\x32\\x78\\x7d\\x77\\x9d\\xd0\\x0c\\x49\\x5e\\x9b\\x43\\\n\\xf6\\x7b\\xd7\\xf5\\xb9\\x5a\\xf3\\x27\\x20\\xf0\\xf9\\x75\\x76\\x9d\\xd8\\xbb\\\n\\x3b\\xe9\\xae\\x13\\x9b\\xdf\\xd4\\x81\\xba\\x3a\\x35\\xc6\\xbe\\x2c\\x05\\xc0\\\n\\x5a\\x61\\x58\\x23\\xb1\\xa2\\x28\\x1a\\xeb\\x82\\xbf\\xf7\\x15\\x8a\\x76\\x30\\\n\\x9b\\x43\\xf7\\x65\\x31\\xdf\\x9e\\x62\\xd4\\x74\\x7d\\x64\\x51\\xde\\x12\\xca\\\n\\x53\\x06\\x81\\xfa\\x97\\x01\\x6b\\xba\\x01\\x32\\x33\\x6f\\x0c\\x95\\x28\\xfa\\\n\\xc0\\x91\\x80\\xbe\\x3b\\x17\\x99\\x95\\x21\\x3b\\x17\\xd9\\xec\\xda\\x7b\\xc8\\\n\\xbf\\x08\\x9d\\x30\\xfb\\xc0\\x82\\x93\\xe2\\x67\\xd7\\xce\\x45\\x1b\\xb9\\xf9\\\n\\xab\\xb5\\x02\\x08\\xc7\\xd8\\xbe\\x14\\x36\\xdd\\x00\\x75\\x82\\x59\\xeb\\x73\\\n\\x20\\xa5\\x6c\\xf9\\xd1\\xc0\\x55\\x03\\xe5\\xef\\x68\\x8d\\xdd\\xf7\\xfa\\xe6\\\n\\x0d\\x84\\x42\\x13\\x99\\xc5\\x72\\xad\\xa6\\xfb\\x14\\xfa\\xbb\\x3d\\xba\\xe5\\\n\\x81\\x32\\xb5\\x50\\x2f\\xe3\\x1f\\xba\\xae\\x6f\\x2d\\xdd\\xd3\\x21\\x3a\\xb1\\\n\\x2a\\x06\\x67\\xb2\\x9c\\x19\\xa4\\xf6\\x4d\\x20\\x6d\\x9b\\xb1\\x09\\xa4\\xb6\\\n\\xb6\\x25\\x72\\xe3\\x48\\xdd\\xbb\\x6b\\xb6\\xe8\\x84\\xb0\\x9b\\x26\\x11\\x88\\\n\\x4d\\x66\\x6d\\xed\\x68\\x83\\xef\\x9b\\x50\\xbe\\xef\\x3a\\x65\\x70\\xda\\xa0\\\n\\x3d\\x84\\x6e\\xa6\\xd7\\xae\\x88\\xca\\xce\\x1d\\x54\\x72\\x46\\xb2\\xad\\x3f\\\n\\xda\\x6d\\xa5\\xd2\\x8e\\x93\\xb5\\xa0\\x71\\x9e\\x81\\x55\\x73\\x3e\\xa4\\xf6\\\n\\x40\\x8a\\x6b\\xd6\\x9e\\x0f\\x61\\x32\\xb7\\xfd\\x7c\\x88\\x67\\x0f\\xcf\\x76\\\n\\x3e\\x04\\x9c\\xa8\\x5d\\x75\\x82\\xca\\x16\\x1c\\xcf\\x9b\\x6a\\x5d\\x2b\\x5e\\\n\\x82\\x86\\x6d\\xe2\\x04\\x15\\xf3\\xe5\\x2c\\x4b\\x53\\x54\\x47\\x18\\x4c\\x69\\\n\\x1f\\x61\\x08\\x75\\x55\\x0a\\x5c\\x6f\\xf1\\x5a\\xcb\\xb4\\x69\\x7d\\x94\\x13\\\n\\x54\\xe0\\x8c\\xa1\\x81\\xab\\x39\\x63\\xb8\\xd2\\x46\\x2e\\x40\\xa7\\x2f\\x1c\\\n\\xd2\\x94\\xb2\\xfd\\xd2\\x20\\x49\\x9e\\xcc\\x64\\x83\\x37\\x05\\xca\\x19\\x43\\\n\\xa6\\xb3\\x08\\xc5\\xfd\\x69\\xe3\\x90\\x33\\x86\\x66\\x7f\\x97\\x76\\x98\\x5c\\\n\\x02\\x92\\xd1\\xce\\x18\\x42\\xed\\x29\\x5c\\x89\\x91\\x7a\\x4e\\x2d\\x8a\\x50\\\n\\x08\\xc0\\xa0\\x98\\xa5\\x04\\x34\\xf7\\x29\\x5c\\xda\\xe8\\x98\\x74\\x6d\\x04\\\n\\x47\\xdb\\xec\\xad\\x3a\\x34\\x2c\\x35\\xbf\\x36\\x7a\\x9e\\x7c\\x75\\xd0\\x53\\\n\\x3b\\x1b\\xcc\\x5a\\xb6\\x5c\\xd8\\xd9\\xb6\\xf8\\xa2\\x33\\xf6\\x73\\x11\\x4c\\\n\\x79\\xce\\xd4\\x2a\\x68\\xb0\\xd8\\xbd\\x14\\xdb\\x6c\\x68\\x90\\x3b\\x78\\x40\\\n\\xc1\\x94\\x10\\x49\\x29\\xa0\\xca\\x09\\x0c\\x18\\x87\\xcf\\x0f\\x9a\\xe9\\x35\\\n\\x60\\x9a\\xad\\x42\\xb2\\x08\\x5d\\x4b\\x10\\x4c\\xd9\\xc1\\xe1\\xcb\\xf7\\xfe\\\n\\x3f\\x2a\\x6e\\x1a\\xd2\\x92\\x36\\x87\\x88\\x84\\x50\\x9e\\xe4\\xd0\\x47\\xf5\\\n\\x7d\\x76\\x93\\x4f\\x72\\xe8\\xd3\\x56\\x8b\\x4f\\x9e\\xce\\x40\\x9b\\xbb\\x4c\\\n\\x95\\x71\\x72\\x46\\xbd\\xd7\\x93\\x1c\\xfa\\x40\\xad\\x5f\\x7c\\xce\\x26\\x36\\\n\\x35\\xa0\\x50\\xa8\\xa9\\x21\\xe7\\x0a\\xfb\\x74\\x74\\x3f\\x80\\x75\\x60\\x62\\\n\\x3d\\x45\\xb5\\x6b\\x62\\x22\\x13\\xec\\xd1\\x54\\x93\\x3d\\xeb\\x04\\x44\\x0a\\\n\\xb5\\x4f\\x03\\xb2\\x39\\x6d\\x48\\x32\\xb7\\xad\\x60\\x92\\x65\\xfe\\x07\\x85\\\n\\x4d\\x7d\\x5e\\xa4\\xf1\\x79\\x53\\x38\\xe9\\xd3\\x80\\x80\\xbd\\x3c\\x2c\\x3f\\\n\\x2f\\x8b\\x7f\\x6b\\xea\\xe7\\x32\\xd5\\xf8\\xac\\x8d\\x4c\\xb1\\xc4\\xfd\\x3f\\\n\\xe0\\xdc\\x95\\x22\\xac\\x7c\\x35\\x35\\x66\\x91\\x34\\xe5\\xb0\\xf8\\x44\\xb9\\\n\\xbe\\xa5\\x97\\xb5\\x61\\xd3\\x9a\\x97\\x9d\\xac\\x32\\x5d\\xc8\\xd6\\x4a\\xb8\\\n\\x74\\x6a\\xcc\\xe5\\xd2\\x39\\x40\\x18\\x1c\\xbf\\xf6\\xd7\\x08\\xc3\\x78\\x88\\\n\\xaa\\xc6\\x3c\\xc8\\x54\\x05\\xf6\\xd4\\x43\\x87\\x6d\\x86\\x58\\xe5\\xdc\\x0a\\\n\\x9d\\x59\\x54\\xbe\\x58\\xb7\\x0c\\x32\\x17\\xb4\\x53\\x89\\xc7\\xc1\\xd6\\xa6\\\n\\xfe\\x2c\\xd3\\x38\\x48\\x8e\\xfb\\x46\\x98\\xa3\\x41\\xc9\\xd9\\x3e\\xa7\\xb2\\\n\\xdb\\x63\\x15\\x45\\x5f\\x8a\\x6b\\x1e\\x66\\x33\\x8b\\x6d\\x5d\\x03\\x0a\\xa5\\\n\\x72\\x0c\\xaf\\xd9\\xab\\xb1\\x02\\xa8\\x92\\x61\\xef\\xd7\\xe0\\x73\\xe8\\xeb\\\n\\xc2\\x0c\\xb2\\xeb\\xe4\\x81\\xe1\\xaa\\x6c\\xb5\\x50\\x15\\x55\\xd5\\xf3\\xfe\\\n\\x61\\x9f\\x8c\\x7e\\x4e\\x78\\x04\\xc6\\x43\\x43\\x89\\x63\\xd7\\xfa\\xc6\\x22\\\n\\x15\\x2c\\xef\\x1d\\x76\\x55\\x7c\\x67\\x01\\x9f\\xe0\\x5c\\xdd\\x90\\x67\\xbf\\\n\\x0b\\x9f\\x25\\x9b\\x83\\x57\\xd0\\x46\\x86\\x42\\xe1\\xbe\\x7e\\xf6\\x7b\\x01\\\n\\x7f\\x22\\xf2\\xb2\\xd2\\x56\\xdb\\x09\\x14\\x8d\\x28\\x95\\xa8\\x23\\x09\\x12\\\n\\x36\\x65\\xc6\\x98\\x27\\x6f\\x8e\\x53\\x70\\xdc\\xf7\\x6f\\x47\\x28\\x90\\xc1\\\n\\x8a\\x46\\xc6\\x78\\x7f\\x48\\xdf\\x07\\xd9\\x0c\\xc5\\xe2\\xfb\\x43\\xd4\\xce\\\n\\x54\\x20\\x6a\\x22\\x29\\x24\\x30\\x66\\x6a\\xf4\\xf7\\x87\\x8c\\x69\\xef\\x34\\\n\\x6a\\xac\\x37\\xec\\x70\\xa6\\xde\\xf7\\xa4\\x76\\xd6\\xf7\\x90\\x4e\\x17\\xec\\\n\\x49\\x2e\\x6f\\xd8\\xf1\\xaf\\xc1\\xec\\xfb\\x86\\x9d\\xd2\\xd6\\x47\\x85\\x8a\\\n\\x86\\x0a\\xa3\\x04\\x39\\x0a\\xc6\\x76\\x40\\x3a\\xe5\\x88\\x72\\x79\\x07\\x55\\\n\\xd7\\xb3\\xb6\\x9a\\x60\\xf6\\x89\\xc6\\x1c\\x2f\\x26\\x1c\\x19\\xaf\\x50\\x72\\\n\\xf9\\x1d\\x54\\x66\\x67\\x17\\xf4\\x8b\\x09\\x54\\x47\\x52\\x83\\x63\\x52\\x54\\\n\\xaa\\xfd\\xbb\\xee\\x3b\\xa8\\xb4\\x43\\x5e\\xb2\\xf5\\xef\\xa0\\x2a\\x70\\x4d\\\n\\xe6\\x40\\x3c\\xee\\x5c\\x87\\x7d\\x48\\xb5\\xeb\\xed\\x8b\\x28\\xa6\\x41\\x00\\\n\\xa0\\x54\\xb3\\xf8\\x96\\x36\\x66\\x4e\\x39\\x5b\\xb5\\x80\\x89\\x34\\x43\\x09\\\n\\x5e\\x25\\xd6\\xbd\\x38\\x68\\x61\\x79\\x79\\x4b\\x9b\\xc1\\x37\\x51\\x2c\\x0f\\\n\\xc0\\x90\\x7e\\xd3\\x54\\xeb\\x1f\\x4c\\x9c\\x87\\x03\\x68\\xc7\\xe8\\x98\\x42\\\n\\x20\\x05\\x66\\xdf\\xe2\\x7b\\x0c\\xcd\\xd6\\x31\\x1c\\x1f\\x21\\x19\\x1c\\xc2\\\n\\xa0\\x29\\x42\\x53\\xbf\\xa3\\x9d\\x04\\x82\\xcc\\x25\\x8e\\x11\\xf5\\x10\\xb6\\\n\\x55\\x41\\x19\\xb8\\xc2\\x62\\x79\\x86\\xd8\\x24\\x98\\x52\\x20\\x05\\xb2\\x73\\\n\\xda\\xe2\\xb9\\xf1\\xde\\x8d\\x6e\\xd6\\xce\\x71\\xdf\\x75\\x41\\x43\\x2d\\xf3\\\n\\x0a\\x38\\x08\\xc3\\xb3\\xdc\\x45\\x85\\x93\\x62\\x8e\\x50\\x8d\\xcd\\xd7\\xa9\\\n\\x92\\x68\\x71\\xac\\x9c\\x68\\xdb\\xca\\xe3\\x36\\x80\\x06\\x3a\\xb9\\x6b\\x13\\\n\\xa0\\xcd\\x1b\\xaf\\x09\\xe7\\x78\\xda\\xf6\\x6c\\xb1\\x33\\x67\\x28\\x43\\x17\\\n\\x5e\\x72\\x84\\xc5\\x29\\xb3\\xf7\\xdb\\x54\\x46\\xe1\\x97\\x44\\x79\\x76\\x21\\\n\\x5a\\x73\\x47\\xc7\\x2e\\xb4\\x7f\\x16\\x6c\\xca\\x74\\x70\\xb2\\x8e\\x2b\\xdb\\\n\\xd3\\x24\\xfc\\xe4\\x70\\x99\\xb2\\xb9\\x26\\xc8\\x22\\xf8\\x03\\xc1\\x82\\xc0\\\n\\xc1\\xe0\\xab\\x62\\x1f\\x12\\x8a\\xf0\\x66\\xc7\\xa6\\x6d\\xb9\\xf5\\x6c\\x51\\\n\\x18\\xff\\x62\\x0b\\x8e\\x10\\x55\\x24\\xd4\\x27\\x2f\\x18\\x02\\x41\\x80\\xa2\\\n\\xa8\\x1d\\x27\\x42\\x69\\x79\\x8f\\x52\\x8e\\xa5\\x67\\x51\\xdd\\xc6\\xb0\\x2d\\\n\\xce\\x95\\x66\\xc8\\x0f\\x3c\\x78\\x53\\x19\\xc5\\x52\\x29\\x8d\\x29\\xfe\\x86\\\n\\x59\\x23\\xa0\\x21\\xed\\xe5\\x9c\\x69\\x01\\x33\\xc9\\x37\\x30\\x4b\\x42\\x56\\\n\\xbb\\x4c\\x3c\\x84\\x8d\\x36\\xd8\\xf9\\x32\\x59\\xe4\\xd4\\x07\\xdb\\x18\\xed\\\n\\x68\\x13\\x61\\xd0\\x18\\xbb\\x1b\\x51\\x42\\xe7\\x77\\x02\\x01\\x24\\x40\\x02\\\n\\x2a\\x2c\\x30\\xf3\\x0b\\x0d\\xb0\\x24\\x53\\x20\\xc1\\x24\\x95\\x0a\\x80\\x77\\\n\\x7a\\x94\\xd7\\x47\\x8c\\x9a\\xd4\\x8d\\x81\\x6d\\x14\\x48\\x1b\\xe4\\x31\\x96\\\n\\x82\\x55\\x97\\x8b\\x59\\x93\\x00\\x96\\x88\\xcd\\xc0\\x1b\\x64\\xa6\\x08\\x45\\\n\\x77\\x02\\x09\\x19\\xbf\\xff\\xef\\xb0\\xc3\\x0e\\x3b\\xec\\xb0\\xc3\\x0e\\x3b\\\n\\xcc\\x85\\x03\\x0e\\xf8\\x17\\x13\\x38\\xc8\\x5d\\x25\\x6a\\x17\\x2b\\x00\\x00\\\n\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x03\\x0d\\\n\\x3c\\\n\\x3f\\x78\\x6d\\x6c\\x20\\x76\\x65\\x72\\x73\\x69\\x6f\\x6e\\x3d\\x22\\x31\\x2e\\\n\\x30\\x22\\x20\\x73\\x74\\x61\\x6e\\x64\\x61\\x6c\\x6f\\x6e\\x65\\x3d\\x22\\x6e\\\n\\x6f\\x22\\x3f\\x3e\\x0a\\x3c\\x21\\x44\\x4f\\x43\\x54\\x59\\x50\\x45\\x20\\x73\\\n\\x76\\x67\\x20\\x50\\x55\\x42\\x4c\\x49\\x43\\x20\\x22\\x2d\\x2f\\x2f\\x57\\x33\\\n\\x43\\x2f\\x2f\\x44\\x54\\x44\\x20\\x53\\x56\\x47\\x20\\x32\\x30\\x30\\x31\\x30\\\n\\x39\\x30\\x34\\x2f\\x2f\\x45\\x4e\\x22\\x0a\\x20\\x22\\x68\\x74\\x74\\x70\\x3a\\\n\\x2f\\x2f\\x77\\x77\\x77\\x2e\\x77\\x33\\x2e\\x6f\\x72\\x67\\x2f\\x54\\x52\\x2f\\\n\\x32\\x30\\x30\\x31\\x2f\\x52\\x45\\x43\\x2d\\x53\\x56\\x47\\x2d\\x32\\x30\\x30\\\n\\x31\\x30\\x39\\x30\\x34\\x2f\\x44\\x54\\x44\\x2f\\x73\\x76\\x67\\x31\\x30\\x2e\\\n\\x64\\x74\\x64\\x22\\x3e\\x0a\\x3c\\x73\\x76\\x67\\x20\\x76\\x65\\x72\\x73\\x69\\\n\\x6f\\x6e\\x3d\\x22\\x31\\x2e\\x30\\x22\\x20\\x78\\x6d\\x6c\\x6e\\x73\\x3d\\x22\\\n\\x68\\x74\\x74\\x70\\x3a\\x2f\\x2f\\x77\\x77\\x77\\x2e\\x77\\x33\\x2e\\x6f\\x72\\\n\\x67\\x2f\\x32\\x30\\x30\\x30\\x2f\\x73\\x76\\x67\\x22\\x0a\\x20\\x77\\x69\\x64\\\n\\x74\\x68\\x3d\\x22\\x32\\x35\\x30\\x2e\\x30\\x30\\x30\\x30\\x30\\x30\\x70\\x74\\\n\\x22\\x20\\x68\\x65\\x69\\x67\\x68\\x74\\x3d\\x22\\x32\\x35\\x30\\x2e\\x30\\x30\\\n\\x30\\x30\\x30\\x30\\x70\\x74\\x22\\x20\\x76\\x69\\x65\\x77\\x42\\x6f\\x78\\x3d\\\n\\x22\\x30\\x20\\x30\\x20\\x32\\x35\\x30\\x2e\\x30\\x30\\x30\\x30\\x30\\x30\\x20\\\n\\x32\\x35\\x30\\x2e\\x30\\x30\\x30\\x30\\x30\\x30\\x22\\x0a\\x20\\x70\\x72\\x65\\\n\\x73\\x65\\x72\\x76\\x65\\x41\\x73\\x70\\x65\\x63\\x74\\x52\\x61\\x74\\x69\\x6f\\\n\\x3d\\x22\\x78\\x4d\\x69\\x64\\x59\\x4d\\x69\\x64\\x20\\x6d\\x65\\x65\\x74\\x22\\\n\\x3e\\x0a\\x0a\\x3c\\x67\\x20\\x74\\x72\\x61\\x6e\\x73\\x66\\x6f\\x72\\x6d\\x3d\\\n\\x22\\x74\\x72\\x61\\x6e\\x73\\x6c\\x61\\x74\\x65\\x28\\x30\\x2e\\x30\\x30\\x30\\\n\\x30\\x30\\x30\\x2c\\x32\\x35\\x30\\x2e\\x30\\x30\\x30\\x30\\x30\\x30\\x29\\x20\\\n\\x73\\x63\\x61\\x6c\\x65\\x28\\x30\\x2e\\x31\\x30\\x30\\x30\\x30\\x30\\x2c\\x2d\\\n\\x30\\x2e\\x31\\x30\\x30\\x30\\x30\\x30\\x29\\x22\\x0a\\x66\\x69\\x6c\\x6c\\x3d\\\n\\x22\\x23\\x30\\x30\\x30\\x30\\x30\\x30\\x22\\x20\\x73\\x74\\x72\\x6f\\x6b\\x65\\\n\\x3d\\x22\\x6e\\x6f\\x6e\\x65\\x22\\x3e\\x0a\\x3c\\x70\\x61\\x74\\x68\\x20\\x64\\\n\\x3d\\x22\\x4d\\x36\\x38\\x32\\x20\\x32\\x32\\x35\\x33\\x20\\x6c\\x33\\x20\\x2d\\\n\\x32\\x34\\x37\\x20\\x36\\x30\\x20\\x2d\\x32\\x31\\x20\\x63\\x32\\x34\\x38\\x20\\\n\\x2d\\x38\\x36\\x20\\x34\\x32\\x34\\x20\\x2d\\x32\\x36\\x30\\x20\\x35\\x30\\x37\\\n\\x20\\x2d\\x35\\x30\\x31\\x20\\x33\\x36\\x20\\x2d\\x31\\x30\\x35\\x20\\x34\\x38\\\n\\x0a\\x2d\\x32\\x35\\x30\\x20\\x32\\x39\\x20\\x2d\\x33\\x35\\x39\\x20\\x2d\\x33\\\n\\x37\\x20\\x2d\\x32\\x30\\x39\\x20\\x2d\\x31\\x37\\x31\\x20\\x2d\\x34\\x31\\x31\\\n\\x20\\x2d\\x33\\x34\\x36\\x20\\x2d\\x35\\x32\\x30\\x20\\x2d\\x36\\x30\\x20\\x2d\\\n\\x33\\x38\\x20\\x2d\\x39\\x37\\x20\\x2d\\x35\\x34\\x20\\x2d\\x32\\x33\\x32\\x20\\\n\\x2d\\x31\\x30\\x36\\x20\\x2d\\x32\\x33\\x20\\x2d\\x39\\x0a\\x2d\\x32\\x33\\x20\\\n\\x2d\\x39\\x20\\x2d\\x32\\x33\\x20\\x2d\\x32\\x35\\x34\\x20\\x6c\\x30\\x20\\x2d\\\n\\x32\\x34\\x35\\x20\\x33\\x37\\x39\\x20\\x30\\x20\\x33\\x38\\x30\\x20\\x30\\x20\\\n\\x35\\x38\\x20\\x34\\x38\\x20\\x63\\x31\\x30\\x32\\x20\\x38\\x36\\x20\\x32\\x34\\\n\\x39\\x20\\x32\\x34\\x37\\x20\\x33\\x31\\x37\\x20\\x33\\x34\\x39\\x20\\x31\\x30\\\n\\x33\\x20\\x31\\x35\\x36\\x0a\\x31\\x37\\x37\\x20\\x33\\x33\\x30\\x20\\x32\\x32\\\n\\x32\\x20\\x35\\x32\\x34\\x20\\x32\\x32\\x20\\x31\\x30\\x30\\x20\\x33\\x31\\x20\\\n\\x34\\x35\\x31\\x20\\x31\\x34\\x20\\x35\\x36\\x39\\x20\\x2d\\x33\\x30\\x20\\x32\\\n\\x30\\x36\\x20\\x2d\\x31\\x31\\x38\\x20\\x34\\x33\\x36\\x20\\x2d\\x32\\x33\\x34\\\n\\x20\\x36\\x30\\x39\\x20\\x2d\\x37\\x30\\x20\\x31\\x30\\x36\\x20\\x2d\\x32\\x33\\\n\\x39\\x0a\\x32\\x39\\x30\\x20\\x2d\\x33\\x32\\x39\\x20\\x33\\x36\\x30\\x20\\x6c\\\n\\x2d\\x35\\x34\\x20\\x34\\x31\\x20\\x2d\\x33\\x37\\x37\\x20\\x30\\x20\\x2d\\x33\\\n\\x37\\x36\\x20\\x30\\x20\\x32\\x20\\x2d\\x32\\x34\\x37\\x7a\\x22\\x2f\\x3e\\x0a\\\n\\x3c\\x2f\\x67\\x3e\\x0a\\x3c\\x2f\\x73\\x76\\x67\\x3e\\x0a\\\n\\x00\\x00\\x00\\xc9\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x10\\x00\\x00\\x00\\x10\\x08\\x06\\x00\\x00\\x00\\x1f\\xf3\\xff\\x61\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x7e\\x49\\x44\\x41\\x54\\x38\\x8d\\xcd\\xd1\\x31\\x0e\\\n\\x82\\x50\\x10\\x84\\xe1\\x4f\\x0b\\x12\\x0e\\x03\\xa1\\x90\\x8a\\xd6\\x86\\x44\\\n\\xce\\x44\\x38\\x8a\\x67\\xe0\\x0c\\x9e\\xc0\\x52\\x7b\\x3c\\x84\\x09\\x16\\x58\\\n\\x18\\x83\\x8f\\xe4\\x51\\xe0\\x24\\x5b\\xec\\x6e\\xe6\\xcf\\x66\\x96\\x7f\\x54\\\n\\x85\\x73\\xac\\xb9\\xc0\\x03\\x75\\x8c\\x39\\xc3\\x80\\x26\\xc6\\xbc\\xc3\\x15\\\n\\xe3\\x4c\\x3d\\x71\\x47\\x87\\x34\\x04\\xc9\\xdf\\x17\\x9c\\xbe\\xe6\\x09\\x4a\\\n\\xf4\\xb8\\x2c\\x41\\x0e\\xa6\\x0c\\x8e\\x3f\\xf6\\x3d\\xda\\x10\\x80\\xf0\\x17\\\n\\x4a\\xdc\\x96\\x00\\x21\\x25\\xa6\\x4c\\x56\\x69\\xfc\\x6c\\xf6\\x6b\\x69\\xdb\\\n\\x03\\xb6\\xd7\\x0b\\x26\\xa7\\x15\\x72\\xfb\\xba\\xe1\\x95\\x00\\x00\\x00\\x00\\\n\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x01\\xf4\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x20\\x00\\x00\\x00\\x20\\x08\\x06\\x00\\x00\\x00\\x73\\x7a\\x7a\\xf4\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc3\\x00\\x00\\x0e\\xc3\\x01\\xc7\\x6f\\\n\\xa8\\x64\\x00\\x00\\x01\\x89\\x49\\x44\\x41\\x54\\x58\\x47\\xe5\\x95\\xbd\\x4a\\\n\\xc5\\x40\\x10\\x85\\x57\\x5b\\x41\\xc1\\x42\\x51\\x41\\xb1\\x12\\x5b\\x3b\\x5f\\\n\\xc0\\x4e\\x9f\\x42\\xf0\\x31\\xc4\\x77\\xf0\\x07\\xdf\\xe1\\x22\\xd6\\x3e\\x80\\\n\\x8d\\xad\\x95\\x88\\xa0\\xa0\\x9d\\x88\\x62\\x61\\xa7\\xe7\\x64\\x66\\x2f\\x43\\\n\\x88\\x9b\\x9d\\xbd\\x89\\x08\\xf9\\xe0\\x30\\x93\\x6c\\x7e\\x76\\xe7\\x64\\x36\\\n\\x61\\xf0\\x4c\\x69\\xf4\\xb2\\x0a\\xed\\x48\\x3a\\xe6\\x0a\\x7a\\x92\\xb4\\x7f\\\n\\xf6\\xa1\\xef\\x9a\\x78\\xee\\x4f\\xe0\\xea\\x2f\\xa1\\xfa\\x04\\x58\\x01\\x8e\\\n\\xf5\\x4e\\xd3\\xea\\xa3\\xdc\\x55\\x98\\xd6\\x58\\xca\\x1d\\x74\\x2b\\x69\\x19\\\n\\x25\\x13\\xd8\\xd4\\x48\\xce\\xa0\\x73\\x49\\x2b\\x76\\x21\\x97\\x0d\\xde\\x09\\\n\\xf0\\xe1\\x07\\x92\\x56\\x7c\\x42\\x5f\\x92\\x56\\xec\\x41\\xf5\\xee\\x48\\xe2\\\n\\x9d\\x00\\x1f\\x3e\\x23\\x69\\x78\\x84\\xf8\\xe1\\x51\\xf7\\x3c\\x51\\x82\\x77\\\n\\x02\\x6b\\x1a\\xc9\\x31\\xc4\\xbe\\xa7\\x4e\\x78\\x42\\xd9\\xd0\\xd8\\x39\\x2c\\\n\\xff\\x1b\\xd4\\xf4\\xc5\\xdb\\xce\\xf8\\x80\\x7a\\x69\\x47\\xfb\\x92\\x67\\xc8\\\n\\xbe\\x84\\x39\\x2b\\x11\\xc7\\xb3\\xdb\\xd1\\x63\\xc1\\x92\\x46\\x72\\x0a\\xd9\\\n\\x6d\\x97\\x39\\x2d\\x89\\x58\\xab\\x92\\xe4\\xfe\\x0b\\xb8\\xc2\\x1b\\x68\\xa1\\\n\\x3a\\x0a\\xe1\\x10\\x7a\\x91\\x74\\xcc\\x32\\x74\\x24\\x69\\x78\\x85\\xb6\\x20\\\n\\x3b\\xc9\\x89\\xb0\\xe5\\xcf\\x55\\x96\\x0d\\xb9\\x16\\xcc\\x6b\\xf4\\xb0\\xa8\\\n\\x31\\x49\\x8e\\x05\\x2c\\xff\\x35\\xb4\\x52\\x1d\\x35\\x97\\x3f\\x62\\x6d\\xe0\\\n\\x35\\xdb\\xd0\\xc4\\x36\\xd8\\xf2\\xbf\\x43\\xa9\\x16\\xe3\\x18\\xaf\\xc9\\xb6\\\n\\x21\\xc7\\x82\\x59\\x8d\\x84\\xfb\\x7e\\x6a\\x45\\x1c\\x63\\x87\\x44\\xe6\\x34\\\n\\x16\\xc3\\x15\\x3d\\x40\\xd9\\x2b\\x02\\xb6\\x62\\xbc\\x37\\x55\\xb1\\xd6\\x0a\\\n\\x70\\xef\\x5f\\x97\\xb4\\x08\\xde\\x9b\\xfc\\x39\\x79\\x36\\xa2\\x0b\\x88\\x3f\\\n\\x9e\\x36\\x78\\xcd\\x48\\xd2\\x76\\xda\\xba\\x80\\xe5\\x8b\\x2b\\xe0\\x83\\x73\\\n\\xbf\\xe8\\xd2\\xfb\\x06\\xc8\\x6f\\x16\\xd8\\x12\\x76\\x85\\xcb\\x0a\\xdb\\x4a\\\n\\x5d\\xa9\\xb1\\x85\\x3d\\x5d\\xd0\\x0b\\xff\\xd6\\x82\\xa1\\x10\\xc2\\x0f\\x6f\\\n\\x35\\x79\\x22\\x70\\x77\\xe8\\xe3\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\\n\\x42\\x60\\x82\\\n\\x00\\x00\\x00\\xaf\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x10\\x00\\x00\\x00\\x10\\x08\\x06\\x00\\x00\\x00\\x1f\\xf3\\xff\\x61\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x64\\x49\\x44\\x41\\x54\\x38\\x8d\\xed\\x92\\x31\\x0a\\\n\\x80\\x30\\x0c\\x45\\x1f\\x1e\\xa1\\xe7\\x71\\x10\\xaf\\xa6\\x78\\x57\\x77\\x97\\\n\\x74\\x89\\x83\\x16\\x44\\xd3\\x92\\x16\\x04\\x07\\x1f\\x64\\x09\\xc9\\x23\\x81\\\n\\x0f\\x5f\\x63\\x01\\x04\\xd0\\x5b\\x6d\\xc0\\xe0\\x11\\x08\\x10\\x8c\\xbe\\x02\\\n\\xab\\x47\\xa2\\x85\\x7e\\x7f\\x4a\\xc6\\x56\\xc1\\xf5\\x9d\\x6a\\x41\\x76\\xa6\\\n\\x73\\x2c\\x14\\xf9\\x05\\x4f\\x41\\xc4\\x0e\\x52\\x22\\x70\\x84\\x2d\\xcb\\x8c\\\n\\x1d\\xe5\\x54\\x02\\x4c\\x8d\\xc7\\xbe\\xc4\\x0e\\x62\\x40\\x1f\\x4c\\x3d\\x90\\\n\\xe3\\x21\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x1c\\x03\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x01\\xd5\\x00\\x00\\x00\\x9a\\x08\\x06\\x00\\x00\\x00\\xff\\xc0\\xd2\\xfa\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc3\\x00\\x00\\x0e\\xc3\\x01\\xc7\\x6f\\\n\\xa8\\x64\\x00\\x00\\x1b\\x98\\x49\\x44\\x41\\x54\\x78\\x5e\\xed\\xdd\\x6d\\x6c\\\n\\x1c\\x67\\x81\\x07\\xf0\\xe7\\x99\\xb1\\x9d\\x36\\x29\\xd4\\xb9\\x96\\x70\\xa0\\\n\\x56\\x75\\x10\\x25\\x95\\x40\\xba\\xa4\\xe9\\x11\\xb5\\xa1\\x57\\x9b\\xa3\\x92\\\n\\x1d\\x54\\x70\\x3e\\x51\\xa9\\x1f\\xba\\x4e\\x48\\xae\\xa7\\x4a\\x4d\\x2d\\x71\\\n\\x2f\\x48\\x85\\x24\\x27\\xa4\\x7e\\x38\\x74\\x49\\xf8\\x84\\x92\\x4b\\xbc\\xfd\\\n\\x80\\xc4\\xdd\\xe9\\x52\\x97\\x4a\\x89\\x05\\x3d\\xec\\xa3\\x6f\\x0a\\xd0\\xd8\\\n\\x48\\x45\\x70\\x07\\x22\\xae\\x82\\xca\\xd1\\x2b\\xad\\x8b\\x2e\\x6f\\xb6\\x77\\\n\\x9e\\x7b\\xfe\\xeb\\x79\\x9c\\xf1\\x74\\x76\\x77\\x9e\\xdd\\xd9\\xd9\\x99\\xd9\\\n\\xff\\x4f\\x79\\xb2\\x6f\\xde\\x9d\\xdd\\x9d\\xdd\\xf9\\xef\\xf3\\x32\\xcf\\x08\\\n\\x22\\x22\\x22\\x22\\x22\\x22\\x22\\x22\\x22\\x22\\x2a\\x22\\xe9\\x9f\\x12\\xa5\\\n\\x66\\x74\\x74\\x74\\xc0\\x3f\\x4b\\x94\\xba\\xc9\\xc9\\xc9\\x79\\xff\\x2c\\x51\\\n\\xe2\\x18\\xaa\\x94\\x2a\\x04\\xaa\\x52\\xea\\x82\\x7f\\x91\\x28\\x75\\xae\\xeb\\\n\\x0e\\x9c\\x3e\\x7d\\xfa\\x0d\\xff\\x22\\x51\\xa2\\x18\\xaa\\x94\\xaa\\x60\\xa8\\\n\\x6e\\xda\\xb4\\xa9\\x7a\\x1d\\x51\\x1a\\xde\\x7a\\xeb\\xad\\xea\\x29\\x43\\x95\\\n\\xda\\x89\\xa1\\x4a\\xa9\\x32\\xa1\\x8a\\x40\\x3d\\x7e\\xfc\\xb8\\x7f\\x2d\\x51\\\n\\xfb\\xed\\xdf\\xbf\\xbf\\x1a\\xac\\x0c\\x55\\x6a\\x27\\xc7\\x3f\\x25\\x22\\x22\\\n\\xa2\\x16\\x31\\x54\\x89\\x88\\x88\\x12\\xc2\\x50\\x25\\x22\\x22\\x4a\\x08\\x43\\\n\\x95\\x88\\x88\\x28\\x21\\x0c\\x55\\x22\\x22\\xa2\\x84\\x30\\x54\\x89\\x88\\x88\\\n\\x12\\xc2\\x50\\x25\\x22\\x22\\x4a\\x08\\x43\\x95\\x88\\x88\\x28\\x21\\x0c\\x55\\\n\\x22\\x22\\xa2\\x84\\x30\\x54\\x89\\x88\\x88\\x12\\xc2\\x50\\xad\\x6d\\x50\\x97\\\n\\x23\\xba\\x60\\x9e\\xda\\x09\\x5c\\x41\\x44\\x54\\x40\\xfd\\xba\\x1c\\xd4\\x65\\\n\\x5a\\x17\\x6c\\xef\\x94\\x7f\\x8a\\xcb\\x25\\x5d\\xc8\\x02\\x43\\xf5\\x3a\\x7c\\\n\\xb0\\xf0\\x01\\x42\\x80\\xbe\\xab\\x0b\\x3e\\x50\\x4f\\xea\\xc2\\xc3\\x94\\x11\\\n\\x51\\x51\\x1d\\xd0\\x05\\x01\\x7a\\xa8\\x7a\\x49\\x88\\x19\\x5d\\x26\\x57\\xce\\\n\\x56\\x2b\\x16\\xd8\\x1e\\xe2\\x76\\x6e\\x07\\x63\\x62\\xa8\\x5e\\x77\\x54\\x17\\\n\\x7c\\x80\\xf0\\x41\\xc2\\x07\\xeb\\x98\\x2e\\x44\\x44\\x45\\x85\\x4a\\x04\\xb6\\\n\\x7b\\xa8\\x50\\x0c\\xf9\\x65\\x4c\\x97\\xdd\\xba\\x6c\\xd6\\xe5\\xb0\\x2e\\x80\\\n\\x40\\x65\\x6b\\x5d\\x4c\\x0c\\xd5\\xeb\\xf0\\x4b\\x6d\\xa3\\x2e\\xf8\\x30\\xe1\\\n\\x43\\x85\\x5a\\x2a\\x11\\x51\\x51\\x3d\\xea\\x9f\\x02\\x2a\\x12\\x61\\xd8\\x26\\\n\\x9a\\xeb\\x51\\xd9\\xd8\\xba\\x72\\x96\\xea\\x61\\xa8\\x5e\\x37\\xaf\\xcb\\xc2\\\n\\xca\\x59\\x22\\x22\\xd2\\x9e\\xf3\\x4f\\x81\\xa1\\x1a\\x03\\x43\\x95\\x88\\xa8\\\n\\x3b\\xa1\\xa9\\x17\\xdd\\x5c\\xa6\\x99\\x37\\x0a\\x2a\\x1b\\x64\\x81\\xa1\\x4a\\\n\\x44\\xd4\\x9d\\x10\\x98\\xe8\\xe6\\x32\\x83\\x94\\xa2\\x04\\x07\\x28\\xcd\\xf9\\\n\\xa7\\x54\\x07\\x43\\x95\\x88\\x88\\x6a\\xc1\\xe8\\x60\\x28\\xeb\\xc2\\x50\\x8d\\\n\\x81\\xa1\\x4a\\x44\\x44\\x61\\x18\\x11\\xfc\\xac\\x2e\\xa8\\xa9\\x62\\xb0\\xd2\\\n\\xb8\\x2e\\x14\\x03\\x43\\x95\\x88\\x88\\xc0\\xec\\xa7\\x3f\\xab\\x0b\\xf6\\xd5\\\n\\x47\\xb0\\xa2\\xdf\\x15\\xbb\\xda\\x70\\x10\\x67\\x4c\\x0c\\x55\\x22\\x22\\x02\\\n\\xec\\x36\\x83\\x60\\x35\\xa3\\x7c\\x71\\x19\\xcd\\xbf\\x9c\\x55\\xc9\\x02\\x43\\\n\\x95\\x88\\x88\\x00\\xe1\\x29\\xfd\\x82\\xfd\\xf5\\xd1\\xe4\\x6b\\x26\\x7e\\xc0\\\n\\xac\\x4a\\xa8\\xb9\\x52\\x03\\x0c\\x55\\xca\\x8d\\x73\\xe7\\xce\\x89\\x1f\\xfe\\\n\\xf0\\x87\\xab\\xe5\\xf5\\xd7\\x5f\\xf7\\x6f\\xc9\\xa6\\x4b\\x97\\x2e\\xad\\x79\\\n\\xbe\\x28\\xb8\\x8e\\x28\\x07\\x30\\x32\\x18\\xb3\\x2d\\x61\\x22\\x1c\\xe0\\xac\\\n\\x4a\\x31\\x31\\x54\\x29\\x37\\x9e\\x7f\\xfe\\x79\\xf1\\xad\\x6f\\x7d\\x6b\\xb5\\\n\\x20\\xa4\\xb2\\x0c\\x01\\x1a\\x7c\\xbe\\x28\\x17\\x2e\\xe0\\x07\\x3f\\x51\\x6e\\\n\\x60\\x90\\x92\\x99\\x55\\x69\\x54\\x17\\xd6\\x56\\x1b\\x60\\xa8\\x12\\x75\\xa9\\\n\\xb7\\xde\\x7a\\x4b\\x3c\\xf5\\xd4\\x53\\xe2\\x91\\x47\\x1e\\x11\\xe3\\xe3\\xe3\\\n\\xd5\\x96\\x00\\xa2\\x08\\x6f\\xf8\\xa7\\x10\\xdc\\x6f\\x95\\x22\\x30\\x54\\x89\\\n\\xba\\xd4\\x77\\xbf\\xfb\\xdd\\x6a\\x13\\x3a\\x6a\\xd4\\xa8\\x41\\xa3\\x26\\xcd\\\n\\xe6\\x69\\x8a\\x70\\xb3\\x7f\\x4a\\x31\\x30\\x54\\x89\\xba\\x54\\xb8\\x4f\\xda\\\n\\x84\\x2b\\x75\\x05\\x34\\xe3\\xe2\\xf0\\x96\\xd8\\x75\\x06\\xcd\\xba\\xf5\\x98\\\n\\xd1\\xc0\\xe8\\x67\\xe5\\x04\\x10\\x0d\\x30\\x54\\x89\\xba\\xd4\\xa6\\x4d\\x9b\\\n\\xfc\\x73\\xd7\\x45\\x5d\\x47\\x85\\x84\\xdd\\x65\\x50\\x10\\xae\\x66\\xd6\\xa4\\\n\\x28\\xb8\\xcd\\x34\\xf9\\x3e\\xe3\\x9f\\x52\\x1d\\x0c\\xd5\\xda\\x82\\x7d\\x07\\\n\\xec\\x9c\\xa7\\xc2\\x79\\xe2\\x89\\x27\\xc4\\xe6\\xcd\\xd8\\x73\\x42\\x88\\x0d\\\n\\x1b\\x36\\x88\\xbd\\x7b\\xf7\\x32\\x54\\xbb\\x07\\x06\\x1f\\x99\\x09\\x1d\\x10\\\n\\xae\\x51\\x7d\\xa5\\x08\\x54\\x8c\\x00\\x06\\xfc\\x7d\\xbd\\x39\\x82\\xc9\\xc7\\\n\\x50\\x5d\\xeb\\x88\\x2e\\x98\\x4d\\x04\\x6d\\x60\\x38\\x35\\xd0\\x3c\\x82\\xeb\\\n\\xd0\\x5c\\x82\\xc2\\x43\\x20\\x51\\xee\\x21\\x40\\x8f\\x1c\\x39\\x22\\x26\\x27\\\n\\x27\\xc5\\x77\\xbe\\xf3\\x1d\\xf1\\xd0\\x43\\x0f\\xf9\\xb7\\x50\\x17\\x40\\xa0\\\n\\x62\\xa6\\x24\\x73\\x14\\x1a\\x6c\\xdf\\x30\\x2d\\x21\\x82\\xd3\\xec\\x97\\x6a\\\n\\x02\\x15\\x47\\xb2\\xc1\\xdf\\x52\\x0c\\x0c\\xd5\\xb5\\x7e\\xa6\\x0b\\x8e\\x1f\\\n\\x88\\x66\\x0e\\x73\\x48\\x24\\x53\\x70\\xdd\\x7f\\xfa\\x85\\x53\\x76\\x11\\x51\\\n\\xde\\xa1\\x7f\\x14\\x4d\\x15\\x98\\x8a\\x70\\x52\\x17\\xd4\\x56\\x71\\xe0\\x72\\\n\\xd4\\x5c\\x71\\x1b\\xb6\\x7b\\x1b\\x75\\xc1\\x91\\x6c\\x28\\x26\\xcc\\x9c\\x41\\\n\\x05\\x53\\x7a\\xf9\\xc1\\xad\\xa2\\xd2\\xa3\\xbf\\x20\\xaa\\xc9\\x66\\x6b\\xb9\\\n\\x20\\xa4\\x5a\\x28\\xdf\\x3f\\x65\\xf6\\x4f\\x4b\\xcc\\xe8\\xe8\\xe8\\x80\\x52\\\n\\xea\\x02\\x6a\\x49\\xc7\\x8f\\x1f\\xf7\\xaf\\x8d\\x07\\xbb\\x7f\\x04\\x07\\xd7\\\n\\x7c\\xf6\\xb3\\x9f\\xad\\x36\\x61\\x66\\x15\\x76\\x59\\xd9\\xbf\\x7f\\xbf\\x7f\\\n\\x69\\xc5\\x37\\xbe\\xf1\\x0d\\xf1\\xa9\\x4f\\x7d\\xca\\xbf\\x44\\x69\\xc2\\xba\\\n\\xc0\\x3a\\x71\\x5d\\x77\\xe0\\xf4\\xe9\\xd3\\xc1\\xdd\\x44\\x88\\x12\\xc3\\x9a\\\n\\x6a\\x41\\x94\\xa6\\x87\\x07\\xf6\\xbc\\x32\\x72\\x64\\xcf\\x4b\\x23\\xef\\x3a\\\n\\xa2\\x67\\xd6\\x71\\xc5\\xb3\\x8e\\x2b\\x27\\x9a\\x2b\\xfa\\xbe\\x8e\\x9c\\xc6\\\n\\x63\\xed\\x79\\x79\\xd7\\x04\\x1e\\xdb\\x5f\\x4c\\x2e\\x60\\xc3\\x69\\x4a\\x3b\\\n\\x77\\x11\\x49\\x6b\\x39\\x41\\x9d\\x58\\x66\\x33\\xf0\\xdc\\x82\\xcf\\xd5\\x46\\\n\\xf8\\xbe\\x59\\x7e\\x9d\\x44\\x61\\xac\\xa9\\x16\\xc0\\xde\\x57\\x76\\x1d\\x50\\\n\\x9e\\x3a\\xa4\\xd7\\x66\\xfb\\x06\\x54\\x39\\xf2\\xd0\\xa9\\x7b\\xcf\\xa0\\x39\\\n\\xa8\\x25\\xed\\xaa\\xa9\\xe2\\x7a\\xcc\\xb0\\x84\\x09\\x0c\\xc2\\x1b\\x61\\x0c\\\n\\xc6\\x41\\xed\\x10\\x7d\\x86\\xad\\x0e\\xc4\\xc1\\x46\\x1e\\x33\\x3b\\x45\\x4d\\\n\\x39\\x88\\xc7\\xc6\\x72\\x1e\\x7e\\xf8\\xe1\\xea\\x79\\xfc\\x6d\\xab\\x35\\x55\\\n\\x2c\\xc3\\xbc\\x2e\\xec\\xee\\x12\\x5e\\x26\\x06\\x18\\xe1\\xf5\\xe1\\xbd\\x40\\\n\\xb1\\x81\\xc7\\x0d\\xce\\x4a\\x85\\xc7\\xfa\\xea\\x57\\xbf\\xea\\x5f\\x8a\\x16\\\n\\xbe\\xcf\\x8e\\x1d\\x3b\\x56\\xfb\\x62\\xcd\\x7b\\x83\\xe7\\x8a\\xf3\\x41\\x78\\\n\\x6c\\xb3\\x0e\\xa2\\x5e\\x7f\\xf0\\x75\\x86\\x77\\xf5\\x01\\xbc\\x46\\x2c\\x0b\\\n\\xaf\\xb1\\xd9\\x75\\x98\\x87\\x9a\\x6a\\x69\\x7a\\xb0\\x5f\\xf4\\xf5\\x0e\\x88\\\n\\x8a\\xbb\\x32\\x6e\\x43\\x8a\\x79\\xb1\\x7c\\x75\\xae\\x3c\\x34\\xc3\\x2e\\xa7\\\n\\x06\\xde\\xf7\\xde\\x35\\x45\\x2e\\x08\\x77\\x79\\xbe\\xbc\\xf3\\x07\\x4d\\xef\\\n\\x3a\\x14\\x19\\xaa\\x5f\\xfe\\xc9\\xf0\\xa0\\xbe\\x49\\x3f\\x31\\xc9\\x51\\xaf\\\n\\x19\\xe7\\x2d\\x8b\\x3b\\x84\\xa7\\xd2\\x39\\x8a\\x44\\x02\\xc1\\x9a\\x74\\xa8\\\n\\x62\\xc4\\x2a\\x26\\x2d\\x88\\x33\\x1b\\x10\\x96\\x89\\xc0\\xb3\\x0d\\x1f\\x03\\\n\\x81\\x71\\xf2\\xe4\\x49\\xff\\x52\\x7d\\x66\\x39\\xad\\x84\\x2a\\x5e\\x93\\xcd\\\n\\x84\\x0c\\x78\\x7d\\xf8\\x91\\x11\\xf7\\xf1\\x31\\xf9\\x03\\x8a\\x11\\x67\\x9d\\\n\\x84\\xef\\x83\\xd7\\x88\\x65\\xe2\\x7d\\xc1\\xfb\\x13\\x07\\x82\\x15\\xeb\\xcd\\\n\\xc0\\x3a\\xc5\\xeb\\x0c\\x07\\x71\\x14\\x3c\\x47\\xdc\\x17\\x01\\x6b\\x2b\\xcb\\\n\\xa1\\x5a\\x7a\\x71\\x78\\xd0\\x75\\xe5\\x41\\xa5\\xaa\\xfd\\x99\\xef\\x23\\xa5\\\n\\x98\\xa9\\x2c\\x8b\\x63\\xe5\\xbf\\x38\\x8b\\xbe\\x4f\\x0a\\x68\\xf4\\xde\\x35\\\n\\x69\\x5e\\xbf\\xeb\\x33\\xde\\xa2\\x77\\xb8\\x3c\\x34\\x65\\x06\\x73\\xc5\\xb2\\\n\\x26\\x54\\x11\\xa6\\xd2\\x75\\x8e\\x08\\xc5\\xd1\\xad\\x79\\xa0\\x2a\\x4a\\x78\\\n\\x4b\\xfe\\x85\\xb4\\x48\\x31\\x7e\\xea\\xbe\\xb3\\x66\\x54\\xa0\\xb5\\x24\\x43\\\n\\x15\\x1b\\x56\\x6c\\x24\\x6d\\x27\\x2c\\x40\\xe0\\xa1\\xd8\\x08\\x87\\x49\\x1c\\\n\\x08\\x9c\\x60\\xad\\x0e\\xe2\\x86\\x6a\\x33\\xcb\\x33\\x10\\x72\\x58\\x76\\x23\\\n\\xe1\\x65\\x34\\x1b\\xaa\\x58\\x07\\x51\\xb5\\xcb\\x7a\\x4c\\xb0\\xda\\xfc\\x50\\\n\\x09\\x6a\\xa6\\x6f\\x3a\\x8b\\xa1\\x8a\\xae\\x15\\x77\\x9d\\x9c\\x88\\x1f\\x08\\\n\\xb2\\xdc\\xcc\\x86\\xbe\\x88\\x50\\x33\\x75\\xd6\\xdd\\x78\\x50\\xe7\\x55\\x3b\\\n\\x07\\x52\\xcd\\x7b\\x15\\x31\\x6e\\xf3\\x63\\x66\\x35\\x54\\xf7\\xff\\x74\\x64\\\n\\x54\\x49\\x89\\x21\\xd5\\x94\\x13\\x95\\x6b\\x4a\\x27\\xab\\x7f\\x21\\x3d\\x0b\\\n\\xde\\xe2\\x95\\xcd\\xcd\\x36\\x47\\x25\\x19\\xaa\\x61\\x78\\x4c\\x6c\\x68\\x71\\\n\\x0a\\x08\\xdb\\x5a\\x35\\x58\\x9b\\x8d\\x72\\x38\\x48\\x0c\\x34\\x69\\x22\\xd8\\\n\\x83\\xcb\\x43\\xa9\\x57\\xe3\\x8a\\xb3\\x5c\\x04\\x31\\x6a\\x6e\\x61\\xb8\\x9f\\\n\\x79\\x7d\\xa8\\xbd\\x62\\x59\\x78\\x3f\\xa2\\x96\\x17\\x67\\x39\\xe1\\xd7\\x15\\\n\\x67\\x9d\\x84\\xef\\x83\\xf7\\x20\\x58\\x93\\xc6\\x32\\xd1\\x54\\x8b\\xeb\\xa1\\\n\\xde\\x3a\\x40\\xb0\\x86\\x6b\\xb7\\xc1\\xfb\\x07\\x5f\\x63\\x58\\x9c\\xe7\\x1a\\\n\\x16\\x27\\x54\\xf7\\xfd\\xf8\\xc1\\xad\\x15\\xb7\\x95\\xe6\\x43\\x0b\\x8b\\xba\\\n\\x78\\xf2\\xa0\\xfe\\xdf\\x76\\xcc\\xc2\\xbc\\xe8\\x55\\x87\\x85\\xeb\\x5f\\xea\\\n\\x52\\xf2\\xaa\\x3c\\xa0\\x37\\x7f\\xe9\\xac\\x2b\\x8b\\xca\\x44\\x35\\x54\\x4b\\\n\\xb3\\xc3\\x03\\xbd\\x9e\\x83\\xfd\\x2f\\x73\\x35\\x20\\xa5\\x9b\\xb5\\x5a\\x4b\\\n\\x5d\\xef\\x2e\\x8b\\x4f\\xdc\\xf4\\x47\\x71\\xb9\\xd2\\x23\\xfe\\xfb\\xff\\x3e\\\n\\xe8\\x5f\\x1b\\x93\\xd2\\x1f\\xb0\\xcf\\x34\\x57\\x5b\\x6d\\x47\\xa8\\xe2\\xb1\\\n\\x6a\\x35\\x7b\\x62\\x23\\x8a\\x10\\x08\\xd7\\x18\\xe3\\x2e\\x1f\\xf7\\x0f\\x37\\\n\\xe1\\x02\\x6a\\xba\\x08\\x05\\x13\\x1e\\x41\\x08\\x0a\\x2c\\x33\\xaa\\xd9\\x36\\\n\\x4e\\xd8\\x99\\x8d\\xbf\\x51\\xef\\xf5\\x41\\x38\\xe8\\x00\\xc1\\x84\\x7d\\x50\\\n\\xeb\\x09\\xdf\\x2f\\xce\\x7b\\x12\\xb5\\x2c\\xc0\\xf2\\xd0\\x1f\\x8b\\xc7\\x08\\\n\\xc3\\x6b\\x41\\x6d\\xb4\\x5e\\x13\\x3d\\x5e\\x1b\\x5e\\x63\\xad\\xfb\\x63\\xdd\\\n\\x07\\xdf\\x13\\xb0\\xad\\xad\\xd6\\x0b\\xd5\\x7d\\xb3\\x18\\x97\\x20\\x0f\\xc9\\\n\\xa6\\x47\\xcc\\x5b\\xd2\\x69\\x50\\x59\\x6c\\xe1\\x47\\xb1\\xde\\x72\\xbb\\x7d\\\n\\xfa\\xbf\\x35\\x6d\\x8d\\xdd\\x43\\x2d\\xeb\\xed\\xdf\\xb2\\x7f\\x21\\x25\\x9e\\\n\\xa3\\x36\\x97\\xef\\x6d\\xdc\\x42\\x50\\x1d\\xfd\\xdb\\xb3\\x2c\\x31\\xb9\\x01\\\n\\x03\\x35\\x47\\x54\\xc5\\x3f\\xd3\\x84\\x2d\\x1b\\xde\\x13\\x4f\\xdf\\x75\\x5e\\\n\\x3c\\x7e\\xc7\\x2f\\xc5\\xdf\\x7c\\xec\\x75\\xf1\\xf5\\x3b\\xe7\\xaa\\x21\\x1b\\\n\\x97\\x72\\xc4\\x17\\xfd\\xb3\\x0d\\xe9\\x6d\\x46\\x5b\\xfb\\x7b\\xb1\\x11\\xae\\\n\\xb7\\x71\\x35\\x81\\x84\\x00\\x0c\\xc2\\xc6\\x35\\x4e\\x1f\\x60\\x54\\x80\\xa0\\\n\\xd9\\x12\\xa1\\x1a\\x15\\xa8\\x80\\x65\\xe1\\x39\\xd5\\xba\\xbd\\x9e\\xa8\\x9a\\\n\\x67\\xbd\\x40\\x05\\x13\\xf0\\x41\\xb5\\x6a\\x78\\xed\\x60\\x02\\x3c\\x2a\\x10\\\n\\x01\\xd7\\x23\\x70\\xf1\\x77\\x51\\x50\\xdb\\xc7\\xfb\\x55\\xef\\xfe\\x51\\xef\\\n\\x67\\xf8\\x87\\x52\\xb3\\xf6\\xcf\\x7e\\xfe\\x88\\xf0\\xc4\\xd1\\xd4\\x02\\x55\\\n\\xf3\\x74\\x28\\xb4\\xd4\\xca\\xa4\\xef\\xeb\\xe9\\x1f\\xd6\\x5d\\x09\\xaf\\x3d\\\n\\xcd\\x40\\x55\\x98\\x97\\x40\\x8d\\xc5\\x09\\x54\\xa8\\x86\\xaa\\x74\\xe3\\x6f\\\n\\x24\\x29\\x1b\\x54\\x0b\\xdf\\xa7\\xd2\\xed\\xbf\\x5e\\x13\\xa2\\xb7\\xdf\\x78\\\n\\x59\\xfc\\xe5\\xad\\xbf\\xf3\\x2f\\x35\\x26\\x63\\xf4\\xb9\\xeb\\xa7\\x37\\xa8\\\n\\x0b\\x5a\\x3f\\x26\\xf4\\x69\\xdb\\xa6\\x37\\xab\\xb7\\x31\\x0e\\x42\\xf0\\x84\\\n\\xff\\xae\\xd1\\xe0\\x26\\x84\\x5b\\x78\\xc3\\x8d\\x3e\\xc4\\x70\\x80\\x45\\x41\\\n\\x80\\xd8\\xf6\\xdb\\x02\\xc2\\x30\\x08\\x41\\x12\\xa7\\x36\\x16\\x15\\xf2\\xe1\\\n\\xc7\\x6a\\x97\\x46\\x23\\x86\\x8d\\x5a\\xef\\x5b\\x70\\xd0\\x52\\x2d\\x58\\x77\\\n\\xe1\\xc1\\x49\\x49\\xfc\\x68\\xd8\\xf7\\xda\\xae\\x92\\xf2\\x54\\xba\\x93\\x1b\\\n\\xe8\\x2f\\x44\\x2b\\x3f\\x8a\\x0d\\x85\\xaf\\x70\\x0b\\xdb\\x81\\xbc\\xaa\\xfe\\\n\\x20\\xb1\\x64\\x5a\\xe6\\xb6\\xde\\xfc\\x8e\\x55\\x05\\x42\\x9b\\xf7\\xa4\\x1c\\\n\\x3a\\xb5\\x73\\xaa\\xec\\x5f\\x6e\\x68\\x65\\x3f\\x55\\x25\\x59\\x4b\\xcd\\x9b\\\n\\x26\\xbf\\x4c\\xb7\\xf4\\x5d\\x13\\xb7\\xea\\x12\\xb6\\x65\\xc3\\x1f\\xfd\\x73\\\n\\xb1\\xd4\\xfc\\x45\\xaf\\x9f\\x56\\xbf\\x2e\\x68\\x77\\x44\\xa0\\x62\\xf0\\x05\\\n\\xfa\\x5e\\xdb\\x32\\xa8\\x22\\xd8\\x9f\\xd9\\x08\\x02\\x27\\x3c\\x78\\x07\\x1b\\\n\\xe5\\x7a\\x23\\x6b\\xa3\\x36\\xda\\x36\\x41\\x19\\x0e\\x81\\x38\\xc2\\xcf\\x27\\\n\\x6e\\x6d\\x17\\x7f\\x87\\xe5\\x21\\x80\\x4d\\x89\\x7b\\xdf\\x56\\x60\\x39\\x71\\\n\\xd7\\x41\\xd4\\xfb\\x61\\xb3\\x0e\\xc3\\x35\\xdd\\x7a\\xeb\\xce\\x02\\xfa\\x34\\\n\\x53\\x95\\x64\\x0d\\xb3\\x1b\\x6b\\xab\\xca\\xf3\\xcf\\xc4\\x84\\x6d\\xde\\xd7\\\n\\xee\\xfc\\x59\\xb5\\x55\\x0e\\xad\\x73\\x5f\\xd7\\xe7\\x6f\\xbf\\xa1\\xf1\\x67\\\n\\x47\\x57\\x1e\\x66\\xbc\\xf5\\x57\\xb6\\x95\\x77\\x9e\\x69\\xb8\\x7b\\x8d\\xbf\\\n\\xdd\\xab\\xb6\\xca\\xad\\x84\\xaa\\x54\\x5d\\x3f\\x92\\x2c\\x77\\x9a\\xec\\x4b\\\n\\xb9\\x52\\x89\\x1e\\xdd\\x70\\xd9\\x6b\\x7d\\xd4\\x83\\xfe\\x50\\x61\\x02\\x6e\\\n\\x54\\x8f\\xcc\\x2f\\x7f\\xec\\x7e\\xb3\\x59\\x3f\\xd5\\xd8\\xbf\\xf2\\x6c\\xd8\\\n\\x86\\x46\\x54\\x4d\\xa9\\x5e\\x6d\\x35\\x5c\\x4b\\xb5\\x09\\x90\\x66\\x85\\x1f\\\n\\x1f\\xb5\\xe5\\xb8\\x35\\x32\\x34\\x13\\xa3\\xe6\\x6e\\x4a\\xf8\\x47\\x44\\xa7\\\n\\x45\\xad\\x2f\\xbc\\xa7\\x71\\x85\\xef\\xdf\\x6a\\xa8\\xae\\xec\\x3a\\xd8\\x81\\\n\\x6e\\x2f\\xcb\\x50\\xa8\\x2b\\xc9\\xc7\\xca\\x03\\xfc\\x86\\xb0\\xfc\\x1d\\xf1\\\n\\x85\\x4d\\x17\\xd7\\x54\\x24\\x10\\xb2\\x5f\\xfa\\x68\\xfd\\x56\\x1c\\xbd\\x88\\\n\\x63\\x27\\x3f\\x73\\x76\\xa8\\xbc\\xad\\xf1\\x80\\x4c\\xfd\\xb7\\xe8\\x3e\\xc5\\\n\\x5c\\xf1\\x68\\x95\\x1b\\xac\\x86\\xaa\\xaa\\x48\\xcc\\x67\\x4b\\x79\\xd2\\x64\\\n\\xa8\\x62\\x60\\xd2\\xf3\\xbf\\xbf\\xdd\\xbf\\xb4\\x02\\xd7\\xfd\\xeb\\x9b\\xf1\\\n\\xb7\\x2d\\xb7\\xbe\\x79\\x79\\x41\\x7f\\x78\\xa6\\x43\\x05\\xc7\\x65\\xc4\\xe0\\\n\\x25\\xd4\\x62\\x31\\xbd\\x21\\xc2\\xf4\\x90\\x2e\\x99\\xd9\\x69\\x1d\\x1b\\xe5\\\n\\x70\\x68\\xd5\\x6b\\x22\\x0d\\xdf\\x56\\xab\\x4f\\x30\\x49\\x51\\xb5\\x39\\x8c\\\n\\x04\\x4e\\xaa\\xff\\x30\\x6b\\xd2\\xa8\\x4d\\x67\\x4d\\x2b\\x5d\\x37\\x61\\x49\\\n\\x3e\\x56\\x1e\\x34\\xf3\\x7a\\x3f\\x71\\xd3\\x7b\\xfe\\xb9\\xeb\\xb6\\xdc\\x54\\\n\\xa3\\x65\\xce\\xef\\x3f\\x9d\\xd8\\x79\\xb6\\x61\\x97\\x80\\x7e\\x2a\\x5b\\x75\\\n\\x41\\x8b\\x1c\\xf6\\x9a\\xc1\\x06\\xb4\\x7a\\xe4\\x9f\\x6a\\xa8\\x2e\\xf7\\xf4\\\n\\xe9\\x8d\\xa1\\xcc\\xcc\\xc6\\x8f\\x1a\\x93\\x2b\\x6d\\x0c\\x4d\\xf9\\x9e\\x0e\\\n\\xd5\\x89\\x8b\\x1f\\x17\\xaf\\xbc\\xb3\\x49\\xbc\\xf0\\xf6\\x47\\xc4\\x37\\x7f\\\n\\xf3\\x49\\xf1\\xf6\\xe2\\x0d\\xfe\\xad\\x8d\\x6d\\x99\\x7b\\x07\\xc1\\x89\\x5f\\\n\\xf9\\xc1\\x62\\x9a\\x84\\xf1\\x39\\x1a\\xd3\\x61\\x9a\\xc9\\xd6\\x0f\\x9b\\x26\\\n\\xc4\\xf0\\x6d\\x69\\x84\\x2a\\x42\\x26\\x5c\\xa3\\x46\\x6d\\x15\\xc1\\x8a\\xd1\\\n\\xab\\x18\\x45\\x9b\\xd6\\x00\\xa4\\xa2\\x93\\xca\\xe9\\xcc\\x36\\x2f\\xc9\\x20\\\n\\xec\\xb2\\x50\\x95\\x4d\\x54\\x26\\xfe\\xb0\\xb8\\xce\\x3f\\x77\\x5d\\xd4\\x75\\\n\\x5a\\xac\\xfe\\x53\\xfd\\x96\\x9b\\x2e\\x2e\\xd4\\x4e\\xb1\\xed\\xc3\\xe7\\x68\\\n\\x5c\\x3f\\xb5\\x21\\x5d\\xe6\\xaa\\x9b\\xe6\\xf2\\xb6\\x49\\x7d\\x65\\x65\\x1c\\\n\\xe7\\x29\\x1f\\x1c\\xb7\\x89\\x4f\\x57\\xc0\\x2b\\xef\\x6e\\x12\\x13\\xbf\\xfd\\\n\\xb8\\xf8\\x97\\x37\\x37\\x8b\\x8b\\x57\\xec\\x6a\\x0b\\x1f\\xfb\\xf9\\xc2\\x6e\\\n\\x7d\\x82\\x43\\x41\\x05\\x0b\\x8e\\x74\\x81\\x20\\x45\\xb8\\x5e\\xd0\\x1f\\x3a\\\n\\x34\\x85\\x64\\xae\\xaf\\x3e\\x5c\\x33\\x0a\\x8f\\xb4\\x35\\xa2\\xae\\x6f\\x77\\\n\\xd3\\xaf\\x81\\x81\\x3b\\x51\\x4d\\xd5\\x78\\x4e\\x18\\xb1\\x8c\\xdd\\x4b\\x46\\\n\\x47\\x47\\xab\\xa7\\x08\\xd9\\xb4\\x06\\x24\\x15\\xcd\\x52\\x6f\\x9f\\xfe\\xbc\\\n\\xe6\\xbc\\x32\\xd1\\xda\\x66\\x20\\x7f\\xf0\\x7a\\x2d\\x5f\\x73\\xb8\\x65\\x0e\\\n\\x5e\\x78\\xfb\\xa3\\xfe\\xb9\\x15\\x5b\\xce\\xbf\\x23\\x8e\\x7d\\xfe\\x85\\x85\\\n\\x89\\x9d\\x67\\x8e\\xe8\\xed\\x56\\xb8\\x15\\x6e\\x4d\\xd1\\x7f\\x1e\\xec\\xe2\\\n\\xc2\\xd1\\xcc\\xd0\\x2a\\xb7\\xba\\x8b\\xe1\\x6a\\x7d\\xe7\\xc4\\xf6\\xa9\\xb2\\\n\\xa7\\xd4\\x6e\\x29\\xd8\\xbf\\x9a\\x0b\\x7a\\x2d\\xca\\x1e\\xff\\x7c\\xaa\\x54\\\n\\x79\\x68\\xf2\\xe2\\xa4\\x5e\\xfc\\x4c\\xa8\\xe0\\xd7\\xdd\\x36\\x5d\\xcc\\x34\\\n\\x86\\xe8\\xb4\\xc7\\x87\\x30\\xf5\\x81\\x20\\x45\\x80\\x60\\xad\\xb5\\xdf\\xa6\\\n\\x81\\x1a\\x2b\\x42\\x76\\x7c\\x7c\\xbc\\x5a\\x8b\\x2d\\x6a\\x13\\x71\\xbb\\xa0\\\n\\x32\\xa1\\x3c\\x85\\x8d\\x62\\xba\\xf4\\x97\\x25\\x31\\x49\\x3e\\x56\\x4e\\xd8\\\n\\xd6\\x56\\xff\\xeb\\xd2\\xcd\\xe2\\xef\\x7f\\xb9\\xbd\\xda\\x2a\\x87\\xd6\\x39\\\n\\xb4\\xcc\\xe1\\x7c\\xd0\\x8e\\x17\\xde\\x5c\\xb8\\x69\\x61\\x09\\x7b\\x35\\x84\\\n\\x5b\\xe0\\xa2\\x8a\\x69\\x95\\xc3\\x2c\\x4b\\x47\\xf5\\xd3\\x59\\xf3\\xc3\\x2c\\\n\\xf2\\xe9\\xed\\xfd\\xe9\\xc8\\xa8\\x54\\x98\\xfb\\x97\\xb2\\xae\\xb2\\xa8\\xbe\\\n\\xa8\\x57\\x62\\x5a\\xeb\\x6a\\xbe\\x3a\\x1a\\xae\\x41\\xe7\\xbd\\x0e\\x52\\xd4\\\n\\x50\\xb1\\x1b\\x0d\\x8e\\xcd\\x08\\xcf\\xe9\\xe7\\x88\\xce\\xfc\\xc4\\xe7\\xfe\\\n\\x45\\xf0\\xd8\\x08\\xf7\\x4f\\x62\\xa0\\x0c\\x06\\xf5\\x84\\xa1\\x56\\x18\\x9e\\\n\\xf4\\x01\\x7f\\x67\\x33\\xb0\\x26\\x89\\xc7\\x00\\x3c\\x5f\\x94\\x38\\xcd\\xbe\\\n\\x78\\x5f\\xeb\\xed\\x13\\x1a\\x94\\xc4\\xe4\\x0f\\xb5\\xde\\xbf\\x5a\\x50\\xc3\\\n\\x0e\\xc2\\xfa\\x8b\\x3b\\xa0\\x0a\\xef\\x41\\x78\\xa6\\x29\\x1c\\x60\\x3d\\xae\\\n\\xa8\\xc9\\x1f\\x4a\\xb3\\xa3\\xfd\\x7d\\xde\\xb5\\x59\\x25\\xd2\\xdb\\x03\\x02\\\n\\xbb\\x84\\x54\\x77\\x87\\x49\\x80\\x74\\x75\\xcd\\xa8\\xd7\\x32\\x65\\x72\\x0e\\\n\\xa3\\x7f\\x3d\\x4c\\x9c\\x91\\xb0\\x7b\\xa6\\xff\\x67\\xe6\\xaf\\x9f\\x9a\\x8d\\\n\\x33\\xb7\\x39\\xb6\\xb7\\x18\\x94\\x69\\x3e\\x33\\xd8\\xd6\\x3d\\xa3\\xd7\\x42\\\n\\xb5\\x42\\xda\\x5d\\x6b\\xa3\\x80\\x4a\\xaf\\x0e\\x0f\\x48\\x4f\\x3e\\xdb\\xee\\\n\\x60\\xd5\\x8f\\x3f\\x57\\x71\\xd4\\xee\\xb8\\x3b\\x40\\x83\\xfe\\xd8\\x63\\x0b\\\n\\x8a\\xbe\\x07\\xf4\\x35\\x54\\xef\\xc7\\x50\\xb5\\x0f\\x55\\x03\\x7d\\xbc\\x68\\\n\\xea\\xc5\\x7b\\x60\\x4a\\x2d\\x08\\xd6\\x46\\xbb\\xf4\\x30\\x54\\x57\\x3c\\x36\\\n\\x3b\\x3c\\x50\\xf1\\x1c\\x7c\\x4e\\xd7\\x3e\\xb9\\x36\\x49\\x32\\x14\\xaa\\xb3\\\n\\x2a\\xb5\\x30\\xbe\\x22\\xaf\\xf0\\xfe\\xd9\\xee\\x5a\\x13\\x8b\\x14\\x93\\xde\\\n\\x35\\x35\\xde\\x68\\x6e\\xe5\\x88\\x8a\\x03\\xfe\\xfe\\xb0\\x5e\\x1b\\x65\\x5d\\\n\\x28\\x0b\\xf4\\x4a\\xea\\xd7\\x2b\\x23\\xb2\\x06\\x88\\x15\\x68\\x42\\xa9\\x96\\\n\\x3d\\x2f\\x0e\\x1f\\x12\\x8e\\xc4\\x0a\\x4e\\xf6\\x17\\x37\\x46\\xc3\\x29\\x75\\\n\\xec\\xd4\\xfd\\x53\\x89\\x4c\\xe0\\xd0\\xe9\\x50\\xb5\\x79\\x8c\\x56\\x02\\x00\\\n\\x92\\x0e\\xd5\\x30\\x84\\x2c\\x76\\x09\\x42\\xc8\\x61\\x59\\x41\\xe8\\x3b\\xc6\\\n\\xfb\\x5b\\x6f\\x74\\x2d\\x43\\x75\\xad\\x95\\x5d\\x6c\\x9c\\x41\\xe9\\x88\\x3b\\\n\\xfc\\xab\\xda\\xa6\\x72\\x4d\\x0d\\xea\\xef\\x56\\x4b\\xdf\\x55\\x29\\xc5\\x9c\\\n\\xb3\\x4e\\x36\\x7d\\x88\\xb2\\x5c\\xab\\xe8\\x7f\\x4b\\xfa\\x3d\\x4c\\x7a\\x7b\\\n\\xb7\\x62\\x5e\\x87\\xf6\\x50\\x9c\\x83\\x16\\xf8\\xe1\\x8a\\xd1\\xbf\\xa6\\x52\\\n\\x83\\x01\\x4b\\xd4\\x69\\x7a\\xc5\\xa0\\x29\\x01\\xa1\\xb5\\x5b\\xaf\\x10\\x0c\\\n\\xcb\\x5e\\xa5\\x6f\\x43\\x9f\\x24\\xfa\\x27\\xb1\\xb2\\x1a\\x6e\\x41\\x4a\\x3f\\\n\\x1a\\x19\\x95\\x2e\\xf6\\x95\\x92\\x37\\xfb\\x57\\x35\\xc5\\x13\\xea\\x3d\\x55\\\n\\xd1\\xcf\\xe5\\x03\\x57\\x66\\xe2\\xec\\xab\\x15\\x57\\xa7\\x43\\xf5\\x91\\x47\\\n\\x1e\\x59\\x33\\xaa\\x17\\x93\\x39\\xd4\\x9a\\xd0\\xc1\\x6c\\x84\\x0d\\x0c\\x1e\\\n\\x8a\\x33\\xfb\\x8f\\xd1\\xee\\x50\\x0d\\x0a\\x87\\x1d\\xd4\\x7b\\x6d\\x10\\xbe\\\n\\x4f\\xb7\\x87\\x6a\\x9a\\xd0\\xc2\\xe4\\x78\\x12\\xa3\\x47\\x4d\\xff\\x9c\\x1d\\\n\\xfd\\x63\\xd7\\x73\\xd5\\x36\\x9b\\x96\\xa3\\xa2\\xf1\\xdf\\xc3\\x76\\xcd\\x59\\\n\\xbf\\xe0\\x55\\xc4\\x58\\xdc\\xa3\\xd3\\xe8\\xed\\x34\\xb6\\xd1\\xa8\\xd4\\xec\\\n\\xee\\xc2\\x86\\x83\\x4c\\xda\\xa8\\x0b\\xbe\\x5c\\x6b\\x66\\x40\\xf7\\x7f\\x05\\\n\\x21\\x6c\\x71\\x1a\\xeb\\x17\\x29\\x3e\\x04\\xd8\\xc7\\xea\\xe4\\xce\\x33\\x63\\\n\\xad\\x14\\x3c\\x06\\x1e\\x2b\\xc9\\x40\\xed\\x34\\x6c\\x50\\x6d\\x76\\x93\\x09\\\n\\x87\\x5f\\xbb\\x47\\xd9\\xe2\\xb9\\xe1\\x39\\x06\\x4b\\x5c\\x08\\xcf\\xb4\\x9f\\\n\\x2f\\x35\\x0f\\x61\\xa8\\x7f\\xb8\\x36\\xbd\\xc7\\x85\\xae\\x4d\\xc7\\x9e\\x8b\\\n\\xb6\\xa8\\xaa\\xef\\xe1\\xe2\\xba\\x6d\\xca\\xab\\x8e\\xc0\\x4d\\x5a\\xbf\\xe3\\\n\\x8a\\x23\\x38\\x34\\x9f\\x7f\\xb9\\x2e\\x5d\\xe1\\x41\\xb3\\x2f\\xba\\xb9\\x56\\\n\\xf6\\x53\\xa5\\x8e\\xc3\\x70\\x6c\\x7c\\x41\\xb0\\x33\\x71\\x70\\xa7\\x63\\x33\\\n\\x72\\x16\\x2b\\xac\\xab\\xbf\\x40\\x51\\xc2\\x01\\xd9\\x48\\xb0\\x2f\\xd5\\xa8\\\n\\x17\\xaa\\xe1\\xdb\\x50\\x4b\\xb6\\x09\\x3a\\x5b\\x68\\xca\\x45\\x6d\\x2a\\x58\\\n\\x6c\\x5e\\x63\\xf8\\xf9\\xda\\xbe\\x3f\\x94\\xae\\xf2\\xce\\xa9\\xb2\\xe7\\xa9\\\n\\x21\\xab\\x91\\x2d\\xfa\\x6f\\x3d\\x21\\xb7\\x9d\\xbc\\x8f\\x07\\x2b\\x87\\xf2\\\n\\xd0\\xe4\\xc2\\xc4\\xfd\\x67\\x9f\\xf4\\xd6\\x5f\\xd9\\xa8\\x6b\\x96\\xbb\\xf5\\\n\\xf6\\xf3\\x98\\x14\\x52\\x6f\\x2f\\x9b\\x2f\\xba\\x36\\x33\\x8e\\xf5\\x72\\x6a\\\n\\xe7\\xd9\\xcd\\xcd\\x1c\\xb7\\x96\\xa1\\x9a\\x01\\xf8\\x75\\xa3\\x4f\\xb0\\x9f\\\n\\x27\\x1c\\xd4\\x1f\\x0c\\xec\\x5c\\x8c\\x76\\x32\\x34\\x29\\xe0\\xb6\\x38\\x23\\\n\\xd2\\xba\\x0e\\x42\\xa8\\xde\\x60\\x9d\\x20\\x84\\x61\\x38\\x54\\x51\\xb3\\x43\\\n\\x93\\x67\\x2d\\x68\\x96\\x0c\\xf7\\x49\\xda\\x1c\\x50\\x3b\\x2a\\xc4\\xeb\\x89\\\n\\x0a\\x78\\x9b\\xda\\x26\\x43\\x34\\x7f\\xca\\xf7\\x4f\\xcd\\x60\\xb0\\x11\\x46\\\n\\xf1\\xd6\\xa5\\x37\\x12\\xb2\\x47\\x56\\x07\\x26\\xc5\\x99\\x8b\\xb6\\xdb\\xa0\\\n\\x45\\x2d\\xa9\\x56\\x3a\\x1c\\xd6\\x12\\xeb\\xc5\\x7f\\x68\\x6b\\x0c\\xd5\\x8c\\\n\\xd0\\xdf\\x19\\xac\\x44\\x14\\x34\\x03\\xa3\\x86\\x6a\\x9a\\x82\\xf5\\x2f\\x2f\\\n\\xd6\\x52\\x6b\\x41\\x1f\\x5b\\x9c\\xda\\x23\\xc2\\x30\\xfc\\x77\\x8d\\xfa\\xf2\\\n\\x10\\xa8\\xe1\\x11\\xb4\\x66\\x60\\x50\\x23\\x08\\xd4\\x38\\x7f\\x17\\x84\\x50\\\n\\x0d\\x07\\x2b\\x5e\\x5f\\x9c\\xb0\\xc4\\x6b\\x0b\\xff\\xc0\\x88\\x0a\\x69\\xca\\\n\\x20\\xfd\\x05\\xc7\\x6e\\x31\\xee\\x3a\\x29\\x1c\\x04\\x2c\\xf6\\x3f\\x47\\xc8\\\n\\xea\\x52\\xdd\\x65\\x46\\x5f\\x87\\x30\\x75\\x70\\xbd\\xfe\\x5b\\xca\\x36\\x86\\\n\\x6a\\xb6\\x98\\xda\\x2a\\x9a\\x80\\xd1\\x96\\x3f\\xaf\\xbf\\x43\\x89\\x8c\\xba\\\n\\x2d\\x2a\\x84\\x09\\x06\\x30\\xd5\\xaa\\x15\\x9a\\xdb\\xc3\\x13\\xe7\\xa3\\x86\\\n\\x1a\\x67\\x80\\x0c\\xfa\\x2a\\xc3\\xb5\\x55\\x33\\x58\\x27\\x2a\\xcc\\x11\\x80\\\n\\xb8\\x2d\\x3c\\xa0\\x26\\xae\\xa8\\x29\\x0a\\x31\\xb9\\x43\\xd4\\xb2\\x0c\\xdc\\\n\\xf6\\xf4\\xd3\\x4f\\xbf\\xef\\x6f\\xa2\\x66\\x65\\xa2\\x0c\\xd3\\x5f\\x76\\x4c\\\n\\x3f\\xea\\xa0\\x46\\x8a\\x90\\xd5\\x05\\x61\\x5b\\x9d\\x92\\x94\\x61\\x9a\\x1b\\\n\\x0c\\xd5\\x0c\\xd1\\xdf\\x1b\\xd4\\x48\\x83\\x9d\\xee\\x6c\\xf6\\x8d\\x01\\x61\\\n\\x82\\x10\\x43\\x1f\\x24\\xc2\\x05\\xe7\\x51\\x10\\xa6\\xb8\\x2e\\xaa\\x89\\x38\\\n\\xee\\x88\\x55\\x84\\x6f\\xd4\\x08\\x5a\\x04\\x27\\xc2\\x2e\\x6a\\x79\\xb6\\x35\\\n\\xd4\\x20\\x04\\x7d\\xb8\\x76\\x8c\\xd7\\x87\\xc7\\xc5\\xe3\\xa3\\xc6\\x8d\\x59\\\n\\x94\\x50\\x70\\xde\\x2c\\x33\\xdc\\x4c\\x8c\\x40\\xad\\xd7\\xb4\\x4d\\x44\\xed\\\n\\xc1\\x50\\xcd\\x1e\\x33\\x87\\x24\\x6a\\xa9\\x6d\\x39\\x64\\x5a\\x51\\x20\\xec\\\n\\x82\\x4d\\x9c\\x08\\x1f\\xd4\\x48\\x51\\x6b\\x45\\xa9\\xd5\\xdf\\x8a\\xdd\\x38\\\n\\x6c\\x02\\x07\\x01\\x15\\x15\\xac\\xa8\\x95\\x86\\x97\\x17\\x6c\\xaa\\xc5\\x7d\\\n\\x9a\\x09\\x36\\x3c\\xbf\\xa8\\x89\\x1b\\xf0\\xf8\\x26\\x4c\\x4d\\xb8\\x46\\xbd\\\n\\x46\\xf4\\x15\\xdb\\xec\\xfa\\x43\\x44\\xc9\\x61\\xa8\\x52\\x6e\\x21\\xb0\\x50\\\n\\xe3\\x8c\\xdb\\xcc\\x69\\xfe\\x1e\\xb5\\x41\\x5b\\x08\\x48\\x04\\x55\\x9c\\x90\\\n\\x44\\x73\\x31\\xfe\\x16\\xf7\\xa9\\x37\\xf9\\x42\\x2d\\xb8\\x0f\\x66\\x44\\x8a\\\n\\xbb\\x3c\\xc3\\x2c\\xd7\\x66\\xbf\\x51\\x22\\x4a\\x56\\xa3\\x31\\x67\\x94\\xb2\\\n\\x43\\x2b\\x03\\x95\\xd0\\xa7\\xba\\x70\\x78\\x6d\\x53\\x70\\x21\\xdc\\x75\\xd7\\\n\\x5d\\xd5\\xd7\\x87\\x00\\xb0\\xed\\xf3\\x43\\x2d\\x70\\xe3\\xc6\\x8d\\xab\\x03\\\n\\x7a\\x50\\x9b\\x43\\xe8\\xdc\\x7d\\xf7\\xdd\\xd5\\xa0\\x34\\xb5\\xc4\\x85\\x85\\\n\\xb5\\xbb\\xd6\\xa2\\xe6\\x86\\xdb\\x51\\x03\\xbc\\xed\\xb6\\xdb\\xfc\\x6b\\xed\\\n\\x6d\\xd9\\xb2\\x65\\xb5\\x06\\xb9\\xb4\\xb4\\xf4\\xbe\\xe5\\xe0\\x39\\x0d\\x0f\\\n\\x0f\\x8b\\xaf\\x7c\\xe5\\x2b\\xab\\xfb\\x8c\\xe2\\xef\\x82\\xcf\\x19\\xd7\\xe3\\\n\\x72\\x1c\\x58\\x1e\\x9e\\xb7\\x79\\xce\\x58\\x1e\\x1e\\x2f\\x08\\xef\\x23\\xfe\\\n\\x0e\\xef\\x25\\x5e\\x9f\\x59\\x6e\\x1c\\x78\\xbf\\xfa\\xfa\\xfa\\x56\\x9f\\x1b\\\n\\x0a\\xde\\xcb\\x7a\\xa2\\xee\\x63\\xb3\\x4c\\xb4\\x26\\x84\\xef\\x1b\\xf7\\x87\\\n\\x83\\x59\\xbf\\xc1\\xfb\\x47\\xd5\\xe8\\x6b\\x41\\xcd\\x1e\\x8f\\xe1\\x38\\xce\\\n\\xd1\\x5f\\xfc\\xe2\\x17\\xef\\x3f\\xc8\\x66\\x87\\x6c\\xff\\xab\\x3b\\xad\\xc6\\\n\\x4d\\x9c\\x3f\\xfe\\x2b\\x76\\x0b\\x65\\x18\\xbb\\xbf\\x33\\xc6\\x9f\\xf0\\x01\\\n\\x1d\\x64\\x68\\xfe\\x2d\\xdc\\xf0\\xcd\\x56\\x66\\x54\\xb2\\x61\\x06\\xed\\xd8\\\n\\xd4\\xf4\\x9a\\x91\\xd6\\x72\\x82\\xcc\\x32\\x11\\xa8\\x28\\x14\\x0f\\xfa\\x9e\\\n\\xf1\\xde\\x65\\x61\\x46\\xa5\\xa0\\x7d\\xaf\\xed\\xd2\\x5f\\xfb\\xf8\\x4e\\x6c\\\n\\x3f\\xc3\\xed\\x76\\x86\\xb1\\xf9\\x37\\x03\\x4a\\x2f\\x3f\\xb8\\xb5\\xf4\\xa3\\\n\\xe1\\x12\\xca\\x3f\\xfd\\xe3\\x3d\\xa3\\x7f\\xf8\\xd3\\x1b\\xfd\\x5b\\xa8\\x59\\\n\\x08\\xb9\\x34\\x82\\x2e\\xad\\xe5\\x04\\x99\\x65\\x32\\x50\\x89\\xb2\\x87\\xa1\\\n\\xda\\x21\\xa5\\xe9\\xc1\\xfe\\x3d\\xaf\\xee\\x3a\\xb8\\xe7\\xa5\\x91\\x77\\x1d\\\n\\xd1\\x33\\xeb\\xb8\\x72\\x02\\xe5\\xe7\\xf7\\x7d\\xe8\\xc8\\xdf\\xfe\\xfb\\xa0\\\n\\xf8\\xbb\\x7f\\x7b\\xa0\\x7f\\xcf\\xcb\\xc3\\x98\\xfc\\x81\\x88\\x88\\x72\\x82\\\n\\xa1\\xda\\x01\\x7b\\x5f\\x19\\x19\\x75\\x7a\\x6f\\xbc\\x20\\x3c\\x75\\x48\\xc8\\\n\\xe8\\x09\\xb5\\xdf\\xfe\\xe8\\x7a\\x7d\\xbd\\x9c\\x18\\x7b\\x65\\x64\\x3a\\xee\\\n\\xfc\\x93\\x44\\x44\\xd4\\x59\\x0c\\xd5\\x94\\xed\\x7d\\xf5\\xf3\\x8f\\x2a\\x25\\\n\\x9e\\xad\\x15\\xa6\\x61\\x52\\x89\\x41\\xa7\\x4f\\xea\\x60\\x1d\\x8c\\xf5\\xf7\\\n\\x44\\x44\\xd4\\x39\\x0c\\xd5\\x14\\xa1\\xc6\\xa9\\x2a\\x9e\\xd9\\x0f\\xd5\\xc6\\\n\\x80\\x5c\\x77\\x23\\x8e\\xd9\\x47\\x44\\x44\\x19\\xc6\\x50\\x4d\\x91\\xd3\\xe7\\\n\\x1c\\x8c\\x5b\\x43\\x0d\\x43\\x8d\\xb5\\xf4\\x22\\x0e\\xa2\\x4c\\x44\\x44\\x59\\\n\\xc5\\x50\\x4d\\xc9\\x4a\\xbf\\xa8\\x6a\\x69\\xe0\\x91\\x74\\xa5\\x39\\x14\\x1c\\\n\\x11\\x11\\x65\\x10\\x43\\x35\\x25\\x4e\\xaf\\xc4\\xa1\\xdc\\x5a\\x52\\xad\\xad\\\n\\xb2\\x6f\\x95\\x88\\x28\\xb3\\x18\\xaa\\x29\\x51\\x42\\x6d\\xf5\\xcf\\xb6\\xa6\\\n\\xaf\\x97\\x23\\x81\\x89\\x88\\x32\\x8a\\xa1\\x9a\\x12\\x47\\xc8\\x3b\\xfc\\xb3\\\n\\xad\\xf1\\x5c\\xd6\\x54\\x89\\x88\\x32\\x8a\\xa1\\x4a\\x44\\x44\\x94\\x10\\x86\\\n\\x6a\\x06\\xac\\x77\\x97\\xc5\\x43\\x1f\\xbe\\x28\\xc6\\x6e\\xfb\\x95\\xb8\\x6f\\\n\\x63\\xed\\x83\\x51\\x13\\x11\\x51\\xb6\\x31\\x54\\x3b\\xec\\x96\\xbe\\x6b\\xe2\\\n\\x6b\\x77\\xfe\\x4c\\x7c\\x41\\x87\\xea\\x7d\\x7f\\xf2\\xbf\\x62\\xec\\xf6\\x5f\\\n\\x8b\\x2f\\x7d\\x64\\xed\\x01\\xa7\\x89\\x88\\x28\\x1f\\x18\\xaa\\x1d\\xf6\\xb9\\\n\\x5b\\xdf\\x14\\xb7\\xea\\x60\\x0d\\xfa\\xdc\\x87\\x7e\\xa7\\xaf\\xbb\\xea\\x5f\\\n\\x22\\x22\\xa2\\xbc\\x60\\xa8\\x76\\xd8\\x2d\\xbd\\x6b\\x03\\xd5\\x40\\x0d\\x96\\\n\\x88\\x88\\xf2\\x85\\xa1\\xda\\x61\\x17\\xaf\\x46\\x1f\\xbe\\xeb\\x0f\\x8b\\xeb\\\n\\xfc\\x73\\x44\\x54\\x70\\xf3\\xfe\\x69\\x2c\\x8f\\x9f\\xdf\\x95\\xcc\\x9e\\x04\\\n\\xd4\\x16\\x0c\\xd5\\x0e\\xfb\\x8f\\xb7\\x3f\\x22\\x2e\\x5e\\x59\\xef\\x5f\\x5a\\\n\\xf1\\xfc\\xef\\x6f\\x17\\x6f\\x2f\\xde\\xe0\\x5f\\x22\\x22\\xa2\\xbc\\x60\\xa8\\\n\\x76\\xd8\\xe5\\x4a\\x8f\\xf8\\x87\\x5f\\x6d\\x15\\xdf\\xfc\\xcd\\x27\\xc5\\xc4\\\n\\x6f\\x3f\\x2e\\x0e\\xfc\\xfc\\xd3\\xe2\\x7b\\x3a\\x54\\x89\\x88\\x28\\x7f\\x18\\\n\\xaa\\x1d\\x26\\x5d\\x29\\x9c\\x3e\\x29\\x7e\\xbd\\xdc\\x2f\\xce\\x5d\\xfe\\xb0\\\n\\xb8\\xd6\\xd3\\x8b\\x29\\x0d\\xf5\\x0d\\xfe\\x1f\\x10\\x11\\x51\\x6e\\x30\\x54\\\n\\x3b\\x45\\x87\\x26\\xc2\\xd4\\xe9\\xd5\\x67\\x83\\x6b\\x01\\x79\\xea\\x0a\\xe1\\\n\\xea\\xdb\\xd6\\x5c\\x4f\\x44\\x44\\x99\\xc7\\xcd\\x76\\x87\\x38\\x3d\\x0d\\x42\\\n\\xd3\\x0f\\x5d\\xd6\\x58\\x89\\x88\\xf2\\x83\\xa1\\xda\\x01\\x08\\x53\\xd4\\x46\\\n\\xe3\\xa8\\x36\\x05\\x13\\x11\\x51\\x2e\\x30\\x54\\x3b\\x00\\xfd\\xa8\\x71\\x55\\\n\\x6b\\xb3\\xcc\\x55\\x22\\xa2\\x5c\\x60\\xa8\\x76\\x02\\x43\\x92\\x88\\xa8\\x90\\\n\\x18\\xaa\\x29\\xf1\\x84\\x7a\\xc3\\x3f\\x6b\\x4d\\x32\\x84\\x89\\x8a\\x4b\\xc9\\\n\\x05\\xff\\x5c\\x2c\\x8b\\xcb\\x4b\\x1b\\xfd\\xb3\\x94\\x41\\x0c\\xd5\\x94\\x48\\\n\\x65\\x37\\x6b\\x4a\\x4d\\xcb\\x57\\xe7\\xfc\\x73\\x44\\x54\\x04\\x8e\\x67\\x15\\\n\\xaa\\x4a\\xf2\\x98\\xca\\x59\\xc6\\x3a\\x50\\x4a\\x4a\\x2f\\x0e\\x0f\\x3a\\x8e\\\n\\x9c\\xc6\\x79\\x8c\\xea\\xb5\\xd9\\x5d\\xc6\\x5b\\x54\\x42\\x79\\xd5\\x95\\x35\\\n\\x77\\x72\\xe7\\xd9\\x6d\\xfe\\xd5\\xb9\\x34\\x3a\\x3a\\x3a\\xa0\\x94\\xba\\xb0\\\n\\x61\\xc3\\x06\\xb1\\x63\\xc7\\x0e\\xff\\x5a\\xa2\\xf6\\x3b\\x77\\xee\\x9c\\xb8\\\n\\x74\\xe9\\x92\\x70\\x5d\\x77\\xe0\\xf4\\xe9\\xd3\\x4d\\xb7\\x1c\\x25\\x6d\\xdf\\\n\\xf9\\x91\\x69\\x9d\\x94\\x83\\xfe\\xc5\\x86\\x94\\xe7\\x0d\\xfd\\xf3\\x9f\\x4f\\\n\\xcd\\xf8\\x17\\x29\\x63\\x18\\xaa\\x29\\x1a\\x7b\\x69\\x64\\x5a\\x4a\\x31\\xe8\\\n\\xae\\xd3\\x6f\\xbb\\xc5\\x3b\\x5f\\xb9\\xa6\\xf4\\x37\\x09\\xe7\\xd4\\xd8\\xa9\\\n\\x9d\\x53\\xe5\\xea\\x95\\x39\\x65\\x42\\xd5\\xbf\\x48\\x94\\x3a\\x86\\x2a\\xb5\\\n\\x13\\x43\\x35\\x45\\xa6\\xb6\\xda\\x64\\xa8\\xce\\x9f\\xda\\x79\\x76\\xb3\\x7f\\\n\\x55\\x6e\\xe9\\x50\\xed\\xaf\\x54\\x2a\\xa3\\xfe\\x45\\xa2\\xd4\\xe9\\x50\\x9d\\\n\\xd4\\xac\\x9a\\x5c\\xdb\\x89\\xa1\\x5a\\x2c\\x0c\\xd5\\x94\\xed\\x79\\x71\\xf8\\\n\\x90\\x7b\\xa3\\x73\\xd0\\x32\\x54\\xe7\\x3d\\xa9\\x86\\xca\\xf7\\x4e\\x25\\xd3\\\n\\x2f\\x4b\\x44\\x99\\xc1\\x50\\x2d\\x16\\x0e\\x54\\x4a\\xd9\\xa9\\xfb\\xa7\\x0e\\\n\\xe9\\x40\\xb5\\x0a\\x47\\xb7\\x67\\x79\\x37\\x03\\x95\\x88\\x28\\xfb\\x18\\xaa\\\n\\x39\\xd0\\xd7\\xd3\\xfb\\xae\\x7f\\x96\\x88\\x0a\\x46\\x79\\xc2\\xaa\\x7f\\xd7\\\n\\x53\\xce\\x80\\x7f\\x96\\x32\\x88\\xa1\\x4a\\x44\\x44\\x94\\x10\\x86\\x2a\\x11\\\n\\x11\\x51\\x42\\x18\\xaa\\x44\\x44\\x44\\x09\\x61\\xa8\\x12\\x11\\x11\\x25\\x84\\\n\\xa1\\x4a\\x44\\x44\\x94\\x10\\x86\\x2a\\x11\\x51\\x07\\x29\\x61\\x37\\xa1\\xbe\\\n\\x23\\x15\\xe7\\xfe\\xcd\\x30\\x86\\x2a\\x11\\x51\\x07\\x49\\x25\\x2c\\x67\\x77\\\n\\x92\\x0c\\xd5\\x0c\\x63\\xa8\\x12\\x11\\x11\\x25\\x84\\xa1\\x4a\\x44\\x44\\x94\\\n\\x10\\x86\\x2a\\x11\\x11\\x51\\x42\\x18\\xaa\\x44\\x44\\x44\\x09\\x61\\xa8\\x12\\\n\\x11\\x11\\x25\\x84\\xa1\\x4a\\x44\\x44\\x94\\x10\\x86\\x2a\\x11\\x11\\x51\\x42\\\n\\x18\\xaa\\x44\\x44\\x44\\x09\\x61\\xa8\\x76\\x82\\xb2\\x9b\\x41\\x65\\x71\\x79\\\n\\x69\\xa3\\x7f\\x96\\xba\\xc3\\xa0\\x2e\\x13\\xba\\x5c\\xd0\\x45\\xf9\\x05\\xc7\\\n\\xd4\\x9d\\xd6\\xa5\\xa4\\x0b\\x11\\x65\\x14\\x43\\xb5\\x13\\x1c\\xcf\\x2a\\x54\\\n\\x95\\x74\\x39\\x83\\x4a\\xf7\\x38\\xa2\\x0b\\xc2\\x73\\x54\\x97\\x19\\x5d\\x0e\\\n\\xeb\\x72\\x4c\\x17\\x7c\\x66\\x4c\\xd8\\xe2\\x76\\x7e\\x26\\x88\\x32\\x88\\xa1\\\n\\x4a\\x94\\x1d\\x07\\x75\\x79\\x52\\x17\\x04\\xe8\\x66\\x5d\\xc6\\x74\\x39\\xe4\\\n\\x5f\\x87\\xcb\\xcf\\xe8\\x02\\x08\\x57\\xfc\\x2d\\x11\\x65\\x0c\\x43\\x95\\x28\\\n\\x1b\\x50\\xf3\\x44\\x80\\x02\\x42\\x35\\xaa\\x35\\xc3\\x04\\x2e\\xe0\\xfc\\x1d\\\n\\x2b\\x67\\x89\\x28\\x2b\\x18\\xaa\\x9d\\x60\\xd9\\xa7\\xaa\\xa4\\xc7\\xa6\\x3e\\\n\\x02\\x7c\\x6e\\x4c\\x6d\\x15\\x86\\xfc\\x53\\x22\\xca\\x08\\x86\\x6a\\x07\\x28\\\n\\xa5\\xde\\xf3\\xcf\\xc6\\xa2\\xbc\\x1e\\x86\\x6a\\xf1\\x21\\x30\\xd1\\x7f\\x3a\\\n\\xe7\\x97\\x5a\\xe6\\xfd\\x53\\x18\\xf0\\x4f\\x89\\x28\\x23\\x18\\xaa\\x44\\xd9\\\n\\x81\\xe6\\xdf\\x6d\\xba\\xec\\xae\\x5e\\x6a\\xcc\\xaa\\xc5\\x83\\x32\\x4a\\x2a\\\n\\xcb\\x1f\\x47\\x8a\\xeb\\x3d\\xc3\\x18\\xaa\\x1d\\x60\\x7f\\x50\\x62\\xd6\\x48\\\n\\x68\\xd5\\x9f\\xf9\\xa7\\x80\\xd1\\xc1\\xd4\\x65\\x3c\\xcb\\xee\\x23\\x4a\\x17\\\n\\x43\\xb5\\x03\\x6c\\x0f\\x4a\\x2c\\x79\\xa4\\x7f\\xba\\x0e\\x23\\x7f\\x01\\x81\\\n\\x5a\\xaf\\x99\\x98\\x72\\x42\\x4a\\x79\\xb3\\x7f\\x96\\x0a\\x80\\xa1\\xda\\x01\\\n\\x9e\\xb3\\xa6\\x5f\\xac\\x31\\x7e\\xe9\\x68\\xc5\\x01\\x5d\\x4c\\xab\\x05\\x76\\\n\\xb7\\xa1\\x22\\xb0\\xfc\\xd1\\xec\\x48\\xcf\\x6e\\xfb\\x41\\xa9\\x62\\xa8\\xe6\\\n\\x81\\xf2\\x38\\xa3\\x12\\x21\\x4c\\xcd\\x2e\\x37\\x18\\xd0\\xc4\\x0d\\x6b\\x51\\\n\\x78\\x0e\\x5b\\xa2\\x0a\\x84\\xa1\\xda\\x01\\x6e\\xc5\\xb2\\xd9\\x4e\\x3a\\xc1\\\n\\x7e\\x34\\xea\\x3e\\x08\\x54\\x33\\x8b\\x12\\x66\\x57\\x32\\xe1\\x4a\\x45\\x60\\\n\\x39\\x66\\x62\\x9d\\xeb\\x60\\xfa\\x4a\\xca\\x28\\x86\\x6a\\x07\\xb8\\xbd\\x76\\\n\\xd3\\x14\\x6a\\xfc\\x25\\xdb\\xbd\\xb0\\xee\\x9f\\xd5\\x05\\x1b\\x5e\\xec\\xa3\\\n\\x8a\\x49\\x1f\\xa8\\x50\\xec\\x9a\\x7f\\x2f\\xc9\\xcb\\x56\\xbb\\xe4\\x51\\xba\\\n\\x18\\xaa\\x1d\\xf0\\xed\\x6d\\x53\\xb6\\x4d\\x77\\xfd\\x8f\\x9f\\xdf\\xc5\\xd9\\\n\\x73\\xba\\x8f\\xa9\\xa1\\x6e\\xd5\\x05\\x35\\x54\\x4e\\xa6\\x5f\\x30\\xfb\\x7e\\\n\\xbc\\x0b\\xeb\\xd6\\xc6\\x42\\x79\\xdb\\x0c\\x47\\xff\\x66\\x18\\x43\\xb5\\x73\\\n\\xac\\x82\\xf5\\xca\\x32\\x67\\xcf\\xe9\\x32\\xc1\\x40\\x45\\x1f\\x2a\\x6b\\xa8\\\n\\x05\\xe4\\x39\\x96\\xfb\\xa8\\x4a\\xc5\\xbe\\xf4\\x8c\\x63\\xa8\\x76\\x8e\\x55\\\n\\xbf\\xaa\\xeb\\x28\\xdb\\x5f\\xb4\\x94\\x5f\\x58\\xd7\\x08\\x54\\x6c\\x70\\xc7\\\n\\x75\\x89\\xea\\x43\\xc5\\x6d\\xb8\\x9e\\x5d\\x03\\x39\\x26\\x95\\xb4\\xfb\\x5e\\\n\\x7b\\xea\\x0d\\xff\\x1c\\x65\\x14\\x43\\xb5\\x43\\x3c\\x25\\xec\\xbe\\x1c\\x8e\\\n\\x78\\xc0\\x3f\\x47\\xc5\\x86\\x43\\xbe\\x99\\x41\\x49\\x68\\x9d\\x38\\xaa\\x4b\\\n\\x14\\x73\\xa4\\x1a\\xee\\x6e\\x95\\x63\\xd2\\x55\\x56\\xdf\\x6b\\xa5\\x1c\\xee\\\n\\x9b\\x9c\\x71\\x0c\\xd5\\x8e\\x51\\x76\\xb3\\xe1\\xe8\\x5f\\xb4\\xfb\\x7e\\xfc\\\n\\x20\\x6b\\xab\\xc5\\x86\\x90\\xc4\\xa0\\x24\\xf4\\x99\\x61\\xba\\xc2\\x7a\\x9f\\\n\\x11\\xfe\\xc8\\xca\\xb9\\xd2\\xec\\x68\\xbf\\xfe\\x5e\\x9b\\xc9\\x3c\\x62\\x51\\\n\\x72\\x99\\xa1\\x9a\\x71\\x0c\\xd5\\x0e\\xa9\\xb8\\xeb\\xac\\xa7\\x98\\x93\\xb2\\\n\\x17\\xb5\\x18\\x2a\\x26\\x04\\xaa\\x69\\xe6\\x45\\x2d\\x15\\xb5\\x55\\xec\\x3a\\\n\\x51\\xab\\xf0\\xb3\\x90\\x73\\xbd\\xde\\xa2\\xf5\\x3a\\xec\\x5d\\x62\\x4d\\x35\\\n\\xeb\\x18\\xaa\\x1d\\x52\\xde\\x36\\xb9\\x20\\xa4\\x5d\\x6d\\x55\\x39\\xe2\\x40\\\n\\xe9\\xd5\\x61\\xbb\\x81\\x0d\\x94\\x17\\xc1\\x1a\\x0b\\x42\\x15\\xeb\\xb9\\x5e\\\n\\x61\\x5f\\x6a\\xde\\x49\\xf5\\xa8\\x7f\\x2e\\x16\\x29\\xd4\\xfc\\xb7\\xef\\xb5\\\n\\xde\\x73\\x80\\x52\\x26\\xfd\\x53\\xea\\x80\\x2f\\xff\\x64\\xd7\\x21\\xe9\\x54\\\n\\x6b\\x28\\xf1\\xe9\\x20\\x3e\\x71\\xf7\\x59\\x8e\\x04\\x2e\\x1e\\xec\\x2e\\x83\\\n\\xb0\\xb4\\x85\\x3e\\x57\\xee\\x62\\x91\\x33\\xfb\\x5e\\xdb\\x85\\xf5\\x3d\\xb1\\\n\\x72\\x29\\xb6\\xf2\\x89\\xed\\x67\\x38\\x3d\\x65\\xc6\\x31\\x54\\x3b\\xa8\\xba\\\n\\x8f\\x9a\\x2b\\x66\\xfd\\x8b\\xb1\\xe9\\x5f\\xac\\x93\\x8b\\xce\\x95\\x31\\xee\\\n\\xaf\\x46\\x94\\x3f\\x25\\xfd\\xbd\\xef\\x71\\xe5\\xb4\\xfe\\x1e\\x5b\\xb5\\x36\\\n\\x78\\x6a\\x79\\xf7\\xc9\\x7b\\xbe\\x3f\\xe9\\x5f\\xa4\\x8c\\x62\\xa8\\x76\\xd8\\\n\\xbe\\xf3\\x23\\xd3\\xb6\\x83\\x15\\x7c\\x68\\x06\\x3a\\xac\\x7f\\xb9\\x96\\x57\\\n\\x2e\\x12\\x51\\x96\\x95\\x66\\x07\\xfb\\xfb\\xc4\\xfa\\x03\\x9e\\x27\\x9f\\xb4\\\n\\x0d\\x54\\x34\\xfd\\x1e\\xdf\\x7e\\x76\\xb3\\x7f\\x91\\x32\\x8c\\xa1\\xda\\x61\\\n\\xfb\\x5e\\x1b\\x2e\\x09\\xe1\\xd8\\x36\\x03\\xad\\xc2\\xb1\\x59\\x1d\\xe1\\xcd\\\n\\xe8\\xd3\\xe7\\x44\\x65\\x69\\xee\\xc4\\xa7\\x7f\\xc0\\x81\\x0c\\x44\\x19\\xf1\\\n\\xd8\\xab\\xc3\\x03\\x4b\\xbd\\x72\\xab\\xeb\\x8a\\x07\\x3c\\xcf\\x29\\xd9\\x86\\\n\\x69\\x00\\x9b\\x7e\\x73\\x82\\xa1\\x9a\\x01\\xfb\\x5f\\x1b\\xb9\\xa0\\x43\\xb1\\\n\\x99\\xfe\\xb4\\x1a\\xd4\\xbc\\x5e\\xb3\\xd5\\x01\\x0d\\x8e\\x92\\xab\\x03\\x1b\\\n\\x2a\\x9e\\xe5\\xbe\\xb1\\x44\\x14\\x8b\\xeb\\x88\\xd5\\x69\\x44\\x95\\x0e\\x4e\\\n\\x25\\xe5\\x80\\x52\\x72\\xa0\\x85\\x10\\x5d\\xc3\\x5d\\xf4\\x36\\x73\\x90\\x52\\\n\\x3e\\x30\\x54\\x33\\x60\\xef\\x4f\\x47\\x46\\x1d\\x29\\xb1\\x7f\\x22\\x11\\x51\\\n\\x18\\x6b\\xa9\\x39\\xc2\\x5d\\x6a\\x32\\xe0\\xe4\\x3d\\x67\\x27\\x6d\\x77\\xaf\\\n\\x21\\xa2\\xae\\xb0\\xa0\\x6b\\xa9\\x98\\xfb\\x99\\x72\\x82\\xa1\\x9a\\x11\\xae\\\n\\x54\\x63\\x18\\x8c\\xe0\\x5f\\x24\\x22\\x12\\xca\\x53\\x87\\xd9\\xec\\x9b\\x2f\\\n\\x6c\\xfe\\xcd\\x90\\x66\\x77\\xb1\\x21\\xa2\\x42\\x62\\xb3\\x6f\\x0e\\xb1\\xa6\\\n\\x9a\\x21\\x27\\x3e\\x7d\\x66\\x4e\\x08\\x8f\\x5f\\x22\\xa2\\x2e\\x27\\xa5\\x98\\\n\\xdb\\xe0\\x5c\\xc6\\x11\\x8a\\x28\\x67\\x18\\xaa\\x19\\x73\\x62\\xfb\\x54\\xd9\\\n\\x53\\x6a\\xb7\\xfe\\x5a\\x71\\x62\\x07\\xa2\\x2e\\x84\\x40\\x5d\\x2f\\x2f\\x0f\\\n\\x1d\\xe5\\xe4\\x2e\\xb9\\xc4\\xe6\\xdf\\x8c\\x7a\\x6c\\x76\\x78\\xc0\\xf3\\xe4\\\n\\x74\\xb2\\xbb\\xda\\x10\\x51\\xa6\\x29\\x75\\xec\\xc4\\x3d\\x67\\x79\\x40\\xfa\\\n\\x1c\\x63\\xa8\\x66\\x1c\\xe6\\x07\\x76\\x1c\\xf5\\x28\\xc3\\x95\\xa8\\xb8\\xaa\\\n\\x83\\x14\\x95\\x18\\x3f\\x8e\\x3d\\x01\\x28\\xd7\\x18\\xaa\\x39\\x80\\x5a\\xeb\\\n\\xf2\\xb2\\x53\\x62\\xb8\\x12\\x15\\xce\\x82\\xf2\\xc4\\xb1\\x9b\\x7a\\x2e\\x1f\\\n\\x65\\x73\\x6f\\x31\\x30\\x54\\x73\\xa6\\x3a\\xad\\xa1\\x72\\xbe\\xa8\\xd7\\x1c\\\n\\xe6\\x0b\\xe6\\xe1\\xbf\\x88\\x72\\x48\\x29\\x35\\xe3\\x49\\xf5\\xcc\\x07\\x9d\\\n\\xab\\x93\\x0c\\xd3\\x62\\x61\\xa8\\xe6\\xd8\\x97\\x7f\\x32\\xac\\x83\\x55\\x6e\\\n\\x95\\x52\\x3e\\xa0\\x84\\x18\\x90\\x92\\xc7\\xd9\\x24\\xca\\x1e\\x34\\xed\\xca\\\n\\x39\\x21\\xd5\\x1b\\x9e\\x12\\x33\\x1f\\x70\\xaf\\xcc\\x30\\x48\\x8b\\x8b\\xa1\\\n\\x5a\\x30\\x4f\\xce\\x0e\\xf6\\x5f\\x5a\\x5a\\x3f\\xa0\\xa4\\x87\\xf9\\x47\\x75\\\n\\xb9\\x3e\\xf7\\xa8\\xe3\\x39\\x6c\\x3a\\x26\\x6a\\x0b\\xb5\\xe0\\x39\\x6a\\x35\\\n\\x28\\x1d\\x4f\\xcc\\xf7\\x2c\\x8b\\xf9\\x1b\\x6e\\xb8\\xba\\xc0\\x00\\x25\\x22\\\n\\x22\\x22\\x22\\x22\\x22\\x22\\x22\\x22\\x22\\xca\\x39\\x21\\xfe\\x1f\\xf5\\x3f\\\n\\xad\\x40\\x47\\xc3\\xfd\\x1e\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\\n\\x60\\x82\\\n\\x00\\x00\\x00\\xd1\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x10\\x00\\x00\\x00\\x10\\x08\\x06\\x00\\x00\\x00\\x1f\\xf3\\xff\\x61\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x86\\x49\\x44\\x41\\x54\\x38\\x8d\\xd5\\xd1\\x3d\\x0a\\\n\\xc2\\x50\\x10\\x04\\xe0\\xcf\\x84\\x74\\x5e\\x44\\x09\\x08\\x82\\x57\\xb0\\xb0\\\n\\x92\\x1c\\xca\\xc2\\x83\\xa4\\x91\\x5c\\x44\\x3c\\x83\\x95\\x7f\\x67\\x10\\x82\\\n\\x29\\xb4\\x90\\xe0\\x7b\\x42\\x52\\x84\\x0c\\x2c\\x2c\\xcc\\xec\\xec\\xb0\\xcb\\\n\\x98\\x50\\x62\\xd5\\xc7\\x60\\x8d\\x07\\x96\\x7d\\x4c\\xb6\\xb8\\x61\\x1e\\x13\\\n\\x4d\\xb1\\xc3\\x19\\x35\\x5e\\x3f\\xea\\x88\\x49\\x68\\xf8\\x84\\xea\\x13\\x35\\\n\\x6b\\xf1\\x05\\xae\\x98\\x85\\xb6\\xef\\x71\\x08\\x70\\x1b\\xdc\\xb1\\x88\\xc5\\\n\\xbf\\x20\\x0f\\x70\\x7f\\xbf\\x90\\xe1\\x89\\x34\\x26\\x6a\\x23\\xf9\\xea\\x53\\\n\\xef\\xa3\\xd5\\x5d\\x0d\\x3a\\x61\\x78\\x83\\xe1\\xd1\\x00\\x11\\x26\\x16\\x72\\\n\\x44\\x98\\x03\\xe0\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\\n\\x00\\x00\\x01\\x1a\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x20\\x00\\x00\\x00\\x20\\x08\\x06\\x00\\x00\\x00\\x73\\x7a\\x7a\\xf4\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\xcf\\x49\\x44\\x41\\x54\\x58\\x85\\xed\\x96\\x41\\x0a\\\n\\xc2\\x30\\x10\\x45\\x9f\\x42\\x77\\xc5\\x73\\x68\\xdd\\xa8\\x3b\\xcf\\xa2\\x47\\\n\\x52\\x51\\xd0\\xc3\\xe8\\x35\\xbc\\x41\\xd1\\x0b\\xd8\\x8d\\x52\\x21\\x2e\\x66\\\n\\x0a\\x6e\\xda\\x26\\x25\\x45\\x90\\xf9\\x10\\x7e\\x20\\x93\\xfc\\x97\\xb4\\x25\\\n\\x05\\x93\\xa9\\x5d\\x4e\\x5b\\x2f\\xf3\\x86\\x1d\\x16\\x8e\\x2a\\x03\\x30\\x00\\\n\\x03\\x30\\x00\\x03\\xf0\\x01\\x28\\xd4\\xd3\\x80\\x75\\x47\\xea\\x8f\\x18\\x00\\\n\\xb9\\xfa\\x34\\x00\\xa0\\xaa\\xcd\\x1b\\xab\\x3c\\x01\\x2e\\xea\\xab\\x00\\x80\\\n\\xb5\\xfa\\x39\\x60\\x4e\\xad\\x32\\xe0\\x0d\\x3c\\x81\\x99\\x47\\xfd\\x02\\x78\\\n\\x01\\x25\\x30\\x8e\\x01\\x00\\x70\\x40\\xee\\xf6\\x1b\\x30\\x6f\\x09\\xbf\\x6b\\\n\\xed\\x2e\\x56\\x38\\x40\\x82\\x3c\\x0a\\x87\\xec\\xee\\x08\\x2c\\x91\\x17\\x33\\\n\\xd5\\xfe\\x49\\xc7\\x1c\\x72\\xf4\\x49\\x4c\\x80\\x0a\\x62\\x8f\\x1c\\xad\\xab\\\n\\x69\\x25\\xb2\\xf3\\xe8\\xe1\\xdf\\xca\\x80\\x2d\\x70\\x45\\x3e\\xd1\\x42\\xfb\\\n\\x1b\\x60\\xd2\\x67\\xf0\\x7f\\x6a\\xd0\\x30\\xd6\\xe5\\x4f\\x38\\x38\\xeb\\xe7\\\n\\x77\\x81\\xc9\\xf4\\x01\\x03\\x59\\x2a\\x74\\x94\\x02\\x88\\x2a\\x00\\x00\\x00\\\n\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x00\\x85\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x20\\x00\\x00\\x00\\x20\\x08\\x06\\x00\\x00\\x00\\x73\\x7a\\x7a\\xf4\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x3a\\x49\\x44\\x41\\x54\\x58\\x85\\xed\\xd4\\x21\\x0e\\\n\\x00\\x20\\x0c\\x03\\xc0\\xc1\\xff\\xff\\x0c\\x9e\\x2c\\x20\\x08\\x20\\xb8\\x93\\\n\\x35\\x35\\x4d\\x23\\xe0\\x77\\x25\\xc9\\xda\\xcd\\xce\\x7a\\xb8\\x8c\\xa5\\x6c\\\n\\x03\\xa3\\xdd\\x4d\\x4c\\x3b\\x6c\\xe0\\x39\\x3f\\x80\\x1f\\xc0\\x0f\\x00\\x74\\\n\\x6a\\x27\\x05\\x10\\x5a\\x70\\x8c\\x42\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\\n\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x0d\\x3b\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x64\\x00\\x00\\x00\\x64\\x08\\x06\\x00\\x00\\x00\\x70\\xe2\\x95\\x54\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc3\\x00\\x00\\x0e\\xc3\\x01\\xc7\\x6f\\\n\\xa8\\x64\\x00\\x00\\x0c\\xd0\\x49\\x44\\x41\\x54\\x78\\x5e\\xed\\xdd\\x65\\x8c\\\n\\x34\\x49\\x1d\\x06\\xf0\\xc3\\xdd\\xdd\\xdd\\xdd\\xdd\\xdd\\x3d\\x10\\x24\\x10\\\n\\x82\\x7c\\x21\\x40\\x80\\x0f\\x90\\x00\\xc1\\x12\\x2c\\x81\\x0f\\x38\\x81\\xe0\\\n\\x10\\x20\\x84\\x04\\x09\\x10\\x9c\\xc3\\x1d\\x0e\\x77\\x77\\x77\\x87\\xe7\\xf7\\\n\\xee\\xf6\\xbd\\xc3\\xa4\\xab\\xba\\x67\\xae\\xbb\\x67\\x76\\xa7\\x9f\\xe4\\xc9\\\n\\xde\\xee\\xed\\xbb\\x53\\x5d\\xff\\xaa\\xbf\\x57\\xf5\\x31\\x33\\x66\\xcc\\x98\\\n\\x31\\x63\\xc6\\x8c\\x19\\x33\\x46\\xc0\\x89\\xf6\\xbf\\x1e\\x04\\x9c\\x23\\xbc\\\n\\xd0\\x3e\\xcf\\x16\\x9e\\x76\\x81\\x27\\x0b\\xff\\x19\\xfe\\x29\\xfc\\xe3\\xfe\\\n\\xd7\\x5f\\x86\\xdf\\xdd\\xe7\\x2f\\xc2\\x03\\x81\\x6d\\x14\\xc8\\x89\\xc3\\x33\\\n\\x86\\x57\\x0e\\xaf\\x16\\x5e\\x35\\xbc\\x48\\x78\\xfa\\xf0\\xe4\\xa1\\xc9\\x3f\\\n\\x49\\xe8\\xf7\\xd0\\x33\\xe0\\x7f\\xf7\\xf9\\x9f\\x7d\\xfe\\x3b\\x24\\xa4\\xbf\\\n\\x87\\xbf\\x0f\\xbf\\x19\\x7e\\x3a\\xfc\\x54\\xf8\\xb9\\xf0\\x0f\\xa1\\xdf\\xdf\\\n\\x2a\\x6c\\x8b\\x40\\x4e\\x1a\\x9e\\x2f\\xbc\\x71\\x78\\xa3\\xf0\\xd2\\x21\\x01\\\n\\x34\\x3b\\xe0\\x94\\x61\\x33\\xf9\\xab\\xa2\\x11\\xd2\\x5f\\xc3\\x3f\\x87\\x76\\\n\\xcf\\xef\\xc2\\x2f\\x85\\xef\\x0d\\xdf\\x1f\\xfe\\x34\\x24\\xc0\\x8d\\x63\\xd3\\\n\\x02\\x39\\x7b\\x78\\xed\\xf0\\x26\\xa1\\x1d\\x71\\xae\\xf0\\x2c\\x21\\x21\\x10\\\n\\xc0\\x58\\x20\\x20\\xaa\\xed\\x57\\x21\\x61\\x7c\\x26\\x7c\\x77\\xf8\\xf1\\xf0\\\n\\xd7\\xe1\\xc6\\xb0\\x29\\x81\\x9c\\x33\\xb4\\x13\\x6e\\x15\\x5e\\x31\\x3c\\x77\\\n\\x78\\xa6\\x70\\x4c\\x21\\x94\\x60\\x67\\xfc\\x36\\xfc\\x51\\x78\\x5c\\x48\\x30\\\n\\x1f\\x08\\x7f\\x18\\x4e\\x8e\\xa9\\x05\\x72\\x9e\\xf0\\x16\\xe1\\x0d\\xc3\\x2b\\\n\\x84\\x0c\\xf4\\xe9\\xc2\\x6d\\x81\\x5d\\xf3\\xfd\\xf0\\xf3\\xe1\\xbb\\xc2\\xf7\\\n\\x84\\x3f\\x0b\\x27\\xc3\\x54\\x02\\x61\\x03\\xae\\x17\\xde\\x21\\x24\\x8c\\x0b\\\n\\x87\\xa7\\x0a\\xb7\\x15\\x6c\\xcd\\xb7\\xc2\\x0f\\x86\\x6f\\x0f\\x8f\\x0d\\xd9\\\n\\xa0\\xd1\\xc1\\x5b\\x19\\x1b\\x97\\x09\\xef\\x13\\xde\\x37\\xbc\\x65\\x78\\xde\\\n\\x90\\xa7\\xb4\\xcd\\xe0\\xcd\\x71\\xb3\\x2f\\x19\\x5a\\x3c\\xd4\\xe9\\x6f\\xc2\\\n\\xd1\\xed\\xcb\\x98\\x3b\\xc4\\xa4\\xb3\\x13\\x77\\x0f\\x6f\\x1d\\x8a\\x1d\\x86\\\n\\x58\\x00\\x8d\\x41\\xfe\\x5b\\xc8\\xa5\\xfd\\xc7\\xfe\\xcf\\xd8\\x1f\\x13\\x69\\\n\\x37\\xda\\x7d\\xa7\\xd9\\xff\\xd9\\x09\\x05\\x1b\\xc3\\xf0\\xbf\\x2d\\x7c\\x43\\\n\\x68\\xb7\\xfc\\x2b\\x1c\\x05\\x63\\x08\\xc4\\xdf\\xb4\\xa2\\x6e\\x13\\xde\\x3f\\\n\\xbc\\x66\\x68\\x92\\x56\\x45\\xe3\\xae\\xf2\\x84\\x7e\\x12\\xfe\\x3c\\x64\\x7c\\\n\\xb9\\xac\\x56\\x2a\\xb5\\x42\\x8d\\x10\\x8a\\x49\\x23\\x6c\\x9f\\x83\\xbc\\x34\\\n\\xde\\x9a\\x78\\xc6\\x58\\xac\\x76\\x8e\\xc3\\x59\\x43\\xe3\\x5b\\xe7\\xb9\\x7d\\\n\\xde\\x47\\xc2\\x97\\x85\\xef\\x0c\\x8d\\x63\\x70\\x0c\\x2d\\x10\\x2b\\x92\\xe1\\\n\\xb6\\x2b\\x1e\\x12\\x52\\x4f\\xab\\xec\\x0a\\x42\\xb0\\xe2\\x19\\xd2\\xef\\x85\\\n\\x3c\\x1d\\xba\\xfc\\xeb\\xe1\\xb7\\x43\\x2b\\x55\\x04\\x4e\\x08\\x5d\\x20\\x18\\\n\\xbb\\x92\\x20\\x04\\x96\\x97\\x08\\x2f\\x1a\\x8a\\x77\\x2e\\x18\\xf2\\xf4\\xc4\\\n\\x3f\\xab\\xcc\\x81\\x9d\\xf1\\x9d\\xf0\\x79\\xe1\\xeb\\x43\\x19\\x80\\x41\\x83\\\n\\xcb\\x21\\x05\\xe2\\xe1\\x3c\\xe8\\xbd\\xc3\\x47\\x85\\xa7\\x0e\\xfb\\xfe\\x7d\\\n\\x3b\\x41\\xe4\\x4c\\x08\\x22\\x6a\\xd1\\xf4\\x87\\x43\\xde\\xce\\x90\\xc6\\xd4\\\n\\x98\\xae\\x12\\x5e\\x37\\x94\\x05\\x20\\x28\\x63\\x5e\\x25\\xee\\x21\\x00\\x91\\\n\\xff\\x33\\xc2\\xd7\\x86\\xdc\\xe5\\xad\\x08\\x2a\\x17\\xc1\\x5e\\x5c\\x2a\\x7c\\\n\\x66\\x68\\xf5\\x1a\\x74\\x1f\\x7a\\x10\\xc6\\xf2\\xb3\\xe1\\x8b\\xc3\\xdb\\x85\\\n\\x67\\x08\\xa7\\x00\\x55\\x76\\xe7\\xf0\\xe5\\x21\\xc1\\x53\\x87\\xc6\\xd3\\x36\\\n\\xce\\x65\\x5a\\x40\\x9e\\xf3\\x29\\xa1\\x5d\\x67\\x31\\x6e\\x0d\\x0c\\x86\\x37\\\n\\x62\\x1b\\xdb\\xd2\\x6d\\x0f\\xd0\\x46\\x3a\\x99\\x2a\\x7a\\x51\\xc8\\xf8\\xaf\\\n\\x63\\x67\\x86\\x00\\x07\\xe0\\xe6\\x21\\xdb\\x60\\x77\\x1a\\x97\\x09\\x6f\\x1b\\\n\\xf3\\x32\\x3d\\xef\\xb3\\x42\\x3b\\x6d\\x0a\\x8f\\xb5\\x13\\x06\\x61\\x30\\x4f\\\n\\x0d\\xfb\\x0a\\xc3\\xef\\x31\\xca\\x0c\\xe3\\xdd\\x42\\xde\\xd0\\x36\\x80\\xda\\\n\\x62\\xfb\\x8c\\xcb\\xae\\x5d\\xe5\\x79\\x9e\\x1c\\x9e\\x3f\\xdc\\x44\\xa6\\xe1\\\n\\x78\\xb0\\x0f\\x8c\\xf6\\xe3\\xc3\\xbe\\x6a\\x8a\\xc1\\x96\\x0e\\x7f\\x74\\xc8\\\n\\xf8\\x6f\\x23\\x2e\\x10\\x3e\\x31\\x14\\xb1\\xcb\\x16\\xb7\\x3d\\xc7\\x32\\xb9\\\n\\xe0\\xec\\x26\\x47\\x61\\x68\\x47\\xa9\\x37\\xce\\x1c\\x3e\\x3c\\x94\\x3d\\x6d\\\n\\x1b\\xe4\\x32\\xad\\xa4\\x8f\\x86\\xdc\\xe1\\x53\\x84\\xdb\\x0c\\x6a\\xec\\xae\\\n\\x21\\xe7\\xa2\\xef\\x4e\\x11\\x1b\\x3d\\x30\\x9c\\xca\\x06\\xfe\\x1f\\xd8\\x8d\\\n\\x7b\\x84\\x56\\x51\\x5f\\x7d\\xfb\\xca\\x50\\x5a\\x7d\\xe8\\x15\\xc4\\x8d\\xc5\\\n\\xa1\\x41\\xfd\\xc8\\x40\\x0b\\x06\\xdb\\x9e\\x67\\x99\\xe6\\x81\\x4b\\x7c\\xdb\\\n\\x70\\x72\\x7b\\xc2\\x08\\xab\\x25\\xf4\\xf1\\x4a\\x0c\\x94\\xc1\\xbf\\x58\\x38\\\n\\xa4\\x8e\\xbd\\x63\\x28\\x36\\x69\\x3e\\x47\\xbc\\x72\\xfb\\x70\\x48\\x98\\x58\\\n\\xde\\xe3\\xf3\\xc3\\x3e\\xcf\\x6a\\x37\\xc9\\x7d\\x5d\\x2b\\x9c\\x0c\\x3c\\x2a\\\n\\x9e\\x91\\xf8\\xa0\\x6d\\x50\\x8b\\xf4\\x10\\x0c\\x9e\\xac\\xee\\x90\\xab\\x86\\\n\\x30\\xda\\x76\\xa6\\xcf\\x1b\\x5a\\x28\\x0d\\xc4\\x1d\\x7d\\x84\\xf2\\x97\\xf0\\\n\\xd9\\x21\\x67\\x67\\x74\\x70\\x4d\\x1f\\x16\\xfe\\x38\\x6c\\x1b\\xcc\\x32\\x9f\\\n\\x13\\x0e\\x2d\\x0c\\x2a\\x6f\\x71\\x67\\x2c\\x93\\xeb\\x3a\\x06\\x2e\\x1e\\x3e\\\n\\x37\\x6c\\xfb\\xcc\\x65\\x0a\\x16\\x1f\\x1c\\x8e\\xee\\xca\\xdf\\x2c\\x54\\xc0\\\n\\xe9\\x32\\x74\\x56\\x12\\x9b\\xe1\\x21\\x86\\xd6\\xa7\\xdc\\xcb\\xb6\\xcf\\x5c\\\n\\xe4\\x18\\x36\\x05\\x64\\xae\\xa5\\x4c\\xda\\x3e\\x73\\x91\\xe6\\x47\\x32\\x52\\\n\\xc9\\x61\\x34\\x28\\xaf\\xda\\x8a\\x92\\x6a\\x6d\\x83\\x68\\xc8\\x55\\xfc\\x44\\\n\\x78\\xd9\\x70\\x0c\\xe3\\x66\\x52\\xda\\x3e\\x77\\x91\\x7e\\x67\\x0c\\xc8\\x48\\\n\\x48\\xb9\\x7c\\x32\\xec\\x72\\x66\\xc4\\x32\\x22\\x79\\x65\\xea\\x51\\x20\\x47\\\n\\xf5\\x85\\xb0\\x36\\x10\\x2b\\xe3\\x07\\x21\\xd7\\x76\\xac\\x20\\x69\\x93\\x02\\\n\\x01\\x29\\x7e\\x36\\x4c\\x62\\xb1\\x66\\x53\\xcc\\x13\\xc1\\x49\\xcf\\xf4\\x46\\\n\\xdf\\x49\\x13\\x00\\xf2\\xac\\xe4\\x6d\\x4a\\x6e\\xab\\x41\\xf0\\xc5\\x5f\\x18\\\n\\x2a\\x7d\\x1a\\xd0\\x61\\x84\\xe0\\xd6\\xf3\\xbd\\x20\\x6c\\x02\\xe2\\x36\\x98\\\n\\x27\\x1e\\x9a\\x0a\\xa9\\x80\\xb1\\x17\\xfa\\x0a\\xe4\\xfa\\xa1\\x2c\\xa9\\x6c\\\n\\x69\\x09\\xa2\\x55\\x5d\\x1b\\xaf\\x08\\xfb\\xa4\\xc7\\x0f\\x32\\xe4\\xbb\\x5e\\\n\\x1a\\x0a\\x1c\\x09\\xa8\\x04\\xe9\\x98\\x6b\\x84\\xbd\\xdd\\xe0\\x3e\\x02\\x51\\\n\\x53\\xd0\\xa6\\xa3\\x94\\x59\\x82\\xdd\\xa0\\x56\\xf1\\x92\\x90\\x07\\x76\\xd8\\\n\\x61\\x57\\x50\\xcd\\xdc\\x7f\\x79\\xb9\\x9a\\x36\\x50\\x87\\xb1\\x4b\\x14\\xcc\\\n\\x3a\\xd1\\x47\\x20\\x24\\x7c\\xf9\\xb0\\xd6\\x1d\\xa2\\x96\\xa1\\x21\\x40\\x62\\\n\\x6e\\x97\\xf0\\xd6\\x50\\x49\\x57\\xec\\x51\\x82\\x54\\x8a\\x88\\xff\\x4a\\x47\\\n\\xbe\\xeb\\x40\\x97\\x40\\xa4\\x48\\x48\\x57\\xc2\\xad\\x04\\xab\\x83\\xdf\\xfd\\\n\\x9a\\xd0\\x56\\xde\\x25\\xb0\\x99\\xea\\x29\\xca\\xcb\\xb5\\x5d\\x22\\x48\\x54\\\n\\x14\\xeb\\xf4\\x3a\\xbb\\x04\\x22\\x23\\xab\\x7f\\x4a\\x22\\xb1\\x04\\xc9\\x45\\\n\\x05\\x26\\x89\\xc3\\x5d\\x84\\xa6\\x3a\\xbd\\xc2\\xb5\\x5d\\xc2\\xf5\\xd5\\x10\\\n\\xd8\\x69\\xdc\\xbb\\x04\\x22\\xb0\\x11\\x64\\x95\\x24\\x4b\\x97\\xaa\\x7b\\xbf\\\n\\x39\\x9c\\xa4\\x6f\\x69\\x0b\\xc1\\x99\\x79\\x63\\x68\\x97\\x94\\x3c\\x2e\\xf3\\\n\\xa7\\x54\\xac\\x6d\\xb6\\x8a\\x9a\\x40\\xb8\\x6d\\xbc\\x2b\\x1d\\x1b\\x25\\x08\\\n\\x02\\xa5\\x31\\xac\\x92\\x5d\\x06\\x37\\x58\\xe6\\x5b\\x1c\\x56\\x82\\xd0\\x81\\\n\\x40\\xaa\\xd9\\xee\\x9a\\x40\\x74\\x9f\\x4b\\x24\\xfa\\x5a\\x82\\xe0\\x48\\xf0\\\n\\x33\\x4a\\x4b\\xcc\\x01\\x82\\xa8\\x5c\\x76\\xa2\\xd6\\x48\\xa7\\x86\\xdf\\x35\\\n\\x9f\\x55\\x81\\xf0\\x0a\\xd8\\x8e\\xd2\\xef\\x34\\xea\\x8a\\x77\\x35\\x63\\xaf\\\n\\x1c\\xa1\\x7d\\xa9\\xa4\\xb6\\xcc\\xa3\\xbe\\x30\\x35\\xa1\\x22\\xba\\x04\\x52\\\n\\xab\\x7e\\xf9\\x60\\x31\\x07\\x83\\x3e\\x63\\x6f\\x87\\xd4\\x04\\x02\\x16\\x38\\\n\\xe3\\x5e\\x44\\x4d\\x20\\x7c\\xe7\\x9a\\x40\\x6c\\x4f\\xa9\\xee\\x9a\\x77\\xb1\\\n\\x4b\\xe0\\x6d\\x9a\\x8f\\x9a\\xfa\\xa6\\xb6\\xc4\\x74\\x45\\xd4\\x04\\xc2\\x2b\\\n\\xa8\\x75\\xa8\\x5b\\x0d\\x5f\\xdd\\xfb\\xcf\\x19\\xfb\\x70\\x2a\\x4b\\xeb\\x6b\\\n\\x09\\x52\\x29\\xe6\\xb5\\x88\\x92\\x40\\xf8\\xcd\\xfa\\x62\\x6b\\x81\\x8c\\x96\\\n\\xce\\xb1\\x8a\\x41\\x07\\x15\\x5f\\x0b\\x6b\\x86\\x5d\\xa0\\x6d\\x5e\\x8b\\x69\\\n\\x94\\x92\\x40\\x44\\xe6\\xaa\\x5d\\x35\\x17\\x4d\\x3b\\xa5\\x26\\xe8\\x19\\x47\\\n\\x21\\x63\\x21\\x7a\\x2f\\xc1\\x7c\\xd2\\x3a\\xc5\\x02\\x5a\\x4d\\x20\\xf2\\xfe\\\n\\x25\\x48\\x13\\x10\\xc8\\x81\\x39\\x6e\\x3c\\x11\\x24\\x58\\x09\\xa4\\x96\\x46\\\n\\x21\\x10\\x55\\xcf\\x56\\x94\\x04\\xc2\\x3d\\xab\\x1d\\xaa\\x91\\xb3\\xa2\\x2b\\\n\\x45\\xa9\\x33\\x8e\\xc2\\x7c\\x98\\x97\\x5a\\xd6\\xc2\\xbc\\x16\\x53\\x51\\x25\\\n\\x81\\x74\\x75\\x83\\xfb\\xc0\\xda\\xd6\\xdc\\x55\\x70\\x79\\xcd\\x4b\\xad\\x1e\\\n\\xc4\\x8e\\x98\\xdf\\x56\\x94\\x26\\x5d\\xbf\\x6d\\xcd\\xa0\\x2b\\xca\\x6c\\xf3\\\n\\xee\\x10\\x7c\\x29\\xa8\\xad\\x4b\\xb1\\x42\\x2d\\x65\\x54\\x83\\xc5\\x2a\\xa5\\\n\\x54\\x82\\x79\\xad\\x15\\xfa\\x5a\\xf1\\xf4\\x90\\xb7\\x40\\xe2\\x6d\\xd4\\xa1\\\n\\xa7\\x1d\\x68\\x13\\xe8\\x53\\x53\\x1f\\x8a\\xd2\\x42\\x9a\\x1a\\x56\\xc1\\x63\\\n\\x42\\x19\\x8c\\xb6\\xbf\\x87\\xec\\xcc\\x13\\xc2\\x56\\x94\\x76\\x08\\x3d\\x57\\\n\\xf3\\xb0\\x18\\x2d\\x05\\xfe\\xc3\\x0e\\xc2\\x70\\xd3\\xc3\\xe5\\x8e\\x7c\\xd7\\\n\\x0f\\x12\\x8c\\xb5\\xb9\\x31\\xe7\\x45\\xfb\\x5c\\x12\\x48\\xd3\\xf5\\x5d\\x82\\\n\\x7f\\x57\\x53\\x69\\x87\\x09\\xd4\\xb7\\xee\\xcb\\xbe\\x60\\x23\\x6a\\x73\\x63\\\n\\x31\\x17\\x55\\x5a\\x49\\x20\\xd2\\x21\\x35\\xd7\\x8d\\x84\\xb7\\xbd\\x83\\x7d\\\n\\x48\\xe8\\xb8\\xe9\\x0b\\x6e\\x6d\\xcd\\x43\\x35\\xaf\\xc5\\x74\\x53\\x49\\x20\\\n\\xdc\\xda\\xda\\xb6\\x13\\xa3\\xd4\\xd2\\x2a\\x63\\x62\\xdb\\xbd\\xbb\\x2e\\x81\\\n\\x98\\xd7\\x95\\x05\\x22\\x51\\xd6\\x15\\xdc\\x6c\\xea\\x4a\\x0c\\xdd\\x1e\\x8a\\\n\\x62\\x53\\xe2\\x7d\\xfb\\x5f\\xbb\\xc0\\xee\\xaa\\x77\\xd4\\xb4\\x07\\x1b\\x53\\\n\\xec\\x3d\\x28\\x09\\x44\\x70\\x53\\x73\\xdd\\xe8\\x55\\xf9\\x98\\x4d\\x9d\\x0b\\\n\\x7c\\x44\\x58\\x5b\\x30\\x43\\xc2\\xe4\\x3d\\x76\\xef\\x3f\\x3b\\x61\\x3e\\xcc\\\n\\x4b\\x4d\\x7b\\x98\\xd7\\x62\\xbe\\xab\\x24\\x10\\xc7\\x93\\x6b\\xc1\\x8d\\x7f\\\n\\x27\\x35\\x3f\\x5a\\xdf\\x6a\\x07\\xde\\x12\\xde\\x29\\x74\\x26\\x64\\x4c\\xa8\\\n\\x71\\xdc\\x20\\xfc\\xf2\\x91\\xef\\xba\\xa1\\xff\\x99\\xe6\\x28\\xcd\\x2b\\x88\\\n\\x53\\x94\\x7b\\x5b\\x51\\x72\\x6d\\x35\\xc7\\xd9\\xa6\\x7c\\xfe\\xd2\\xef\\xf8\\\n\\xff\\x56\\xce\\xc7\\x8e\\x7c\\xb7\\x39\\xa8\\x55\\xaf\\x1b\\xc4\\x95\\x40\\xcf\\\n\\x4b\\x9c\\xae\\x9a\\xab\\xd3\\x83\\xf0\\xb4\\xb0\\xd4\\xa9\\xc8\\x73\\x25\\x64\\\n\\xa7\\xac\\x6a\\x59\\xe1\\x56\\x38\\xb8\\xdf\\xb8\\xbf\\x6d\\xfc\\x62\\xe8\\x52\\\n\\x99\\x19\\x47\\xf1\\xa0\\xd0\\x51\\xef\\xb6\\xf9\\x42\\x19\\x8e\\x77\\x84\\x45\\\n\\xd4\\xb6\\x96\\x68\\xbc\\x56\\x0d\\xd4\\x63\\x54\\xad\\x0f\\xef\\x20\\x1c\\xc1\\\n\\xa0\\x5d\\x4a\\xe0\\x2c\\x31\\x07\\x45\\xd4\\x04\\xd2\\x5c\\x14\\x59\\x82\\x8c\\\n\\xa5\\x73\\x83\\x2b\\xe7\\x65\\x0e\\x29\\xd8\\x0e\\x07\\x94\\x6a\\x65\\x6f\\xdd\\\n\\x29\\x8e\\x74\\x14\\x51\\x13\\x88\\xe6\\x05\\x35\\x8f\\x12\\xfc\\x5b\\x17\\xbb\\\n\\x48\\xc6\\xcd\\xd8\\xeb\\x81\\x66\\xcb\\x6a\\x29\\x27\\xd7\\x77\\xac\\x2d\\x10\\\n\\xff\\x90\\xe1\\x29\\xb9\\x97\\x3e\\x58\\xe5\\x8b\\x21\\x9b\\xb1\\x77\\x42\\x80\\\n\\x97\\x55\\x12\\x08\\x47\\x41\\xd9\\xbb\\xea\\xb1\\xd5\\x04\\x62\\x77\\xa8\\x11\\\n\\xd7\\xd4\\x16\\xb7\\xd7\\xca\\xd0\\x4d\\xb1\\xcb\\xa0\\xbe\\xcd\\x43\\xb1\\xf0\\\n\\x14\\xd8\\x1d\\xe6\\xb3\\x9a\\x69\\xa8\\x09\\x84\\x57\\x70\\x6c\\xa8\\x67\\xb5\\\n\\x04\\x29\\x02\\xe7\\x46\\x74\\xc8\\xef\\x32\\x5c\\x5e\\xa3\\x2c\\x2b\\xb1\\x58\\\n\\x82\\x1e\\x36\\x0d\\xe9\\xe6\\xb5\\x88\\x9a\\x40\\x40\\x57\\xa2\\x54\\x45\\x29\\\n\\xaf\\xd5\\xa8\\x2d\\x41\\xda\\xa6\\x72\\x5b\\x9b\\x86\\xe8\\xfc\\x2e\\x61\\xcd\\\n\\x7e\\x98\\x3f\\x77\\xbc\\x74\\xc6\\x6c\\x5d\\x02\\x11\\x1c\\xb1\\x25\\xbc\\x83\\\n\\x12\\x94\\x23\\x75\\x39\\x5e\\xe7\\xc8\\x77\\xbb\\x07\\x99\\x60\\xcf\\x5f\\xf3\\\n\\x36\\x05\\x98\\xe6\\xb1\\xf3\\xca\\xd9\\x2e\\x81\\x90\\xac\\xce\\xf6\\x62\\xa8\\\n\\x1f\\xf8\\x1b\\x76\\xc9\\xbd\\xc2\\x62\\xad\\xf8\\x90\\x82\\xab\\x7b\\xbf\\x50\\\n\\x4c\\x56\\x9b\\x4b\\x29\\x1e\\x81\\x76\\x49\\xd3\\x1c\\x8f\\x2e\\x81\\x80\\x32\\\n\\x26\\xe9\\xd6\\x8c\\x91\\x81\\xf1\\xb6\\x5c\\x03\\xbb\\x4b\\x70\\x03\\x9e\\x33\\\n\\x34\\x35\\x75\\xcd\\x39\\x12\\xd3\\xe1\\x60\\xb8\\x67\\xe8\\x1a\\xbc\\xc5\\x34\\\n\\xc0\\x32\\x45\\xf5\\xce\\x18\\xca\\x2d\\x1d\\x76\\xb0\\x15\\x8c\\x38\\xa7\\xa7\\\n\\xeb\\xae\\x30\\x27\\x93\\xd9\\xd8\\x5e\\xe8\\xb3\\x43\\x80\\x71\\x77\\x61\\x7d\\\n\\x2d\\x95\\xc2\\xb8\\x71\\xfd\\x5c\\x98\\xbc\\xa9\\xb4\\xfc\\x54\\x50\\x7e\\x78\\\n\\x40\\x28\\x28\\xae\\x35\\x14\\x4a\\x95\\xd0\\x30\\xa3\\x24\\x60\\xd9\\x08\\xbb\\\n\\x44\\xa0\\xd8\\xb6\\x12\\x70\\xf1\\x26\\x87\\xc3\\x5a\\x73\\x57\\x7c\\x72\\x3b\\\n\\x83\\x20\\x8f\\x4d\\x68\\x9b\\x07\\x34\\x4f\\x32\\xbb\\x2b\\xdd\\xe4\\xb0\\x0a\\\n\\x44\\xa1\\x2e\\x7c\\xec\\x7b\\xd7\\x89\\x4e\\x8d\\xc3\\x24\\x14\\x69\\x22\\x71\\\n\\xd7\\xd5\\x43\\x69\\xa5\\xda\\xc2\\x44\\x59\\x0e\\xcd\\x11\\xa3\\xd6\\x8c\\x6e\\\n\\x1a\\xf6\\xbd\\x0d\\xe8\\xd5\\xe1\\x18\\xb7\\x01\\x6d\\x0a\\x82\\x3e\\xf5\\xa1\\\n\\x3e\\x37\\xcc\\x99\\x1f\\x67\\xd8\\x47\\xbd\\x0d\\x08\\xd8\\x86\\x4d\\xdf\\x97\\\n\\xb5\\x09\\x18\\xbf\\xc5\\xe5\\x66\\xbc\\xb6\\xe7\\x5c\\xa6\\x46\\x39\\xb5\\x91\\\n\\x49\\x6c\\xa9\\x83\\x8b\\x2e\\x98\\x51\\x8a\\x6c\\x1b\\xcc\\x22\\xed\\x94\\x31\\\n\\x6e\\x94\\x9b\\x12\\xc6\\xad\\xcc\\xb0\\xca\\x8d\\x72\\xcd\\x5d\\xbe\\x93\\xc1\\\n\\xbb\\xa2\\x1c\\x05\\xee\\x52\\x5d\\x48\\xd7\\xba\\xb3\\x70\\xe8\\x3b\\x17\\xa7\\\n\\x00\\x61\\xac\\x73\\xe7\\xa2\\x17\\x10\\x4c\\x0a\\xfa\\xd4\\xa5\\xc3\\xaa\\x5f\\\n\\x5d\\xc6\\xad\\xe1\\xab\\xc2\\x31\\x6e\\x25\\x1d\\x0b\\xc6\\xc9\\xad\\x75\\x29\\\n\\x40\\xdb\\xf3\\x2c\\xd3\\x3c\\x68\\x4f\\xda\\x98\\x87\\x29\\xd5\\xfc\\xd0\\x50\\\n\\x04\\xdf\\x36\\xc0\\x65\\xf2\\xbe\\xf8\\xe3\\x0a\\xfc\\xdb\\x1e\\xa7\\x88\\xbc\\\n\\xdd\\xdb\\xeb\\x35\\x7b\\x7d\\xb4\\x00\\x2a\\x53\\x88\\x4d\\x6a\\x15\\xc3\\x51\\\n\\x61\\x05\\xb9\\x0b\\xe5\\x71\\x61\\x57\\xb4\\xda\\xb0\\xb9\\xd9\\x5a\\x87\\xf8\\\n\\xb6\\x46\\xf4\\x0e\\x65\\x3e\\x29\\x94\\xbf\\x33\\xde\\xb6\\xe7\\x58\\xa6\\xa3\\\n\\x19\\x8f\\x0c\\xbb\\x2a\\x86\\xa3\\x83\\x4d\\x50\\x0f\\x59\\xe7\\xee\\x77\\xee\\\n\\xb3\\x60\\xb3\\x7a\\xb3\\xc1\\x84\\x90\\x8f\\x3b\\xd0\\x77\\xbf\\x37\\x60\\x4f\\\n\\x78\\x5e\\xae\\x50\\xed\\xfb\\x10\\xc8\\x1b\\xf9\\x46\\xe8\\x35\\x15\\x9c\\x84\\\n\\x4d\\xa9\\x31\\xea\\xc9\\x9b\\xe3\\x5c\\xb3\\x74\\xe0\\xdf\\x8e\\xd0\\x40\\x04\\\n\\x3b\\xd4\\xfb\\x43\\x1c\\x1b\\x9e\\x02\\x8b\\xef\\x0f\\x91\\xcd\\x96\\x81\\xe8\\\n\\xe3\\x49\\x21\\x81\\x51\\x53\\x83\\xbf\\x3f\\x64\\x48\\x7d\\x67\\x50\\xf4\\xef\\\n\\x10\\x6f\\xd8\\x61\\x4c\\xbd\\xef\\x49\\xee\\xac\\xd8\\x98\\xbc\\x06\\x24\\x05\\\n\\x79\\x4e\\x2e\\x13\\xf3\\xd5\\x64\\x1a\\x73\\xd7\\x99\\xca\\x45\\x34\\x63\\x75\\\n\\xca\\xec\\x75\\xe1\\xa0\\x6f\\xd8\\x19\\xda\\x00\\x79\\x28\\x39\\x9f\\xe6\\x1d\\\n\\x54\\xb5\\xbb\\xb6\\xda\\x60\\xf5\\xf1\\xc6\\x1c\\xfb\\x22\\x1c\\x11\\x2f\\x57\\\n\\x72\\xf9\\x1d\\x54\\x5d\\xe7\\x1b\\x3d\\x17\\x15\\x28\\x8f\\x24\\x07\\x47\\xa5\\\n\\xb8\\xfb\\xd0\\x57\\x63\\x22\\x04\\x45\\x25\\x8b\\x68\\x95\\x39\\xa0\\xa2\\x8c\\\n\\x43\\x5c\\xb2\\xf5\\xef\\xa0\\x6a\\xe0\\x6f\\x52\\x07\\xfc\\x71\\xd5\\x34\\x7d\\\n\\xae\\xeb\\xd4\\xdb\\x1b\\xd5\\xc0\\x01\\x90\\xaa\\x59\\x7c\\x4b\\x1b\\x35\\x27\\\n\\xb5\\x2d\\x5b\\x40\\x45\\x5a\\xa1\\x04\\x2f\\x13\\xeb\\xb3\\x18\\x68\\x6e\\x79\\\n\\xf3\\x96\\x36\\x93\\x6f\\xa1\\x38\\xee\\x0d\\xeb\\x3c\\xb7\\x9d\\xaa\\xfe\\x41\\\n\\xc5\\x79\\x0b\\xe8\\x28\\x57\\x52\\x8d\\x21\\x90\\x06\\x56\\x9f\\x7a\\xb3\\xdd\\\n\\xe2\\x3d\\x86\\x56\\xeb\\x10\\x86\\x8f\\x90\\x4c\\x0e\\x61\\xd8\\x29\\x5c\\x53\\\n\\x3f\\xb3\\x3b\\x09\\x04\\xa9\\x4b\\x1c\\xc2\\xeb\\x21\\x6c\\xbd\\x05\\x22\\x70\\\n\\x89\\xc5\\x0f\\xed\\xff\\x6c\\x14\\x8c\\x29\\x90\\x06\\xa2\\x73\\xbb\\xc5\\xbd\\\n\\xf1\\xde\\x8d\\x6e\\xd5\\x4e\\xf1\\xb9\\x27\\x14\\x76\\xa8\\xf2\\x2b\\x87\\x83\\\n\\x30\\xdc\\xe5\\xce\\x2b\\x1c\\x15\\x53\\xb8\\x6a\\x74\\xbe\\x87\\x6a\\x02\\x2d\\\n\\x86\\x95\\x11\\xad\\x1d\\xfb\\xda\\x34\\xec\\xc0\\xaf\\x84\\xce\\xa1\\x78\\x59\\\n\\xd8\\x9b\\xc2\\x5a\\x7f\\xda\\x60\\x98\\xca\\x77\\x66\\x0c\\x45\\xe8\\xdc\\x4b\\\n\\x86\\xb0\\x31\\xca\\xf4\\xfd\\x36\\xa5\\x51\\x9a\\x3b\\xaf\\x9c\\x7d\\xf1\\x76\\\n\\x07\\x74\\xec\\xc2\\xf8\\x27\\xc1\\xa6\\x54\\x07\\x23\\xab\\x4b\\xc5\\xfb\\xd4\\\n\\xb9\\x9f\\x0c\\x6e\\xd7\\x75\\x50\\x63\\x81\\x3d\\xe0\\x2c\\x70\\x1c\\x4c\\xbe\\\n\\x2c\\xb6\\xb3\\xe9\\x3c\\xbc\\xc9\\xb1\\x69\\x5d\\xee\\x2c\\x05\\x2f\\x8c\\x7d\\\n\\xd1\\x6c\\xc6\\x45\\xe5\\x09\\xad\\x12\\x17\\xac\\x03\\x4e\\x80\\xa4\\xa8\\xb3\\\n\\x94\\x5c\\x69\\x71\\x8f\\x54\\x8e\\xd2\\xf3\\xca\\x27\\x9b\\x86\\xc4\\xb6\\x18\\\n\\x57\\x3b\\x43\\x7c\\xa0\\x47\\x58\\x1a\\x45\\xa9\\xd4\\x8e\\x69\\xec\\x0d\\xb5\\\n\\x46\\x40\\xeb\\x8c\\x97\\x71\\xb6\\x0b\\xa8\\x49\\xb6\\x81\\x5a\\xe2\\xb2\\x1e\\\n\\x17\\xba\\xb8\\xd2\\x6e\\xd0\\x51\\x38\\x9a\\xe7\\xb4\\x0a\\xb6\\xd1\\xdb\\x31\\\n\\x26\\xc2\\xb0\\x63\\x5c\\x6d\\xd1\\xbc\\xb3\\xd6\\xcf\\x38\\x02\\x48\\x80\\x04\\\n\\xd4\\xb0\\x81\\x95\\xdf\\xd0\\x04\\x0b\\x32\\x39\\x12\\x54\\x52\\x93\\x01\\xd0\\\n\\x96\\xa3\\x69\\x8d\\x60\\x06\\x0d\\xea\\x86\\xc0\\x36\\x0a\\xa4\\x04\\x71\\x8c\\\n\\x52\\xb0\\xec\\x72\\xa3\\xd6\\x04\\x80\\x8d\\xc7\\x66\\xe2\\x4d\\x32\\x55\\x84\\\n\\xbc\\x3b\\x8e\\x84\\x88\\xdf\\x7f\\xcf\\x98\\x31\\x63\\xc6\\x8c\\x19\\x33\\x66\\\n\\x4c\\x85\\x63\\x8e\\xf9\\x1f\\x14\\xbe\\xad\\xda\\x96\\xb0\\xa6\\xcd\\x00\\x00\\\n\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x00\\x84\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x20\\x00\\x00\\x00\\x20\\x08\\x06\\x00\\x00\\x00\\x73\\x7a\\x7a\\xf4\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x39\\x49\\x44\\x41\\x54\\x58\\x85\\xed\\xd4\\x31\\x0a\\\n\\x00\\x20\\x0c\\x03\\xc0\\xea\\xff\\xff\\xac\\x1f\\x28\\x74\\x28\\x8a\\xe0\\xdd\\\n\\x98\\x25\\x4b\\x48\\x04\\xfc\\x6e\\x24\\xd9\\xba\\xd9\\x39\\x0f\\x97\\x51\\xca\\\n\\x36\\x50\\xe9\\x6e\\xc4\\x06\\xde\\xe2\\x07\\xf0\\x03\\xf8\\x01\\x80\\x0d\\x4a\\\n\\x27\\x05\\x10\\x7b\\xf4\\xd9\\x97\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\\n\\x42\\x60\\x82\\\n\\x00\\x00\\x0e\\xae\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\xfa\\x00\\x00\\x00\\xfa\\x08\\x06\\x00\\x00\\x00\\x88\\xec\\x5a\\x3d\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc3\\x00\\x00\\x0e\\xc3\\x01\\xc7\\x6f\\\n\\xa8\\x64\\x00\\x00\\x0e\\x43\\x49\\x44\\x41\\x54\\x78\\x5e\\xed\\xdd\\x05\\x90\\\n\\x23\\x69\\x19\\x87\\xf1\\xc3\\xdd\\xdd\\xdd\\x39\\xdc\\xdd\\x5d\\x0e\\x77\\x77\\\n\\x28\\x5c\\x0e\\x87\\x82\\xc3\\xe5\\x28\\xdc\\xdd\\x0b\\x28\\xdc\\xfd\\x70\\x77\\\n\\x2d\\xec\\x90\\xc2\\xdd\\xfd\\x7d\\x36\\xe9\\xb9\\x9e\\xec\\xdb\\x92\\xb4\\xce\\\n\\xec\\xf3\\xab\\xfa\\xd7\\x64\\x67\\x93\\x74\\xa6\\xd3\\x5f\\xcb\\x67\\xbd\\x9f\\\n\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\\n\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\\n\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\\n\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\\n\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\\n\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\\n\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\\n\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\\n\\x92\\x24\\x49\\x92\\x24\\x0d\\xe3\\x28\\xcb\\x9f\\x43\\x39\\xfe\\xf2\\xe7\\x46\\\n\\x0e\\xb7\\xfc\\xa9\\xf9\\x3b\\x68\\xf9\\xb3\\xca\\xdf\\x22\\x8f\\x59\\x3c\\xd4\\\n\\x48\\x4e\\x18\\x61\\x9d\\xdf\\x3c\\x72\\xf4\\xc8\\x37\\x22\\x77\\x8b\\x7c\\x38\\\n\\xd2\\x97\\x87\\x46\\xee\\x1d\\xa1\\xa0\\xff\\x28\\xf2\\xa4\\xc8\\xb3\\x22\\xda\\\n\\x85\\x8e\\x11\\xf9\\x5f\\x43\\xfa\\xdc\\xb8\\xd4\\x8c\\x82\\xfd\\xa5\\x48\\xf6\\\n\\x5d\\x5c\\x3a\\xd2\\x87\\xa7\\x45\\xb2\\xf7\\xbf\\x6f\\x44\\xbb\\x90\\x05\\x7d\\\n\\x7e\\x9e\\x13\\xc9\\xbe\\x07\\xf2\\x9e\\x48\\x57\\xa7\\x8b\\x64\\xef\\x5d\\xe4\\\n\\x22\\x11\\xed\\x32\\x16\\xf4\\x79\\x39\\x20\\x92\\x7d\\x07\\x45\\x0e\\x8d\\x74\\\n\\x75\\xb5\\x48\\xf6\\xde\\x45\\x3e\\x12\\xd1\\x2e\\x63\\x41\\x9f\\x97\\x6f\\x45\\\n\\xb2\\xef\\xa0\\xc8\\x9b\\x23\\x5d\\x9d\\x22\\x92\\xbd\\x77\\x39\\xf7\\x88\\x68\\\n\\x17\\xb1\\xa0\\xcf\\xc7\\x81\\x91\\x6c\\xfd\\x97\\x73\\xcd\\x48\\x1f\\x5e\\x1f\\\n\\xc9\\xde\\xbf\\xc8\\x5f\\x22\\xa7\\x8a\\x68\\x97\\xb0\\xa0\\xcf\\xc3\\xb1\\x23\\\n\\x7f\\x88\\x64\\xeb\\xbf\\xc8\\x07\\x23\\x7d\\xb9\\x58\\x24\\x5b\\x46\\x39\\xaf\\\n\\x88\\x68\\x97\\xb0\\xa0\\xcf\\xc3\\xa3\\x22\\xd9\\xba\\x2f\\xe7\\xb2\\x91\\x3e\\\n\\xbd\\x2c\\x92\\x2d\\xa7\\x9c\\xfd\\x23\\xb5\\x6c\\x47\\xdf\\x39\\x68\\x4b\\xad\\\n\\xf3\\x9f\\xc8\\xd3\\x17\\x0f\\x35\\x80\\x13\\x44\\x7e\\x1c\\x39\\xda\\x9e\\x7f\\\n\\xe5\\x5e\\x19\\xb9\\xc5\\xe2\\x61\\x6f\\xce\\x1a\\xf9\\xe6\\xe2\\x61\\xa5\\x97\\\n\\x44\\x6e\\xbb\\x78\\x28\\xa9\\x8b\\xc7\\x45\\xb2\\xa3\\x69\\x39\\x67\\x8e\\x0c\\\n\\xe1\\xe0\\x48\\xb6\\xbc\\x72\\xd8\\x21\\x48\\xea\\xe0\\xa4\\x91\\x7f\\x45\\xb2\\\n\\x02\\x56\\xe4\\xf1\\x91\\xa1\\x9c\\x38\\xf2\\xd7\\x48\\xb6\\xdc\\x22\\xcf\\x8b\\\n\\x48\\xea\\xe0\\xc9\\x91\\xac\\x70\\x15\\xf9\\x65\\x84\\x7a\\x94\\x21\\x3d\\x2c\\\n\\x92\\x2d\\xbb\\x9c\\x33\\x46\\x24\\x6d\\x88\\x82\\x9c\\x15\\xac\\x22\\x0f\\x89\\\n\\x0c\\x8d\\xba\\x01\\x9a\\xd3\\xb2\\xe5\\x17\\x61\\x87\\x94\\xea\\xa3\\x32\\xee\\\n\\x88\\x91\\x73\\x2f\\xc3\\x29\\xce\\xb7\\x23\\x87\\x44\\x58\\x39\\x75\\x8e\\x1a\\\n\\xb9\\x5c\\xe4\\xd4\\x11\\x5e\\xc7\\x80\\x80\\x22\\xff\\x8d\\x0c\\x8d\\xbf\\x9d\\\n\\xe5\\x16\\x39\\xd9\\xf2\\xe7\\x6f\\x23\\xbf\\x59\\xe6\\x7b\\x11\\x06\\x12\\xa8\\\n\\x3b\\xd6\\xf7\\xc5\\x23\\x27\\x59\\x86\\x23\\xe0\\xaf\\x23\\xac\\xe7\\x5f\\x44\\\n\\x3e\\x1d\\x99\\xa3\\x9b\\x44\\x5e\\xbd\\x78\\x58\\x89\\xee\\xaa\\x3f\\x5c\\x3c\\\n\\x1c\\x14\\x83\\x59\\xee\\xba\\x78\\x98\\xfa\\x55\\x84\\xd3\\xfc\\xbd\\xac\\x16\\\n\\xf4\\x6b\\x44\\x4e\\xb9\\x0c\\x9d\\xf6\\x8f\\x1c\\x39\\xd2\\xf2\\xe7\\xe1\\x23\\\n\\xa0\\x20\\x50\\x03\\xcc\\x97\\x45\\x05\\xc5\\x6d\\x22\\x19\\x7a\\x07\\xd1\\x73\\\n\\x87\\x9a\\xca\\x32\\x3a\\xfc\\xdf\\x2b\\x42\\xa7\\x82\\x23\\xf0\\x8b\\xc4\\xeb\\\n\\x22\\x8f\\x8d\\x7c\\x65\\xcf\\xbf\\xba\\xe3\\xf3\\x9f\\x6f\\x25\\xe7\\x8d\\xb4\\\n\\x41\\xbb\\xe9\\xd7\\x22\\xaf\\x8a\\xd0\\xd4\\xc1\\xb5\\xd2\\x50\\x58\\xd7\\x74\\\n\\x7d\\x3c\\x79\\x84\\x1d\\x0f\\xeb\\xa7\\x08\\xeb\\x7f\\xf5\\xdf\\xab\\x28\\x38\\\n\\x8c\\x76\\x1a\\xca\\x15\\x23\\x6c\\x1b\\x74\\xd2\\x60\\x58\\x66\\x79\\xfb\\x28\\\n\\xb0\\xc1\\x3f\\x71\\xf1\\x70\\x8f\\x3b\\x47\\x6e\\x18\\xb9\\x44\\x84\\xe7\\x56\\\n\\xe1\\xb3\\x7f\\x20\\xc2\\x7a\\x7e\\x1b\\xbf\\x98\\x89\\x77\\x46\\xae\\xba\\x78\\\n\\x98\\x7a\\x7b\\xa4\\xaf\\x0e\\x32\\x4d\\x2e\\x14\\x69\\xda\\x21\\xde\\x2c\\x52\\\n\\xb9\\x63\\x3a\\x5b\\x84\\x86\\xfe\\xec\\x74\\x60\\x35\\x5f\\x88\\xf0\\x85\\xf3\\\n\\xc5\\x64\\xff\\x5f\\xce\\xef\\x22\\xd7\\x8d\\xe0\\xb4\\x11\\x0a\\x7f\\xf6\\xbc\\\n\\xaa\\x3c\\x3b\\x52\\xb7\\x71\\x34\\xb9\\x63\\xe4\\xfd\\x91\\xec\\xbd\\x37\\x49\\\n\\x31\\x14\\x94\\x82\\xd6\\x37\\x86\\x37\\x72\\x74\\xcb\\x96\\xdb\\x36\\x7d\\x0c\\\n\\xa6\\xc8\\xf0\\x7d\\x7f\\x35\\x92\\x2d\\x73\\x35\\x6f\\x89\\xe0\\xd6\\x91\\xef\\\n\\x44\\xb2\\xe7\\x34\\x85\\xf7\\x60\\xa3\\x9e\\xda\\x99\\x22\\xd9\\xe7\\x2b\\xe7\\\n\\xc6\\x91\\x31\\x1d\\x12\\xc9\\x3e\\x47\\x91\\x77\\x47\\x2a\\x7d\\x2a\\x92\\xbd\\\n\\x28\\xcb\\xef\\x93\\xdf\\x35\\xe5\\x35\\xc9\\xef\\xda\\xe6\\xad\\x91\\x75\\x5d\\\n\\x30\\xf2\\xd3\\x48\\xf6\\x7e\\x7d\\x84\\xa3\\xd6\\xb5\\x22\\x7d\\x39\\x7b\\x84\\\n\\xcb\\x95\\x6c\\x59\\xeb\\x64\\xa8\\x82\\xce\\xe5\\x58\\xb6\\xbc\\x2c\\x1f\\x8f\\\n\\xbc\\x77\\xe5\\x77\\x9b\\xe6\\x76\\x91\\x29\\x35\\x75\\x90\\xe1\\x54\\x79\\x6c\\\n\\xac\\x93\\xec\\xb3\\x94\\x93\\x36\\xb5\\x71\\x8d\\x9c\\x3d\\x79\\x4e\\x59\\xb7\\\n\\xe9\\xa0\\x69\\xd0\\x41\\x5f\\xe1\\x34\\xa9\\x0f\\xb7\\x8c\\x64\\xef\\xbf\\x6e\\\n\\x86\\x28\\xe8\\x5c\\xe2\\x64\\xcb\\x1a\\x2b\\x5c\\xc2\\x4d\\x85\\x11\\x62\\xd9\\\n\\x67\\x2a\\xc2\\x78\\xf1\\xb1\\x71\\x36\\xd9\\xd4\\x0d\\x77\\xaf\\xeb\\x78\\xae\\\n\\xf3\\x86\\x6e\\x16\\xe8\\x03\\xa7\\xe0\\x17\\x5d\\x3c\\x6c\\x74\\xbc\\xc8\\x59\\\n\\x16\\x0f\\x07\\x47\\x4f\\xa8\\xc6\\xee\\x87\\x2d\\x1c\\x73\\xf9\\x73\\x8e\\xe8\\\n\\xdf\\x3d\\xa5\\x07\\x45\\xaa\\xea\\x81\\x86\\x44\\x1d\\xc4\\xa5\\x16\\x0f\\x2b\\\n\\xbd\\x6b\\xf9\\x73\\x4c\\xf4\\x80\\xe4\\x8c\\xa9\\x0e\\x7d\\xe4\\xb7\\xa1\\xa0\\\n\\xd3\\xbd\\x8e\\x6a\\xfb\\xb9\\xbb\\xcb\\xf2\\x67\\x13\\x3a\\x36\\x8c\\x89\\xf6\\\n\\xcd\\xae\\x68\\x69\\x98\\xab\\x39\\x7c\\xb6\\x17\\x47\\x98\\xb6\\x69\\x4c\\x4d\\\n\\x85\\x1c\\x5c\\xa6\\x4c\\xa1\\x69\\xb9\\xb4\\x6e\\xa4\\x6e\\x15\\xc9\\x4e\\x01\\\n\\xda\\x86\\x1d\\xc5\\xcf\\x56\\x7e\\xb7\\x4e\\xbe\\x9e\\xfc\\x6e\\x35\\x54\\x84\\\n\\x95\\x6b\\x77\\xeb\\x7c\\x22\\x92\\xbd\\x47\\x5d\\xfe\\x19\\xa1\\x29\\xed\\xe7\\\n\\xcb\\xc7\\xd9\\x73\\xaa\\x72\\x8e\\x48\\x57\\x5c\\x9e\\x64\\xef\\xbd\\x4e\\x86\\\n\\xba\\x46\\xa7\\xe6\\x3c\\x5b\\xde\\x26\\xa1\\x2e\\xe2\\x27\\x11\\x5a\\x6f\\xb2\\\n\\xff\\xaf\\xca\\xfd\\x23\\x63\\x7a\\x74\\x24\\xfb\\x1c\\x45\\xa6\\x6c\\x0e\\xbc\\\n\\x40\\x24\\xfb\\x4c\\xe5\\xd0\\xe4\\x97\\x62\\x63\\x65\\x50\\x04\\xa7\\x05\\x6d\\\n\\x6a\\xd4\\xc9\\x47\\x23\\x57\\x8f\\x14\\x6e\\x10\\x59\\xa7\\xc0\\x3f\\x32\\x42\\\n\\xfb\\x3b\\xd8\\x0b\\xd1\\x6e\\x9d\\x3d\\xaf\\xc8\\x85\\x23\\x6d\\x30\\x82\\xe8\\\n\\x4f\\x91\\xec\\x3d\\xf8\\x3d\\x23\\xbd\\xe8\\x5c\\x40\\x1b\\x29\\xcb\\x3f\\x51\\\n\\x64\\xd5\\xb1\\x22\\xbc\\xcf\\x6b\\x23\\xd9\\xfb\\x94\\xc3\\xdf\\xd1\\x87\\x6b\\\n\\x47\\x5e\\x1a\\xe1\\x3b\\xa0\\x69\\x91\\x50\\x11\\x56\\xec\\x80\\x68\\xc5\\xa8\\\n\\xeb\\x0a\\x39\\x54\\x41\\xc7\\x79\\x22\\x1c\\x59\\xa9\\xb8\\x5d\\x77\\x47\\xf8\\\n\\xd9\\xc8\\x03\\x22\\xab\\x1b\\xdf\\x71\\x22\\x5c\\xfa\\x3c\\x21\\x92\\xbd\\xae\\\n\\x1c\\x0e\\x06\\x63\\x6a\\xba\\x3e\\x7f\\x4a\\x64\\x4a\\x4d\\xd7\\xe9\\xad\\xea\\\n\\x8f\\xf8\\x62\\xb2\\x17\\x97\\x43\\x13\\x48\\xd6\\xf4\\xc5\\x75\\x6b\\xf6\\xfc\\\n\\x72\\x38\\x03\\xc8\\x6a\\xad\\xe9\\x40\\x93\\x3d\\xbf\\xc8\\x95\\x22\\x6d\\xd1\\\n\\xde\\x4b\\x93\\xd5\\x53\\x23\\xf7\\x8b\\x5c\\x27\\x72\\xce\\xc8\\x26\\x18\\x91\\\n\\x94\\x7d\\x9e\\x22\\x1f\\x8a\\x8c\\xa5\\xee\\xec\\x67\\xc8\\x82\\x5e\\x46\\xdf\\\n\\x88\\x6c\\xf9\\x59\\x38\\x32\\xb6\\x41\\xa5\\x30\\x3b\\xb6\\xec\\x3d\\x8a\\x9c\\\n\\x21\\x32\\x06\\xae\\xcf\\xb3\\xe5\\x97\\x53\\x34\\x1b\\x4f\\x85\\xf6\\xfd\\xec\\\n\\x73\\x15\\xa1\\x69\\xba\\x51\\x53\\x41\\xaf\\x1b\\xfb\\x7c\\xfd\\x48\\xf6\\x9a\\\n\\x72\\xaa\\x9a\\xa6\\x38\\x8a\\x66\\xcf\\x2f\\x42\\x61\\x9d\\x4a\\x5d\\x13\\x21\\\n\\xb5\\xfc\\x63\\xd9\\x29\\x05\\x9d\\x33\\x8f\\xba\\x8e\\x26\\x99\\xa6\\x89\\x16\\\n\\xee\\x14\\x19\\x03\\xfd\\x4a\\xb2\\xe5\\x97\\x93\\xf6\\x40\\x1b\\x51\\x53\\x13\\\n\\xe6\\xb6\\x83\\x4f\\xd6\\xbb\\xaa\\x09\\xa7\\xd7\\xf4\\x74\\xaa\\xf2\\xf7\\xe5\\\n\\xcf\\x2a\\x7c\\x59\\x55\\x6d\\xe3\\x4d\\xaf\\xdd\\xe4\\xf3\\xf6\\xa5\\xae\\x02\\\n\\x84\\x5e\\x6c\\x3a\\xcc\\x1f\\x23\\x57\\x89\\xac\\x5b\\x2b\\x4d\\xdd\\x0a\\x97\\\n\\x56\\x55\\x38\\xd5\\x1f\\x43\\x53\\xc5\\x1f\\x35\\xdf\\x4d\\x5d\\xbc\\x87\\xc6\\\n\\x34\\x53\\x75\\xb6\\xfd\\x0d\\x9b\\x14\\x1c\\x7a\\xc6\\x75\\xf9\\x23\\xe9\\xe2\\\n\\xb8\\xa9\\x3e\\x0b\\x3a\\x5d\\x7c\\xe9\\xa8\\xc2\\x51\\x84\\x6e\\xa7\\x37\\x8d\\\n\\x30\\x11\\xff\\xf5\\x96\\xff\\xe6\\xfa\\xfc\\xf4\\x91\\x42\\x5d\\xd7\\xd7\\x21\\\n\\x7a\\xca\\xed\\x54\\xf4\\xee\\xbb\\x42\\x84\\xfa\\x9b\\x4d\\xd4\\xf5\\x19\\x1f\\\n\\xab\\x19\\xb2\\xa9\\xa0\\x4f\\x5d\\xc8\\xd1\\xf4\\x19\\xb6\\xd5\\x3b\\x6d\\x52\\\n\\x70\\xa6\\x9c\\x95\\xa6\\x4b\\x41\\xa7\\x60\\xd3\\x44\\xf7\\xa2\\xc8\\x97\\x23\\\n\\xd4\\x13\\x70\\x1a\\xcc\\x91\\xfa\\x1d\\x11\\x76\\x40\\xcc\\xbf\\xf5\\x86\\xe5\\\n\\xbf\\xe9\\x12\\x5c\\x54\\x0e\\x52\\x39\\x49\\x2f\\xa9\\x2a\\x16\\xf4\\xc3\\x30\\\n\\x4e\\x81\\x4b\\xbf\\x4d\\xfd\\x63\\xf9\\x33\\xc3\\x40\\xa8\\x31\\xec\\x86\\x82\\\n\\xde\\xf9\\x88\\xde\\xe7\\x51\\x75\\x5d\\x9b\\x2c\\x9b\\x9e\\x5d\\xcf\\x8c\\x50\\\n\\x58\\xa9\\xa0\\x60\\xca\\x9d\\x73\\x45\\xd6\\xc1\\x34\\x42\\x4c\\xbf\\x5b\\x65\\\n\\xca\\x75\\x32\\x37\\x43\\xae\\x8b\\xb1\\xd6\\xf3\\x6e\\x28\\xe8\\x1c\\x7c\\xb6\\\n\\xee\\xd7\\xb6\\xc9\\x8a\\xdb\\x49\\x47\\xf4\\x47\\x44\\xb8\\xd4\\xa0\\xf6\\xbd\\\n\\x6e\\xae\\xaf\\xae\\x2c\\xe8\\x87\\xb1\\xa0\\x8f\\xa3\\xcd\\x67\\xd8\\x3a\\x7d\\\n\\xdf\\x64\\xc5\\x4d\\xb9\\x51\\xb7\\xdd\\xc9\\xd0\\x05\\x96\\x8a\\x9d\\xbe\\xda\\\n\\xb7\\x9b\\xec\\x6b\\xa7\\xee\\x75\\xdf\\x43\\xd7\\xed\\xa3\\x6e\\x5d\\x8e\\xb5\\\n\\xed\\x35\\x8d\\x98\\xa4\\x1f\\xc1\\xd4\\xda\\x7c\\x86\\xad\\xbf\\x63\\xa7\\x15\\\n\\xf4\\x36\\x28\\xe4\\x5c\\x63\\xb7\\xed\\x1b\\xdf\\x87\\x29\\xcf\\x72\\xe6\\xa6\\\n\\xeb\\xf6\\x51\\xf7\\xfa\\xb1\\x76\\xa8\\x4d\\xa3\\xd2\\xa6\\x6e\\x5a\\x43\\x9b\\\n\\xcf\\x40\\xc5\\xe8\\x1e\\x9b\\x7c\\x29\\x73\\xde\\xa8\\x19\\xf3\\x4e\\x21\\x1f\\\n\\xab\\x63\\x85\\xf6\\xd6\\x75\\xfb\\x98\\xc3\\x11\\x9d\\xfa\\x9c\\x3a\\x59\\x4f\\\n\\xca\\xb1\\xb5\\xf9\\x0c\\x5b\\x7f\\xc7\\x26\\x2b\\x6e\\xac\\x95\\xbd\\x89\\x67\\\n\\x44\\x2c\\xe4\\xd3\\xea\\xba\\x7d\\xd4\\xbd\\x7e\\x2e\\x05\\x7d\\x27\\x1c\\xd1\\\n\\xe9\\x22\\xbb\\x35\\xc0\\x6b\\x93\\x15\\x37\\xd7\\x23\\x3a\\x7d\\xa9\\x99\\x0a\\\n\\xab\\x0d\\x06\\x55\\xd0\\xbf\\xfa\\x0e\\x11\\xda\\xcb\\x99\\x1a\\x89\\xbf\\x8b\\\n\\x6b\\x1a\\xf6\\x94\\xcc\\xcf\\x4d\\xfb\\x3a\\xe3\\xc4\\xe9\\xc2\\xc9\\xd4\\x46\\\n\\xab\\x53\\x62\\x29\\xd7\\xb5\\x30\\xd6\\x1d\\xd1\\xe7\\x72\\xea\\xbe\\x13\\x8e\\\n\\xe8\\xdb\\x76\\x56\\x9b\\x7c\\x29\\x63\\xed\\x55\\xd7\\x75\\x9f\\xe5\\xcf\\x3a\\\n\\x4c\\x87\\x44\\xcf\\x3c\\x0a\\xf6\\x03\\x23\\x2f\\x8c\\xd0\\x9d\\x97\\x82\\x8f\\\n\\x7f\\x47\\x58\\x41\\xdf\\x8d\\x7c\\x32\\x42\\xbb\\xfa\\xc3\\x23\\x74\\xd9\\xa5\\\n\\xcf\\xbc\\x16\\xea\\x76\\xf6\\x5d\\xb7\\x8f\\xba\\xd7\\x8f\\xb5\\xed\\x35\\x1d\\\n\\xd1\\x99\\xc3\\x61\\xea\\x39\\x04\\x9a\\x8e\\xe8\\x5b\\xd7\\xe7\\xd8\\x2d\\x05\\\n\\x9d\\x89\\x29\\x98\\xac\\xb2\\x0e\\xe3\\xc6\\x69\\x3f\\x7f\\xfe\\x9e\\x7f\\xad\\\n\\x8f\\x8e\\x33\\x6a\\x36\\xe4\\x35\\xfa\\x58\\x8a\\x1d\\x7f\\x1d\\x46\\xf3\\x4d\\\n\\xa9\\xa9\\x2f\\xc8\\xb6\\xe6\\xb7\\x21\\x0a\\xed\\x14\\x05\\xa2\\x72\\xa0\\xfd\\\n\\xd2\\x3d\\x23\\x07\\x2d\\x1e\\x6e\\x8c\\xa3\\xbd\\x86\\x37\\x87\\x03\\x09\\xf3\\\n\\x22\\x7e\\x71\\xf1\\xb0\\x12\\xb3\\xda\\x4e\\xa9\\x69\\x9b\\x67\\x98\\xed\\x96\\\n\\x39\\x1e\\x9d\\x37\\xc1\\xf4\\xc8\\x55\\x18\\xc3\\xdd\\xf5\\xe6\\x83\\x77\\x8f\\\n\\x4c\\x39\\x77\\xd9\\xbe\\x64\\x0e\\x47\\x74\\x6c\\x3c\\x8b\\xcb\\x08\\x18\\xd2\\\n\\xdb\\x74\\x57\\x16\\x66\\x8b\\xdd\\xb2\\x5b\\x0a\\x7a\\x5d\\xaf\\xb7\\x2e\\x53\\\n\\x4b\\x31\\xe6\\x98\\x99\\x44\\xd8\\x51\\x4c\\x3d\\x77\\xda\\xbe\\x62\\x2e\\xdb\\\n\\x24\\x1d\\xae\\xea\\x4c\\x59\\xd0\\x9b\\x96\\x4d\\x8d\\xfb\\xb6\\x19\\x70\\x56\\\n\\xf7\\x9e\\xd4\\x36\\xd3\\xd1\\xe4\\x32\\x91\\xaa\\xa3\\xe4\\xf7\\x23\\xcc\\x22\\\n\\xc3\\x1d\\x5a\\x98\\x0e\\x68\\x15\\xef\\xc1\\x48\\xb0\\x2a\\xdc\\x0c\\x81\\xda\\\n\\x6d\\x66\\x4c\\x59\\xc5\\xe7\\xa9\\x9b\\x83\\x8d\\x4a\\x12\\x2a\\x19\\x28\\xbc\\\n\\xe5\\x79\\xee\\xf8\\xbc\\xc5\\x4c\\x35\\xab\\xa8\\x38\\x61\\x78\\x23\\x5f\\x5c\\\n\\x9b\\xde\\x44\\x5c\\xfb\\x70\\x83\\x0a\\x66\\x7a\\xb9\\x7d\\xa4\\xae\\x8f\\x7b\\\n\\x19\\x7f\\x17\\x33\\xa8\\xb0\\x3c\\x86\\x31\\xae\\x73\\xa3\\x07\\x26\\xc9\\x60\\\n\\x86\\x1f\\xd6\\x3d\\x7f\\x07\\xfd\\xf3\\xcf\\xbf\\xcc\\xea\\x8d\\x27\\x78\\x4e\\\n\\x55\\x8d\\x2b\\xc3\\x7c\\xff\\x1c\\xe1\\xbd\\x98\\xf2\\x97\\x9f\\xab\\x61\\xac\\\n\\x35\\xeb\\x83\\x6b\\x69\\x86\\x93\\xb6\\xc5\\x7a\\x60\\x86\\x1f\\x3e\\x13\\x43\\\n\\x50\\x99\\x3b\\x20\\xc3\\xf7\\x42\\x0b\\x05\\x95\\x45\\x6c\\x70\\x6d\\x7b\\x91\\\n\\xb1\\xee\\x98\\xa6\\x9b\\xd1\\x83\\x55\\x15\\x5d\\xfc\\x6d\\xcc\\x71\\xc8\\x74\\\n\\x54\\x3c\\x1e\\x12\\xeb\\xa6\\xee\\x56\\xd5\\x1c\\x5c\\x18\\x6e\\x9d\\x6d\\xc7\\\n\\x43\\x63\\x70\\x16\\xeb\\xaa\\xca\\xfb\\x22\\xcc\\x9f\\xb0\\x17\\xbe\\xb4\\x17\\\n\\x44\\x8a\\x41\\xeb\\x6d\\x43\\xc5\\xd6\\x6a\\xe5\\x0b\\x4d\\x5c\\xd9\\x73\\x57\\\n\\xc3\\x6c\\x22\\x57\\x8e\\x94\\xb1\\x03\\xc8\\x9e\\xbb\\x1a\\x36\\x68\\xee\\x02\\\n\\x53\\xe0\\x66\\x01\\xd9\\xf3\\xca\\x61\\x83\\x7b\\x6e\\x84\\x41\\x2d\\x34\\xa9\\\n\\x9d\\x26\\x42\\xa1\\x66\\x48\\x25\\x33\\xc8\\x50\\xb0\\x0f\\x8d\\x64\\xaf\\xdd\\\n\\x24\\xb4\\xe9\\x37\\xe1\\xae\\x35\\x74\\xf0\\xc9\\x5e\\x3f\\x46\\x98\\x25\\xa8\\\n\\xcd\\x00\\x1f\\x36\\xe8\\xec\\xf5\\x6d\\xd2\\x34\\xe5\\x12\\x3b\\x36\\x3e\\x47\\\n\\xf6\\xda\\xba\\xbc\\x3c\\x72\\xdc\\xc8\\x90\\x9a\\xa6\\x36\\x2b\\x6f\\x83\\x63\\\n\\x62\\xf4\\x65\\xf6\\x79\\x8a\\x54\\xce\\xaf\\xc7\\xd0\\xcc\\xec\\x05\\x6d\\x42\\\n\\x01\\x29\\xa3\\x29\\x2a\\x7b\\x5e\\x16\\xf6\\x9a\\xe5\\x7b\\x4a\\xb7\\x2d\\xe8\\\n\\x45\\x98\\xd4\\xb2\\xd0\\x65\\x72\\xca\\xa1\\x52\\x79\\xd3\\xbb\\xc0\\x29\\x2a\\\n\\x33\\xac\\x66\\xaf\\x1b\\x33\\x4d\\xe3\\xc6\\xb9\\xc9\\x7e\\xf6\\xba\\x75\\x52\\\n\\xb7\\x1e\\x3e\\x16\\xc9\\x5e\\xd3\\x26\\x8c\\x4a\\x1c\\x12\\xdb\\x76\\xb6\\xdc\\\n\\x22\\x53\\x4c\\x10\\xc9\\xd9\\x6b\\xf6\\x59\\xca\\x49\\xef\\x72\\x43\\xb3\\x54\\\n\\xf6\\xe4\\x75\\x52\\x1e\\x27\\x7c\\x40\\x24\\x7b\\x4e\\x55\\xa8\\xe8\\x2a\\xac\\\n\\x5b\\xd0\\xb9\\xef\\x55\\xa1\\xeb\\x4c\\xb6\\x43\\xa4\\xae\\xe3\\x05\\xb7\\x39\\\n\\xca\\x5e\\x33\\x45\\xea\\xe6\\xd2\\xe3\\x72\\x29\\x7b\\xcd\\x3a\\xa9\\x9a\\xd8\\\n\\x91\\x26\\xaa\\xec\\xf9\\x6d\\x33\\xe4\\x7d\\xf0\\xc0\\xd9\\x5e\\xb6\\xdc\\x72\\\n\\xc6\\xbe\\x75\\x54\\xd3\\xce\\x27\\x9d\\x9e\\x9b\\xa3\\x4a\\x5d\\x8d\\x75\\x5b\\\n\\xe5\\xf7\\x58\\xb7\\x32\\xa5\\xed\\x35\\x70\\xa6\\xbc\\x5c\\x6e\\x80\\xc8\\xc4\\\n\\x94\\x73\\xc2\\x70\\xc7\\xaa\\x1b\\x64\\x70\\x5d\\x3e\\x17\\x74\\x20\\xca\\x30\\\n\\xc3\\x0e\\x63\\xf1\\xbb\\x62\\x26\\x9f\\xac\\xc2\\xb4\\xeb\\x3a\\xe0\\x3d\\x87\\\n\\xbc\\x59\\x07\\xf7\\xed\\xa3\\x4e\\xa0\\x4e\\x5f\\x77\\xeb\\x69\\x83\\xef\\xa2\\\n\\x7c\\x16\\x9b\\xa1\\x93\\x57\\x8a\\xb9\\xd2\\xb3\\x3d\\x43\\xdb\\x30\\xdf\\x7a\\\n\\x59\\x9b\\xc9\\x21\\xcb\\xa1\\x9b\\x69\\x61\\xdd\\x23\\x7a\\x56\\xb0\\xf9\\x43\\\n\\xb3\\xe7\\x4e\\x11\\x2a\\x2e\\xab\\x50\\xb1\\x95\\xbd\\x66\\x8a\\xd0\\x5c\\x53\\\n\\xa5\\x6e\\x7a\\xe9\\xb6\\x39\\x24\\x92\\x61\\x47\\x92\\x3d\\xbf\\x6d\\xa8\\x53\\\n\\x19\\x1a\\xf7\\x3e\\xcf\\x96\\x5d\\xa4\\xa9\\x17\\x5d\\x9f\\xe8\\xfd\\x99\\x7d\\\n\\x86\\x72\\x6a\\x77\\x9e\\x0f\\x8e\\x64\\x2f\\x6a\\x93\\xd5\\x0a\\x09\\x26\\x8e\\\n\\xcc\\x9e\\x97\\x65\\x75\\x03\\x58\\xa7\\xa0\\x53\\xb3\\x4d\\x0d\\x72\\x86\\x6e\\\n\\xab\\xd9\\x6b\\x36\\x0d\\xa7\\x43\\x4d\\xd3\\xeb\\x66\\x29\\xef\\xc4\\x32\\x4c\\\n\\x5f\\x95\\xbd\\x6e\\xcc\\x34\\xf5\\x31\\xa0\\xe6\\x39\\x7b\\xdd\\x3a\\xe1\\x14\\\n\\xb8\\x0a\\xf7\\xfc\\xce\\x5e\\xd3\\x26\\x4d\\xeb\\xb7\\x0f\\x54\\xda\\x66\\xcb\\\n\\x2e\\x87\\xfb\\x03\\x8c\\xa1\\x69\\x3a\\xec\\x37\\x46\\x1a\\x51\\x89\\xc6\\x74\\\n\\xc1\\x9c\\xaa\\x30\\x13\\x27\\x35\\xdb\\x59\\x68\\x32\\x61\\x7a\\x63\\xe6\\x54\\\n\\xcb\\xee\\x0b\\xcd\\x6d\\x64\\xb3\\x0f\\x41\\x98\\x0f\\x8c\\xbd\\x30\\x37\\x01\\\n\\x60\\x4f\\xb9\\x3a\\x07\\x58\\x5d\\x41\\xa7\\xd6\\x9c\\x1b\\xe6\\xd3\\x63\\x89\\\n\\x16\\x82\\xf4\\x8e\\x91\\x25\\x97\\x8c\\x74\\xa9\\x64\\xe4\\x68\\x4c\\x21\\xe0\\\n\\xae\\x18\\x38\\x30\\x92\\x3d\\xaf\\x1c\\xd6\\x0f\\xaf\\xe3\\x3e\\xdf\\x6d\\xa7\\\n\\x3a\\xa6\\xa9\\x84\\xf5\\x41\\xb7\\xcb\\xec\\x3d\\xfb\\x0e\\x3b\\x48\\x9a\\xbf\\\n\\xa8\\x48\\x62\\x50\\x4f\\x1b\\xd4\\xbb\\x30\\xbd\\xf0\\x0f\\x22\\x34\\x6d\\x66\\\n\\xef\\x5b\\x0e\\x4d\\x6c\\x8c\\x17\\x78\\x53\\xa4\\x4d\\x7b\\x33\\x2d\\x21\\x8c\\\n\\x2d\\x68\\x9a\\x46\\xba\\x58\\xbf\\x9c\\x52\\xaf\\x3b\\x95\\x74\\x17\\xcc\\xb8\\\n\\x9a\\x7d\\x9e\\x22\\x34\\x67\\x0d\\xad\\x4d\\xdd\\x17\\xcf\\xd9\\x67\\x31\\x6c\\\n\\x95\\x42\\x4a\\x13\\x51\\x55\\xc5\\x12\\x6d\\xb2\\x9f\\x8f\\x70\\x03\\x79\\xa6\\\n\\x9f\\xaa\\x6a\\xa3\\xa4\\xfe\\xa1\\x2e\\x5d\\xd1\\x54\\x39\\x74\\xfa\\x90\\xfd\\\n\\xed\\xe5\\x74\\x91\\xbd\\x5f\\x91\\xa9\\xd0\\x77\\x21\\xdb\\x6e\\xca\\xa9\\xeb\\\n\\x3b\\xd2\\x07\\x76\\xcc\\xd9\\x72\\x8b\\x74\\x99\\x90\\x73\\x57\\xa2\\xb3\\x08\\\n\\x37\\xb8\\xe7\\x48\\x43\\xd3\\xde\\x58\\x73\\x85\\x6b\\x67\\xe3\\xec\\x24\\x2b\\\n\\x60\\x45\\x86\\xbc\\x19\\x25\\x67\\x3c\\xd9\\x32\\xcb\\xb9\\x51\\x44\\x52\\x47\\\n\\xdc\\x5d\\x35\\x2b\\x60\\xe5\\x70\\xeb\\xaf\\x21\\x70\\x19\\x94\\x2d\\xaf\\x48\\\n\\x53\\x77\\x5d\\x49\\x6b\\x60\\x02\\x92\\xac\\xa0\\x15\\xa1\\xfe\\xaa\\x8f\\xe6\\\n\\xc8\\x32\\x76\\x1e\\xd9\\xb2\\xca\\x99\\xfa\\x3e\\x70\\xd2\\xae\\x72\\xf9\\x48\\\n\\x56\\xd0\\xca\\x39\\x38\\xd2\\x17\\xba\\xa6\\x33\\xb6\\x23\\x5b\\x4e\\x91\\x6d\\\n\\xc3\\x51\\x25\\xf5\\xa3\\xe9\\x5a\\x9d\\x94\\xbb\\x75\\x77\\xd1\\x74\\x8f\\x76\\\n\\xd2\\x76\\xfa\\x34\\x49\\x6b\\x60\\x64\\x61\\x56\\xe0\\xca\\xe9\\xe3\\xa8\\xce\\\n\\xe8\\xd0\\xa6\\xa3\\x79\\xab\\x76\\x73\\x49\\x9b\\xe1\\x3e\\x7c\\x59\\xc1\\x2b\\\n\\xc2\\x90\\xe5\\xae\\xda\\x54\\xfe\\x55\\x0d\\xcd\\x96\\xd4\\x13\\x46\\xfd\\x65\\\n\\x85\\x8f\\xf4\\x31\\xaa\\xad\\x69\\xc0\\x0f\\xb3\\x1e\\x4b\\x1a\\x58\\x5d\\x41\\\n\\xa4\\x4b\\x79\\x1f\\x3e\\x17\\xc9\\xde\\x9f\\x9e\\x97\\x92\\x46\\x42\\x1f\\x77\\\n\\x26\\x92\\x2c\\x17\\xc2\\x3e\\xa7\\x05\\xdf\\x3f\\xf2\\x99\\x48\\xf9\\xfd\\x99\\\n\\xa8\\x64\\xed\\x1b\\x48\\xf4\\xd5\\x25\\x52\\xda\\x57\\x31\\xcb\\x0d\\x33\\x25\\\n\\x31\\xa7\\x20\\xbd\\xe3\\x9a\\x26\\x95\\xdc\\x04\\xe3\\x50\\x18\\xe9\\xc7\\xa0\\\n\\x16\\xc6\\x98\\x48\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\\n\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\\n\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\\n\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\\n\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\\n\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\\n\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\\n\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\\n\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\x49\\x92\\x24\\\n\\x49\\x92\\x24\\xf5\\x67\\xbf\\xfd\\xfe\\x0f\\x9b\\xbc\\x15\\xda\\x67\\xbe\\x80\\\n\\x39\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x00\\xe7\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x10\\x00\\x00\\x00\\x10\\x08\\x06\\x00\\x00\\x00\\x1f\\xf3\\xff\\x61\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x9c\\x49\\x44\\x41\\x54\\x38\\x8d\\xcd\\xd2\\x3d\\x0a\\\n\\xc2\\x40\\x10\\x86\\xe1\\x87\\xa0\\x76\\x2a\\xa4\\xf5\\x50\\x76\\x36\\x7a\\x1b\\\n\\x83\\x07\\xf1\\x08\\x82\\xad\\x78\\x24\\x2d\\x04\\xb7\\xf0\\xa7\\x48\\xfc\\x4b\\\n\\xd4\\x6c\\xd4\\xc2\\x0f\\x3e\\xd8\\x19\\x76\\x5f\\x66\\x76\\x86\\x7f\\xd1\\x0c\\\n\\x01\\x27\\x1c\\xb1\\x46\\xb7\\x09\\x20\\x20\\x2d\\xce\\x09\\xe6\\x05\\x34\\x5a\\\n\\xa7\\x52\\x3c\\xc0\\xae\\xc8\\x3f\\x73\\x40\\xf6\\x0e\\x50\\xa7\\x14\\xfb\\x6f\\\n\\x00\\xd7\\x37\\x49\\x29\\xd9\\xc1\\x12\\x07\\xaf\\xcb\\xbf\\x18\\xb4\\x4a\\x80\\\n\\x51\\x01\\x6d\\xcb\\xa7\\x51\\x5b\\x41\\x39\\x58\\x60\\x1c\\xd7\\x41\\x15\\xd0\\\n\\xc3\\x06\\xfd\\x26\\x80\\xfb\\x3f\\x18\\xca\\x17\\x68\\x1b\\x09\\x78\\x50\\xc0\\\n\\x0a\\x93\\xc8\\xfb\\x95\\x31\\x66\\x6e\\xab\\x1c\\xe3\\x80\\xe9\\x27\\x95\\xfe\\\n\\x5e\\x67\\xca\\x4f\\x38\\x40\\x1e\\xdb\\x25\\xdb\\x00\\x00\\x00\\x00\\x49\\x45\\\n\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x03\\x0e\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x19\\x00\\x00\\x00\\x19\\x08\\x06\\x00\\x00\\x00\\xc4\\xe9\\x85\\x63\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc2\\x00\\x00\\x0e\\xc2\\x01\\x15\\x28\\\n\\x4a\\x80\\x00\\x00\\x02\\xa3\\x49\\x44\\x41\\x54\\x48\\x4b\\xad\\x96\\x4d\\x4f\\\n\\x13\\x51\\x14\\x86\\xcf\\x4c\\xb1\\x45\\x34\\x8d\\x48\\x5b\\xc4\\x44\\xe2\\x17\\\n\\xea\\xc6\\x85\\x74\\x67\\x4c\\x8c\\x0b\\xd1\\x0a\\x3f\\x80\\x98\\xd4\\x85\\xd1\\\n\\xea\\xca\\x98\\x74\\x83\\x0b\\x83\\x1f\\x0b\\xdd\\x90\\xb8\\xe9\\xa6\\x76\\x25\\\n\\xd1\\xf8\\x03\\xd4\\xfa\\xf1\\x1b\\x8a\\x1a\\x0d\\x12\\x15\\xdd\\x89\\xa0\\xc4\\\n\\x68\\x43\\xcc\\x14\\xe8\\xf8\\x9e\\x7b\\xef\\x4c\\xa7\\xcc\\x6d\\xe9\\x50\\x1f\\\n\\x52\\x72\\xce\\x99\\xce\\xbc\\x3d\\xf7\\x9e\\x7b\\xce\\x18\\xd4\\x84\\x4c\\xe9\\\n\\x54\\x9f\\x4d\\xe6\\x59\\x98\\x23\\xf8\\x0c\\x12\\x19\\x51\\x71\\x41\\x60\\xff\\\n\\xc1\\xbf\\x29\\x7c\\x9e\\x18\\x54\\x7d\\x94\\x4f\\xbe\\x98\\x13\\x61\\x0d\\x5a\\\n\\x91\\x4c\\xe9\\x74\\x8f\\x4d\\xc6\\x4d\\x5c\\xbe\\x00\\x37\\x22\\xa3\\x4d\\xb1\\\n\\x20\\x5a\\x30\\xc8\\x1e\\xcf\\x27\\x9f\\x2f\\xaa\\x98\\x8b\\x4f\\x24\\x53\\x4a\\\n\\x9d\\x84\\xc0\\x03\\x98\\x3b\\x64\\x24\\x10\\xdf\\x21\\x74\\x2e\\x9f\\x2c\\xbe\\\n\\x52\\xbe\\xa0\\x4e\\xe4\\x62\\x29\\x35\\x8a\\xd0\\x24\\xcc\\x0e\\x19\\xd9\\x10\\\n\\x2b\\xc8\\x2a\\x7d\\x3f\\x59\\x7c\\xac\\xfc\\x9a\\x88\\xca\\xe0\\x19\\xcc\\x76\\\n\\x04\\x1c\\x56\\x90\\xd1\\x19\\x27\\x23\\x21\\x22\\xf7\\xc0\\x7c\\x0f\\x73\\x23\\\n\\x4b\\xd4\\x88\\x79\\x83\\x56\\x0f\\xa3\\x20\\x7e\\x98\\xec\\xc9\\x4d\\x6e\\x4f\\\n\\xe0\\x78\\x2c\\x45\\x7b\\xb7\\x1c\\x52\\x9e\\xa0\\x17\\x3f\\x7c\\x9c\\x0d\\x43\\\n\\x96\\x69\\xe8\\x2b\\xec\\x56\\xaa\\x48\\xcb\\x89\\xf8\\x08\\x8d\\xee\\xba\\x4c\\\n\\xd6\\xea\\x5f\\xba\\xf7\\xf9\\x3a\\x7d\\x59\\x9a\\x51\\x57\\xc8\\x42\\x36\\x7b\\\n\\x4c\\x75\\x0e\\xda\\x16\\x30\\xf0\\xd7\\x19\\xea\\xa2\\xab\\xfb\\x6f\\x7b\\x33\\\n\\xc2\\x73\\xcd\\x34\\x2f\\x17\\x1f\\x34\\x1f\\x5b\\x3b\\xa2\\xe2\\xc6\\x66\\x78\\\n\\x05\\x1c\\x4c\\x23\\x44\\x11\\xb3\\x53\\x79\\xbc\\x15\\x94\\x62\\x11\\x9c\\xe4\\\n\\x7a\\xba\\x37\\xc5\\x68\\xec\\xe0\\x04\\xa5\\xfb\\xaf\\x34\\x14\\xd2\\x09\\x54\\\n\\xaa\\x16\\xe5\\x66\\x6f\\xd1\\x87\\xf2\\x1b\\x15\\x11\\x0c\\x42\\xc4\\xdb\\x2a\\\n\\xa4\\x40\\xf6\\xc0\\x1d\\x4a\\x44\\x76\\xd2\\xb1\\xd8\\x90\\x56\\x28\\x80\\x00\\\n\\x30\\xa2\\xa2\\xba\\xbc\\x9c\\xdf\\x9d\\x15\\x02\\x0e\\x6b\\x85\\x82\\x09\\x48\\\n\\x42\\xc9\\x4b\\x03\\x37\\x94\\x2d\\x98\\x5d\\x9a\\xa6\\x23\\xdb\\x8e\\xd2\\x66\\\n\\x6c\\xa2\\x43\\x7f\\xd7\\x3e\\x91\\x61\\x4f\\x38\\x11\\x58\\x80\\x31\\xd0\\x4a\\\n\\x7e\\xaf\\x5d\\xb2\\x44\\xa4\\x8f\\xb2\\x03\\x77\\xa9\\x3b\\x1c\\x53\\x11\\x3d\\\n\\xad\\x08\\x70\\xb7\\xe6\\xe5\\xe2\\x76\\x5d\\xc7\\x82\\x35\\x47\\x13\\x9f\\xc6\\\n\\xe8\\x57\\xe5\\xa7\\x8a\\xf8\\x69\\x4d\\x40\\x30\\xc5\\x22\\x4f\\xa5\\x5d\\x8f\\\n\\x2b\\xb4\\xec\\x17\\x5a\\xae\\x56\\x5a\\x15\\xe0\\x85\\x2d\\x9a\\x18\\x38\\x0f\\\n\\x61\\x63\\x1e\\xf8\\x11\\x42\\x1f\\xaf\\x41\\xa8\\x36\\x22\\x82\\x08\\x00\\x3c\\\n\\xb7\\x3a\\x69\\xca\\x89\\x66\\x17\\x54\\xd0\\xc7\\x82\\xf5\\x0d\\x42\\x9c\\xd1\\\n\\xa2\\x2b\\x30\\x5d\\x7e\\xad\\xae\\xae\\x87\\x5d\\xe0\\xe7\\x8b\\x32\\x41\\xff\\\n\\x8a\\xa3\\x7f\\xbd\\x83\\xd9\\xcb\\xbe\\x0e\\x2e\\xeb\\xed\\xe1\\x38\\xcd\\x94\\\n\\xdf\\xaa\\xc8\\xba\\xb8\\x5d\\xd8\\xad\\x45\\x54\\xd9\\x10\\x56\\x90\\xf7\\xe7\\\n\\xbf\\xcc\\x13\\x64\\x31\\x8c\\xc1\\xf5\\x92\\x1d\\xf7\\x30\\xca\\x80\\x9d\\x86\\\n\\x89\\x2f\\xb4\\x85\\x33\\x19\\x85\\x00\\x53\\x77\\xe2\\xe5\\xc8\\xb4\\x87\\x61\\\n\\xce\\xcb\\x48\\x60\\x70\\x9f\\xc8\\xc0\\x1d\\xbd\\x8c\\xaf\\xad\\xf0\\x2f\\xe0\\\n\\xb5\\xc4\\x97\\x73\\x70\\xb5\\x55\\xa7\\x81\\xdf\\x56\\x72\\x7c\\x9f\\x37\\x03\\\n\\x87\\x5a\\x7f\\xd0\\xc0\\x03\\x8d\\xe7\\x01\\xb7\\x6b\\xb8\\xda\\xf7\\x2e\\x3e\\\n\\x07\\x5c\\xa6\\x8d\\xdf\\xbb\\x88\\xfe\\x01\\x2d\\xca\\x14\\x85\\x20\\xa6\\xbe\\\n\\xe2\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x09\\x1b\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x64\\x00\\x00\\x00\\x64\\x08\\x06\\x00\\x00\\x00\\x70\\xe2\\x95\\x54\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc2\\x00\\x00\\x0e\\xc2\\x01\\x15\\x28\\\n\\x4a\\x80\\x00\\x00\\x08\\xb0\\x49\\x44\\x41\\x54\\x78\\x5e\\xed\\x9c\\x57\\xc8\\\n\\x24\\x45\\x14\\x85\\xd7\\x9c\\xc5\\x9c\\xd7\\x2c\\x98\\x33\\x6b\\x0e\\xb8\\x66\\\n\\x45\\x14\\x0c\\x0f\\x0a\\xa2\\xbe\\x88\\x22\\x98\\x31\\xe7\\x9c\\xb3\\x20\\x62\\\n\\x06\\xc5\\x27\\x31\\xa0\\xb8\\x2a\\x06\\x54\\x74\\x4d\\x88\\x98\\xf3\\x9a\\xb3\\\n\\xae\\x39\\x9f\\xef\\x9f\\xe9\\xb5\\xf6\\xda\\xdd\\xd3\\xa9\\x7a\\x6a\\x7a\\xeb\\\n\\xc0\\xc7\\xf4\\x1f\\xa6\\xfa\\x76\\x9f\\xae\\x74\\xab\\x66\\xc6\\x15\\xd0\\x3f\\\n\\x23\\xc2\\x1f\\x62\\x7f\\xd1\\x79\\xa5\\x5d\\x7c\\xa8\\xfc\\x2d\\x0e\\x16\\x9d\\\n\\x56\\xda\\x85\\x87\\x4c\\xe7\\x4d\\x49\\xbb\\xe8\\xd0\\xe9\\xb4\\x29\\xf6\\x62\\\n\\x43\\x93\\x8d\\x2f\\xa1\\xb3\\xa6\\xd8\\x0b\\x0d\\x4d\\x36\\x3e\\x97\\x4e\\x9a\\\n\\x62\\x2f\\x32\\x34\\xd9\\xf8\\xfe\\x4a\\xf9\\xf9\\x40\\xd1\\x19\\xb9\\x17\\x07\\\n\\xa1\\xc9\\xc6\\x77\\x80\\xb0\\xa6\\x74\\xaa\\xa6\\xb8\\x17\\x06\\xa1\\x29\\x2d\\\n\\xbe\\x4e\\x9b\\xe2\\x5e\\x14\\x84\\xa6\\xac\\xf8\\x3a\\x6b\\x8a\\x7b\\x41\\x10\\\n\\x9a\\xf2\\xe2\\xeb\\xa4\\x29\\xee\\xc5\\x40\\x68\\x1a\\x14\\x5f\\xe7\\x4c\\x71\\\n\\x2f\\x04\\x42\\x53\\x91\\xf8\\x3a\\x65\\x8a\\x7b\\x11\\x10\\x9a\\x8a\\xc6\\xd7\\\n\\x19\\x53\\xdc\\x0b\\x80\\xd0\\x54\\x26\\xbe\\x4e\\x98\\xe2\\x06\\x0f\\xa1\\xa9\\\n\\x6c\\x7c\\x23\\x6f\\x8a\\x1b\\x38\\x84\\xa6\\x2a\\xf1\\x8d\\xb4\\x29\\x6e\\xd0\\\n\\x10\\x9a\\xaa\\xc6\\x37\\xb2\\xa6\\xb8\\x01\\x43\\x68\\xaa\\x13\\xdf\\x48\\x9a\\\n\\xe2\\x06\\x0b\\xa1\\xa9\\x6e\\x7c\\x23\\x67\\x8a\\x1b\\x28\\x84\\xa6\\x26\\xe2\\\n\\x1b\\x29\\x53\\xdc\\x20\\x21\\x34\\x35\\x15\\xdf\\xc8\\x98\\xe2\\x06\\x08\\xa1\\\n\\xa9\\xc9\\xf8\\x46\\xc2\\x14\\x37\\x38\\x08\\x4d\\x4d\\xc7\\x17\\xbc\\x29\\x6e\\\n\\x60\\x10\\x9a\\x7c\\xc4\\x17\\xb4\\x29\\x6e\\x50\\x10\\x9a\\x7c\\xc5\\x17\\xac\\\n\\x29\\x6e\\x40\\x10\\x9a\\x7c\\xc6\\x17\\xa4\\x29\\x6e\\x30\\x10\\x9a\\x7c\\xc7\\\n\\x17\\x9c\\x29\\x6e\\x20\\x10\\x9a\\x6c\\x7c\\x6d\\x81\\x49\\x8d\\xef\\x25\\x9e\\\n\\xa9\\xff\\x9a\\x27\\x4e\\xee\\xaa\\xc8\\x7b\\xda\\x94\\x8d\\xaf\\x4d\\xfd\\x29\\\n\\x66\\xeb\\x1d\\x36\\xa3\\x68\\x48\\x7d\\x35\\x7a\\x3f\\x66\\xee\\xbf\\x46\\x05\\\n\\xa2\\x2e\\xd4\\x90\\xb6\\xe5\\xf5\\x7e\\xc4\\x1a\\x12\\x98\\xa2\\x21\\x81\\x29\\\n\\xc4\\x26\\x8b\\xf2\\xe7\\x14\\xf3\\xf4\\x5f\\xf3\\xc4\\xc7\\xd8\\x7e\\x14\\xbf\\\n\\x08\\xe6\\x06\\x6d\\xc8\\xeb\\xfd\\x08\\xd1\\x10\\x86\\x91\\x8b\\x8b\\xe5\\xc4\\\n\\x62\\xfc\\x22\\x47\\x3f\\x88\\x77\\xc4\\xa7\\xe2\\x77\\x61\\x63\\xf5\\xa1\\x19\\\n\\xce\\x10\\x6a\\xc6\\x5a\\x62\\xf3\\xfe\\x6b\\x9e\\xa6\\x88\\x87\\xc4\\x8b\\xe2\\\n\\x27\\xc1\\xbc\\xc0\\xb7\\x66\\x38\\x43\\x16\\x10\\x5b\\x89\\xbd\\xc4\\x96\\xfc\\\n\\x22\\x47\\x6f\\x88\\x9b\\xc4\\x83\\xe2\\x7b\\x41\\x2d\\xf1\\x2d\\xaf\\xf7\\x23\\\n\\xc4\\x4e\\x9d\\x98\\xe6\\x16\\x8b\\x88\\xf1\\x03\\xa0\\x69\\xa3\\x46\\xcd\\x22\\\n\\x7c\\x3f\\x28\\xad\\x28\\x8e\\xb2\\x02\\x53\\x34\\x24\\x30\\x45\\x43\\x02\\x53\\\n\\x34\\x24\\x30\\x45\\x43\\x02\\x53\\x34\\x24\\x30\\x45\\x43\\x02\\x53\\x34\\x24\\\n\\x30\\x45\\x43\\x02\\x53\\x34\\xa4\\x3d\\x2d\\x28\\x56\\x13\\x24\\x4d\\xe7\\xe0\\\n\\x17\\x69\\x8a\\x86\\xf8\\xd5\\x7c\\xe2\\x44\\xf1\\x8a\\xf8\\x46\\xbc\\x2a\\xde\\\n\\x17\\xdf\\x89\\xfb\\xc5\\x2e\\x62\\x3a\\x45\\x43\\xfc\\x89\\xc4\\xe8\\x5b\\xe2\\\n\\x2c\\xb1\\x06\\xbf\\x70\\xc4\\x3a\\xcf\\x8e\\xe2\\x5e\\x71\\x9f\\x20\\xa1\\x3a\\\n\\xa6\\x68\\x88\\x1f\\xed\\x2e\\x58\\x16\\x20\\xf9\\x39\\x48\\x3b\\x8b\\xc7\\x05\\\n\\xb5\\x29\\x1a\\xe2\\x41\\x5b\\x88\\x3b\\x44\\x99\\xfd\\x5a\\xac\\xfb\\x5c\\xc7\\\n\\x41\\x34\\xa4\\xbc\\xde\\xeb\\xbf\\x22\\xf7\\x18\\xad\\x2f\\xee\\x12\\x99\\x9d\\\n\\x76\\x8e\\xf6\\x11\\x13\\xa2\\x21\\xe5\\x75\\xa8\\xf8\\xb8\\x0f\\xc7\\x89\\x30\\\n\\x63\\x92\\x58\\x68\\xec\\xa7\\xf2\\x62\\x3d\\xe7\\xa0\\x68\\x48\\x79\\x31\\x3a\\\n\\x5a\\xa6\\x0f\\xc7\\x28\\xcb\\x8c\\xc7\\xfa\\xaf\\x45\\x35\\x31\\x1a\\x52\\x5f\\\n\\x59\\x66\\x9c\\x2e\\xb6\\xee\\xbf\\x16\\xd5\\xf8\\x68\\x48\\x3d\\xe5\\x99\\x71\\\n\\x5a\\xef\\x70\\xec\\xb5\\xb0\\x29\\xd1\\x90\\xea\\xca\\x32\\xe3\\x0c\\x91\\x98\\\n\\x91\\xa8\\xa8\\x29\\x53\\xa2\\x21\\xd5\\xb4\\xae\\x60\\xa7\\x8b\\x35\\xe3\\x7c\\\n\\x71\\x6a\\xef\\xf0\\x7f\\xc2\\x94\\xe3\\x7a\\x87\\x99\\x9a\\x14\\x0d\\x29\\x2f\\\n\\x6a\\xc6\\xc3\\x62\\xe1\\xb1\\x9f\\xfe\\xd3\\x99\\x62\\xd0\\x0d\\xc7\\xb0\\xac\\\n\\x9a\\xc2\\xf6\\xa2\\x1b\\xa2\\x21\\xe5\\x94\\xd5\\x4c\\x61\\xc6\\x29\\xbd\\xc3\\\n\\x81\\xa2\\xa6\\x3c\\xda\\x3b\\x9c\\x4e\\xb7\\x8b\\xc9\\x3e\\x36\\xca\\xb1\\x47\\\n\\x6a\\x2e\\xb1\\xac\\x60\\x06\\xca\\x93\\x54\\xc6\\x78\\xf6\\x59\\x91\\x15\\x9d\\\n\\xd0\\x7f\\xcd\\xd3\\x27\\x82\\xb4\\x03\\xc9\\xbb\\x32\\x3b\\x17\\xd9\\x07\\xcc\\\n\\x47\\xd2\\xd8\\xf1\\x48\\xb2\\xef\\x5b\\xc1\\x3e\\xe1\\x3c\\x65\\x99\\x41\\xae\\\n\\xea\\xe4\\xde\\x61\\x21\\x51\\x43\\xac\\x79\\x2f\\x0b\\x76\\x6a\\x4e\\xf5\\x65\\\n\\x08\\x37\\x75\\x15\\x41\\x1a\\x81\\xc4\\x1a\\x39\\x9d\\xd9\\x45\\x11\\xf1\\x7f\\\n\\x98\\xb8\\x94\\x60\\xb3\\x5c\\x9e\\xa6\\x0a\\xb6\\x93\\x7e\\x29\\xb8\\xa1\\xdc\\\n\\xe4\\x41\\xe2\\xff\\xd8\\xe5\\xf8\\x81\\x78\\x44\\xbc\\x26\\x92\\xf7\\x67\\xa9\\\n\\x29\\x33\\xa8\\x49\\x27\\xf5\\x0e\\xa7\\xe9\\x2b\\xb1\\x8e\\xe0\\xe1\\x2a\\xb4\\\n\\xdb\\xaf\\xac\\x21\\xfc\\x9d\\x9b\\xca\\xc4\\x69\\x63\\xc1\\x58\\x7c\\x43\\xc1\\\n\\xcd\\x4d\\xf2\\x3b\\x79\\x65\\x24\\xef\\x27\\x23\\x3a\\x28\\x05\\x41\\x8d\\x60\\\n\\xe7\\xfb\\x6f\\x22\\x6f\\xf7\\x7b\\x72\\x0d\\xfc\\x3f\\xa9\\x6f\\xb2\\xb0\\x24\\\n\\xff\\x9e\\x16\\xa4\\x3f\\x30\\x28\\xeb\\xfd\\x74\\xe0\\xfc\\xaf\\xed\\x33\\x2e\\\n\\x14\\xc7\\xf6\\x0e\\x0b\\x89\\xd1\\x97\\x35\\x8f\\x58\\xb6\\x17\\x93\\xc7\\x7e\\\n\\x2a\\x28\\x2e\\xc6\\xa5\\xa8\\xc8\\x5e\\xae\\x27\\x8e\\x10\\x0f\\x08\\x9e\\x00\\\n\\xf6\\xde\\xda\\x8f\\x18\\xfb\\x86\\x1b\\x9d\\x34\\x51\\xd4\\x84\\xa7\\x04\\x37\\\n\\x73\\x23\\xc1\\xee\\xfa\\xbc\\x24\\x20\\x66\\xf0\\x04\\xdb\\x32\\x2f\\x10\\x65\\\n\\x44\\xcd\\xb0\\x65\\xb0\\x3e\\xc2\\x83\\x5a\\x5a\\xb6\\xa0\\xa2\\xa2\\xdf\\xc0\\\n\\x94\\xb5\\xc5\\x21\\x82\\xa7\\xec\\x6b\\x81\\x29\\xc9\\x4d\\xb2\\x65\\x37\\x8d\\\n\\x6b\\x06\\x7d\\x0c\\x35\\x82\\x9b\\xc3\\x5a\\x05\\xcd\\xea\\xac\\x22\\x4b\\xbe\\\n\\xcd\\xd8\\x40\\x54\\x92\\x2d\\xac\\x8c\\xe8\\x4f\\x58\\xba\\xe4\\x49\\x38\\x52\\\n\\xdc\\x2d\\x3e\\x14\\x34\\x1d\\x6d\\x19\\xc2\\xb9\\x7e\\x16\\x4f\\x08\\xda\\xfc\\\n\\x1d\\xc4\\x12\\x22\\x6f\\xa0\\x91\\x65\\x06\\x35\\xab\\x8c\\x38\\x9f\\x2d\\xe3\\\n\\x0b\\x31\\xe8\\x63\\x16\\xb9\\xb2\\x05\\x96\\x15\\xa6\\xd0\\x19\\x62\\xca\\xe1\\\n\\x82\\x15\\x32\\x32\\xa5\\xb4\\xfb\\x3c\\xb9\\xbe\\x8c\\xa1\\x5c\\xce\\xc1\\x8d\\\n\\x7d\\x49\\x9c\\x2d\\x30\\x83\\x5d\\xf3\\x55\\x9a\\xa9\\xb2\\x66\\x70\\x3e\\x5b\\\n\\xc6\\xe7\\xa2\\x96\\x19\\xc8\\x16\\x5a\\x45\\x98\\x32\\xbf\\x48\\x4c\\xb9\\x47\\\n\\xd0\\x91\\xfa\\xac\\x29\\x98\\x4d\\xa7\\xf9\\x8c\\xa0\\xd9\\x98\\x28\\x96\\x16\\\n\\x79\\x03\\x85\\xa6\\xcc\\x38\\x47\\xd8\\x32\\x30\\x63\\x4d\\x51\\x5b\\xb6\\xe0\\\n\\x3a\\x4a\\x4c\\x39\\x4a\\xd0\\x84\\x7c\\x26\\x92\\x11\\x92\\x3d\\x4f\\x15\\x28\\\n\\x07\\x30\\x83\\xb9\\x05\\xa3\\x97\\x4b\\xc5\\x66\\xa2\\x6a\\x07\\x1e\\x94\\x19\\\n\\xc8\\x16\\x5e\\x47\\x74\\xa2\\x0c\\x7f\\x19\\xe1\\x50\\x53\\xc8\\x07\\x31\\xfa\\\n\\xfa\\x55\\x24\\x37\\xd3\\x9e\\xaf\\x28\\xc9\\xfb\\xa9\\x75\\xcc\\x4f\\xa8\\x19\\\n\\xe7\\x89\\x9d\\x04\\xe7\\x64\\x28\\x9d\\x35\\xdc\\xce\\x32\\xe3\\x22\\x51\\x46\\\n\\xe7\\x0a\\x5b\\x06\\x0f\\x9d\\xdd\\xe4\\x50\\x4b\\xf6\\x04\\x75\\x95\\x74\\xf4\\\n\\x0c\\x89\\x8f\\x17\\x0c\\x89\\x3f\\x12\\x75\\x9b\\xaf\\xc4\\x0c\\x9a\\xc2\\x67\\\n\\xc5\\xc5\\x82\\x6d\\x36\\x4b\\x8a\\x2a\\x1d\\x78\\x19\\x33\\x30\\xfa\\x32\\x61\\\n\\xcb\\xc0\\x8c\\xd5\\x45\\xa3\\xb2\\x27\\x69\\x42\\x98\\xc2\\x90\\x98\\xe6\\xeb\\\n\\x68\\x41\\x4d\\x61\\x48\\x9c\\x98\\x52\\xd6\\x18\\xfe\\x9f\\x99\\x36\\x9f\\xca\\\n\\x25\\x8d\\x42\\xcd\\x60\\xc2\\xc5\\xe4\\xb4\\xca\\xd0\\xb6\\xac\\x19\\x97\\x0b\\\n\\x5b\\x06\\x9f\\x0c\\x6e\\xdc\\x0c\\x64\\x4f\\xd4\\x94\\x78\\x6a\\xa9\\x29\\x9b\\\n\\x0a\\x66\\xbc\\x2c\\x87\\x32\\xeb\\xae\\x52\\x53\\xe8\\x33\\x30\\x83\\x3e\\x83\\\n\\x36\\x9f\\xd1\\x14\\x66\\xe4\\x7d\\xce\\xbd\\x29\\x33\\xae\\x10\\xb6\\x0c\\xcc\\\n\\x18\\x94\\x87\\xab\\x2c\\x7b\\xb2\\x26\\x45\\x4d\\xa1\\xb3\\x25\\xb1\\x86\\x29\\\n\\x4c\\xdc\\xb8\\x98\\xe4\\x8b\\x00\\xec\\xb9\\x2d\\xfc\\x8f\\xdb\\x81\\xd3\\x6c\\\n\\xb0\\x01\\x0d\\x33\\x18\\x4d\\x95\\xed\\x33\\x68\\xe6\\x8a\\x2a\\xcb\\x0c\\x72\\\n\\x6b\\x2b\\x0b\\x6f\\xb2\\x27\\x6c\\x5a\\x74\\xb6\\x4c\\xd4\\x18\\x09\\x61\\x0a\\\n\\x49\\x3c\\xfa\\x14\\xb7\\xa3\\xb7\\xe6\\x24\\xbf\\x4b\\x9a\\xa9\\xe7\\x05\\x4f\\\n\\xf6\\x6e\\x82\\x79\\x06\\x35\\xc3\\xb7\\x19\\x57\\x0a\\x5b\\x06\\x93\\x5e\\xaf\\\n\\x66\\x20\\x7b\\x52\\x1f\\xa2\\x9d\\xa7\\xf9\\x62\\xd2\\x44\\x6a\\x9a\\x05\\x20\\\n\\x6a\\x4a\\x56\\x9f\\xc2\\xcf\\xc9\\x3c\\x83\\x49\\xdf\\x35\\x62\\x57\\x41\\x86\\\n\\xb8\\x4a\\x9f\\x51\\xd6\\x8c\\xab\\x84\\x2d\\x03\\x33\\x56\\x12\\xde\\x65\\x4f\\\n\\xec\\x4b\\x5c\\x28\\x37\\x93\\x9b\\x46\\x4d\\x61\\x9e\\x92\\xcc\\x51\\xd2\\x0c\\\n\\xa1\\x76\\xf0\\xc5\\x01\\xe4\\x96\\xc8\\x28\\xd3\\xf4\\x55\\x19\\x4d\\x95\\x35\\\n\\xe3\\x6a\\x61\\xcb\\x20\\x95\\xdf\\x8a\\x19\\xc8\\x9e\\xdc\\xb7\\x48\\xb3\\xf0\\\n\\x4d\\x0e\\xec\\x1a\\x27\\x21\\x49\\x93\\xc4\\xcd\\x4f\\x8c\\xa1\\x66\\x90\\x28\\\n\\x7c\\x4e\\xd0\\x67\\x30\\xb4\\xa5\\x66\\x0c\\x4a\\xd5\\xa7\\x99\\x71\\x89\\x28\\\n\\xaa\\x3c\\x33\\x56\\x14\\xad\\xc9\\x06\\xe0\\x5b\\xcc\\xa6\\xb9\\xc1\\x3c\\xf5\\\n\\x27\\x88\\x27\\x05\\x93\\x47\\x3a\\x7a\\x8c\\xa1\\x03\\x67\\xa5\\x0f\\x33\\xd8\\\n\\xd4\\xbc\\xbc\\xc0\\x8c\\xac\\xda\\x91\\x55\\x33\\xca\\x9a\\x41\\xb3\\x68\\xcb\\\n\\x60\\xb5\\x71\\x05\\xd1\\xaa\\x6c\\x10\\x6d\\x88\\x8e\\x9e\\x09\\x1d\\x69\\x72\\\n\\x16\\x75\\x58\\xd9\\xa3\\xa3\\x67\\xae\\x42\\x9f\\xc1\\xb8\\x7f\\x0f\\xc1\\xcd\\\n\\xa8\\x32\\xb4\\x2d\\x6b\\xc6\\xb5\\xc2\\x96\\x31\\x14\\x33\\x90\\x0d\\xa4\\x2d\\\n\\x25\\x59\\x62\\xd6\\x0d\\xc8\\x9c\\x32\\x4f\\x61\\xfd\\xfc\\x7a\\x41\\x33\\xc5\\\n\\xd0\\x16\\xe3\\xb2\\xe4\\xd3\\x0c\\x56\\x19\\xa9\\x99\\x43\\x91\\x0d\\xa6\\x4d\\\n\\xd1\\x0c\\xb1\\x90\\xb4\\x89\\xd8\\x5b\\xec\\x27\\xb6\\x13\\x0c\\x93\\xf3\\x72\\\n\\x53\\x4c\\xca\\xa8\\x4d\\x36\\xf6\\x32\\x66\\x70\\x6e\\xbe\\x69\\xc8\\x96\\xc1\\\n\\xf2\\x2f\\x0f\\xc3\\xd0\\x64\\x03\\x6a\\x5b\\xdc\\x18\\x36\\x49\\xb0\\x69\\x62\\\n\\x55\\xc1\\x3c\\x23\\x6f\\xd2\\x87\\x98\\xcb\\xd8\\xb8\\xcb\\x98\\x41\\xed\\xbc\\\n\\x59\\xd8\\x32\\xde\\x14\\xa4\\xf0\\x87\\x2a\\x1b\\xd4\\x30\\x44\\x6d\\x60\\x6b\\\n\\x11\\x5f\\xdb\\x34\\xc8\\x0c\\x3e\\x1e\\x46\\xe7\\xef\\xc6\\x4c\\x0a\\xbe\\xa8\\\n\\xb2\\xcc\\x60\\x88\\x3d\\x74\\x33\\x90\\x0d\\x2c\\x74\\xed\\x29\\xdc\\x78\\x19\\\n\\x26\\x93\\xc4\\x2c\\x22\\xcc\\xb8\\x4d\\xb8\\xef\\x07\\xb6\\x0a\\x31\\xc8\\x08\\\n\\x42\\x36\\xb8\\xd0\\x45\\xa7\\x6f\\x63\\x66\\x46\\x4f\\x12\\x33\\x4f\\x98\\x71\\\n\\x8b\\xb0\\xef\\x7d\\x5d\\x30\\x0c\\x0f\\x46\\x36\\xc0\\xd0\\x45\\x0a\\xc3\\xc6\\\n\\x0c\\x7c\\x7b\\x29\\xcb\\xb8\\x69\\xc2\\x8c\\x5b\\x85\\x7d\\x4f\\x70\\x66\\x20\\\n\\x1b\\x64\\xc8\\x22\\x17\\x66\\xe3\\x75\\x61\\x86\\xcf\\x3a\\x89\\xab\\x2c\\x33\\\n\\x82\\x6a\\xa6\\x5c\\xd9\\x40\\x43\\xd6\\x31\\xc2\\xc6\\x6b\\x21\\x3f\\xc6\\x0c\\\n\\x1f\\x8d\\x44\\x9f\\x61\\x65\\x83\\x1d\\x16\\xef\\x0a\\xd6\\xc7\\xf3\\x44\\xee\\\n\\x2b\\xed\\xbd\\x16\\x4c\\x61\\x5e\\x73\\xa7\\xf3\\xbb\\x04\\x36\\x3e\\x2f\\x2a\\\n\\x82\\x95\\x0d\\x78\\x98\\x90\\x3e\\xc9\\x12\\x13\\x48\\xd6\\x50\\xd2\\xde\\x57\\\n\\x14\\xd2\\x32\\x83\\x36\\x78\\x7b\\x55\\x5e\\xba\\x7a\\xd4\\xb4\\x8d\\x18\\x94\\\n\\xf1\\xcd\\x13\\x66\\x6c\\x2b\\x48\\xb7\\x04\\xad\\xb4\\x27\\x69\\x18\\x0c\\x6a\\\n\\xb2\\xd2\\x16\\x8d\\x8a\\xf2\\x82\\xb0\\xbb\\xdb\\xa3\\x6a\\xea\\x6d\\x91\\x76\\\n\\xb3\\xf3\\x60\\xad\\x85\\x79\\xcb\\xb4\\x2f\\x7f\\x89\\x6a\\x46\\xcc\\x15\\xd2\\\n\\x6e\\xb8\\x85\\x9d\\xf7\\xac\\x44\\xf2\\xc1\\x4c\\xd6\\xf0\\xf3\\x96\\x7b\\xa3\\\n\\x6a\\x88\\xe4\\xa3\\xcd\\x5f\\x01\\x2b\\x8c\\x8c\\x9a\\xc8\\x65\\x91\\xb2\\x9f\\\n\\x57\\x44\\xb5\\xa4\\xc3\\x04\\x7b\\x68\\x59\\xab\\xb8\\x51\\xec\\x2b\\x48\\xd3\\\n\\x8f\\x90\\xc6\\x8d\\xfb\\x17\\xa6\\x87\\x61\\x1e\\x5b\\xff\\x9d\\x6e\\x00\\x00\\\n\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x00\\x83\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x20\\x00\\x00\\x00\\x20\\x08\\x06\\x00\\x00\\x00\\x73\\x7a\\x7a\\xf4\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x38\\x49\\x44\\x41\\x54\\x58\\x85\\xed\\xd4\\xb1\\x11\\\n\\x00\\x20\\x08\\x03\\x40\\x74\\xff\\x9d\\x75\\x01\\x3c\\x2a\\xb4\\xf0\\xbf\\xa4\\\n\\x20\\x4d\\x2e\\x11\\xf0\\xbb\\x91\\xdc\\xd6\\xcd\\xcc\\xd9\\x1c\\x46\\xa9\\xa3\\\n\\x03\\xd9\\xcf\\x23\\x1d\\x78\\xce\\x0e\\x60\\x07\\xb0\\x03\\x00\\x1b\\x8a\\x27\\\n\\x05\\x10\\xf6\\xe3\\x4e\\x43\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\\n\\x60\\x82\\\n\\x00\\x00\\x1a\\xb9\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\xb2\\x00\\x00\\x00\\xb2\\x08\\x02\\x00\\x00\\x00\\x69\\xe8\\x02\\x3f\\\n\\x00\\x00\\x01\\x35\\x69\\x43\\x43\\x50\\x49\\x43\\x43\\x20\\x50\\x72\\x6f\\x66\\\n\\x69\\x6c\\x65\\x00\\x00\\x78\\x9c\\x63\\x60\\x60\\x32\\x61\\x80\\x82\\xdc\\xbc\\\n\\x92\\xa2\\x20\\x77\\x27\\x85\\x88\\xc8\\x28\\x05\\xf6\\x7b\\x0c\\x6c\\x0c\\x2c\\\n\\x0c\\x82\\x0c\\xda\\x0c\\x16\\x89\\xc9\\xc5\\x05\\x0c\\x98\\x80\\x11\\xc1\\xfc\\\n\\x76\\x0d\\xc2\\xbb\\xac\\x8b\\x45\\x1d\\x21\\xc0\\x95\\x92\\x5a\\x9c\\x0c\\xa4\\\n\\xff\\x00\\x71\\x65\\x52\\x76\\x41\\x09\\xd0\\xe8\\x0a\\x20\\x5b\\xa4\\xbc\\x04\\\n\\xcc\\xee\\x01\\xb1\\x93\\x0b\\x8a\\x40\\xec\\x05\\x40\\xb6\\x68\\x11\\xd0\\x81\\\n\\x40\\xf6\\x0e\\x90\\x78\\x3a\\x84\\x7d\\x06\\xc4\\x4e\\x82\\xb0\\x1f\\x80\\xd8\\\n\\x45\\x21\\x41\\xce\\x40\\xf6\\x17\\x20\\xdb\\x21\\x1d\\x89\\x9d\\x84\\xc4\\x86\\\n\\xda\\x0b\\x02\\xf2\\xc5\\x20\\x8f\\x7b\\xba\\x3a\\x9b\\x19\\x5a\\x9a\\x99\\xe9\\\n\\x1a\\xe9\\x1a\\x2a\\x24\\xe5\\x24\\x26\\x67\\x2b\\x14\\x27\\x27\\xe6\\xa4\\xa6\\\n\\x90\\xe1\\x2b\\x02\\x00\\x14\\xc6\\x10\\x16\\xb3\\x18\\x10\\x1b\\x33\\x30\\x30\\\n\\x2d\\x41\\x88\\x21\\xc2\\xb3\\x24\\xb5\\xa2\\x04\\xc4\\x72\\x29\\xca\\x2f\\x48\\\n\\xca\\xaf\\xd0\\x51\\xf0\\xcc\\x4b\\xd6\\x43\\xd1\\x9f\\xbf\\x88\\x81\\xc1\\xe2\\\n\\x2b\\xd0\\x8c\\x09\\x08\\xb1\\xa4\\x99\\x0c\\x0c\\xdb\\x5b\\x19\\x18\\x24\\x6e\\\n\\x21\\xc4\\x54\\x80\\x61\\xc7\\xdf\\xc2\\xc0\\xb0\\xed\\x7c\\x72\\x69\\x51\\x19\\\n\\xd4\\x19\\x52\\x40\\x7c\\x94\\xf1\\x0c\\x73\\x12\\xeb\\x64\\x8e\\x6c\\xee\\x6f\\\n\\x02\\x0e\\xa2\\x81\\xd2\\x26\\x8a\\x1f\\x35\\x27\\x18\\x49\\x58\\x4f\\x72\\x63\\\n\\x0d\\x2c\\x8b\\x7d\\x9b\\x5d\\x50\\xc5\\xda\\xb9\\x69\\x56\\xcd\\x9a\\xcc\\xfd\\\n\\x75\\x97\\x0f\\xbe\\x34\\xff\\xff\\x1f\\x00\\x81\\x49\\x5c\\xa9\\xc6\\xc2\\x24\\\n\\x8e\\x00\\x00\\x19\\x3f\\x49\\x44\\x41\\x54\\x78\\x9c\\xed\\x9d\\x7b\\x74\\x94\\\n\\xc5\\xdd\\xc7\\x7f\\xf3\\x3c\\xcf\\xee\\x3e\\x7b\\xcb\\x6d\\xb3\\xe6\\x46\\x08\\\n\\x9b\\x40\\x48\\xc8\\x05\\xc1\\x80\\x16\\x4d\\x41\\x0e\\x58\\x24\\x3d\\xa5\\xa0\\\n\\x20\\xc7\\xa2\\xb6\\x88\\x58\\x7b\\xb4\\xbe\\x5a\\xad\\x9e\\xf2\\x9e\\x1e\\xa8\\\n\\x6f\\x5b\\x34\\x54\\x4f\\x2d\\xb6\\xc8\\x91\\x42\\x78\\x9b\\x16\\xb1\\x05\\x4f\\\n\\xad\\x1c\\x0d\\xbc\\x90\\x22\\xe5\\x7e\\x4f\\x20\\xb7\\x4d\\x08\\x21\\x09\\x24\\\n\\x61\\x73\\x21\\xc9\\xee\\xe6\\xb9\\xcd\\xfb\\xc7\\x98\\x75\\x4d\\x26\\xc9\\x86\\\n\\x5c\\x71\\xe7\\x73\\xf2\\x47\\xb2\\x99\\x9d\\x99\\xe7\\x99\\xef\\x33\\xf3\\x9b\\\n\\xdf\\xfc\\xe6\\x19\\x84\\x31\\x06\\x06\\xe3\\xeb\\x70\\x63\\x5d\\x01\\xc6\\x78\\\n\\x84\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\\n\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\\n\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\\n\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\\n\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\\n\\x81\\xc9\\x82\\x41\\x41\\x18\\x7a\\x16\\x6c\\x4b\\xc1\\x9d\\x02\\x42\\x28\\xd0\\\n\\x94\\xac\\x51\\x19\\xbd\\x19\\x6a\\x6f\\xa1\\x28\\xca\\x17\\x5f\\x7c\\x21\\x49\\\n\\x12\\xcf\\xf3\\x30\\x18\\x3d\\x32\\x46\\x07\\x8c\\x31\\x42\\x48\\x96\\x65\\xa3\\\n\\xd1\\x38\\x77\\xee\\x5c\\xf2\\xe7\\x80\\xdf\\x1a\\xaa\\x2c\\xdc\\x6e\\xf7\\xdb\\\n\\x6f\\xbf\\xed\\x72\\xb9\\x38\\x8e\\x63\\x1d\\xcf\\xf8\\x04\\x21\\x84\\x31\\x8e\\\n\\x89\\x89\\x19\\x3d\\x59\\x70\\x1c\\x17\\x1a\\x1a\\x3a\\x61\\xc2\\x84\\xc7\\x1f\\\n\\x7f\\x5c\\xd3\\x34\\xd6\\x5b\\x8c\\x37\\x30\\xc6\\x1c\\xc7\\xfd\\xe9\\x4f\\x7f\\\n\\x12\\x45\\x31\\xf0\\x6f\\x0d\\x83\\xc9\\x29\\x49\\x52\\x58\\x58\\x58\\x76\\x76\\\n\\xf6\\xd0\\xb3\\x62\\x8c\\x10\\x5b\\xb7\\x6e\\x95\\x24\\x29\\xf0\\xf4\\xc3\\x20\\\n\\x0b\\x00\\x90\\x65\\x59\\x55\\x55\\x4d\\xd3\\x38\\x8e\\xcd\\x78\\xc7\\x17\\xa4\\\n\\x51\\x06\\x3b\\xbe\\x0f\\x8f\\x2c\\x10\\x42\\x3c\\xcf\\x23\\x84\\x98\\x2c\\xc6\\\n\\x1b\\xb7\\xd7\\x28\\xac\\x15\\x19\\x14\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\\n\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\\n\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\\n\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\x98\\x2c\\x18\\x14\\\n\\x98\\x2c\\x18\\x14\\x86\\x27\\x0c\\x67\\x40\\x34\\x4d\\xf3\\x05\\x08\\x71\\x1c\\\n\\x37\\x6a\\x21\\x9f\\xfe\\xe5\\x92\\xd8\\xf4\\x11\\x02\\x63\\xac\\x69\\x1a\\xdc\\\n\\x6e\\xd8\\xcb\\x78\\x63\\xc4\\x65\\x41\\x82\\xc6\\x9c\\x4e\\xe7\\xe1\\xc3\\x87\\\n\\x31\\xc6\\x18\\xe3\\x59\\xb3\\x66\\xcd\\x98\\x31\\x63\\xa4\\xcb\\x25\\x21\\xce\\\n\\xfb\\xf7\\xef\\x77\\x3a\\x9d\\x7a\\xbd\\x5e\\xa7\\xd3\\x2d\\x5d\\xba\\x34\\x34\\\n\\x34\\x74\\x84\\x8a\\x23\\xf1\\x69\\x23\\x94\\xf9\\xe8\\x33\\xe2\\xb2\\x20\\x0f\\\n\\x6b\\x5d\\x5d\\xdd\\x9e\\x3d\\x7b\\x54\\x55\\x55\\x55\\xd5\\x6c\\x36\\x8f\\xb4\\\n\\x2c\\x88\\xfe\\x10\\x42\\xc7\\x8e\\x1d\\x2b\\x28\\x28\\xb0\\x5a\\xad\\x06\\x83\\\n\\x21\\x3b\\x3b\\x3b\\x34\\x34\\x34\\xc0\\x88\\xf8\\xc1\\x22\\xcb\\xf2\\xd9\\xb3\\\n\\x67\\xdd\\x6e\\x77\\x62\\x62\\x62\\x42\\x42\\xc2\\xb0\\xe7\\x3f\\xca\\x8c\\xd2\\\n\\x20\\x22\\x08\\x82\\xc5\\x62\\x21\\x61\\xc0\\x7a\\xbd\\x7e\\x74\\x0a\\x05\\x00\\\n\\x51\\x14\\xad\\x56\\xab\\xc5\\x62\\x31\\x18\\x0c\\x23\\xf7\\x34\\xab\\xaa\\xba\\\n\\x6b\\xd7\\xae\\x0f\\x3f\\xfc\\x50\\x92\\xa4\\x84\\x84\\x84\\x57\\x5e\\x79\\x65\\\n\\xea\\xd4\\xa9\\x77\\x74\\xc0\\xf3\\x28\\xd5\\x1b\\x63\\xac\\x76\\x33\\x9a\\xbb\\\n\\x8c\\x34\\x4d\\x1b\\x85\\x72\\x65\\x59\\xfe\\xfc\\xf3\\xcf\\x05\\x41\\x88\\x88\\\n\\x88\\x28\\x2f\\x2f\\xbf\\x70\\xe1\\x02\\xdc\\xe1\\x1b\\xec\\xee\\x54\\x39\\x8f\\\n\\x2b\\x10\\x42\\x56\\xab\\x55\\x51\\x14\\xd2\\x1d\\x0e\\x6a\\xa3\\xce\\xf8\\x84\\\n\\xc9\\x62\\x18\\xd0\\xeb\\xf5\\xcf\\x3e\\xfb\\xac\\xcd\\x66\\xf3\\x7a\\xbd\\x0b\\\n\\x16\\x2c\\xb8\\xff\\xfe\\xfb\\xc7\\xba\\x46\\x43\\xe5\\x4b\\xdb\\x02\\xc3\\x97\\\n\\x36\\x1a\\x82\\x3b\\xb8\\xeb\\x1b\\x2b\\x10\\x42\\x77\\xdf\\x7d\\xf7\\xb6\\x6d\\\n\\xdb\\x30\\xc6\\x82\\x20\\x90\\xe1\\xe3\\x8e\\x1e\\x44\\x04\\x15\\xab\\x3c\\xe2\\\n\\x11\\x20\\x72\\x19\\x1a\\xd6\\x38\\x34\\x4a\\x5d\\x08\\x71\\x2a\\x20\\x84\\xc8\\\n\\xde\\x59\\x32\\xf6\\x0f\\xd6\\xab\\xe1\\x73\\x18\\x90\\xbd\\x53\\x3e\\x03\\xe2\\\n\\x36\\x5a\\xc5\\xdf\\xf7\\xe0\\xfb\\x04\\x02\\x73\\x45\\x68\\x9a\\x46\\x4c\\x5a\\\n\\xdf\\x57\\xfa\\xca\\x1c\\xfc\\xae\\x91\\x5a\\x22\\xb5\\x38\\xdf\\xbd\\xf2\\xfd\\\n\\x49\\x92\\x8d\\x90\\xf8\\x84\\x5d\\xd5\\x5b\\xad\\xba\\xb0\\x70\\xbd\\x2d\\xc6\\\n\\x38\\xc1\\x61\\x99\\xca\\x23\\x7e\\x14\\x94\\x41\\x6e\\x87\\xff\\xd4\\xc0\\xff\\\n\\xf2\\x02\\xb7\\xe1\\x55\\x55\\xe5\\x79\\xde\\x97\\x8f\\x7f\\x26\\xb2\\x2c\\x0f\\\n\\xea\\x96\\xf5\\xc8\\xaa\\xf7\\x7f\\xfb\\x6f\\x03\\x5f\\x85\\xfb\\x4a\\xd3\\xdb\\\n\\xb1\\x41\\x2e\\x93\\x5a\\xa2\\x7f\\x71\\x44\\xeb\\x3d\\x6e\\x88\\xef\\xcf\\x11\\\n\\x9a\\xef\\x08\\x9f\\xd6\\x7e\\xa8\\x61\\x55\\x03\\x2d\\x42\\x1f\\x79\\x8f\\xed\\\n\\x81\\x05\\x31\\x4b\\x1c\\x96\\x64\\x0c\\x78\\xe4\\x46\\x13\\xf2\\x7c\\xf0\\x3c\\\n\\x7f\\xfd\\xfa\\xf5\\xd2\\xd2\\xd2\\xe6\\xe6\\x66\\x8f\\xc7\\xc3\\x71\\x9c\\x28\\\n\\x8a\\xf1\\xf1\\xf1\\xa9\\xa9\\xa9\\x16\\x8b\\xa5\\xaf\\x67\\xae\\x47\\x3e\\x3c\\\n\\xcf\\xbb\\xdd\\xee\\xa2\\xa2\\xa2\\x9a\\x9a\\x1a\\x49\\x92\\x10\\x42\\xa2\\x28\\\n\\x46\\x47\\x47\\xc7\\xc7\\xc7\\xc7\\xc7\\xc7\\xfb\\x3f\\xa0\\x03\\x56\\x89\\xe7\\\n\\x79\\x49\\x92\\xca\\xca\\xca\\x1a\\x1a\\x1a\\x9a\\x9a\\x9a\\xc8\\xed\\x36\\x99\\\n\\x4c\\x36\\x9b\\x6d\\xe2\\xc4\\x89\\x13\\x27\\x4e\\x84\\xbe\\xdb\\x00\\x63\\x7c\\\n\\xe5\\xca\\x15\\x97\\xcb\\x45\\xda\\x7e\\xf2\\xe4\\xc9\\x56\\xab\\xd5\\xf7\\x70\\\n\\x93\\x5f\\x6e\\xdd\\xba\\x75\\xe5\\xca\\x15\\x52\\xc9\\xd8\\xd8\\xd8\\xe8\\xe8\\\n\\x68\\x8e\\xe3\\x5a\\x5b\\x5b\\x4b\\x4a\\x4a\\x6e\\xdc\\xb8\\xe1\\xf5\\x7a\\x49\\\n\\x1d\\xec\\x76\\x7b\\x46\\x46\\xc6\\x5d\\x77\\xdd\\x05\\x7e\\x82\\x40\\x08\\x55\\\n\\x56\\x56\\x5e\\xbb\\x76\\xed\\xfa\\xf5\\xeb\\xe4\\x43\\x8b\\xc5\\x62\\xb7\\xdb\\\n\\x33\\x33\\x33\\x2d\\x16\\x0b\\xe9\\x39\\x86\\xb7\\xdb\\x10\\x2c\\x82\\x15\\x00\\\n\\x21\\x00\\x15\\xab\\x05\\x75\\x7b\\x4b\\xda\\xce\\xaf\\x9e\\xfc\\x72\\x7a\\xd8\\\n\\x3d\\xc3\\x58\\x86\\x3f\\x18\\x63\\xbd\\x5e\\x8f\\x10\\xda\\xbd\\x7b\\xf7\\xd1\\\n\\xa3\\x47\\x2b\\x2a\\x2a\\xbc\\x5e\\x2f\\x74\\xcf\\x60\\xef\\xba\\xeb\\xae\\xd4\\\n\\xd4\\xd4\\x85\\x0b\\x17\\x66\\x67\\x67\\xfb\\x5c\\x52\\xd4\\x7c\\x48\\x0b\\x1d\\\n\\x3a\\x74\\xe8\\xe0\\xc1\\x83\\xa5\\xa5\\xa5\\x8d\\x8d\\x8d\\x82\\x20\\x90\\x7c\\\n\\xc2\\xc2\\xc2\\x62\\x63\\x63\\x1f\\x7a\\xe8\\xa1\\x9c\\x9c\\x1c\\x83\\xc1\\xd0\\\n\\xbf\\x32\\x7c\\x23\\xd7\\xe1\\xc3\\x87\\x0f\\x1f\\x3e\\x5c\\x5e\\x5e\\xde\\xd0\\\n\\xd0\\xa0\\x28\\x0a\\x74\\x77\\x69\\x21\\x21\\x21\\x13\\x27\\x4e\\xcc\\xc8\\xc8\\\n\\x78\\xe2\\x89\\x27\\x4c\\x26\\x13\\xb5\\x4a\\x9a\\xa6\\xed\\xd9\\xb3\\xe7\\xe8\\\n\\xd1\\xa3\\x82\\x20\\x18\\x8d\\xc6\\xd7\\x5f\\x7f\\x3d\\x35\\x35\\xd5\\x97\\x92\\\n\\xb4\\x77\\x65\\x65\\xe5\\x1f\\xfe\\xf0\\x87\\xd6\\xd6\\x56\\x9e\\xe7\\x7f\\xf8\\\n\\xc3\\x1f\\xe6\\xe4\\xe4\\xec\\xdb\\xb7\\xaf\\xb0\\xb0\\xb0\\xaa\\xaa\\xea\\xe6\\\n\\xcd\\x9b\\x3c\\xcf\\x93\\xe2\\x44\\x51\\x9c\\x3a\\x75\\xea\\xfc\\xf9\\xf3\\x17\\\n\\x2f\\x5e\\xcc\\xf3\\x3c\\xc7\\x71\\x2e\\x97\\x6b\\xf7\\xee\\xdd\\xe7\\xcf\\x9f\\\n\\xaf\\xaf\\xaf\\x6f\\x6f\\x6f\\x27\\x29\\x65\\x59\\x8e\\x8c\\x8c\\x9c\\x36\\x6d\\\n\\xda\\xdc\\xb9\\x73\\x1f\\x7a\\xe8\\xa1\\x1e\\x23\\xd1\\x20\\x9a\\x03\\xe8\\x93\\\n\\x76\\x41\\xc5\\x2a\\xf9\\x0d\\x01\\x8a\\x30\\xd8\\x9b\\xbc\\x37\\x3e\\xa8\\xd8\\\n\\xf4\\xdf\\x19\\xef\\x44\\x8a\\xd1\\x83\\x2d\\x63\\xe0\\x4a\\x60\\xcc\\xf3\\x7c\\\n\\x4b\\x4b\\x4b\\x6e\\x6e\\xee\\xc1\\x83\\x07\\x01\\x40\\xaf\\xd7\\x9b\\xcd\\x66\\\n\\x62\\xa9\\xe9\\x74\\x3a\\x49\\x92\\x4e\\x9e\\x3c\\x59\\x54\\x54\\xd4\\xd8\\xd8\\\n\\xb8\\x74\\xe9\\x52\\x62\\x73\\x50\\xaf\\x96\\xe3\\xb8\\x8f\\x3f\\xfe\\x78\\xe7\\\n\\xce\\x9d\\xb7\\x6e\\xdd\\xb2\\x5a\\xad\\x51\\x51\\x51\\xb2\\x2c\\x2b\\x8a\\x82\\\n\\x10\\x52\\x14\\xa5\\xaa\\xaa\\x6a\\xcb\\x96\\x2d\\x4d\\x4d\\x4d\\x2d\\x2d\\x2d\\\n\\x82\\x20\\xf4\\xe5\\xb1\\xf0\\x7d\\xfe\\xd1\\x47\\x1f\\xe5\\xe7\\xe7\\xbb\\xdd\\\n\\x6e\\xa3\\xd1\\x68\\x32\\x99\\x14\\x45\\x21\\xb2\\x23\\xf6\\xe3\\x95\\x2b\\x57\\\n\\x4a\\x4b\\x4b\\xcb\\xcb\\xcb\\xd7\\xac\\x59\\x93\\x9a\\x9a\\x4a\\xcd\\xaa\\xab\\\n\\xab\\x4b\\x92\\x24\\xd2\\xf9\\x53\\x85\\x28\\xcb\\xb2\\xd7\\xeb\\x95\\x24\\x49\\\n\\x10\\x84\\x6b\\xd7\\xae\\x6d\\xde\\xbc\\xf9\\xe0\\xc1\\x83\\x1d\\x1d\\x1d\\x06\\\n\\x83\\x21\\x24\\x24\\x04\\x00\\x78\\x9e\\xd7\\xe9\\x74\\x9a\\xa6\\x95\\x95\\x95\\\n\\x95\\x96\\x96\\xba\\x5c\\xae\\xd5\\xab\\x57\\x97\\x95\\x95\\xbd\\xff\\xfe\\xfb\\\n\\x45\\x45\\x45\\x7a\\xbd\\x9e\\xe7\\x79\\xff\\x94\\xb2\\x2c\\x9f\\x3a\\x75\\xea\\\n\\xf2\\xe5\\xcb\\x5e\\xaf\\xf7\\x7b\\xdf\\xfb\\x1e\\x74\\x77\\x4b\\x83\\x68\\x0d\\\n\\x80\\xbe\\xc6\\x84\\xaf\\xbc\\x9c\\x18\\xb0\\x82\\x65\\x91\\x37\\xba\\xba\\x1a\\\n\\xff\\xb7\\xea\\xbd\\x97\\x52\\xdf\\x18\\xf6\\x61\\x84\\xf4\\x75\\x07\\x0e\\x1c\\\n\\xb8\\x75\\xeb\\x16\\xcf\\xf3\\x06\\x83\\x21\\x25\\x25\\x25\\x2a\\x2a\\x8a\\x3c\\\n\\x4c\\x25\\x25\\x25\\x3a\\x9d\\xce\\x62\\xb1\\x48\\x92\\xb4\\x75\\xeb\\x56\\x9b\\\n\\xcd\\x36\\x6f\\xde\\x3c\\xda\\xd5\\x60\\x84\\x50\\x61\\x61\\x61\\x5e\\x5e\\x9e\\\n\\xaa\\xaa\\x61\\x61\\x61\\x92\\x24\\x49\\x92\\x94\\x9a\\x9a\\x3a\\x69\\xd2\\x24\\\n\\x8c\\xf1\\xd5\\xab\\x57\\x6b\\x6b\\x6b\\xdb\\xda\\xda\\xfe\\xf5\\xaf\\x7f\\xf1\\\n\\x3c\\x6f\\x34\\x1a\\xfb\\xea\\x30\\xc8\\x4d\\xfc\\xec\\xb3\\xcf\\xf2\\xf2\\xf2\\\n\\xc8\\x4d\\xef\\xec\\xec\\x9c\\x30\\x61\\xc2\\xec\\xd9\\xb3\\x2d\\x16\\x4b\\x5b\\\n\\x5b\\x9b\\xd3\\xe9\\xac\\xac\\xac\\x24\\x7d\\xc0\\x85\\x0b\\x17\\x36\\x6f\\xde\\\n\\xfc\\xc6\\x1b\\x6f\\x44\\x44\\x44\\xf4\\xce\\x8a\\xf3\\xa3\\xaf\\xb2\\x7c\\x09\\\n\\x0a\\x0b\\x0b\\x3b\\x3a\\x3a\\x64\\x59\\xb6\\xd9\\x6c\\x29\\x29\\x29\\xe1\\xe1\\\n\\xe1\\xb2\\x2c\\xd7\\xd4\\xd4\\x94\\x97\\x97\\x93\\x3b\\xa0\\x28\\xca\\x47\\x1f\\\n\\x7d\\xa4\\xd3\\xe9\\xce\\x9c\\x39\\x53\\x5c\\x5c\\x6c\\x32\\x99\\xcc\\x66\\xb3\\\n\\xc3\\xe1\\x20\\x83\\x4b\\x7d\\x7d\\xfd\\xe5\\xcb\\x97\\xc9\\x0b\\x67\\xdc\\x6e\\\n\\xf7\\x5f\\xff\\xfa\\x57\\x87\\xc3\\x91\\x91\\x91\\xd1\\xc3\\x5c\\x1b\\xb8\\x35\\\n\\x00\\xea\\xbd\\x35\\x2d\\x72\\x13\\xf4\\x6a\\xe9\\x9e\\xce\\x6f\\x0d\\x6b\\x3a\\\n\\xa4\\x2f\\x69\\xbb\\x50\\xd2\\x76\\x3e\\x35\\xec\\xee\\x9e\\x46\\x86\\xa6\\xc1\\\n\\x90\\x0d\\x9c\\x8e\\x8e\\x0e\\x84\\x50\\x56\\x56\\xd6\\xd3\\x4f\\x3f\\x6d\\xb7\\\n\\xdb\\xc9\\x13\\x29\\x49\\xd2\\xd5\\xab\\x57\\xb7\\x6f\\xdf\\x5e\\x5c\\x5c\\x6c\\\n\\x34\\x1a\\x55\\x55\\xcd\\xcf\\xcf\\x4f\\x4f\\x4f\\x8f\\x8c\\x8c\\xec\\xfd\\x10\\\n\\xb4\\xb7\\xb7\\x6f\\xdb\\xb6\\x4d\\x92\\x24\\x51\\x14\\xdb\\xdb\\xdb\\xa7\\x4f\\\n\\x9f\\xfe\\xdc\\x73\\xcf\\x45\\x47\\x47\\xeb\\x74\\x3a\\x00\\x90\\x65\\xb9\\xb9\\\n\\xb9\\x79\\xcb\\x96\\x2d\\xa7\\x4e\\x9d\\x12\\x45\\xb1\\xaf\\xc7\\xd7\\x57\\x99\\\n\\xfc\\xfc\\x7c\\xd2\\x31\\xa8\\xaa\\xfa\\xe2\\x8b\\x2f\\x66\\x67\\x67\\x8b\\xa2\\\n\\xc8\\xf3\\xbc\\xa2\\x28\\xb2\\x2c\\x97\\x96\\x96\\x6e\\xde\\xbc\\xb9\\xa1\\xa1\\\n\\x21\\x34\\x34\\xb4\\xba\\xba\\x3a\\x3f\\x3f\\xff\\x85\\x17\\x5e\\xe8\\x6d\\x64\\\n\\x60\\x3f\\xfa\\x2a\\xcb\\x97\\xa0\\xa3\\xa3\\x43\\xa7\\xd3\\x2d\\x59\\xb2\\x64\\\n\\xf9\\xf2\\xe5\\x46\\xa3\\x91\\xb4\\xa5\\x24\\x49\\x4e\\xa7\\xf3\\xf7\\xbf\\xff\\\n\\x7d\\x63\\x63\\xa3\\x4e\\xa7\\xd3\\xe9\\x74\\xff\\xf8\\xc7\\x3f\\x54\\x55\\x35\\\n\\x99\\x4c\\x0b\\x16\\x2c\\x78\\xea\\xa9\\xa7\\xc8\\x82\\x1f\\x00\\x28\\x8a\\xd2\\\n\\xd0\\xd0\\xb0\\x71\\xe3\\xc6\\x6b\\xd7\\xae\\x99\\x4c\\xa6\\x9b\\x37\\x6f\\x16\\\n\\x16\\x16\\xa6\\xa5\\xa5\\x91\\xf1\\x65\\xc0\\x0e\\x83\\xa4\\xb9\\xd8\\x76\\xf2\\\n\\xe3\\xfa\\xbc\\x9b\\x5d\\x37\\x34\\xda\\x38\\x42\\x69\\x63\\x84\\x40\\xc1\\xd2\\\n\\xb9\\xd6\\xe3\\x00\\x80\\x71\\xf7\\x0d\\xd5\\xb4\\xaf\\x34\\x71\\xf6\\x2c\\x1c\\\n\\x38\\x00\\x8a\\x02\\xb7\\xe5\\x4e\\x56\\x55\\xf5\\x81\\x07\\x1e\\x58\\xbf\\x7e\\\n\\x7d\\x7c\\x7c\\xbc\\x28\\x8a\\x82\\x20\\x90\\x67\\x3a\\x25\\x25\\x65\\xdd\\xba\\\n\\x75\\x33\\x66\\xcc\\xe8\\xec\\xec\\x34\\x9b\\xcd\\x57\\xae\\x5c\\x39\\x7a\\xf4\\\n\\x68\\x8f\\xeb\\x54\\x55\\x15\\x21\\xf4\\xe7\\x3f\\xff\\xb9\\xb9\\xb9\\x59\\x14\\\n\\x45\\x8f\\xc7\\x93\\x99\\x99\\xf9\\xf3\\x9f\\xff\\xdc\\xe1\\x70\\x18\\x8d\\x46\\\n\\x41\\x10\\xc8\\x93\\x1d\\x17\\x17\\xf7\\xda\\x6b\\xaf\\xcd\\x9d\\x3b\\xb7\\xab\\\n\\xab\\xab\\xff\\xdb\\x74\\xe2\\xc4\\x89\\x9b\\x37\\x6f\\x1a\\x0c\\x86\\x96\\x96\\\n\\x96\\x15\\x2b\\x56\\x2c\\x5a\\xb4\\xc8\\x6c\\x36\\x93\\x76\\x22\\x59\\xcd\\x98\\\n\\x31\\xe3\\xc5\\x17\\x5f\\xb4\\xd9\\x6c\\x5d\\x5d\\x5d\\x00\\x70\\xe6\\xcc\\x19\\\n\\xb7\\xdb\\x3d\\x94\\x17\\x85\\x11\\xeb\\x6a\\xe5\\xca\\x95\\xcf\\x3c\\xf3\\x4c\\\n\\x58\\x58\\x98\\xc1\\x60\\x20\\xd5\\x36\\x99\\x4c\\x99\\x99\\x99\\xaf\\xbd\\xf6\\\n\\x1a\\xe9\\xde\\x7c\\x63\\x5f\\x4e\\x4e\\xce\\x4f\\x7f\\xfa\\xd3\\xd0\\xd0\\x50\\\n\\xdf\\x05\\x8a\\xa2\\x98\\x90\\x90\\xf0\\xf2\\xcb\\x2f\\x73\\x1c\\xa7\\xaa\\xaa\\\n\\xc1\\x60\\x28\\x2b\\x2b\\xab\\xaf\\xaf\\x87\\x00\\x5e\\x86\\xa9\\x61\\x0d\\x03\\\n\\x3e\\xde\\xfc\\x7f\\x5b\\xaf\\x6c\\xbc\\xd2\\x59\\xe6\\x56\\x3b\\xbd\\xaa\\xbb\\\n\\xf7\\x0f\\x47\\xcb\\x86\\x53\\x34\\xf9\\x7a\\x7b\\x35\\xc8\\x0a\\x56\\x14\\x50\\\n\\x14\\x90\\x65\\xe0\\x38\\xe0\\x38\\xa8\\xab\\x83\\xff\\xf9\\x1f\\xb8\\xe7\\x1e\\\n\\xf8\\xc9\\x4f\\xa0\\xb6\\x16\\x10\\x02\\x55\\x1d\\xd4\\x4d\\x51\\x55\\x35\\x2e\\\n\\x2e\\xee\\x67\\x3f\\xfb\\x19\\xa5\\xc6\\x9a\\x16\\x12\\x12\\xb2\\x62\\xc5\\x0a\\\n\\xbd\\x5e\\xaf\\x28\\x8a\\xc5\\x62\\xd9\\xbb\\x77\\x6f\\x67\\x67\\xa7\\xff\\x0d\\\n\\x25\\xd6\\xfb\\xc5\\x8b\\x17\\xa1\\xfb\\xe5\\x4c\\xab\\x56\\xad\\x8a\\x8c\\x8c\\\n\\x54\\xbf\\x5e\\x0d\\x4d\\xd3\\x2c\\x16\\xcb\\xea\\xd5\\xab\\x93\\x93\\x93\\xc9\\\n\\x34\\xa7\\xaf\\xfa\\x54\\x57\\x57\\xf3\\x3c\\x2f\\xcb\\x72\\x58\\x58\\x98\\xc3\\\n\\xe1\\xd0\\x34\\x8d\\xd8\\x9b\\xfe\\x15\\xce\\xcc\\xcc\\x4c\\x4a\\x4a\\xf2\\x7a\\\n\\xbd\\x3c\\xcf\\x7b\\xbd\\xde\\xb2\\xb2\\x32\\xb8\\xdd\\xb7\\x91\\x22\\x84\\x34\\\n\\x4d\\x4b\\x4e\\x4e\\x5e\\xb6\\x6c\\x59\\x8f\\x7f\\x91\\x0c\\x1d\\x0e\\xc7\\xdc\\\n\\xb9\\x73\\xdd\\x6e\\x37\\x51\\x73\\x74\\x74\\xf4\\xa3\\x8f\\x3e\\x4a\\xcd\\x2a\\\n\\x31\\x31\\x31\\x23\\x23\\x43\\x96\\x65\\xbd\\x5e\\xdf\\xd0\\xd0\\xd0\\xd2\\xd2\\\n\\x12\\x48\\x05\\x04\\x5e\\xb8\\xea\\xae\\xf8\\x7b\\xdd\\xf6\\x4e\\xa5\\xdd\\xc0\\\n\\x1b\\x39\\xc4\\x53\\x7f\\x04\\x0c\\x08\\x7d\\xbd\\x1b\\x41\\x64\\x5e\\xa0\\xe7\\\n\\x41\\x27\\x7c\\x35\\xca\\xb8\\x5c\\xf0\\xcf\\x7f\\xc2\\x9b\\x6f\\x42\\x59\\x19\\\n\\xcc\\x98\\x01\\x6b\\xd7\\x82\\xcd\\x06\\x00\\xb7\\x31\\xa6\\x64\\x67\\x67\\x93\\\n\\xce\\xb0\\x07\\xe4\\x46\\x4c\\x99\\x32\\xe5\\xbe\\xfb\\xee\\x3b\\x74\\xe8\\x50\\\n\\x68\\x68\\x68\\x7d\\x7d\\x7d\\x43\\x43\\x83\\xc5\\x62\\x21\\x09\\xc8\\xd8\\x79\\\n\\xe4\\xc8\\x91\\xd6\\xd6\\x56\\x41\\x10\\x24\\x49\\x9a\\x32\\x65\\xca\\xf4\\xe9\\\n\\xd3\\x7b\\x8f\\xa9\\xe4\\xee\\x47\\x45\\x45\\xc5\\xc4\\xc4\\x14\\x17\\x17\\x1b\\\n\\x0c\\x86\\x7e\\xea\\x43\\x46\\x7d\\x8f\\xc7\\x23\\x49\\x12\\xc7\\x71\\xc4\\xe1\\\n\\xe1\\x73\\x1b\\x10\\xb3\\x77\\xd1\\xa2\\x45\\x53\\xa7\\x4e\\x25\\x63\\x8d\\xcd\\\n\\x66\\x83\\xdb\\x75\\x62\\x92\\xce\\x2f\\x22\\x22\\x42\\xa7\\xd3\\xf5\\xe8\\x08\\\n\\x49\\x41\\x3a\\x9d\\x2e\\x29\\x29\\x89\\xbc\\xd0\\xd2\\xe3\\xf1\\x4c\\x9f\\x3e\\\n\\x9d\\x6a\\xca\\x00\\x00\\xc7\\x71\\xc9\\xc9\\xc9\\x67\\xcf\\x9e\\x35\\x18\\x0c\\\n\\x6e\\xb7\\x9b\\x74\\x66\\x81\\x88\\xb5\\xac\\xe3\\xe2\\x0d\\x6f\\xad\\x55\\x08\\\n\\x55\\xb1\\xd2\\x57\\x1a\\xa1\\x77\\xab\\x62\\xc0\\x48\\xd0\\x59\\x1a\\x3a\\xe0\\\n\\xf2\\x27\\x20\\xa8\\xc0\\xe9\\xa0\\xb1\\x11\\xfe\\xfe\\x77\\xd8\\xb7\\x0f\\xc2\\\n\\xc3\\x61\\xfd\\x7a\\x58\\xb3\\x06\\xe2\\xe2\\x7c\\x57\\x33\\x60\\x3d\\x7a\\x60\\\n\\x34\\x1a\\xa9\\x9f\\x23\\x84\\x54\\x55\\x35\\x1a\\x8d\\xc9\\xc9\\xc9\\xfb\\xf7\\\n\\xef\\x07\\x00\\x41\\x10\\x2a\\x2b\\x2b\\x93\\x92\\x92\\xbe\\xac\\x18\\xc6\\x00\\\n\\x50\\x5f\\x5f\\xef\\xf5\\x7a\\x49\\xaf\\x9b\\x95\\x95\\xe5\\x1f\\x7f\\xd5\\xf3\\\n\\x42\\x30\\x26\\x83\\x4e\\x3f\\x95\\x89\\x8d\\x8d\\xed\\xea\\xea\\x22\\xfd\\x76\\\n\\x41\\x41\\x41\\x52\\x52\\x52\\x5c\\xf7\\xa5\\x91\\x79\\x0d\\xd1\\xc7\\xec\\xd9\\\n\\xb3\\x67\\xcf\\x9e\\xdd\\xa3\\xb6\\x83\\xbc\\xee\\xaf\\x50\\xfb\\xe8\\x62\\x89\\\n\\xbe\\x45\\x51\\x24\\xae\\x08\\x4d\\xd3\\x62\\x62\\x62\\xfa\\xf1\\x8f\\x99\\xcd\\\n\\x66\\xdf\\xef\\x03\\x9b\\x14\\x80\\x01\\xa0\\x4b\\xf5\\xd6\\xb8\\x2b\\x07\\x1c\\\n\\xfd\\x05\\xe8\\x65\\x71\\x60\\x84\\x0c\\x2a\\x9f\\xf8\\xce\\x87\\xf0\\xf1\\xbb\\\n\\x5f\\x13\\x4d\\x78\\x38\\x14\\x14\\x40\\x56\\x16\\x00\\x80\\x24\\xc1\\xed\\x86\\\n\\x4d\\xf4\\x63\\x00\\x12\\x8b\\xcc\\x6e\\xb7\\x8b\\xa2\\x48\\x5a\\xb4\\xae\\xae\\\n\\xae\\x47\\x9a\\x86\\x86\\x06\\xf2\\x30\\x19\\x8d\\xc6\\xb4\\xb4\\xb4\\x7e\\x86\\\n\\xf9\\x40\\x6e\\xd6\\xcc\\x99\\x33\\x13\\x13\\x13\\x6b\\x6b\\x6b\\x43\\x42\\x42\\\n\\xce\\x9c\\x39\\xf3\\xe6\\x9b\\x6f\\x66\\x65\\x65\\xa5\\xa4\\xa4\\x64\\x64\\x64\\\n\\xf8\\xe4\\xab\\x69\\x9a\\x7f\\x9d\\xc9\\x5b\\xc2\\x02\\xba\\xd4\\x3e\\xe8\\xff\\\n\\xeb\\xfe\\x5d\\x69\\x8f\\x11\\xad\\x07\\x01\\x3a\\xeb\\xfc\\x91\\xd4\\x2e\\x49\\\n\\xf5\\x08\\x88\\xd2\\xee\\xfe\\x50\\xc2\\x70\\x34\\x50\\x75\\x18\\x65\\x2d\\xfa\\\n\\x2f\\xc8\\x52\\x11\\xb9\\xe3\\xb2\\x0c\\x3b\\x77\\x42\\x75\\x35\\x6c\\xd8\\x00\\\n\\x3f\\xf8\\x01\\xac\\x5c\\x09\\x7a\\x3d\\x60\\x7c\\x1b\\x5d\\x05\\xf4\\x7b\\x53\\\n\\x48\\x43\\x5a\\xad\\x56\\x32\\xf5\\x42\\x08\\xb5\\xb5\\xb5\\x91\\x7f\\x11\\x9f\\\n\\x87\\xaa\\xaa\\x9d\\x9d\\x9d\\xa4\\xbf\\x15\\x04\\x61\\x88\\x41\\x78\\x18\\xe3\\\n\\xa8\\xa8\\xa8\\xb5\\x6b\\xd7\\xe6\\xe6\\xe6\\xb6\\xb6\\xb6\\x9a\\x4c\\xa6\\x8a\\\n\\x8a\\x8a\\xd2\\xd2\\x52\\xbb\\xdd\\x1e\\x15\\x15\\x65\\xb7\\xdb\\x89\\x3e\\x26\\\n\\x4f\\x9e\\x4c\\xc4\\x37\\x3a\\xab\\x5f\\xfe\\x2a\\xef\\xbf\\xc4\\x41\\xd5\\x87\\\n\\xcc\\x28\\x4d\\x3a\\xcb\\x5d\\xe2\\x04\\x8f\\xe6\\x31\\x81\\xa5\\x9f\\xc4\\x34\\\n\\x59\\xa8\\xea\\x83\\x13\\x1e\\x8d\\xcc\\x7e\\x16\\xfb\\xcf\\x67\\x1f\\x7d\\x14\\\n\\x7e\\xf7\\x3b\\xc8\\xcb\\x83\\x82\\x02\\x28\\x28\\x80\\x0d\\x1b\\x20\\x3e\\x1e\\\n\\x06\\xaf\\xd6\\x01\\xaa\\x8e\\x10\\x00\\x18\\x8d\\x46\\xa3\\xd1\\xd8\\xd1\\xd1\\\n\\x01\\x5f\\x7f\\x20\\x10\\x42\\x3e\\x0b\\x80\\x98\\x9f\\x7d\\x8d\\x47\\x81\\x17\\\n\\xa7\\x69\\xda\\xcc\\x99\\x33\\x7f\\xf3\\x9b\\xdf\\xe4\\xe7\\xe7\\x9f\\x38\\x71\\\n\\x42\\xa7\\xd3\\xe9\\xf5\\xfa\\xd6\\xd6\\xd6\\xa6\\xa6\\x26\\x8c\\xf1\\xe9\\xd3\\\n\\xa7\\x2d\\x16\\x4b\\x78\\x78\\xf8\\x82\\x05\\x0b\\xbe\\xfb\\xdd\\xef\\x0e\\xf1\\\n\\xea\\xc6\\x03\\x3c\\xe2\\x93\\xad\\x99\\x61\\x7a\\x9b\\x8c\\x65\\x1e\\x78\\x0d\\\n\\xe8\\x2d\\xc8\\x21\\x40\\xe4\\x87\\x43\\x1c\\xc6\\x58\\xd2\\xba\\x1c\\xd6\\xe4\\\n\\x47\\x13\\x56\\x43\\x0f\\x1f\\x47\\x46\\x06\\x6c\\xdb\\x06\\xa7\\x4f\\xc3\\xac\\\n\\x59\\xb0\\x7d\\x3b\\x2c\\x5e\\x0c\\xc5\\xc5\\xc0\\x71\\x83\\x9d\\x89\\x0c\\x91\\\n\\x1e\\xe3\\xc5\\xd0\\xe3\\xf0\\xc8\\x24\\xc5\\xe1\\x70\\xbc\\xfe\\xfa\\xeb\\xb9\\\n\\xb9\\xb9\\x0f\\x3e\\xf8\\xa0\\xc5\\x62\\x11\\x45\\xd1\\x6c\\x36\\x1b\\x8d\\x46\\\n\\xb7\\xdb\\xdd\\xd4\\xd4\\x54\\x5e\\x5e\\xfe\\xc1\\x07\\x1f\\xfc\\xf8\\xc7\\x3f\\\n\\xae\\xae\\xae\\xee\\x5d\\x87\\x3b\\x0b\\x55\\x53\\x33\\x43\\x66\\x2d\\xb0\\x2f\\\n\\x91\\x34\\x49\\xd2\\xba\\xc8\\x7c\\xb5\\xf7\\xcf\\x97\\xce\\x6f\\x0d\\x54\\x45\\\n\\x55\\x44\\x5e\\xcc\\x0c\\x9b\\xbd\\x66\\xca\\xab\\x02\\xd7\\x6b\\xa6\\x80\\x31\\\n\\xf0\\x3c\\xdc\\x73\\x0f\\x1c\\x39\\x02\\xaf\\xbc\\x02\\x7a\\x3d\\xa4\\xa5\\x01\\\n\\xc6\\x43\\xf7\\x6e\\x7d\\xbd\\x10\\x0c\\x00\\x1d\\x1d\\x1d\\x1d\\x1d\\x1d\\x64\\\n\\xc8\\xe8\\xb1\\xb2\\x6a\\xb5\\x5a\\x89\\x79\\x48\\xc6\\x11\\x45\\x51\\xfa\\x9f\\\n\\x65\\x04\\x5e\\xa8\\x20\\x08\\x29\\x29\\x29\\x29\\x29\\x29\\x8a\\xa2\\x94\\x96\\\n\\x96\\x5e\\xba\\x74\\xc9\\xe9\\x74\\x3a\\x9d\\xce\\x5b\\xb7\\x6e\\x79\\x3c\\x1e\\\n\\x8c\\xf1\\xb5\\x6b\\xd7\\x7e\\xf1\\x8b\\x5f\\xfc\\xf2\\x97\\xbf\\x4c\\x49\\x49\\\n\\x19\\x62\\x89\\x63\\x08\\x79\\xfe\\x97\\x4f\\x58\\xa3\\x81\\x76\\xcc\\x75\\x50\\\n\\xd6\\xbc\\xbe\\xd5\\x0f\\x7f\\x04\\x91\\x37\\x02\\x80\\x89\\x37\\x87\\x1a\\xc2\\\n\\x67\\xd9\\xb2\\x1f\\x8e\\x5b\\x01\\x64\\x32\\xd2\\xc3\\x21\\xea\\x3f\\x8c\\x6d\\\n\\xda\\x44\\xff\\x7c\\xc8\\x10\\x93\\xd3\\xe3\\xf1\\x74\\x76\\x76\\x1a\\x0c\\x06\\\n\\x45\\x51\\xac\\x56\\x6b\\x77\\x39\\x88\\x0c\\x28\\x7a\\xbd\\x9e\\x0c\\xf3\\x92\\\n\\x24\\xd5\\xd5\\xd5\\x25\\x27\\x27\\x0f\\xa5\\xc4\\x1e\\x83\\x14\\x00\\x08\\x82\\\n\\x90\\x9e\\x9e\\x9e\\x9e\\x9e\\x0e\\x00\\x1e\\x8f\\xa7\\xa0\\xa0\\x60\\xff\\xfe\\\n\\xfd\\xb5\\xb5\\xb5\\x7a\\xbd\\xbe\\xad\\xad\\xed\\xdd\\x77\\xdf\\xcd\\xcd\\xcd\\\n\\x35\\x99\\x4c\\x77\\x74\\x94\\x0d\\x06\\xfc\\xd8\\x84\\xb5\\x8b\\xa2\\x97\\x17\\\n\\xb5\\x9d\\x72\\x2b\\x1d\\xbd\\x57\\x46\\x84\\xa7\\x92\\x5e\\xc0\\x00\\x91\\x86\\\n\\xa8\\x29\\x21\\x69\\xd0\\x2d\\x88\\x01\\x56\\xd5\\xc9\\xad\\xbc\\xdd\\x7e\\xa2\\\n\\x9f\\xa5\\x51\\x62\\x72\\x36\\x34\\x34\\xb4\\xb7\\xb7\\x9b\\xcd\\x66\\x49\\x92\\\n\\x62\\x62\\x62\\xfc\\xbf\\x08\\x00\\x91\\x91\\x91\\xfe\\xfe\\xf2\\xc9\\x93\\x27\\\n\\x43\\x1f\\xc6\\x57\\x20\\xbd\\x7d\\x5f\\x0b\\xe5\\xe4\\xbb\\x06\\x83\\x61\\xc9\\\n\\x92\\x25\\x73\\xe6\\xcc\\x59\\xbf\\x7e\\x7d\\x55\\x55\\x95\\x5e\\xaf\\x6f\\x6a\\\n\\x6a\\x3a\\x79\\xf2\\xe4\\x83\\x0f\\x3e\\x48\\xe2\\x33\\x02\\xbe\\xe8\\xf1\\x05\\\n\\x02\\xa4\\x61\\x2d\\x54\\x08\\x7f\\xc0\\xf6\\x10\\x35\\x81\\x70\\x9f\\x7d\\x3e\\\n\\xf9\\x0d\\x83\\x86\\x31\\xe6\\x50\\x00\\x97\\x3a\\xb4\\x81\\xa3\\xaf\\x09\\x1e\\\n\\x99\\xb5\\x77\\x74\\x74\\x94\\x94\\x94\\x98\\x4c\\x26\\x4d\\xd3\\x24\\x49\\xf2\\\n\\x39\\x2d\\xa0\\xbb\\xed\\x27\\x4e\\x9c\\x48\\x16\\x39\\x3b\\x3b\\x3b\\x2f\\x5e\\\n\\xbc\\xb8\\x70\\xe1\\x42\\x45\\x51\\xa8\\xad\\x3b\\xe0\\x03\\x5d\\x51\\x51\\x51\\\n\\x58\\x58\\x88\\x10\\xf2\\x7a\\xbd\\xdf\\xfa\\xd6\\xb7\\x66\\xce\\x9c\\x49\\xea\\\n\\xe0\\x3f\\xb3\\xed\\xea\\xea\\xb2\\xdb\\xed\\x73\\xe6\\xcc\\xa9\\xa9\\xa9\\x01\\\n\\x00\\x59\\x96\\x89\\x9b\\xf9\\x4e\\x87\\x43\\x1c\\x89\\xd4\\xa4\\xce\\x54\\x39\\\n\\x15\\xab\\x2a\\x56\\x35\\xac\\x01\\xa0\\x80\\x34\\x31\\x64\\x8e\\x1d\\x3b\\x26\\\n\\xcb\\x72\\x5f\\xab\\x4a\\x4e\\xa7\\xf3\\xc4\\x89\\x13\\xa4\\xe1\\x63\\x63\\x63\\\n\\x7d\\xce\\x25\\xe8\\x0e\\xcb\\xbb\\xff\\xfe\\xfb\\xc3\\xc3\\xc3\\x89\\xaf\\xa9\\\n\\xa2\\xa2\\xa2\\xb6\\xb6\\x96\\x58\\x21\\xfe\\x99\\x90\\xa5\\xac\\x1b\\x37\\x6e\\\n\\xd4\\xd7\\xd7\\x93\\x41\\xa7\\x47\\x29\\xe4\\x13\\x97\\xcb\\xf5\\xb7\\xbf\\xfd\\\n\\x6d\\xd7\\xae\\x5d\\x3b\\x76\\xec\\xf8\\xf7\\xbf\\xff\\xed\\x8b\\x9a\\xf1\\x4f\\\n\\x49\\x96\\xd0\\x22\\x22\\x22\\x0c\\x06\\x03\\x09\\x89\\x90\\x65\\x79\\xb8\\x6e\\\n\\xc5\\xd8\\x42\\xec\\x0c\\xba\\xff\\x9b\\x47\\x3c\\x8f\\x78\\x0e\\x71\\xa3\\x13\\\n\\xdc\\xcb\\x71\\xdc\\xe5\\xcb\\x97\\x3f\\xf8\\xe0\\x03\\x5f\\x08\\x27\\xf9\\x9c\\\n\\x4c\\x38\\xdd\\x6e\\x77\\x5e\\x5e\\x9e\\xaf\\xdb\\x58\\xb4\\x68\\x91\\xcf\\xf3\\\n\\x0d\\xdd\\xe6\\x45\\x44\\x44\\x84\\xc3\\xe1\\xc0\\x18\\x1b\\x0c\\x86\\x9a\\x9a\\\n\\x9a\\x1d\\x3b\\x76\\x90\\xd5\\x0a\\x9f\\x95\\x40\\x3c\\x1c\\x5d\\x5d\\x5d\\xf9\\\n\\xf9\\xf9\\x55\\x55\\x55\\xc4\\x69\\xd8\\xf3\\x8e\\x20\\x04\\x00\\x77\\xdf\\x7d\\\n\\x77\\x4c\\x4c\\x4c\\x58\\x58\\xd8\\xc4\\x89\\x13\\xcf\\x9d\\x3b\\x57\\x54\\x54\\\n\\x44\\x16\\x21\\x7d\\xc9\\xc8\\x60\\xc7\\xf3\\x7c\\x49\\x49\\x89\\xdb\\xed\\x06\\\n\\x00\\x51\\x14\\x1d\\x0e\\x07\\x0c\\xcd\\xcb\\x39\\xfe\\x19\\xed\\x0d\\x01\\x08\\\n\\x21\\x9d\\x4e\\xf7\\xd9\\x67\\x9f\\x6d\\xda\\xb4\\xe9\\xfa\\xf5\\xeb\\xbe\\x9b\\\n\\x4b\\xa2\\x5d\\x36\\x6c\\xd8\\x50\\x5e\\x5e\\x6e\\x32\\x99\\x3c\\x1e\\xcf\\xa4\\\n\\x49\\x93\\xe6\\xcd\\x9b\\xe7\\x2f\\x1d\\x00\\x20\\xcd\\x46\\x56\\xe4\\x65\\x59\\\n\\x36\\x18\\x0c\\xc7\\x8e\\x1d\\x7b\\xeb\\xad\\xb7\\xc8\\xf1\\x47\\xbe\\xac\\x1a\\\n\\x1b\\x1b\\xdf\\x7e\\xfb\\xed\\x83\\x07\\x0f\\x92\\xa5\\x87\\xbe\\x2a\\x23\\x8a\\\n\\x62\\x76\\x76\\x36\\xf1\\x8f\\xb5\\xb5\\xb5\\xbd\\xf3\\xce\\x3b\\xe7\\xce\\x9d\\\n\\xf3\\x1f\\x8f\\x10\\x42\\xb2\\x2c\\xe7\\xe5\\xe5\\x1d\\x39\\x72\\x44\\xaf\\xd7\\\n\\x13\\xdf\\x7c\\x56\\x56\\x16\\x7c\\xd3\\x65\\x31\\x4a\\x9b\\x0d\\xa1\\xdb\\x9c\\\n\\x44\\x08\\xe9\\xf5\\x7a\\x8f\\xc7\\x53\\x58\\x58\\x78\\xfe\\xfc\\x79\\x87\\xc3\\\n\\x61\\xb7\\xdb\\x79\\x9e\\xbf\\x79\\xf3\\x66\\x71\\x71\\xb1\\xd7\\xeb\\x25\\x13\\\n\\x10\\x4d\\xd3\\x1e\\x7f\\xfc\\xf1\\xe8\\xe8\\x68\\xaa\\x71\\x1a\\x1d\\x1d\\xbd\\\n\\x72\\xe5\\xca\\x2d\\x5b\\xb6\\x90\\xad\\x8b\\xa7\\x4f\\x9f\\x7e\\xfe\\xf9\\xe7\\\n\\x93\\x93\\x93\\x23\\x23\\x23\\x01\\xe0\\xc6\\x8d\\x1b\\x35\\x35\\x35\\xcd\\xcd\\\n\\xcd\\xbe\\x28\\x8a\\xbe\\xbc\\xe0\\x18\\xe3\\x27\\x9f\\x7c\\xb2\\xbc\\xbc\\xfc\\\n\\xf2\\xe5\\xcb\\xa2\\x28\\xba\\x5c\\xae\\x5f\\xfd\\xea\\x57\\xc9\\xc9\\xc9\\x99\\\n\\x99\\x99\\x56\\xab\\x55\\x96\\xe5\\x1b\\x37\\x6e\\x5c\\xba\\x74\\xa9\\xa6\\xa6\\\n\\x46\\xa7\\xd3\\xa9\\xaa\\x2a\\x08\\xc2\\x63\\x8f\\x3d\\x46\\xc2\\xc9\\x7a\\x64\\\n\\x88\\xfc\\x18\\xf0\\x0e\\x0c\\x28\\xa9\\x00\\x93\\x0d\\x2a\\xe5\\xa0\\x18\\x25\\\n\\x59\\x10\\x1f\\x03\\x69\\xa1\\xb5\\x6b\\xd7\\x1e\\x3e\\x7c\\xb8\\xa4\\xa4\\xa4\\\n\\xa9\\xa9\\xa9\\xad\\xad\\xcd\\x3f\\xa2\\x9a\\xe3\\x38\\xb2\\x0c\\xf6\\xdc\\x73\\\n\\xcf\\xcd\\x9f\\x3f\\x1f\\x68\\x0f\\x25\\xf9\\xe4\\xe1\\x87\\x1f\\xf6\\x78\\x3c\\\n\\x3b\\x76\\xec\\xf0\\x78\\x3c\\x24\\xf0\\x82\\x6c\\xf1\\x03\\x00\\x45\\x51\\x14\\\n\\x45\\x91\\x24\\x69\\xc5\\x8a\\x15\\x2d\\x2d\\x2d\\x85\\x85\\x85\\xa4\\x51\\xa9\\\n\\x15\\x33\\x99\\x4c\\xaf\\xbe\\xfa\\x6a\\x6e\\x6e\\x6e\\x55\\x55\\x95\\x2c\\xcb\\\n\\x1c\\xc7\\x95\\x96\\x96\\x96\\x95\\x95\\xe1\\xee\\x18\\x63\\x32\\x00\\xb9\\xdd\\\n\\x6e\\x8b\\xc5\\xb2\\x6c\\xd9\\xb2\\xc5\\x8b\\x17\\x53\\x6b\\x45\\xf6\\x33\\x42\\\n\\xdf\\xcb\\x60\\xb8\\x7b\\xbb\\xa5\\x2f\\xcf\\x01\\xef\\xd5\\x80\\x1b\\x24\\xf1\\\n\\x88\\x6d\\xe1\\x1c\\x25\\x59\\x90\\x58\\x34\\x62\\x69\\x3a\\x1c\\x8e\\x79\\xf3\\\n\\xe6\\xed\\xde\\xbd\\xfb\\x3f\\xff\\xf9\\x8f\\xcb\\xe5\\x6a\\x6f\\x6f\\x27\\x69\\\n\\x48\\x14\\x5a\\x5c\\x5c\\xdc\\xd2\\xa5\\x4b\\x17\\x2e\\x5c\\x08\\x03\\x05\\x27\\\n\\x2e\\x5b\\xb6\\x4c\\x10\\x84\\x7d\\xfb\\xf6\\x35\\x36\\x36\\xb6\\xb7\\xb7\\xfb\\\n\\xee\\x78\\x78\\x78\\x78\\x6c\\x6c\\xec\\xac\\x59\\xb3\\x9e\\x7e\\xfa\\xe9\\xbd\\\n\\x7b\\xf7\\x9e\\x3c\\x79\\x52\\xaf\\xd7\\x53\\x37\\x00\\xa2\\xee\\xb3\\xdd\\x36\\\n\\x6e\\xdc\\xb8\\x67\\xcf\\x9e\\x33\\x67\\xce\\xd4\\xd4\\xd4\\xb4\\xb4\\xb4\\x10\\\n\\x7b\\x96\\x54\\xc0\\x68\\x34\\xda\\x6c\\xb6\\xd8\\xd8\\xd8\\x9c\\x9c\\x9c\\x7e\\\n\\x0e\\xde\\x32\\x1a\\x8d\\x24\\x7e\\xc7\\x60\\x30\\x50\\xeb\\x4c\\x96\\x7c\\x89\\\n\\x68\\xa8\\x71\\x05\\xfe\\x29\\x2d\\x16\\x0b\\x31\\xba\\x49\\xdc\\x72\\x3f\\x29\\\n\\xcd\\x66\\xb3\\xc9\\x64\\xea\\x6b\\x63\\xc1\\x6d\\x33\\xd4\\x73\\x50\\x3b\\x3a\\\n\\x3a\\x56\\xaf\\x5e\\x9d\\x90\\x90\\x90\\x9b\\x9b\\x4b\\x8d\\x97\\x27\\x4d\\xdb\\\n\\xdc\\xdc\\x5c\\x5e\\x5e\\x4e\\xd6\\x03\\xa7\\x4e\\x9d\\x6a\\xb7\\xdb\\x01\\xa0\\\n\\xba\\xba\\xfa\\xe2\\xc5\\x8b\\x75\\x75\\x75\\x24\\x8c\\xcf\\x66\\xb3\\xc5\\xc5\\\n\\xc5\\xcd\\x9c\\x39\\x33\\x32\\x32\\x32\\x90\\xed\\x0f\\x24\\x67\\x97\\xcb\\x75\\\n\\xfc\\xf8\\xf1\\xc6\\xc6\\xc6\\xe6\\xe6\\x66\\x12\\x7d\\x33\\x69\\xd2\\xa4\\x8c\\\n\\x8c\\x8c\\x09\\x13\\x26\\x60\\x8c\\x6b\\x6b\\x6b\\xaf\\x5e\\xbd\\x0a\\x00\\x3c\\\n\\xcf\\xa7\\xa5\\xa5\\x85\\x84\\x84\\xf4\\x96\\x9a\\xef\\x93\\xf6\\xf6\\xf6\\x73\\\n\\xe7\\xce\\x55\\x55\\x55\\xdd\\xba\\x75\\x8b\\x84\\x75\\x91\\xed\\x05\\x89\\x89\\\n\\x89\\xd3\\xa7\\x4f\\x27\\x56\\x6d\\x5f\\x7e\\x8e\\xb2\\xb2\\xb2\\xa6\\xa6\\x26\\\n\\xf2\\xdf\\xb4\\xb4\\xb4\\xb0\\xb0\\x30\\xfc\\xf5\\x0d\\x01\\xad\\xad\\xad\\x65\\\n\\x65\\x65\\xe4\\xc0\\xb0\\xf0\\xf0\\xf0\\xf4\\xf4\\xf4\\xbe\\x6a\\xd2\\xd4\\xd4\\\n\\x54\\x5c\\x5c\\x2c\\x8a\\xa2\\x2c\\xcb\\x09\\x09\\x09\\xfd\\xbc\\x16\\xa1\\xa6\\\n\\xa6\\xa6\\xba\\xba\\x5a\\x10\\x04\\x45\\x51\\xd2\\xd3\\xd3\\x23\\x22\\x22\\x7a\\\n\\xe7\\x49\\xea\\xbc\\x6a\\xd5\\x2a\\x00\\xf8\\xcb\\x5f\\xfe\\x12\\xe0\\xbe\\x92\\\n\\x11\\x97\\x05\\x15\\xdc\\x6b\\xfb\\x90\\x3f\\x81\\x7b\\x8a\\xfa\\x49\\x39\\x28\\\n\\x77\\x13\\x99\\x2d\\xf7\\x53\\xf9\\x01\\x13\\x8c\\x5b\\x6e\\x4f\\x16\\xa3\\x67\\\n\\x5b\\xf4\\xd8\\x6a\\x47\\x1e\\x3e\\xdf\\x3e\\x41\\xf0\\xdb\\x40\\x17\\x78\\x73\\\n\\xfa\\xb6\\x57\\xe0\\xee\\x4d\\x8b\\x64\\x28\\xf1\\x65\\xd2\\xbb\\x5c\\x6a\\x3e\\\n\\xbe\\xd9\\xb2\\x2f\\xa8\\xc7\\x57\\x25\\xf0\\x0b\\xda\\xee\\xa7\\x26\\x03\\xbe\\\n\\x05\\xca\\xbf\\x26\\xa8\\xdf\\xdd\\x8b\\x81\\xa7\\x1c\\xb9\\x57\\x4f\\x8d\\x92\\\n\\x2c\\x10\\xed\\x1d\\x42\\xfe\\xf7\\x9a\\xc4\\x4f\\x0c\\x31\\x67\\x12\\xf4\\x36\\\n\\x60\\xb9\\x01\\x66\\xd5\\x7f\\x93\\xf4\\x60\\xc0\\x94\\x81\\xd7\\x24\\xf0\\x94\\\n\\x23\\xd7\\x7b\\x8d\\x97\\x5e\\x71\\x58\\x94\\x3e\\x8c\\x8f\\xcb\\x37\\xdb\\x2d\\\n\\x31\\x20\\xe3\\x45\\x16\\x8c\\x71\\x05\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\\n\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\\n\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\\n\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\\n\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\xc2\\xf0\\x04\\xed\\x91\\x0d\\x0b\\xfd\\xbc\\\n\\xdd\\x8c\\x31\\x56\\xdc\\x5e\\xa3\\x0c\\x8f\\x2c\\xf8\\x6e\\x86\\x25\\x37\\xc6\\\n\\x30\\x42\\x1a\\xa5\\xc7\\x9e\\xcd\\x01\\x19\\x06\\x59\\x08\\x82\\xe0\\xf1\\x78\\\n\\x2e\\x5d\\xba\\xe4\\xdb\\x75\\xc3\\x18\\x3f\\x90\\xd8\\x69\\x55\\x55\\x07\\x75\\\n\\xa0\\xe4\\x50\\x65\\x81\\x31\\x26\\x2f\\xb6\\xdd\\xb0\\x61\\xc3\\x6d\\xbc\\x0f\\\n\\x90\\x31\\x0a\\x90\\x2d\\xbe\\x64\\xcb\\x56\\x80\\x0c\\x55\\x16\\x82\\x20\\x3c\\\n\\xf2\\xc8\\x23\\x1e\\x8f\\x67\\x88\\xf9\\x30\\x46\\x1a\\xf2\\xba\\xa9\\x00\\xbb\\\n\\xf3\\xa1\\xee\\x2a\\xf3\\xbd\\xbd\\x84\\x0d\\x1f\\xe3\\x19\\xff\\x3d\\x51\\x81\\\n\\x30\\x54\\x59\\x30\\xbe\\x91\\x30\\xbf\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\\n\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\\n\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\\n\\x05\\x83\\x02\\x93\\x05\\x83\\xc2\\xe8\\xbd\\xf3\\x7b\\xdc\\x42\\x16\\x0b\\x7d\\\n\\x4b\\x86\\xa8\\xfb\\x54\\xdc\\xb1\\xac\\xd3\\x58\\xc3\\x56\\x50\\x19\\x14\\x82\\\n\\x7d\\x10\\x51\\x55\\x75\\xcf\\x9e\\x3d\\xdf\\xff\\xfe\\xf7\\x13\\x13\\x13\\xed\\\n\\x76\\x7b\\x4c\\x4c\\xcc\\xfc\\xf9\\xf3\\xf3\\xf2\\xf2\\xc6\\xba\\x5e\\x63\\x4c\\\n\\x50\\xf7\\x16\\x1e\\x8f\\x67\\xd5\\xaa\\x55\\x9f\\x7e\\xfa\\xe9\\x9c\\x39\\x73\\\n\\x16\\x2d\\x5a\\xd4\\xde\\xde\\x7e\\xfc\\xf8\\xf1\\x03\\x07\\x0e\\x00\\xc0\\x4b\\\n\\x2f\\xbd\\xf4\\xdb\\xdf\\xfe\\x56\\x10\\x84\\x20\\x8d\\x5b\\xc6\\x41\\x09\\x39\\\n\\x69\\xe1\\x99\\x67\\x9e\\x01\\x80\\xa5\\x4b\\x97\\xfa\\xff\\xeb\\xad\\xb7\\xde\\\n\\x22\\x52\\x58\\xb7\\x6e\\x1d\\xc6\\xd8\\x77\\x7e\\x56\\x50\\x11\\xa4\\xb2\\xc0\\\n\\x18\\x77\\x75\\x75\\x99\\xcd\\x66\\x41\\x10\\xbe\\xf3\\x9d\\xef\\x28\\x8a\\xe2\\\n\\xf5\\x7a\\x55\\x55\\x25\\x22\\xf8\\xf6\\xb7\\xbf\\x8d\\x10\\x4a\\x4a\\x4a\\x6a\\\n\\x6e\\x6e\\x26\\x67\\xde\\x8c\\x75\\x65\\x47\\x9b\\x60\\xb4\\x2d\\xc8\\x95\\x6b\\\n\\x9a\\x36\\x63\\xc6\\x0c\\x45\\x51\\x1c\\x0e\\x07\\xd9\\xe4\\x42\\x5e\\x20\\xaf\\\n\\xaa\\xea\\xfc\\xf9\\xf3\\x31\\xc6\\x1e\\x8f\\xa7\\xa2\\xa2\\xc2\\xff\\x14\\xb4\\\n\\xe0\\x21\\x18\\x27\\xa8\\x64\\x2f\\x8d\\x28\\x8a\\x5b\\xb7\\x6e\\x2d\\x2a\\x2a\\\n\\xba\\xf7\\xde\\x7b\\xc1\\xef\\x5c\\x6e\\x9e\\xe7\\x43\\x42\\x42\\xa0\\xfb\\x60\\\n\\x18\\x08\\xca\\xc9\\x6a\\x30\\xca\\x02\\xba\\x5b\\x3a\\x35\\x35\\x35\\x35\\x35\\\n\\xd5\\xff\\x13\\x02\\x39\\x99\\x46\\xa7\\xd3\\x91\\x23\\x14\\x83\\x50\\x16\\xc1\\\n\\x38\\x88\\xf8\\x50\\x55\\x95\\x98\\x0e\\xe4\\x4f\\x8c\\x31\\x00\\x74\\x76\\x76\\\n\\x7e\\xfe\\xf9\\xe7\\x00\\xb0\\x7c\\xf9\\x72\\xb3\\xd9\\xdc\\xe3\\x9c\\xf7\\x20\\\n\\x21\\xa8\\x27\\xa8\\x3d\\x90\\x65\\x59\\xa7\\xd3\\xed\\xd8\\xb1\\xe3\\x47\\x3f\\\n\\xfa\\x51\\x64\\x64\\xa4\\xd3\\xe9\\x0c\\x0d\\x0d\\x65\\xbd\\x45\\x50\\xa3\\xaa\\\n\\xaa\\x4e\\xa7\\x73\\xb9\\x5c\\xeb\\xd6\\xad\\x13\\x45\\x71\\xd3\\xa6\\x4d\\x41\\\n\\xab\\x09\\x60\\xb2\\x20\\x28\\x8a\\xc2\\xf3\\x7c\\x43\\x43\\x43\\x4e\\x4e\\x4e\\\n\\x5b\\x5b\\xdb\\xfb\\xef\\xbf\\xff\\xd4\\x53\\x4f\\x41\\x50\\x1a\\x9b\\x04\\x26\\\n\\x0b\\x20\\xe7\\x4a\\xd6\\xd7\\xd7\\x3f\\xf2\\xc8\\x23\\x45\\x45\\x45\\x7f\\xfc\\\n\\xe3\\x1f\\x9f\\x7c\\xf2\\x49\\x72\\x8e\\x5a\\x5f\\x87\\x9a\\x7e\\xf3\\x19\\x13\\\n\\x6f\\xc9\\xf8\\x41\\x51\\x14\\x8c\\x71\\x7d\\x7d\\xfd\\xbd\\xf7\\xde\\xab\\xd7\\\n\\xeb\\x77\\xee\\xdc\\x89\\x31\\x96\\x65\\x39\\x08\\x5d\\x58\\xfe\\x04\\x75\\x6f\\\n\\x41\\x0e\\xdd\\x74\\x3a\\x9d\\x0f\\x3f\\xfc\\xb0\\xd3\\xe9\\xdc\\xb5\\x6b\\xd7\\\n\\x13\\x4f\\x3c\\x41\\x06\\x14\\x84\\x50\\x4d\\x4d\\xcd\\xc9\\x93\\x27\\xc7\\xba\\\n\\x8e\\x63\\x43\\x90\\xfa\\x2d\\x08\\x1c\\xc7\\x15\\x14\\x14\\xac\\x59\\xb3\\xc6\\\n\\x6a\\xb5\\x1e\\x3e\\x7c\\x78\\xda\\xb4\\x69\\x9a\\xa6\\x91\\x03\\x16\\x31\\xc6\\\n\\xbf\\xfe\\xf5\\xaf\\xeb\\xeb\\xeb\\x3f\\xf9\\xe4\\x13\\x55\\x55\\x87\\xf7\\x38\\\n\\xc9\\xf1\\x4f\\x90\\xf6\\x16\\x18\\x63\\x00\\xd8\\xbe\\x7d\\xfb\\xf2\\xe5\\xcb\\\n\\x1d\\x0e\\xc7\\x17\\x5f\\x7c\\x31\\x6d\\xda\\x34\\xf0\\xdb\\xea\\x2f\\x49\\xd2\\\n\\xa1\\x43\\x87\\x7c\\x07\\x7d\\x07\\x1b\\xc1\\xd8\\x5b\\x90\\x03\\x95\\xdf\\x7b\\\n\\xef\\xbd\\xe7\\x9f\\x7f\\x1e\\x00\\x6a\\x6b\\x6b\\xe7\\xcc\\x99\\xd3\\xd5\\xd5\\\n\\xe5\\xff\\xfa\\x07\\x8e\\xe3\\x9c\\x4e\\x67\\x3f\\x07\\x59\\x7f\\xb3\\x09\\x46\\\n\\x59\\x90\\xae\\xc2\\xe9\\x74\\x9a\\xcd\\x66\\x32\\x2f\\xed\\xed\\xca\\x24\\xa7\\\n\\xda\\x93\\x37\\xc8\\x04\\x21\\xc1\\xe8\\xe5\\xc4\\x18\\x23\\x84\\x2e\\x5c\\xb8\\\n\\x50\\x59\\x59\\xd9\\x97\\xc5\\xc0\\x71\\x9c\\xd7\\xeb\\x8d\\x8f\\x8f\\x9f\\x33\\\n\\x67\\x0e\\x0e\\x3e\\xa7\\x16\\x52\\xb5\\x20\\x9d\\x9a\\x73\\x28\\x20\\xbb\\x4a\\\n\\xc3\\x64\\xc5\\x04\\x03\\x04\\x91\\x32\\x82\\xb1\\xb7\\xf8\\x8a\\xfe\\x2f\\x1d\\\n\\x07\\xad\\x45\\x0e\\x42\\x51\\xdb\\xa9\\xb1\\xae\\x03\\x63\\xdc\\x81\\x5e\\x3c\\\n\\xbf\\x62\\xac\\xeb\\xc0\\x18\\x77\\x08\\xed\\x4a\\xeb\\x58\\xd7\\x81\\x31\\xee\\\n\\x10\\x04\\xa4\\x1b\\xeb\\x3a\\x30\\xc6\\x1d\\x02\\x1e\\xc0\\xee\\x62\\x04\\x23\\\n\\xc1\\x6a\\x6a\\x33\\xfa\\x85\\xc9\\x82\\x41\\x81\\xc9\\x82\\x41\\x81\\xc9\\x82\\\n\\x41\\x81\\x99\\x9c\\x0c\\x0a\\x02\\x0a\\x26\\x57\\x3f\\x23\\x40\\xd0\\xfe\\x86\\\n\\xbd\\x63\\x5d\\x07\\xc6\\xb8\\x23\\xb8\\x97\\xca\\x18\\x7d\\xc0\\x6c\\x0b\\x06\\\n\\x05\\x66\\x5b\\x30\\x28\\xb0\\x09\\x2a\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\\n\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\\n\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\\n\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\\n\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\x83\\x02\\x93\\x05\\\n\\x83\\xc2\\xff\\x03\\x78\\xf8\\xa2\\x0e\\x16\\xe4\\x5d\\x96\\x00\\x00\\x00\\x00\\\n\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x01\\x93\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x20\\x00\\x00\\x00\\x20\\x08\\x06\\x00\\x00\\x00\\x73\\x7a\\x7a\\xf4\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x01\\x48\\x49\\x44\\x41\\x54\\x58\\x85\\xed\\xd6\\x4f\\x4a\\\n\\x03\\x31\\x1c\\xc5\\xf1\\xcf\\x5a\\x71\\x67\\x15\\xa1\\xe0\\x42\\xef\\xa4\\x6e\\\n\\xb4\\x8b\\xe2\\xba\\x22\\x88\\xa2\\x47\\xb2\\x47\\x10\\x14\\x3c\\x81\\xd6\\xba\\\n\\x14\\xea\\x5e\\x3d\\x80\\x65\\x5c\\x4c\\x86\\x46\\xd1\\xb6\\x99\\x3f\\x15\\xc4\\\n\\x07\\xd9\\x84\\xbc\\x7c\\x5f\\x92\\x5f\\x32\\xc3\\xbf\\xea\\xd1\\x0e\\x86\\x78\\\n\\x41\\x1f\\xed\\x45\\xc2\\x8f\\x91\\x7d\\x69\\xcf\\xd8\\x5e\\x04\\xfc\\x24\\x00\\\n\\xc7\\xe8\\xa2\\x85\\xeb\\xd0\\x37\\xc2\\x56\\x93\\xf0\\x62\\xe5\\x63\\x1c\\x44\\\n\\xfd\\x4b\\xb8\\xd2\\xf0\\x4e\\xfc\\x04\\x5f\\x48\\x88\\x59\\xf0\\x46\\x43\\xc4\\\n\\x67\\x3e\\x0d\\x5e\\x68\\xd9\\xe7\\x9a\\xa8\\x74\\x3b\\x62\\x78\\x27\\xc1\\x17\\\n\\x87\\xe8\\x57\\x85\\x67\\x38\\x2a\\xe1\\x6f\\x05\\xef\\x6b\\x55\\x78\\x86\\x7b\\\n\\xac\\x25\\xce\\xd1\\x0d\\xde\\x61\\x59\\xf8\\x58\\xbe\\xf2\\xfb\\x12\\x21\\xf6\\\n\\x83\\x3f\\xc3\\x5e\\x0a\\xfc\\xbb\\x6a\\x6f\\xe1\\x2e\\xf4\\x3f\\x62\\x63\\xc6\\\n\\x1c\\xbb\\x78\\x0f\\xe3\\x2f\\xaa\\xc2\\x0b\\xcd\\x1b\\xa2\\x11\\xf8\\xbc\\x21\\\n\\x1a\\x85\\xcf\\x0a\\x51\\x1a\\xbe\\x13\\xc1\\xf7\\xe7\\xf4\\xac\\x63\\x10\\x7c\\\n\\x03\\xf4\\x4c\\x0a\\xee\\x2c\\x05\\x0e\\x0f\\xc1\\xd8\\x4d\\xf4\\xc5\\x21\\x8a\\\n\\x96\\x0c\\x27\\xff\\x99\\xc8\\xb0\\x5a\\xc2\\xdb\\xab\\x0a\\x27\\x7f\\x26\\x33\\\n\\xf9\\xb3\\xb9\\x9c\\xe0\\x8b\\xef\\xf9\\x69\\x59\\x38\\xf9\\x87\\x62\\x94\\x18\\\n\\xe2\\xa0\\x2e\\x78\\xa1\\x4d\\x3c\\x85\\x09\\x6f\\xb1\\x32\\x65\\x6c\\xe9\\x6a\\\n\\xaf\\x23\\x44\\x0c\\x3f\\xaf\\x13\\x3e\\x4f\\x88\\x8e\\xc9\\xb6\\x37\\x02\\x2f\\\n\\xb4\\x65\\x52\\x13\\x37\\xf2\\x8f\\xcf\\xa1\\x9a\\xcf\\x7c\\x96\\xe2\\x9d\\xa8\\\n\\xab\\x25\\xab\\x8d\\x4b\\xbc\\xfd\\x56\\x80\\x7f\\xfd\\x6d\\x7d\\x00\\xd1\\x84\\\n\\xbb\\x35\\x03\\xbe\\x08\\xdc\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\\n\\x60\\x82\\\n\\x00\\x00\\x01\\x63\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x10\\x00\\x00\\x00\\x10\\x08\\x06\\x00\\x00\\x00\\x1f\\xf3\\xff\\x61\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x01\\x18\\x49\\x44\\x41\\x54\\x38\\x8d\\xa5\\xd3\\xbf\\x2e\\\n\\x44\\x41\\x14\\x06\\xf0\\x9f\\x3f\\x8d\\x15\\xbb\\x15\\xd1\\xe8\\x90\\xb5\\x05\\\n\\x7a\\xd9\\xc2\\x13\\x68\\x14\\x1e\\x44\\x21\\xda\\x6d\\xfd\\xcd\\xe5\\x01\\x88\\\n\\x6c\\xa5\\x10\\x85\\x42\\x34\\xe2\\x05\\x58\\xc5\\x8a\\x55\\xe2\\x01\\x88\\x56\\\n\\x14\\x77\\x6e\\x4c\\x26\\xf7\\x36\\x7c\\xc9\\x49\\x66\\xce\\xf9\\x66\\xce\\x77\\\n\\xce\\x9c\\xe1\\x9f\\x18\\xaa\\xf0\\xb7\\xb0\\x86\\xf9\\xb0\\x7f\\xc6\\x05\\xfa\\\n\\x29\\x71\\x38\\xd9\\x37\\xd0\\xc5\\x35\\x26\\x71\\x1b\\x6c\\x0a\\x37\\x38\\x43\\\n\\xbd\\x4a\\x4d\\x03\\x3d\\x1c\\x62\\xac\\x24\\x5e\\x43\\x86\\x87\\xaa\\x4b\\xba\\\n\\xe1\\x70\\x81\\x69\\xec\\x63\\x2f\\xac\\x0b\\x64\\x38\\x4d\\x0f\\xb7\\xf0\\x9a\\\n\\x64\\xbe\\xc3\\x0e\\x76\\x43\\x19\\xb1\\x92\\x37\\x34\\xe3\\x0b\\xb6\\x43\\xa6\\\n\\x18\\xf7\\x18\\x09\\x72\\xbf\\x92\\xd8\\x01\\xb6\\xf8\\x6d\\xe2\\x2c\\x1e\\x13\\\n\\xd2\\x32\\xbe\\xd1\\xc1\\x55\\x12\\xeb\\x61\\x0e\\x46\\xd3\\x5a\\x12\\x6c\\x60\\\n\\x05\\xab\\x55\\x84\\x42\\xc1\\x0b\\x16\\x4b\\xe2\\xef\\xd8\\xc4\\x67\\xe2\\x5f\\\n\\xc2\\x20\\x76\\x2c\\xc8\\x9b\\x58\\x4b\\x88\\x33\\xc1\\x62\\x8c\\x2b\\x69\\x22\\\n\\xf9\\x90\\x64\\x89\\xaf\\x13\\x2c\\xc6\\x11\\x4e\\x4a\\xd4\\xaa\\xcb\\x87\\x24\\\n\\x2b\\x51\\x52\\x64\\x3e\\x96\\xbf\\xce\\x44\\xe1\\x8c\\x9b\\xf8\\x81\\x76\\xc8\\\n\\x30\\xc0\\x79\\x20\\x93\\xbf\\xc8\\xba\\x7c\\x9c\\xdb\\xa2\\x9e\\x54\\x7d\\xa6\\\n\\xa6\\xfc\\x33\\x15\\x75\\xf6\\x71\\x89\\xa7\\x0a\\xfe\\xdf\\xf1\\x03\\x27\\xfd\\\n\\x32\\xe4\\xdd\\x25\\x00\\xc7\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\\n\\x60\\x82\\\n\\x00\\x00\\x00\\xae\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x10\\x00\\x00\\x00\\x10\\x08\\x06\\x00\\x00\\x00\\x1f\\xf3\\xff\\x61\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x63\\x49\\x44\\x41\\x54\\x38\\x8d\\xcd\\x92\\x41\\x0a\\\n\\xc0\\x20\\x0c\\x04\\x87\\xbe\\xab\\x60\\xe8\\x33\\x7d\\x61\\xed\\x2b\\xbc\\x44\\\n\\x28\\xd4\\x98\\x88\\x07\\xbb\\xd7\\x9d\\x5d\\xd8\\x10\\xf8\\x93\\x32\\x90\\x02\\\n\\x9c\\x28\\xfb\\x51\\x02\\x8a\\x53\\x22\\xca\\x88\\x05\\x9c\\xc0\\x0d\\x5c\\x86\\\n\\x57\\x0c\\xcf\\x05\\xc3\\xe1\\x5e\\x60\\x3a\\xdc\\xd4\\xf6\\x0e\\x37\\x1f\\xb3\\\n\\xad\\x51\\x2d\\x4d\\x58\\x3a\\xe2\\x08\\x74\\x4b\\xdc\\x27\\x51\\xef\\xb1\\x98\\\n\\xec\\x84\\xdf\\x25\\xdd\\x57\\xde\\xa3\\x0a\\x64\\xe5\\x1c\\x32\\x38\\xcd\\xe4\\\n\\x26\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x01\\xd7\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x20\\x00\\x00\\x00\\x20\\x08\\x06\\x00\\x00\\x00\\x73\\x7a\\x7a\\xf4\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x01\\x8c\\x49\\x44\\x41\\x54\\x58\\x85\\xed\\xd6\\xcf\\x4b\\\n\\x15\\x51\\x18\\xc6\\xf1\\x4f\\xb7\\x16\\xc1\\x05\\x85\\x28\\x25\\x84\\x10\\xdb\\\n\\x28\\x44\\x24\\xa8\\x18\\x41\\x11\\xad\\xec\\xef\\x10\\x5a\\xb4\\x6e\\xa1\\x0b\\\n\\x71\\xd5\\xa2\\x16\\x41\\x2b\\xfd\\x33\\x5c\\x0a\\x6d\\xfd\\xb1\\x11\\xac\\x96\\\n\\xd1\\xc6\\x54\\x68\\x53\\x54\\x46\\x68\\xa5\\x2d\\xce\\xbd\\x70\\x19\\xce\\x19\\\n\\xee\\xdc\\x3b\\x77\\xee\\x22\\x1f\\x38\\x30\\xbc\\xef\\xbc\\xe7\\xfd\\x32\\xf3\\\n\\xce\\x33\\x87\\xff\\x5d\\x17\\x12\\xf1\\x3a\\x66\\x73\\xf2\\x31\\x7d\\xc7\\x11\\\n\\x3e\\xe2\\xb8\\x4b\\x2e\\x0b\\x38\\xeb\\x70\\xfd\\xc1\\x0e\\x16\\x31\\xd0\\x29\\\n\\xc0\\x72\\x17\\x00\\xad\\xeb\\x33\\xee\\xe5\\x35\\xaa\\x75\\x4a\\xd8\\xa6\\x86\\\n\\xb0\\x8e\\x9b\\xfd\\x02\\x20\\xcc\\xd3\\x8b\\x54\\xf2\\x52\\xc1\\xcd\\xde\\x63\\\n\\x2b\\x12\\xbf\\x8a\\x29\\xdc\\x48\\xd4\\x3d\\x6e\\x80\\xfc\\x6c\\xb7\\x51\\x6a\\\n\\x06\\x5e\\xe5\\xd4\\xd4\\xf0\\x24\\x51\\x77\\x86\\x5b\\xa9\\xa2\\xb2\\x74\\x8a\\\n\\x55\\x6c\\x26\\xf2\\x57\\x7a\\x0d\\xd0\\xd4\\xa7\\x44\\xfc\\xb0\\x2a\\x80\\x89\\\n\\x48\\xec\\x2b\\xf6\\x62\\x37\\x17\\x1d\\xc2\\x3c\\x5d\\xc4\\x53\\xdc\\x8e\\xe4\\\n\\x56\\x71\\x52\\x06\\xc0\\xa3\\xc6\\x66\\x59\\x5d\\xc3\\x24\\x46\\x23\\xb9\\xb7\\\n\\x78\\x5e\\xb0\\x4f\\x69\\x4e\\x78\\x24\\xc7\\x84\\xe8\\xbd\\x11\\xd5\\x05\\xdf\\\n\\x78\\xd0\\x2f\\x00\\xc2\\xeb\\x59\\xc3\\x78\\x19\\x00\\x2b\\xc2\\xf7\\x9c\\x5d\\\n\\xc3\\x98\\xc6\\x92\\x30\\xf1\\x59\\x0d\\xe2\\x65\\x91\\x46\\x9d\\x38\\x61\\x53\\\n\\x77\\xf0\\x3b\\x52\\xfb\\x17\\xd7\\xb3\\x37\\xf7\\xe2\\x15\\xec\\x8a\\xbb\\x61\\\n\\x4d\\x38\\xe4\\xf4\\x1c\\x80\\xb4\\x1b\\x56\\xf2\\x04\\xa2\\x8d\\x1a\\xfa\\x55\\\n\\x05\\xc0\\x14\\xee\\x27\\x72\\xfb\\xd9\\x40\\x51\\x27\\x1c\\xc4\\x58\\x24\\x7e\\\n\\x19\\x23\\x98\\xc3\\x7c\\x62\\xdf\\x1f\\xd8\\x68\\xb7\\x51\\x59\\x4e\\xd8\\xba\\\n\\x5e\\xc7\\x1a\\x55\\x61\\x44\\xf0\\x41\\x38\\x25\\xf7\\x05\\xe0\\x1d\\x1e\\x0a\\\n\\xff\\x85\\x4a\\x01\\x0e\\xf0\\x0c\\x33\\x8d\\xeb\\xa8\\x52\\x43\\xf8\\x06\\x77\\\n\\x15\\x03\\xfc\\x86\\x2f\\xc2\\xe3\\xde\\x16\\x06\\xee\\xb4\\x40\\xfd\\xb9\\xfa\\\n\\xa3\\x7f\\xde\\xd4\\x90\\xf2\\xea\\x8a\\xc9\\x88\\x00\\x00\\x00\\x00\\x49\\x45\\\n\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x00\\xa7\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x10\\x00\\x00\\x00\\x10\\x08\\x06\\x00\\x00\\x00\\x1f\\xf3\\xff\\x61\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x5c\\x49\\x44\\x41\\x54\\x38\\x8d\\xed\\x93\\x41\\x0a\\\n\\x80\\x30\\x0c\\x04\\x47\\x9f\\xd0\\x2f\\x5b\\x7c\\xb3\\x39\\xd5\\x4b\\xc5\\xba\\\n\\x52\\xdb\\x4a\\xbc\\x39\\x10\\xb2\\x90\\x65\\xc9\\x21\\x81\\x8f\\x58\\x01\\x03\\\n\\x52\\xee\\x71\\x34\\xc0\\x80\\x90\\x75\\x00\\xb6\\x9a\\x71\\x2a\\x74\\x7a\\x39\\\n\\xbb\\xa0\\xc6\\xe6\\x7c\\x6e\\x18\\xb5\\xdf\\xa8\\x05\\x74\\xf3\\x07\\x38\\x04\\\n\\x28\\xe5\\x05\\x2a\\x8f\\x17\\x79\\x10\\x39\\x7f\\x40\\xcb\\x80\\xc5\\x65\\x4d\\\n\\x57\\x76\\x10\\x96\\x17\\x24\\xc4\\x1a\\x99\\x16\\x00\\x00\\x00\\x00\\x49\\x45\\\n\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x03\\x43\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x19\\x00\\x00\\x00\\x19\\x08\\x06\\x00\\x00\\x00\\xc4\\xe9\\x85\\x63\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc2\\x00\\x00\\x0e\\xc2\\x01\\x15\\x28\\\n\\x4a\\x80\\x00\\x00\\x02\\xd8\\x49\\x44\\x41\\x54\\x48\\x4b\\xad\\x96\\x3f\\x4c\\\n\\x54\\x41\\x10\\xc6\\xbf\\x7d\\xf7\\x10\\x4a\\x8d\\x05\\x58\\x91\\x50\\x90\\x78\\\n\\x9c\\x12\\xb5\\xa2\\x34\\x1a\\x51\\x08\\xd4\\x72\\x91\\x02\\x0c\\xa1\\xa2\\x27\\\n\\x34\\xc4\\x86\\x02\\x48\\x28\\x08\\xe5\\x41\\x21\\x01\\x0b\\x28\\x48\\x20\\x67\\\n\\x34\\x6a\\x49\\xa5\\xe6\\x34\\x9e\\x1d\\x96\\x1e\\x09\\x9c\\x16\\x14\\x87\\xf7\\\n\\xee\\xad\\x33\\xfb\\xf6\\xdd\\xfb\\xff\\x0e\\x89\\xbf\\xe2\\xb2\\x33\\x7b\\xb7\\\n\\xdf\\xee\\xce\\xcc\\xce\\x09\\xa4\\x70\\x7e\\xf7\\x66\\x57\\x5b\\xdd\\xc8\\x43\\\n\\xe2\\x09\\x04\\xee\\x09\\x1b\\xd7\\xf4\\x14\\xa4\\x81\\x5f\\xe4\\xff\\x48\\xfe\\\n\\x62\\xbd\\xcd\\xde\\x6a\\xff\\xf4\\xbd\\xa2\\xa7\\x22\\xc4\\x8a\\xd4\\xfb\\xb3\\\n\\xd7\\x33\\xb6\\x78\\x41\\x8b\\x3e\\x27\\xb3\\xc3\\xf1\\xa6\\x52\\x23\\xd1\\x42\\\n\\xc3\\x90\\xf3\\x6d\\xa5\\xf2\\xa9\\xf6\\x35\\x89\\x88\\x58\\xb7\\xb3\\xf7\\x49\\\n\\x60\\x8b\\x76\\xd9\\xa5\\x5d\\x17\\x47\\xa0\\x42\\x42\\x79\\xf3\\x4b\\xf9\\x83\\\n\\xf6\\x28\\x02\\x22\\xf6\\xad\\xbe\\xa7\\xb4\\xfb\\x97\\x34\\x34\\x1d\\xcf\\xa5\\\n\\xb0\\xe8\\x54\\xe3\\xc6\\xd7\\x6f\\xaf\\xb4\\xed\\x89\\xa8\\x13\\x34\\xc4\\x1b\\\n\\x1a\\x7a\\x02\\x1d\\x74\\x53\\xb5\\x9a\\x36\\x52\\x88\\x7e\\xcf\\x6a\\x64\\xe4\\\n\\x23\\xf7\\x44\\x06\\x7f\\xe8\\x18\\x6c\\xd1\\xd0\\x13\\xe8\\xec\\x04\\x76\\x77\\\n\\x81\\xb1\\x31\\xed\\x48\\x60\\x70\\x10\\x38\\x38\\x00\\x7a\\x7a\\xb4\\x43\\x61\\\n\\xf2\\x7a\\xbc\\x2e\\x1b\\x4a\\x84\\x83\\x1c\\x88\\x01\\x0b\\x6c\\x6c\\x00\\xdd\\\n\\xdd\\xc0\\xdc\\x5c\\xb2\\x10\\x0b\\x2c\\x2e\\x3a\\xdf\\x5f\\x5f\\x0f\\x0a\\xd1\\\n\\x7a\\x6a\\x5d\\x42\\x70\\x9a\\x5e\\x39\\x37\\x7e\\xd0\\xd8\\xc9\\x22\\x83\\x74\\\n\\x77\\x76\\x80\\xde\\x5e\\x65\\x2a\\xa4\\x04\\x16\\x16\\x80\\xed\\x6d\\xed\\x20\\\n\\x5c\\x81\\x4c\\x46\\x3b\\x88\\xe3\\x63\\x60\\x78\\xd8\\x7f\\x75\\xb5\\x3f\\xed\\\n\\x76\\x8f\\xa1\\xea\\xc0\\x9f\\xa6\\xb6\\x0d\\x2c\\x2d\\x05\\xef\\x58\\x50\\xe8\\\n\\xfc\\x27\\x8a\\x13\\x68\\x34\\x80\\xe5\\xe5\\x70\\x6c\\x3a\\xcc\\xba\\xc8\\x0b\\\n\\x3b\\xd7\\xf7\\x56\\x48\\x3c\\xd4\\x4e\\x8f\\x81\\x01\\x60\\x75\\xd5\\x09\\xaa\\\n\\x0b\\x9f\\x68\\x6f\\x0f\\x18\\x19\\x89\\x0a\\xcc\\xce\\x02\\xc5\\xa2\\x76\\x78\\\n\\x48\\x81\\xf7\\x82\\xd2\\xb6\\xea\\xaf\\xe4\\x00\\x71\\x42\\x61\\x52\\x04\\x18\\\n\\x4a\\xe7\\xdf\\x46\\xa2\\x00\\x73\\x78\\x08\\xcc\\xcc\\x84\\xaf\\xc0\\xa3\\x85\\\n\\x00\\x43\\xeb\\x5f\\x55\\xd9\\x95\\x0a\\x0b\\x6d\\x6e\\x6a\\x23\\xc4\\xfe\\x7e\\\n\\xaa\\x80\\x4b\\x6b\\x11\\x0e\\xf2\\xc4\\x84\\x36\\x42\\x8c\\x8e\\xb6\\xae\\x23\\\n\\xc2\\x50\\xaf\\x69\\x12\\x71\\x59\\xe4\\x27\\x9c\\x75\\x31\\xa8\\x98\\xa8\\xe7\\\n\\x3a\\x8e\\xa4\\x34\\x2d\\x14\\xd2\\xd3\\x3b\\x8c\\xc4\\x67\\x43\\x0a\\xf9\\x5a\\\n\\x9b\\x1e\\x49\\x02\\x1c\\xe4\\x95\\x95\\x68\\x32\\xa4\\x08\\x49\\x43\\x16\\xa3\\\n\\x15\\xcf\\xe9\\xca\\x6f\\x11\\x3f\\x15\\x2e\\x71\\x59\\x14\\x97\\xde\\x67\\x67\\\n\\xc0\\xd0\\x10\\x50\\xad\\x6a\\x87\\xae\\x78\\xee\\x68\\xdc\\x70\\xb4\\xd3\\xd9\\\n\\xe1\\xd4\\x14\\x70\\x72\\xe2\\xd8\\x49\\x69\\x1a\\x4e\\x6f\\x16\\x98\\x9e\\xf6\\\n\\x0b\\x70\\x3c\\x0a\\xb4\\xfe\\x4f\\x95\\x5d\\xdc\\xd1\\xb8\\xe1\\xa8\\x19\\xe6\\\n\\xe8\\x08\\x98\\x9c\\x74\\xde\\xa2\\xb4\\x3a\\x70\\x85\\x4e\\xa9\\x19\\xb2\\x40\\\n\\xa9\\xa4\\x27\\x14\\x15\\x6a\\xcb\\xf3\\x3c\\xf0\\xfa\\x49\\x7f\\xf6\\x41\\xc6\\\n\\x12\\x1c\\x9f\\xff\\xd3\\x4f\\x4c\\xf9\\xd8\\x2c\\x95\\xdf\\xb1\\xd1\\xac\\x13\\\n\\x76\\xd0\\xf1\\xc6\\x69\\x68\\x39\\x1e\\xe2\\x22\\x02\\x4c\\x48\\x80\\xd7\\x71\\\n\\x05\\x98\\x40\\x31\\x72\\xcb\\xe4\\x1d\\x04\\xae\\xee\\xdf\\xa8\\xf0\\xef\\xfd\\\n\\xad\\x97\\x89\\x54\\x3c\\xef\\xc0\\xca\\xc8\\x1c\\xed\\x66\\x8d\\xcc\\x0b\\x1e\\\n\\x45\\xfd\\x5b\\x59\\xa3\\x4c\\xca\\xf9\\x4f\\xe0\\xd2\\x8c\\x49\\x1c\\x94\\xde\\\n\\x37\\x4c\\x4b\\x3c\\x13\\xb6\\xe0\\xff\\x5d\\x77\\xf8\\xb1\\xd3\\x53\\xaa\\x92\\\n\\xb9\\xd0\\xb8\\x0e\\x2c\\x53\\x6e\\x72\\x16\\xe9\\xa9\\x10\\xc0\\x5f\\xd7\\x77\\\n\\x48\\xe8\\xe8\\xc2\\xdf\\x4d\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\\n\\x60\\x82\\\n\\x00\\x00\\x03\\x4d\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x64\\x00\\x00\\x00\\x64\\x08\\x06\\x00\\x00\\x00\\x70\\xe2\\x95\\x54\\\n\\x00\\x00\\x00\\x01\\x73\\x52\\x47\\x42\\x00\\xae\\xce\\x1c\\xe9\\x00\\x00\\x00\\\n\\x04\\x67\\x41\\x4d\\x41\\x00\\x00\\xb1\\x8f\\x0b\\xfc\\x61\\x05\\x00\\x00\\x00\\\n\\x09\\x70\\x48\\x59\\x73\\x00\\x00\\x0e\\xc3\\x00\\x00\\x0e\\xc3\\x01\\xc7\\x6f\\\n\\xa8\\x64\\x00\\x00\\x02\\xe2\\x49\\x44\\x41\\x54\\x78\\x5e\\xed\\xdd\\xbd\\x8a\\\n\\x15\\x31\\x1c\\x05\\xf0\\xeb\\x07\\x8a\\x2f\\xa0\\x8d\\x95\\xa2\\x2c\\x8a\\xa0\\\n\\x20\\x82\\xbd\\xa8\\xcd\\x62\\xa3\\x0b\\xea\\x53\\x58\\x69\\xa7\\x76\\x5a\\xf9\\\n\\x1e\\x8a\\xa8\\xfb\\x12\\x36\\x56\\xa2\\xd8\\xe8\\x0a\\xb2\\x8d\\x36\\x2a\\xf8\\\n\\x81\\x36\\x7a\\xfe\\x24\\x45\\x18\\x32\\x33\\x77\\x32\\xc9\\xdc\\x33\\xd9\\xf3\\\n\\x83\\x43\\xc2\\x2d\\x96\\xc9\\x3d\\xbb\\xe1\\x86\\x3b\\xec\\x2c\\x44\\x44\\x44\\\n\\x44\\x44\\x44\\x26\\xb6\\xcb\\x8f\\x39\\x1c\\x43\\xd6\\x91\\x23\\xc8\\x41\\x7b\\\n\\x81\\xc0\\x17\\x64\\x0b\\xd9\\x44\\xde\\xdb\\x0b\\x3b\\xc1\\x71\\xc4\\x16\\xfc\\\n\\x8f\\x3c\\x2f\\x10\\xfb\\xa5\\xa9\\xda\\x65\\xe4\\x3b\\x12\\x7b\\x03\\x18\\xf3\\\n\\x0d\\xb9\\x84\\x54\\xe9\\x0c\\xf2\\x13\\x89\\x2d\\x9c\\x39\\xbf\\x90\\x73\\x48\\\n\\x55\\xf6\\x20\\x6f\\x91\\xd8\\x82\\xe7\\x90\\x77\\xc8\\x5e\\xa4\\x1a\\x37\\x90\\\n\\xd8\\x42\\xe7\\x94\\xeb\\x08\\x9d\\xdd\\x7e\\x1c\\xea\\x9a\\x1f\\xe7\\xec\\xaa\\\n\\x1f\\xa9\\xa4\\x16\\x72\\xd6\\x8f\\x73\\x46\\xb9\\x86\\xd4\\x73\\xc8\\x1f\\x64\\\n\\x9f\\x9b\\x46\\xbd\\x44\\xb6\\xdd\\x74\\x65\\x0e\\x23\\xe7\\xdd\\x34\\xea\\x2f\\\n\\xb2\\xdf\\x4d\\xe7\\x2f\\xb6\\x27\\x87\\x61\\xd8\\xd2\\xec\\x1a\\x62\\xd7\\x16\\\n\\x86\\x4e\\xea\\x96\\x25\\x85\\xa8\\x10\\x32\\x2a\\x84\\x8c\\x0a\\x21\\xa3\\x42\\\n\\xc8\\xa8\\x10\\x32\\x2a\\x84\\x8c\\x0a\\x21\\xa3\\x42\\xc8\\xa8\\x10\\x32\\x2a\\\n\\x84\\x8c\\x0a\\x21\\xa3\\x42\\xc8\\xa8\\x10\\x32\\x2a\\x84\\x8c\\x0a\\xe9\\xd6\\\n\\xf5\\x05\\x57\\x11\\x2a\\xa4\\xdb\\x2d\\xe4\\x81\\x9b\\x4e\\x43\\x85\\xf4\\xbb\\\n\\x8d\\x4c\\x56\\x8a\\x0a\\x59\\xce\\x64\\xa5\\xa4\\xde\\xe4\\xd0\\xf7\\x7d\\xf4\\\n\\x06\\xf2\\xc4\\x4d\\x57\\xe6\\x14\\x72\\xd3\\x4d\\x5b\\xdd\\xf1\\x63\\x9b\\xc7\\\n\\x48\\x78\\x7f\\xc0\\x7d\\xe4\\x9e\\x9b\\x72\\x69\\xde\\x2c\\xd0\\x4c\\x0d\\xf7\\\n\\x6d\\x19\\x2b\\xa4\\xb9\\xb6\\xa2\\x7f\\x29\\xda\\xb2\\x86\\x2b\\xba\\x7d\\xa9\\\n\\x90\\x34\\xc5\\x4a\\x51\\x21\\xe9\\x8a\\x94\\xa2\\x42\\xc6\\xc9\\x5e\\x8a\\x0a\\\n\\x19\\x2f\\x6b\\x29\\x2a\\x24\\x8f\\x6c\\xa5\\xb0\\x9c\\x43\\x0e\\x20\\x27\\xdc\\\n\\x94\\x8a\\xbd\\xc9\\x17\\xdc\\x74\\x29\\x2b\\x3b\\xa7\\x34\\x3f\\x9b\\x37\\x33\\\n\\xf4\\x1c\\x72\\x12\\x89\\xfd\\x9c\\x39\\x66\\xd4\\x5f\\x8a\\xb6\\xac\\xfc\\x46\\\n\\x6d\\x5f\\x2a\\xa4\\x8c\\xe4\\x52\\x54\\x48\\x39\\x49\\xa5\\xa8\\x90\\xb2\\x7e\\\n\\xfb\\x71\\x69\\x2a\\xa4\\x1c\\xfb\\xb4\\x65\\x9f\\xba\\x06\\x51\\x21\\x65\\x24\\\n\\x95\\x61\\x54\\x48\\x7e\\xc9\\x65\\x18\\x1d\\x0c\\xbb\\xed\\xd8\\x83\\x21\\xab\\\n\\xd8\\x17\\x54\\x6d\\xb9\\x8b\\x8c\\xa6\\x2d\\x2b\\x8f\\x51\\xdb\\x54\\x48\\x85\\\n\\x8c\\x97\\xad\\x0c\\xa3\\x42\\xc6\\xc9\\x5a\\x86\\x51\\x21\\xe9\\xb2\\x97\\x61\\\n\\x54\\x48\\x9a\\x22\\x65\\x18\\x15\\x32\\x5c\\xb1\\x32\\x4c\\xcd\\x37\\xca\\xad\\\n\\x21\\x57\\xdc\\xb4\\xd5\\x43\\x3f\\xb6\\xd1\\x8d\\x72\\x19\\xd9\\x35\\xc4\\xae\\\n\\x2d\\x4c\\x9f\\xf0\\x1c\\x92\\xe5\\x9c\\xd1\\x47\\x5b\\xd6\\x72\\x8a\\x6e\\x53\\\n\\x21\\x15\\xd2\\x6f\\xb2\\x32\\x8c\\x0a\\xe9\\xf6\\x08\\x99\\xac\\x0c\\xa3\\x42\\\n\\xba\\xd9\\xbf\\x2a\\x9c\\x94\\x0a\\x21\\xa3\\x42\\xc8\\xa8\\x10\\x32\\x2a\\x84\\\n\\x8c\\x0a\\x21\\xa3\\x42\\xc8\\xa8\\x10\\x32\\x2a\\x84\\x8c\\x0a\\x21\\xa3\\x42\\\n\\xc8\\xa8\\x10\\x32\\x2a\\x84\\x8c\\x0a\\x21\\xa3\\x42\\xc8\\xa8\\x10\\x32\\x7a\\\n\\xe4\\x51\\x25\\x3e\\x21\\xe1\\xcd\\x02\\x73\\xcc\\x47\\x84\\x4e\\xea\\x96\\xf5\\\n\\xca\\x8f\\x73\\x46\\xb9\\x86\\xd4\\x42\\x56\\x7d\\xcf\\x55\\x0e\\x4f\\xfd\\x58\\\n\\x05\\x7b\\xf4\\xea\\x1b\\x24\\xb6\\x15\\xcc\\x21\\xaf\\x11\\x5b\\x43\\x55\\x4e\\\n\\x23\\x3f\\x90\\xd8\\x82\\x99\\x63\\x0f\\x27\\xae\\xe1\\xc1\\x98\\x51\\x17\\x11\\\n\\x7b\\x24\\x76\\x6c\\xe1\\x8c\\xf9\\x8a\\xd8\\x35\\x57\\xcd\\x1e\\x1a\\xff\\x1c\\\n\\x89\\xbd\\x01\\x4c\\x79\\x86\\x1c\\x45\\xa8\\xa5\\x9e\\x43\\x62\\x6c\\xb1\\xeb\\\n\\x7e\\x3c\\x64\\x2f\\x10\\xf8\\x8c\\x7c\\x40\\x36\\x91\\x2d\\x7b\\x41\\x44\\x44\\\n\\x44\\x44\\x44\\x44\\x42\\x8b\\xc5\\x7f\\xe5\\x3f\\x89\\x9d\\x4e\\x70\\xa6\\x97\\\n\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\x42\\x60\\x82\\\n\\x00\\x00\\x00\\xd4\\\n\\x89\\\n\\x50\\x4e\\x47\\x0d\\x0a\\x1a\\x0a\\x00\\x00\\x00\\x0d\\x49\\x48\\x44\\x52\\x00\\\n\\x00\\x00\\x20\\x00\\x00\\x00\\x20\\x08\\x06\\x00\\x00\\x00\\x73\\x7a\\x7a\\xf4\\\n\\x00\\x00\\x00\\x06\\x62\\x4b\\x47\\x44\\x00\\xff\\x00\\xff\\x00\\xff\\xa0\\xbd\\\n\\xa7\\x93\\x00\\x00\\x00\\x89\\x49\\x44\\x41\\x54\\x58\\x85\\x63\\x60\\x18\\x05\\\n\\xa3\\x80\\x74\\x30\\x9f\\x81\\x81\\xe1\\x3f\\x01\\x7c\\x9f\\x58\\xc3\\x98\\xc8\\\n\\x70\\x80\\x03\\x11\\x6a\\x0e\\x90\\x61\\x2e\\x59\\x40\\x8a\\x01\\xe2\\xe3\\xa7\\\n\\xe4\\x1a\\x40\\x4e\\x08\\x20\\x03\\x63\\x28\\x7d\\x76\\xc4\\x3a\\xc0\\x04\\x4a\\\n\\x9f\\xa1\\xd0\\x1c\\xb2\\xc1\\x33\\x06\\x48\\x1a\\x90\\x1c\\x08\\xcb\\x29\\x4e\\\n\\x80\\x0c\\x0c\\x94\\x45\\x01\\xc5\\xf1\\x3f\\xe4\\x1d\\x30\\x9a\\x00\\x29\\x4e\\\n\\x80\\x0c\\x0c\\xe4\\x47\\x01\\x55\\xe2\\x7f\\x48\\x3b\\x60\\x34\\x01\\x52\\x25\\\n\\x01\\x32\\x30\\x90\\x17\\x05\\x54\\x8b\\xff\\x21\\xeb\\x80\\x91\\x97\\x00\\xa9\\\n\\xda\\x0a\\x46\\x07\\xc4\\x44\\xc1\\xa0\\x6a\\x05\\x8f\\x82\\xe1\\x07\\x00\\x83\\\n\\x09\\x30\\xf9\\xc1\\x98\\x1d\\x5e\\x00\\x00\\x00\\x00\\x49\\x45\\x4e\\x44\\xae\\\n\\x42\\x60\\x82\\\n\"\n\nqt_resource_name = b\"\\\n\\x00\\x0f\\\n\\x00\\x7b\\x2b\\x75\\\n\\x00\\x49\\\n\\x00\\x63\\x00\\x6f\\x00\\x6e\\x00\\x73\\x00\\x5f\\x00\\x52\\x00\\x65\\x00\\x66\\x00\\x65\\x00\\x72\\x00\\x65\\x00\\x6e\\x00\\x63\\x00\\x65\\\n\\x00\\x05\\\n\\x00\\x4f\\xa6\\x53\\\n\\x00\\x49\\\n\\x00\\x63\\x00\\x6f\\x00\\x6e\\x00\\x73\\\n\\x00\\x07\\\n\\x09\\xc1\\x57\\xa7\\\n\\x00\\x72\\\n\\x00\\x75\\x00\\x6e\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0e\\\n\\x01\\x21\\x26\\xa7\\\n\\x00\\x62\\\n\\x00\\x64\\x00\\x73\\x00\\x69\\x00\\x6d\\x00\\x5f\\x00\\x69\\x00\\x63\\x00\\x6f\\x00\\x6e\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x08\\\n\\x08\\xc8\\x58\\x67\\\n\\x00\\x73\\\n\\x00\\x61\\x00\\x76\\x00\\x65\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x09\\\n\\x06\\x97\\x98\\x67\\\n\\x00\\x61\\\n\\x00\\x62\\x00\\x6f\\x00\\x72\\x00\\x74\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0b\\\n\\x02\\x6e\\xc3\\xe7\\\n\\x00\\x6f\\\n\\x00\\x76\\x00\\x65\\x00\\x72\\x00\\x6c\\x00\\x61\\x00\\x70\\x00\\x2e\\x00\\x73\\x00\\x76\\x00\\x67\\\n\\x00\\x08\\\n\\x04\\xb2\\x58\\xc7\\\n\\x00\\x75\\\n\\x00\\x6e\\x00\\x64\\x00\\x6f\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x10\\\n\\x0c\\xd3\\x1f\\x47\\\n\\x00\\x63\\\n\\x00\\x6f\\x00\\x6c\\x00\\x6f\\x00\\x72\\x00\\x5f\\x00\\x70\\x00\\x69\\x00\\x63\\x00\\x6b\\x00\\x65\\x00\\x72\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0c\\\n\\x02\\xc1\\xfc\\xc7\\\n\\x00\\x6e\\\n\\x00\\x65\\x00\\x77\\x00\\x5f\\x00\\x66\\x00\\x69\\x00\\x6c\\x00\\x65\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0f\\\n\\x0a\\x22\\x33\\x07\\\n\\x00\\x62\\\n\\x00\\x64\\x00\\x73\\x00\\x69\\x00\\x6d\\x00\\x5f\\x00\\x6c\\x00\\x6f\\x00\\x67\\x00\\x6f\\x00\\x32\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x08\\\n\\x0b\\xb2\\x58\\x47\\\n\\x00\\x72\\\n\\x00\\x65\\x00\\x64\\x00\\x6f\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0d\\\n\\x08\\xd5\\xc4\\xe7\\\n\\x00\\x75\\\n\\x00\\x6e\\x00\\x64\\x00\\x65\\x00\\x72\\x00\\x6c\\x00\\x69\\x00\\x6e\\x00\\x65\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x10\\\n\\x0a\\x7b\\xb6\\x67\\\n\\x00\\x63\\\n\\x00\\x65\\x00\\x6e\\x00\\x74\\x00\\x65\\x00\\x72\\x00\\x5f\\x00\\x61\\x00\\x6c\\x00\\x69\\x00\\x67\\x00\\x6e\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0b\\\n\\x00\\xc4\\x52\\x27\\\n\\x00\\x73\\\n\\x00\\x69\\x00\\x6d\\x00\\x54\\x00\\x69\\x00\\x6d\\x00\\x65\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0f\\\n\\x04\\x54\\x04\\xe7\\\n\\x00\\x72\\\n\\x00\\x69\\x00\\x67\\x00\\x68\\x00\\x74\\x00\\x5f\\x00\\x61\\x00\\x6c\\x00\\x69\\x00\\x67\\x00\\x6e\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x08\\\n\\x08\\x01\\x59\\x27\\\n\\x00\\x6d\\\n\\x00\\x61\\x00\\x69\\x00\\x6e\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0f\\\n\\x02\\x4f\\x22\\xa7\\\n\\x00\\x6f\\\n\\x00\\x70\\x00\\x65\\x00\\x6e\\x00\\x5f\\x00\\x66\\x00\\x6f\\x00\\x6c\\x00\\x64\\x00\\x65\\x00\\x72\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0b\\\n\\x0c\\x53\\x24\\x67\\\n\\x00\\x73\\\n\\x00\\x75\\x00\\x63\\x00\\x63\\x00\\x65\\x00\\x73\\x00\\x73\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0b\\\n\\x05\\x79\\x4e\\x27\\\n\\x00\\x73\\\n\\x00\\x61\\x00\\x76\\x00\\x65\\x00\\x5f\\x00\\x61\\x00\\x73\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0e\\\n\\x08\\x95\\xe3\\xa7\\\n\\x00\\x6c\\\n\\x00\\x65\\x00\\x66\\x00\\x74\\x00\\x5f\\x00\\x61\\x00\\x6c\\x00\\x69\\x00\\x67\\x00\\x6e\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0f\\\n\\x02\\x12\\x49\\x67\\\n\\x00\\x62\\\n\\x00\\x64\\x00\\x73\\x00\\x69\\x00\\x6d\\x00\\x5f\\x00\\x69\\x00\\x63\\x00\\x6f\\x00\\x6e\\x00\\x32\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x10\\\n\\x02\\x96\\x70\\x87\\\n\\x00\\x63\\\n\\x00\\x6c\\x00\\x65\\x00\\x61\\x00\\x72\\x00\\x5f\\x00\\x66\\x00\\x6f\\x00\\x72\\x00\\x6d\\x00\\x61\\x00\\x74\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x08\\\n\\x0c\\x33\\x5a\\x87\\\n\\x00\\x68\\\n\\x00\\x65\\x00\\x6c\\x00\\x70\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x08\\\n\\x0c\\x07\\x58\\x47\\\n\\x00\\x71\\\n\\x00\\x75\\x00\\x69\\x00\\x74\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x08\\\n\\x06\\x27\\x5a\\x67\\\n\\x00\\x62\\\n\\x00\\x6f\\x00\\x6c\\x00\\x64\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0a\\\n\\x06\\xcb\\x4f\\xc7\\\n\\x00\\x72\\\n\\x00\\x65\\x00\\x6d\\x00\\x6f\\x00\\x76\\x00\\x65\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x09\\\n\\x09\\x65\\x8e\\x67\\\n\\x00\\x65\\\n\\x00\\x72\\x00\\x72\\x00\\x6f\\x00\\x72\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0d\\\n\\x0c\\x6c\\x85\\xa7\\\n\\x00\\x65\\\n\\x00\\x78\\x00\\x70\\x00\\x6f\\x00\\x72\\x00\\x74\\x00\\x5f\\x00\\x61\\x00\\x73\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\\x00\\x0a\\\n\\x02\\xfc\\x42\\x47\\\n\\x00\\x69\\\n\\x00\\x74\\x00\\x61\\x00\\x6c\\x00\\x69\\x00\\x63\\x00\\x2e\\x00\\x70\\x00\\x6e\\x00\\x67\\\n\"\n\nqt_resource_struct_v1 = b\"\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\\n\\x00\\x00\\x00\\x24\\x00\\x02\\x00\\x00\\x00\\x1c\\x00\\x00\\x00\\x03\\\n\\x00\\x00\\x01\\x8e\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6f\\x6f\\\n\\x00\\x00\\x00\\x48\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x0e\\xc8\\\n\\x00\\x00\\x02\\x62\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x99\\x8b\\\n\\x00\\x00\\x01\\xe4\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x8b\\xe8\\\n\\x00\\x00\\x00\\x98\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x4a\\x63\\\n\\x00\\x00\\x02\\x86\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb4\\x48\\\n\\x00\\x00\\x00\\xf0\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x50\\x39\\\n\\x00\\x00\\x03\\x40\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xc1\\x16\\\n\\x00\\x00\\x01\\xaa\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x7c\\xae\\\n\\x00\\x00\\x00\\xb4\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x4d\\x74\\\n\\x00\\x00\\x02\\x24\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x8f\\xe5\\\n\\x00\\x00\\x02\\xd8\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb7\\xf8\\\n\\x00\\x00\\x00\\x80\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x3a\\x24\\\n\\x00\\x00\\x02\\xee\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb9\\xd3\\\n\\x00\\x00\\x01\\xce\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x7d\\x36\\\n\\x00\\x00\\x02\\x40\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x99\\x04\\\n\\x00\\x00\\x00\\x6a\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x33\\xe3\\\n\\x00\\x00\\x01\\x48\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6d\\xc8\\\n\\x00\\x00\\x03\\x08\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xba\\x7e\\\n\\x00\\x00\\x00\\x34\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\\n\\x00\\x00\\x01\\x0e\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x50\\xec\\\n\\x00\\x00\\x01\\x68\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6e\\xe6\\\n\\x00\\x00\\x01\\x32\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6c\\xf3\\\n\\x00\\x00\\x02\\xc2\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb7\\x46\\\n\\x00\\x00\\x02\\xac\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb5\\xdf\\\n\\x00\\x00\\x02\\x08\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x8c\\xd3\\\n\\x00\\x00\\x03\\x20\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xbd\\xc5\\\n\\x00\\x00\\x00\\xca\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x4e\\x41\\\n\"\n\nqt_resource_struct_v2 = b\"\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x01\\\n\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\n\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\\n\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\n\\x00\\x00\\x00\\x24\\x00\\x02\\x00\\x00\\x00\\x1c\\x00\\x00\\x00\\x03\\\n\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\\n\\x00\\x00\\x01\\x8e\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6f\\x6f\\\n\\x00\\x00\\x01\\x7f\\x26\\x32\\x4b\\x81\\\n\\x00\\x00\\x00\\x48\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x0e\\xc8\\\n\\x00\\x00\\x01\\x7a\\x7a\\xcc\\x36\\x6e\\\n\\x00\\x00\\x02\\x62\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x99\\x8b\\\n\\x00\\x00\\x01\\x7a\\x7a\\xcc\\x36\\x6e\\\n\\x00\\x00\\x01\\xe4\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x8b\\xe8\\\n\\x00\\x00\\x01\\x7d\\xb2\\xf7\\x5e\\xe7\\\n\\x00\\x00\\x00\\x98\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x4a\\x63\\\n\\x00\\x00\\x01\\x7d\\xb6\\xca\\xd9\\x30\\\n\\x00\\x00\\x02\\x86\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb4\\x48\\\n\\x00\\x00\\x01\\x7d\\xb3\\x00\\x7b\\x5f\\\n\\x00\\x00\\x00\\xf0\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x50\\x39\\\n\\x00\\x00\\x01\\x7d\\xb2\\xf7\\xf5\\xc3\\\n\\x00\\x00\\x03\\x40\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xc1\\x16\\\n\\x00\\x00\\x01\\x7d\\xb3\\x02\\x62\\xed\\\n\\x00\\x00\\x01\\xaa\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x7c\\xae\\\n\\x00\\x00\\x01\\x7d\\xb3\\x01\\x4d\\x71\\\n\\x00\\x00\\x00\\xb4\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x4d\\x74\\\n\\x00\\x00\\x01\\x7d\\xb2\\xf2\\xf3\\x99\\\n\\x00\\x00\\x02\\x24\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x8f\\xe5\\\n\\x00\\x00\\x01\\x7d\\xb3\\x18\\xc2\\xa3\\\n\\x00\\x00\\x02\\xd8\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb7\\xf8\\\n\\x00\\x00\\x01\\x7d\\xb3\\x01\\xfe\\x34\\\n\\x00\\x00\\x00\\x80\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x3a\\x24\\\n\\x00\\x00\\x01\\x7e\\xdd\\xf3\\x69\\xe1\\\n\\x00\\x00\\x02\\xee\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb9\\xd3\\\n\\x00\\x00\\x01\\x7d\\xb2\\xf5\\xe9\\xc9\\\n\\x00\\x00\\x01\\xce\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x7d\\x36\\\n\\x00\\x00\\x01\\x7b\\xdd\\xcc\\x05\\xd7\\\n\\x00\\x00\\x02\\x40\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x99\\x04\\\n\\x00\\x00\\x01\\x7d\\xb3\\x01\\x1f\\xc7\\\n\\x00\\x00\\x00\\x6a\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x33\\xe3\\\n\\x00\\x00\\x01\\x7d\\xb3\\x18\\xd0\\x59\\\n\\x00\\x00\\x01\\x48\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6d\\xc8\\\n\\x00\\x00\\x01\\x7d\\xb3\\x02\\x9b\\xc6\\\n\\x00\\x00\\x03\\x08\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xba\\x7e\\\n\\x00\\x00\\x01\\x7b\\xdd\\x98\\xbe\\xba\\\n\\x00\\x00\\x00\\x34\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\\n\\x00\\x00\\x01\\x7e\\xdd\\xf7\\x66\\xb4\\\n\\x00\\x00\\x01\\x0e\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x50\\xec\\\n\\x00\\x00\\x01\\x7b\\x71\\x75\\xd1\\xa2\\\n\\x00\\x00\\x01\\x68\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6e\\xe6\\\n\\x00\\x00\\x01\\x7d\\xb3\\x01\\x83\\x0f\\\n\\x00\\x00\\x01\\x32\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x6c\\xf3\\\n\\x00\\x00\\x01\\x7d\\xb2\\xf2\\x00\\x41\\\n\\x00\\x00\\x02\\xc2\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb7\\x46\\\n\\x00\\x00\\x01\\x7d\\xb2\\xfd\\x02\\xf6\\\n\\x00\\x00\\x02\\xac\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xb5\\xdf\\\n\\x00\\x00\\x01\\x7d\\xb3\\x04\\x21\\xa1\\\n\\x00\\x00\\x02\\x08\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x8c\\xd3\\\n\\x00\\x00\\x01\\x7b\\xec\\x12\\x34\\x16\\\n\\x00\\x00\\x03\\x20\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\xbd\\xc5\\\n\\x00\\x00\\x01\\x7e\\xca\\x15\\xa4\\x64\\\n\\x00\\x00\\x00\\xca\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x4e\\x41\\\n\\x00\\x00\\x01\\x7d\\xb3\\x1b\\x2a\\x81\\\n\"\n\nqt_version = [int(v) for v in QtCore.qVersion().split(\".\")]\nif qt_version < [5, 8, 0]:\n    rcc_version = 1\n    qt_resource_struct = qt_resource_struct_v1\nelse:\n    rcc_version = 2\n    qt_resource_struct = qt_resource_struct_v2\n\n\ndef qInitResources():\n    QtCore.qRegisterResourceData(\n        rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data\n    )\n\n\ndef qCleanupResources():\n    QtCore.qUnregisterResourceData(\n        rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data\n    )\n\n\nqInitResources()\n"
  },
  {
    "path": "bdsim/bdedit/Icons.qrc",
    "content": "<!DOCTYPE RCC><RCC version=\"1.0\">\n<qresource prefix=\"Icons_Reference\">\n\t<file>Icons/bdsim_icon.png</file>\n\t<file>Icons/bdsim_icon2.png</file>\n\t<file>Icons/bdsim_logo2.png</file>\n\n\t<file>Icons/run.png</file>\n\t<file>Icons/abort.png</file>\n\t<file>Icons/simTime.png</file>\n\t<file>Icons/error.png</file>\n\t<file>Icons/success.png</file>\n\n\t<file>Icons/main.png</file>\n\t<file>Icons/overlap.svg</file>\n\n\t<file>Icons/bold.png</file>\n\t<file>Icons/italic.png</file>\n\t<file>Icons/underline.png</file>\n\n\t<file>Icons/left_align.png</file>\n\t<file>Icons/center_align.png</file>\n\t<file>Icons/right_align.png</file>\n\n\t<file>Icons/color_picker.png</file>\n\t<file>Icons/clear_format.png</file>\n\n\t<file>Icons/new_file.png</file>\n\t<file>Icons/open_folder.png</file>\n\t<file>Icons/save.png</file>\n\t<file>Icons/save_as.png</file>\n\t<file>Icons/export_as.png</file>\n\t<file>Icons/quit.png</file>\n\n\t<file>Icons/undo.png</file>\n\t<file>Icons/redo.png</file>\n\t<file>Icons/remove.png</file>\n\n\t<file>Icons/help.png</file>\n</qresource>\n</RCC>"
  },
  {
    "path": "bdsim/bdedit/LICENSE",
    "content": "GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Copyright (C) {year}  {name of author}\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    {project}  Copyright (C) {year}  {fullname}\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n\n"
  },
  {
    "path": "bdsim/bdedit/README.md",
    "content": "\n![block diagram](https://github.com/petercorke/bdsim/raw/master/figs/eg1-bdedit.png)\n\n`bdedit` is a multi-platform PyQt5-based graphical tool to create, edit, render and execute block diagram models.\n\n\nKey features include:\n\n  * allows graphical creation of block diagrams\n  * the diagram is stored in a human readable/editable JSON file with extension `.bd`\n  * creates good-quality graphics for inclusion in publications\n  * can launch `bdsim` to import and execute the model\n  * automatically discovers all bsdim and toolbbox blocks and adds them to the block library menu\n  * icons can be easily created using any image creation tool or a LaTeX expression \n\n**Note that `PyQt5` is licenced under GPL3.**\n\n# Getting started\n\nFrom the examples folder\n```\n% bdedit eg1.bd\n```\nwill create a display like that shown above.  \n\nTo run an existing `.bd` file\n```\n% bdrun eg1.bd\n```\nwhich will:\n\n* parse the JSON file\n* instantiate all blocks and wires\n* compile and run the diagram\n\nIt takes standard options like\n```\n% bdrun +g -a eg1.bd\n```\nto enable graphics but disable animation.\n\nPushing the run button, top left (triangle in circle) will save the file then spawn `bdrun` as a subprocess.\n\n## Adding a block\n\nClick a block from the library panel on the left-hand side.  Each category is initially closed,\nclick it, to open it and reveal the blocks within.\n\nAll blocks, when added are instantiated in the middle of the canvas.\n\nThe key elements of a block are:\n* input ports, small blue boxes\n* output ports, small red triangles or arrow heads\n* icon, which occupies the middle of the box (a 250x250 PNG image)\n* block label, beneath the block, must be unique in the diagram\n* block class, this appears when you hover the cursor over a block\n* port labels, small text inside the box, against input and/or output ports. \n  Most ports don't have port labels.\n* parameters, these are set by right clicking the block, see [details here](block-parameters).\n\nBlocks can be flipped by typing \"f\" while the block is selected.\n\n## Wiring blocks together\n\n* Click one port then click another port, or\n* Click and drag from one port to another.\n\nAn output port can connect to an arbitrary number of input ports.\n\n## Selecting and moving elements\n\n![highlighted elements](figs/Figure_2.5-Block_and_Wire_Selected.png)\nAll selected elements, wires or blocks have an orange highlight when selected.\nYou can drag a region to select all blocks and wires within.\n\nSelected items can be moved: click and drag them.  Blocks cannot be resized.\n\nSelected wires can be adjusted:\n* horizontal segments can be dragged up and down, \n* vertical segments can be dragged left or right.\n\n## Connectors\n\n![connectors](figs/Figure_1.2-Example_of_Block_Diagram_as_represented_in_bdedit.png)\n\nThe wire dragging is a little limited, and sometimes it is hard to get the layout you want. In this\ncase try adding a \"Connector\" from the \"Canvas Items\" category.  Run a wire to the input of the connector\nand one or more wires from the output of the connector.  You can drag the connector by dragging it, click\nclose to, but not on, the connector to highlight it.  A wire can have an arbitrary number of connectors in it.\n\n## Block parameters\n\n![parameter panel](figs/Figure_2.9-Parameter_Window.png)\nRight clicking a block opens a panel on the right.  The parameters are initialized to values taken\nfrom the docstring for the block.\n\nMake changes and then click \"Update parameters\".  This will check validity of the types and values.\n\nClick \"View documentation\" will open a browser window at the GitHub documentation page for the block \nclass.\n\nBlock parameters can be:\n\n* constants\n\n* a native Python expression, prefix it with an equal sign, for example\n`=[x**2 for x in range(10)]`.  \n\n* an expression which relies on global variables or other run-time context, add a Main block\n  to the diagram.  It contain the name of a Python script (by definition, for a block diagram `model` it would be `model-main.py` which will be spawned when you hit\n  the Run button.  This can create the runtime environment, load the `.bd` file,\n  for example:\n\n    ```\n    from bdsim import bdload, BDSim\n\n    sim = BDSim() #debug='i')\n    bd = sim.blockdiagram()\n\n    lmbda = 0.08\n\n    bd = bdload(bd, \"IBVS.bd\", globals=globals())\n    bd.compile()\n    bd.report()\n\n    out = sim.run(bd, 100)\n    print(out)\n    ```*\n\n![parameter panel](figs/Main.png)\n\n# Grouping boxes\n\n![parameter panel](figs/GroupingBoxes.png)\n\nThese are transparent colored boxes that are drawn below all other graphical\nitems.  They can be used to add structure to the diagrams.\n\n# Free text\n\nClick `Canvas Items/Text Item` to drop a default string `Text` onto the canvas.\nSelect the text to edit it.  Formatting options are in the toolbar.  Multiline\ntext with left/right/centred alignment is supported.\n\n# Further details\n\nMore detail about how the tool works and key datastructures are in the [technical report](TechReport.md).  This is a little dated now, and the visual appearance\nof the GUI has evolved.\n"
  },
  {
    "path": "bdsim/bdedit/TechReport.md",
    "content": "bdedit was developed by a QUT computer science student project team.  The following is the final report of that student project.  Significant\nsubsequent work has been on this tool since the project completed.\n\n# BdEdit Technical Report\n\nContact Details\n\nDevelopers\n\nSamara - Email: samara.barwick@connect.qut.edu.au\n\nRory - Email: rory.higgins@connect.qut.edu.au\n\nJohn - Email: john.wishart@connect.qut.edu.au\n\nDaniel - Email: daniel.petkov@connect.qut.edu.au\n\nSupervisor\n\nProfessor Peter Corke - GitHub: https://github.com/petercorke\n\n# Table of Contents\n1. [Context](#h1)\n\n2. [Feature Exploration of Bdedit](#h2)\n\n    [Interface](#h2-sh1)\n\n    [Adding Blocks](#h2-sh2)\n\n    [Sockets](#h2-sh3)\n\n    [Socket Flipping](#h2-sh4)\n\n    [Further Block Manipulation](#h2-sh5)\n\n    [Wires](#h2-sh6)\n\n    [Connector Block](#h2-sh7)\n\n    [Intersection Management](#h2-sh8)\n\n    [Editing Block Parameters](#h2-sh9)\n\n    [Screenshot](#h2-sh10)\n\n    [Grid Mode](#h2-sh11)\n\n    [Grid Snapping](#h2-sh12)\n\n    [Saving and Loading](#h2-sh13)\n\n3. [Class Architecture (High Level)](#h3)\n\n    [1) The Interface Class](#h3-sh1)\n\n    [2) The Scene Class](#h3-sh2)\n\n    [3) The GraphicsView Class](#h3-sh3)\n\n    [4) The Block Class](#h3-sh4)\n\n    [5) The Socket Class](#h3-sh5)\n\n    [6) The Wire Class](#h3-sh6)\n\n4. [Making changes to code](#h4)\n\n    [Adding more blocks types to application](#h4-sh1)\n\n    [Block parameters explained](#h4-sh1)\n\n    [JSON file structure outline](#h4-sh2)\n\n    [How icons were created](#h4-sh3)\n\n    [Procedure for updating changes to existing icons, or adding new ones](#h4-sh4)\n\n5. [Appendices](#h5)\n\n    [APPENDIX A – High Level Class Architecture Diagram](#h5-sh1)\n\n    [APPENDIX B – Stepped Wire Drawing Logic](#h5-sh2)\n\n    [Embedded Links](#h5-sh3)\n\n# 1. Context<a id=\"h1\"></a>\n\nIn engineering, complex systems are often represented with block diagrams (refer to Figure 1.1), where blocks represent functions with inputs and outputs, and wires represent the flow of values between the ports of these functions.\n\n<p align=\"center\"><img width=\"500\" alt=\"Example of System as a Block Diagram\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_1.1-Example_of_System_as_a_Block_Diagram.png\"/></p>\n\nThese block diagrams can be modelled and simulated as code through the bdsim [[1]](#h5-sh3-item1) Python package developed by Professor Peter Corke, where the blocks and wires are represented in terms of Python class and method calls.\n\nTo aid with the conceptualization of the developed block diagram model and its modelling process, the bdedit package was developed as an addition to bdsim, allowing for block diagrams to be created graphically with items that visually represent the blocks, in/out ports and the wires (refer to Figure 1.2). Bdedit supports the saving and loading of these diagrams to and from a JSON file, which stores all the necessary data for the diagram to later be simulated through bdsim.\n\n<p align=\"center\"><img width=\"800\" alt=\"Example of Block Diagram as represented in bdedit\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_1.2-Example_of_Block_Diagram_as_represented_in_bdedit.png\"/></p>\n\n# 2. Feature Exploration of Bdedit<a id=\"h2\"></a>\n## Interface<a id=\"h2-sh1\"></a>\nInstalling the bdsim package and its necessary files, then running the bdedit&#46;py [[2]](#h5-sh3-item2) file, launches a new window containing a graphical user interface (refer to Figure 2.1). This interface contains three areas of focus, the canvas (grey grid space), the library browser panel, and the toolbar.\n\n<p align=\"center\"><img width=\"500\" alt=\"Bdedit Graphical User Interface\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.1-Bdedit_Graphical_User_Interface.png\"/></p>\n\n## Adding Blocks<a id=\"h2-sh2\"></a>\nThrough this interface, the user can create a block diagram by choosing from a list of available blocks found within the Library Browser panel. These will call on the classes related to those blocks, to create a block which both stores its values internally within the program and graphically represents that block within the diagram. The graphical information of these blocks and wires is then stored within the canvas area (refer to Figure 2.2).\n\n<p align=\"center\"><img width=\"500\" alt=\"Adding Blocks to Canvas and Connecting them\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.2-Adding_Blocks_to_Canvas_and_Connecting_them.png\"/></p>\n\n## Sockets<a id=\"h2-sh3\"></a>\nThese blocks have sockets, representing its inputs and outputs. These are determined through the block type, with some blocks only having input sockets (sink blocks or INPORT blocks), some only having output sockets (source blocks or OUTPORT blocks), and others having both input and output sockets (function, transfer, discrete or SUBSYSTEM blocks) (refer to Figure 2.3).\n\n<p align=\"center\"><img width=\"400\" alt=\"Examples of Blocks\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.3-Examples_of_Blocks.png\"/></p>\n\nThese sockets can be used to connect the output of one block to one or more other blocks, creating a flow of data. The following logic is applied to these sockets based on their types:\n\n* Sockets cannot connect to the same socket type (Output cannot connect to Output, Input cannot connect to Input)\n\n* Input sockets can only have one wire connecting into them (any further wires that are connected will be disconnected until the existing wire is removed)\n\n* Output sockets can have any number of wires connected to them\n\n## Socket Flipping<a id=\"h2-sh4\"></a>\nBlocks can also be flipped, reversing the sides on which the input and output sockets are located. This can be achieved through pressing the 'F' key (F for flip). These are only graphically updated and do not impact the flow of logic to those sockets (refer to Figure 2.4).\n\n<p align=\"center\"><img width=\"400\" alt=\"Example of Flipping Socket Orientation\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.4-Example_of_Flipping_Socket_Orientation.png\"/></p>\n\n## Further Block Manipulation<a id=\"h2-sh5\"></a>\nBlocks can also be selected/ moved and deleted as desired. All items are restriced to being moved around within the borders of the canvas. Wires can also be selected and deleted, but not moved. Sockets cannot be selected, moved or deleted through mouse interaction. Selecting, or rather clicking on, a socket creates a draggable wire. As the block is moved, so too are its sockets. The only instance where sockets move relative to the block, is when the number of input or output sockets changes (which is controlled through the [parameter window](#h2-sh9)).\n\nThe selection of an item is indicated by a colour change. When a block, connector block or wire is selected, its outline changes from a thin black line, to a thicker bright orange outline (refer to Figure 2.5).\n\n<p align=\"center\"><img width=\"300\" alt=\"Block and Wire Selected\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.5-Block_and_Wire_Selected.png\"/></p>\n\nAs mentioned above, blocks and wires can be deleted when desired. This is done through first selecting the item, then pressing either the 'Backspace' or the 'Del' keys on the keyboard. If a wire is deleted, only the wire will be removed. If a block is deleted, any wires that were connected to it will also be deleted with the block.\n\n## Wires<a id=\"h2-sh6\"></a>\nBlocks can be connected to one another by either clicking on a socket of one block, then clicking on a socket of another block, or by click-and-dragging from one socket and releasing over the socket of another block (refer to Figure 2.6). When a wire is connected between two points, wire logic will be applied to it, in order to determine the path it should take to connect those two blocks. Moving the block around once the wire is connected, will update the position of the wire end points, and as such, will cycle through the wire logic to determine what path the wire should follow (refer to [APPENDIX B](#h5-sh2) for examples and a walkthrough of this logic).\n\n<p align=\"center\"><img width=\"600\" alt=\"Example of Dragging Wire\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.6-Example_of_Dragging_Wire.png\"/></p>\n\n## Connector Block<a id=\"h2-sh7\"></a>\nThe sections of the wires cannot be pulled out and positioned to the user's liking, as their path is solely dependent on the position of the two points it connects. Hence, to assist with routing the wires when the diagrams become more complex with wires travelling in multiple directions, a connector block can be used as an intermediary point through which the wire must travel. These provide the user with more control over how the wire travels between any two points, by creating more points in between the start and end point, which the wire must first connect. The comparison between using a connector block and not, can be seen in Figure 2.7. The connect block appears as a single Input and Output socket joined together on one edge; and similarly to other blocks, it is also flip-able.\n\n<p align=\"center\"><img width=\"600\" alt=\"Usage of Connector Blocks\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.7-Usage_of_Connector_Blocks.png\"/></p>\n\n## Intersection Management<a id=\"h2-sh8\"></a>\nAs seen in the bottom part of Figure 2.7, wires can overlap at times, and although they are fairly easy to follow in this figure, it can become difficult to follow the flow of logic when the diagram becomes more complex. To address this problem area, parts of wires that cross over each other can be separated to indicate they do not cross, but instead pass over each other (refer to Figure 2.8). This feature might not always be desired, so it has been disabled by default, however can be toggled on or off by the user through pressing the 'I' key (I for intersection). The wire logic at these intersection points, keeps all vertical segments of wires solid, and erases parts of any horizontal segments that they pass through.\n\n<p align=\"center\"><img width=\"700\" alt=\"Toggling Wire Intersection Detection ON\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.8-Toggling_Wire_Intersection_Detection_ON.png\"/></p>\n\n## Editing Block Parameters<a id=\"h2-sh9\"></a>\nIntegral to the creation and simulation of block diagrams, is the ability to edit the parameter values related to each block, as this dictates what output value a block produces and how blocks process any inputs that feed into it to produce an output. If supported for the given block, it is also possible to edit the number of input or output sockets a block has. All blocks (aside from connector blocks) can be named as desired by the user. As blocks are spawned they are given a default name which is auto incremented depending on the block type.\n\nThese user-editable block parameters are editable through a Parameter Window panel that appears on the right hand side of the screen when triggered to do so (refer to Figure 2.9). It can be toggled to open by first selecting a block, then right clicking the mouse; subsequently, it can be closed at any moment by either right clicking again or left clicking anywhere in the screen. Closing the Parameter Window will retain any values that have been edited, but will only update the block parameters once the 'Updated Parameters' button has been clicked.\n\n<p align=\"center\"><img width=\"600\" alt=\"Parameter Window\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.9-Parameter_Window.png\"/></p>\n\nWhen parameters are edited and the user selects update, all editable values within the Parameter Window will be checked to ensure they adhere to the conditions placed on them. If the block title is changed, this will be checked against other existing block titles, to ensure the name of the current block would not be a duplicate. If the block parameters are changed, they will be compared against their required types to ensure they match (e.g. float, int, bool, list, str), and if any further restrictions are placed on these parameters (e.g. matching to certain strings, or being within a certain range), they will be checked against those too. This information is defined internally within the block class, and applied to the block when it is created.\n\nUser feedback pop-up windows are also connected to this Parameter Window. If the user provides values that are incorrect - be they a duplicate block title, incorrect types or not adhering to further restrictions – the block parameters will not be updated, and an error message will be displayed notifying the user with useful information for where the issue occurred. If all values are correctly inputted, a success message will be displayed in the same area (refer to Figure 2.10).\n\n<p align=\"center\"><img width=\"700\" alt=\"User-Feedback Messages\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.10-User-Feedback_Messages.png\"/></p>\n\n## Screenshot<a id=\"h2-sh10\"></a>\nUpon creating a block diagram, the user can take a screenshot of all items within the canvas by simply pressing the 'Screenshot' button located within the toolbar. This will save a 4k resolution image of the entire canvas and everything in it. This resolution is chosen due to canvas size potentially being 5x the desktop screen size due to the zooming feature. Due to limited time to further develop this feature, at present time, this image will be saved with the '.png' file extension, under the name 'Scene Picture' in the same folder the interface is run from. **If taking multiple screenshots this way, be aware that this will override any previous screenshot you may have taken.**\n\n## Grid Mode<a id=\"h2-sh11\"></a>\nTo improve the viewing quality of the screenshots taken, and reduce the amount of visual noise/messiness created by having the background be a grid, an option is available from the toolbar to disable the background by navigating to the 'Grid Mode\" button in the toolbar, and selecting 'Off' from the drop down menu. Alternatively, the grid can be displayed in two other modes, Light (the default mode) and Dark (refer to Figure 2.11).\n\n<p align=\"center\"><img width=\"1400\" alt=\"Background Colour Modes\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_2.11-Background_Colour_Modes.png\"/></p>\n\n## Grid Snapping<a id=\"h2-sh12\"></a>\nTo improve the usability of the interface and the user experience when moving/aligning blocks within the canvas, a grid snapping feature has been implemented, where movement of the mouse will be restricted to moving the block in increments of 20 pixels (the width of the smaller grid squares). Additionally, all sockets are indexed in increments of the same value (20 pixels) in order to line up with these smaller grid lines. As such, since wires are automatically drawn between the socket positions, it is much easier to move blocks around in order to make them straight.\n\n## Saving and Loading<a id=\"h2-sh13\"></a>\nAn integral component to this bdedit tool is the support for saving the current progress made on a block diagram, and the support to load a previously worked on block diagram (provided it is in a compatible format). Block diagrams are saved as JSON files, containing information about the canvas size, all the blocks (its name, on-screen position, parameters, and sockets), and finally all the wires and the sockets they connect to. This information is stored as a dictionary within the JSON file, which is parse-able as key-value pairs, where the key represents the name of the variable or parameter related to the scene, block, socket or wire, and the value representing the value that variable holds.\n\nA file can be saved or loaded from through the associated 'Save' or 'Save As' and 'Load' buttons within the toolbar. Upon clicking on one of these buttons, the a file browser window will pop up (allowing the user to browse their devices' file structure), prompting the user to either select a file to load or to choose the location they wish for their file to be saved (and the name of the file if it's the first time saving or if saving the diagram as a new file).\n\nDue to a limitation of time to further develop this feature, whether this file is in a compatible format is not checked before it is attempted to be parsed, so any errors that may occur due to an incorrect file being loaded, will result in the crashing of the bdedit tool.\n\n# 3. Class Architecture (High Level)<a id=\"h3\"></a>\n The architecture of BDEdit can be summarize through the connectivity between 6 main classes as seen in Figure 3.1. Other classes are also essential, however it is through the interactions between these 6 main classes that the application is able to run. For a full size image of this architecture refer to [APPENDIX A](#h5-sh1). These classes break down into the following:\n\n<p align=\"center\"><img width=\"300\" alt=\"Bdedit Architecture Diagram\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_3.1-BdEdit_Architecture_Diagram.png\"/></p>\n\n### 1) <span style=\"color:#EA503B\">**The Interface Class**</span><a id=\"h3-sh1\"></a> – \nThis class is responsible for the dimensions of the BDEdit window that appears when the application is run, as well as managing the layout of where all the interact-able areas of the application are, these being:\n* The toolbar;\n\n* The left side panel (otherwise named the Library Browser);\n\n* The right side panel (otherwise named the Parameter Window); and\n\n* The canvas or work-area (which is an instance of the <span style=\"color:#EC872D\">GraphicsScene</span> class, who itself is a child class of the <span style=\"color:#EC872D\">Scene</span> class, AND is connected to a <span style=\"color:#EC872D\">GraphicsView</span> class instance).\n\nIt is namely the creation of the <span style=\"color:#EC872D\">GraphicsScene</span> class that allows for the graphical representation of <span style=\"color:#4E9FD8\">Blocks</span>, <span style=\"color:#7ABA50\">Sockets</span> and <span style=\"color:#957597\">Wires</span>, the culmination of which allows for the making of a Block Diagram.\n\n### 2) <span style=\"color:#EC872D\">**The Scene Class**</span><a id=\"h3-sh2\"></a> – \nThis class is responsible for three things.\n\n* Storing all instances of any Wires and Blocks (and their <span style=\"color:#7ABA50\">Sockets</span>) that are created, i.e. their structures, internal variables, lists, properties, etc. It also manages the adding/removing of these instances.\n\n* Creating and storing a <span style=\"color:#EC872D\">GraphicsScene</span> class instance, in which all the <span style=\"color:#4E9FD8\">GraphicsBlock</span>, <span style=\"color:#7ABA50\">GraphicsSocket</span>, and <span style=\"color:#957597\">GraphicsWire</span> class instances are added to graphically represent their class respectively. This allows for the all the relevant internal information of the <span style=\"color:#4E9FD8\">Block</span>, <span style=\"color:#7ABA50\">Socket</span> and <span style=\"color:#957597\">Wire</span> classes to be represented graphically!\n\n* Managing the intersection points at which any two (or more) wires overlap.\n\n### 3) <span style=\"color:#EC872D\">**The GraphicsView Class**</span><a id=\"h3-sh3\"></a> – \nThis class instance is connected to the <span style=\"color:#EC872D\">GraphicsScene</span> through the <span style=\"color:#EA503B\">Interface</span> class, and is responsible for monitoring the <span style=\"color:#EC872D\">GraphicsScene</span> and implementing logic to any user interactions within it. These interactions being: key presses, mouse press/release, mouse movement, scroll click and scroll movement events. These detected events are caught in real time, allowing for logic within the GraphicsScene to also be updated in real time. Some examples of this includes:\n\n* the creation of a <span style=\"color:#957597\">Wire</span> (and subsequent <span style=\"color:#957597\">GraphicsWire</span>) when a <span style=\"color:#7ABA50\">GraphicsSocket</span> is clicked on;\n\n* the real-time updates to how the <span style=\"color:#957597\">GraphicsWire</span> is drawn while being pulled from one <span style=\"color:#7ABA50\">GraphicsSocket</span> to another;\n\n* the real-time updates to how the <span style=\"color:#4E9FD8\">GraphicsBlock</span> is drawn when the number of sockets on it changes, or when it is selected;\n\n* the zooming in and out of, and panning of the canvas (<span style=\"color:#EC872D\">GraphicsScene</span>).\n\n### 4) <span style=\"color:#4E9FD8\">**The Block Class**</span><a id=\"h3-sh4\"></a> – \nAn instance of this class is created when a respective button is clicked from the Library Browser side panel in the Interface. This class is responsible for holding all <span style=\"color:#4E9FD8\">Block</span> related variables, these beings things like its name, position within the canvas, block type, icon, dimensions, user-editable parameters and a list of input and output <span style=\"color:#7ABA50\">Socket</span> instances that are related to this <span style=\"color:#4E9FD8\">Block</span>. Additionally, this class relates and instance of the **ParamWindow** class and <span style=\"color:#4E9FD8\">GraphicsBlock</span> class to this <span style=\"color:#4E9FD8\">Block</span>.\n\nThe **ParamWindow** is a class which creates a Parameter Window in which are displayed this <span style=\"color:#4E9FD8\">Blocks'</span> type, title and user-editable parameters, and through which a user can edit the parameters of a given block. When this Parameter Window is opened, it appears in a right side panel within the <span style=\"color:#EA503B\">Interface</span>.\n\nSimilar to how the <span style=\"color:#EC872D\">GraphicsScene</span> represents a <span style=\"color:#EC872D\">Scene</span> class instance, the <span style=\"color:#4E9FD8\">GraphicsBlock</span> graphically represents a given <span style=\"color:#4E9FD8\">Block</span>, and sends that graphical information to the <span style=\"color:#EC872D\">GraphicsScene</span> to display.\n\n### 5) <span style=\"color:#7ABA50\">**The Socket Class**</span><a id=\"h3-sh5\"></a> –\nAn instance of this class is created and connected to a <span style=\"color:#4E9FD8\">Block</span>, whenever one is made. This class is responsible for holding all <span style=\"color:#7ABA50\">Socket</span> related variables, like its index (from the top of the <span style=\"color:#4E9FD8\">Block</span>, these are auto incremented as more <span style=\"color:#7ABA50\">Socket</span> are made for a Block), the position to be drawn at (Left or Right of the <span style=\"color:#4E9FD8\">Block</span>), the type of <span style=\"color:#7ABA50\">Socket</span> being drawn (Input or Output) and finally a list of all <span style=\"color:#957597\">Wires</span> that are connected to this <span style=\"color:#7ABA50\">Socket</span>.\n\nAdditionally, some special blocks (PROD and SUM Blocks) have math operators (+,-,×,&#xf7;) drawn alongside their input Sockets depending on what string for one of those block's parameters. For example, that parameter may be the string \"`*/*`\" in the PROD block, and this will draw a '×', '&#xf7;', '×' alongside the first, second, third input sockets respectively.\n\nThe <span style=\"color:#7ABA50\">Socket</span> class also holds an instance of <span style=\"color:#7ABA50\">GraphicsSocket</span> which graphically represents the <span style=\"color:#7ABA50\">Socket</span>, and is sent to the <span style=\"color:#EC872D\">GraphicsScene</span> to be drawn.\n\n### 6) <span style=\"color:#957597\">**The Wire Class**</span><a id=\"h3-sh6\"></a> – \nAs was mentioned in the <span style=\"color:#EC872D\">GraphicsView</span>, when it has detected that a <span style=\"color:#7ABA50\">GraphicsSocket</span> has been clicked, this will create a <span style=\"color:#957597\">Wire</span> instance from that <span style=\"color:#7ABA50\">Socket</span>, and a subsequent <span style=\"color:#957597\">GraphicsWire</span> from the <span style=\"color:#7ABA50\">GraphicsSocket</span> to the mouse cursor, until either the <span style=\"color:#957597\">GraphicsWire</span> is clicked off of into an empty space within the <span style=\"color:#EC872D\">GraphicsScene</span>, or the wire is clicked off of onto another <span style=\"color:#7ABA50\">GraphicsSocket</span>. If these socket types are different (i.e. both aren't input or output sockets), then the wire is connected and will remain so, even as the <span style=\"color:#4E9FD8\">GraphicsBlock</span> is moved around. The <span style=\"color:#957597\">Wire</span> class is responsible for holding all <span style=\"color:#957597\">Wire</span> related variables, these being what <span style=\"color:#7ABA50\">Sockets</span> this <span style=\"color:#957597\">Wire</span> connects (start/end sockets) and the type of wire being drawn (Direct, Bezier or Step). The wire type dictates the style with which the wire is drawn. Direct draws the wire as a straight line between two points. Bezier draws the wire as a cubic between two points (think sinusoidal wave). Step draws a wire with 90 degree bends at each point the wire must turn to reach the end socket.\n\nAlthough other methods and classes are involved in the process of making this application meet further functional requirements, these 6 classes are what tie everything together.\n\n# 4. Making changes to code<a id=\"h4\"></a>\n<a id=\"h4-sh1\"></a>\n\n## Adding more blocks types to application\nIf the new block type falls under one of the following, already existing categories: Source, Sink, Function, Transfer, Discrete, INPORT, OUTPORT or SUBSYSTEM block (these last three are located within the hierarchy file), then that block simply needs to be added as a class of one of the Python files relating to those block types. These Python files are located in the \"**_`bdsim/bdsim/bdedit/Block_Classes`_**\" folder (refer to Figure 4.1), with the names seen in Figure 4.2.\n\n<p align=\"center\" float=\"middle\">\n<img width=\"400\" alt=\"Relevant bdsim File Structure\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_4.1-Relevant_bdsim_File_Structure.png\"/>\n\n\n<img width=\"200\" alt=\"Block Type Files\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_4.2-Block_Type_Files.png\"/>\n</p>\n\nWithin each of those files, the first few lines import the block type they inherit, for example, the \"**_`block_function_blocks.py`_**\" file imports the FunctionBlock class from the \"**_`block.py`_**\" file (located in \"**_`bdsim/bdsim/bdedit`_** \") inheriting its properties. An example of one of the blocks within these files (without the block comments) is given below:\n\n``` python\nclass Function(FunctionBlock): \n    def __init__(self, \n                 scene, \n                 window, \n                 func=\"Provide Function\", \n                 nin=1, \n                 nout=1, \n                 dictionary=False, \n                 args=(), \n                 kwargs={}, \n                 name=\"Function Block\", \n                 pos=(0, 0)): \n\n        super().__init__(scene, window, name, pos)\n\n        self.setDefaultTitle(name)\n\n        self.block_type = blockname(self.__class__)\n\n        self.parameters = [ \n            [\"func\", str, func, []], \n            [\"nin\", int, nin, [[\"range\", [0, 1000]]]], \n            [\"nout\", int, nout, [[\"range\", [0, 1000]]]], \n            [\"dict\", bool, dictionary, []], \n            [\"args\", tuple, args, []], \n            [\"kwargs\", dict, kwargs, []] \n        ]\n\n        self.inputsNum = nin \n        self.outputsNum = nout\n\n        self.icon = \":/Icons_Reference/Icons/function.png\" \n        self.width = 100 \n        self.height = 100\n\n        self._createBlock(self.inputsNum, self.outputsNum)\n```\n\nThis block class type is constructed based on the definition of the corresponding bdsim block [[3]](#h5-sh3-item3). When adding in a new block, the following template can be copied and adjusted as needed.\n\n``` python\n# The name of this new block class should be unique, and\n# it should inherit whichever block type it belongs to.\nclass My_New_Block(Class_the_new_block_relates_to):\n\n    # Next, the scene and window are required to be passed to the\n    # creation of this block (and will be done so automatically from\n    # the interface). The following input parameters are the parameters\n    # of the block and their respective default values.\n    # Finally comes the block's default name (if the user doesn't provide\n    # one), and the position is set to always spawn the block at the\n    # centre of the work area.\n    def __init__(self, \n                 scene, \n                 window, \n                 param1=\"parm1_default_value\", \n                 param2=\"parm2_default_value\", \n                 param3=\"parm3_default_value\", \n                 name=\"My_New_Block Block\", \n                 pos=(0, 0)): \n        super().__init__(scene, window, name, pos)\n\n        # The chosen default name for this block is passed to\n        # the setDefaultTitle function which will ensure no duplicate\n        # names names of this block exist.\n        self.setDefaultTitle(name)\n\n        # The block type is set as the given name of this block class\n        self.block_type = blockname(self.__class__)\n\n        # The parameters of the block are wrapped into a list, where each\n        # parameter sits inside its own list and defines\n        # the name, type, default value, and any further restrictions\n        # for each respective parameter.\n        self.parameters = [ \n            [\"parameter 1\", str, param1, []], \n            [\"parameter 2\", str, param2, []], \n            [\"parameter 3\", str, param3, []] \n        ]\n\n        # The icon file path is matched to whatever name the icon for\n        # this block was named within the Icons folder (this procedure\n        # will require the icons resource file to be updated for a new\n        # image to be findable within this folder).\n        self.icon = \":/Icons_Reference/Icons/my_new_block.png\"\n\n        # The height and width are set for this block\n        self.width = 100 \n        self.height = 100\n\n        # Finally the block is created, with the number of input and\n        # output sockets that have been assigned to this block. (This\n        # will be inherited from the class this block inherits).\n        self._createBlock(self.inputsNum, self.outputsNum)\n```\n\nThis simply needs to be added to the end of the appropriate file (as chosen from Figure 4.2), and this will make the block automatically appear within the interface.\n\n## Block parameters explained<a id=\"h4-sh2\"></a>\nEach block has its own unique parameters, with their own unique names, types, default values and further restrictions (like being restricted to a certain range of allowable numbers). All of a given blocks' parameters are stored within the self.parameters variable list, with each individual parameter being stored as a list within the self.parameters list. Each individual parameter is defined with the following format:\n\n* **_parameter = [\"name\", type, value, [restrictions]]_**\n    \n    _e.g. parameter = [[\"Gain\", float, gain, []], [\"Premul\", bool, premul, []]]_\n\nThe items which make up this list of the parameter, are as follows:\n\n* **_name_**: _this is the name of the parameter as a string_\n\n* **_type_**: _this is the type this parameter must be (e.g. int, str, float)_\n\n* **_value_**: _this is the default value the parameter will be set to, if no other value is given. It must also adhere to the required type of the parameter._\n\n* **_restrictions_**: _this is a list (can be list of lists) containing further restrictions applied to the parameter._\n\nAs multiple restrictions can be applied to a single parameter, each individual restriction is enclosed as a list. If no restrictions are applied to a parameter, the main restrictions list (inside the parameter list) will simply be an empty list, as seen in the example. These restrictions follow the following structure:\n\n* **_restriction = [\"restriction name\", [condition(s)]]_**\n    \n    What these two items within the restriction list represent is explained below:\n\n* **_restriction name_** : _can be only one of the following \"keywords\", \"range\", \"type\" or \"signs\"._\n\n* **_condition(s)_**: _differ based on the restriction name used, and will be of the following format:_\n\nCurrently, only the four restriction types mentioned below are recognized. These must be entered as a string in the first item within the restriction list (\"restriction name\"), to indicate what kind of restriction is being applied to this parameter. Following this first value, a list containing one or more conditions placed on the restriction is defined. These depend on the type of restriction chosen. Examples of these restrictions are given below:\n\n```python\n[[\"keywords\", [\"sine\", \"square\", \"triangle\"]]]\n```\n\n* This restriction compares the parameter value against the strings defined within the conditions list. This restriction should only be used on parameters whose required type is 'str' (string). If the parameter value doesn't match any of these strings, this will throw an error notifying the user that their input must match one of those strings.\n\n* Here the conditions list is just a list of all the variations the parameter value can be.\n\n```python\n[[\"range\", [-math.inf, math.inf]]]\n```\n\n* This restriction compares the parameter value against being within a range of given numbers, defined by a min and a max. This restriction should only be used on parameters whose required type is either 'float' or 'int'. If the parameter value is outside the allowable range, this will throw an error notifying the user that their input must be within the given range.\n\n* Here the conditions list simply is made up of a minimum and maximum value.\n\n```python\n[[\"type\", [type(None), int, float]]]\n```\n\n* This restriction compares the type of the parameter value against one of the additional allowable types for this parameter. If for instance, a parameter can either an integer or a float when defined, or a None type otherwise, this means the parameter can be one of 3 different types, and this restriction allows the parameter to pass as long as its type matches one of the defined types. In order to allow other types, the type set for this parameter (as the second item in the parameters list), must also be included in this conditions list, usually as the last item (for consistency sake). Note, when allowing a parameter to have None as a value, since None isn't a type, but rather a NoneType, type(None) is used to extract the type of None. If the type of the parameter value doesn't match one of the other allowable types, this will notify the user of the error, and the allowable types.\n\n* Here the conditions list is just a list of all the acceptable types for that parameter, with the required type of the parameter also being in that list (usually as the last value in the list; which is float in this case).\n\n```python\n[[\"signs\", [\"*\", \"/\"]]] or[[\"signs\", [\"+\", \"-\"]]]\n```\n\n* This restriction compares the parameter value against the various characters that have been defined in the conditions list. This restriction should only be used for SUM and PROD type blocks, as these have input sockets which are labelled according to the signs defined in this condition list. The parameter value for these blocks (SUM and PROD) is entered as a string of characters, and each character for the respective block is checked against the ones that are allowed from the conditions list. If that string is made up of any number of characters that don't match the ones that are allowed, an error will be thrown, notifying the user of the allowable inputs.\n\n* Here the conditions list is just a list of all the allowable characters for that parameter\n\n## JSON file structure outline<a id=\"h4-sh2\"></a>\nThe JSON file structure contains all the necessary information of the reconstruction of blocks, sockets and wires that exist within a block diagram, and represents them as dictionaries, of key-value pairs which represent the name and value of parameters relevant to those items. All of these items (blocks, sockets, and wires) are contained within a Scene as explained in [Section 3](#Class_Architecture(High), hence they follow the following hierarchy:\n\n* A Scene is represented as dictionary with:\n\n    * Dimensions: these are two parameters of the width and height of the scene.\n\n    * Blocks: this is a list of all the blocks within the diagram, with each block as a dictionary.\n\n    * Sockets: each block has its own unique sockets, so these are stored as part of the block they belong to, also in a list, with each socket as a dictionary.\n\n    * Wires: this is a dictionary list of all the wires within the diagram.\n\nThe following block diagram was made to aid with understanding this structure.\n\n<p align=\"center\"><img width=\"250\" alt=\"Block Diagram Example for JSON File Stucture\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/JSON_file_example_diagram.png\"/></p>\n\nThere are 3 blocks, created in the order:\n1. Function Block – has 1 input socket, 1 output socket\n2. Scope Block – has 2 input sockets, no output sockets\n3. Constant Block – has no input sockets, 1 output socket\n\nThere are also 2 wires, created in the order:\n\n1. Function block -&gt; 1st input socket of Scope Block\n2. Constant block -&gt; 2nd input socket of Scope Block\n\nBelow, is the resulting JSON file that was generated.\n\n<p align=\"center\">\n<img width=\"1300\" alt=\"JSON File Structure 1\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/JSON_file_example_code_1.PNG\"/>\n<img width=\"1300\" alt=\"JSON File Structure 2\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/JSON_file_example_code_2.PNG\"/>\n</p>\n\nThe important points to take away from this JSON structure, is that each block, socket and wire has unique ID's. Although the ID's of the blocks are less useful (can be helpful for differentiating between different blocks of the same time, although their name should be sufficient), the ID's of the sockets are very important. By definition each wire has a start socket and end socket that it is drawn between, and these are referred to by their unique ID. These unique ID's of the sockets, can then be traced back to the block they belong to, hence providing the crucial information of which block connects to which.\n\nAs an example, in this block diagram that was made, wire #1 connects the **Function block** from its **output**, to the **1st input** of the **Scope block**. In the wire, these start/end sockets are stored as \"start_socket\": 2427529113712 and \"end_socket\": 2427529150816,and if we check the socket id's of the **output socket** of the **Function block**, it is stored as \"id\": 2427529113712, which we expect to match our \"start_socket\"(which it does), and doing the same for the **1st input socket** of the **Scope block**, it is stored as \"id\": 2427529150816, which also matches our ID of the \"end_socket\".\n\n## How icons were created<a id=\"h4-sh3\"></a>\nIcons for bdedit were creating using the free image editing application, paint&#46;net [[4]](#h5-sh3-item4). Paint&#46;net is only compatible with windows operating systems, however there are other options available for image editing applications on Mac or Linux systems.\n\nThe sought after properties of image editing tools for creating/editing these icons were: for the ability to create layered images, moving layer position in the layer stack, hiding/showing the layer, selecting parts of images and separating them from the background (leaving only the outline/shape), and more importantly, support for transparent backgrounds.\n\nPaint&#46;net provides support for all these requirements, but other software options may also, so feel free to use whichever software, as long as the final images are saved in '.png' format and have transparent backgrounds. Paint&#46;net also allows for files to be saved in their separate state as layers with the '.pdn' file type, however only Paint&#46;net can open these files. For Windows users this shouldn't be a problem, but for users on other systems, the layers that make up each icon have been saved separately, which will allow them to be added as layers to which ever software is used on those operating systems.\n\nIcons in general, were developed on a 250x250 pixel, transparent background. These dimensions were based off the blocks being 100x100 pixels when drawn within the interface, and the icon being drawn within these blocks having a space of 50x50 pixels to occupy. Having a 250x250 pixel raw icon image allows it to be scaled down to a 50x50 image through PyQt5's scaling tool, which retains the quality of the image better, resulting in it being less pixelated when zoomed in.\n\nThe items (text, dividing lines, function lines, etc.) within the icons were positioned with the help of a grid (named \"layout_grid.png\"), located within the Icons folder in which all the icons are stored. There wasn't a specific method for positioning the items within these icons, but depending on what the icon was (text, shape, axis with function) the lines of the grid were used to symmetrically place items and position them to allow for satisfactory visibility. These icons were developed in monochrome mode (black and white). The following values were used for lines and text:\n\n* linewidth:\n    * 6 for axis lines and outline of gain,\n    * 8 for bolded thin lines (particularly as dividing lines),\n    * 15 for outline of stop icon\n    * 19 for function lines (clip, constant, piecewise, step, waveform)\n* text font: Calibri\n* text size: various amongst the text used, but will be one of the following:\n    * 36, 48, 59, 72, 84, 108, 144\n* text bolding: True for all text, apart from the stop icon\n\n<a id=\"h4-sh4\"></a>\n\n## Procedure for updating changes to existing icons, or adding new ones\n\nAs Python creates some difficulties in accessing absolute or relative file paths, and making this consistent across all users, an alternative available from PyQt5 was used, which is a QReferenceFile.\n\nSimilar to zipping files into a folder, this reference file packages image files into a Python importable file, which after importing, can then be accessed locally within the same directory. Hence all icons which were used, were placed into the Icons folder, located at \"**_`bdsim/bdsim/bdedit/Icons`_**\" folder (see Figure 4.1), and a reference file named \" Icons.qrc \" was made (following the structure below) in the bdedit package, located at \"**_`bdsim/bdsim/bdedit`_**\" folder (see Figure 4.1).\n\nIn order to make the \"**_`.qrc`_**\" (resource) file importable and usable in the Python scripts, it must be converted to a \"**_`.py`_**\" (Python) file (in our case named \"**_`Icons.py`_**\"). The steps for this procedure will be outlined below.\n\nThe following steps should be followed for updating an icon that already exists\n\n1. The new icon (under the same name as the existing icon it's replacing) should be added as a \"**_`.png`_**\" to the \"**_`bdsim/bdsim/bdedit/Icons`_**\" folder, replacing the old version of the icon.\n\n2. The \"**_Icons.qrc_**\" file located at \"**_`bdsim/bdsim/bdedit`_**\" should be converted to \"**_`Icons.py`_**\" with the following steps:\n    \n    1. Via the terminal, navigate to the bdedit directory\n\n    2. Via the terminal, type \"**_`pyrcc5 Icons.qrc -o Icons.py`_**\" to convert and write the contents of the resource file (named \"**_`Icons.qrc`_**\") to a Python file (named \"**_`Icons.py`_**\"). The name of the resource file should match that of what was given to the resource file, and the name of the Python file will be what is called when importing into other Python files (as \"**_`from bdsim.bdedit.Icons import *`_**\"). DO NOT make any changes to this generated Python file, as this could result in unforeseen errors.\n\n3. Assuming the icon that is being replaced, was previously set up and being used, re-running the program after updating the \"**_`Icons.py`_**\" file will update the changes made to this icon.\n\nThe following steps should be followed for adding in a new icon, that doesn't exist anywhere in the code:\n\n1. The new icon (with a unique name) should be added as a \"**_`.png`_**\" to the \"**_`bdsim/bdsim/bdedit/Icons`_**\" folder.\n\n2. The structure of the \"**_`Icons.qrc`_**\" resource file located at \"**_`bdsim/bdsim/bdedit`_**\" should be edited to include the file path to this newly added icon. The following steps should be taken:\n\n    1. Open the resource file with any text viewer (should see a file similar to Figure 4.3)\n\n    2. Add the file path to the new icon as \"**_`Icons/filename.png`_**\" enclosed in the &lt;file&gt; and &lt;/file&gt; tags, indicating that this icon is located within the Icons folder. Note the qresource prefix name; this will be used for picking out specific icons from this file.\n\n    3. Save the resource file and proceed to Step 3.\n\n3. The \"**_`Icons.qrc`_**\" resource file located at \"**_`bdsim/bdsim/bdedit`_**\" should be converted to \"**_`Icons.py`_**\" with the following steps:\n\n    1. Via the terminal, navigate to the bdedit directory\n\n    2. Via the terminal, type \"**_`pyrcc5 Icons.qrc -o Icons.py`_**\" to convert and write the contents of the resource file (named \"**_`Icons.qrc`_**\") to a Python file (named \"**_`Icons.py`_**\"). The name of the resource file should match that of what was given to the resource file, and the name of the Python file will be what is called when importing into other Python files (as \"**_`import Icons`_**\"). DO NOT make any changes to this generated Python file, as this could result in unforeseen errors.\n\n4. Next, you should open the file where you planned to use the icon (this should be one of the files in either the \"**_`bdsim/bdsim/bdedit/Block_Classes`_**\" folder or in the \"**_`bdsim/bdsim/bdedit`_**\" package).\n\n    1. If in any file within the Block_Classes folder, continue to Step 5.\n\n    2. If in any other within the bdedit package: 1. Import the \"**_`Icons.py`_**\" file from the bdedit package as: \"**_`from bdsim.bdedit.Icons import *`_**\".\n\n5. Still in the same file as Step 4, continue to the code where you want the Icon file path to be defined and insert the following string: \"**_`:/Icons_Reference/Icons/filename.png`_**\". The \"**_`:/`_**\" notation is important for navigating the \"**_`Icons.py`_**\" file. Also, remember from the note in Step 2, the qreference name is used here as \"**_`Icons_Reference`_**\" to refer to the \"**_`Icons.py`_**\" file. The \"**_`/Icons/filename.png`_**\" points to the path defined in the \"**_`Icons.qrc`_**\" file. Replace \"**_`filename`_**\" with whatever name you saved the icon under. \n\n6. This should complete the process for adding in a new icon.\n\n<p align=\"center\"><img width=\"700\" alt=\"QResource File Structure\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/Figure_4.3-QResource_File_Structure.png\"/></p>\n\n# 5. Appendices<a id=\"h5\"></a>\n<a id=\"h5-sh1\"></a>\n\n## APPENDIX A – High Level Class Architecture Diagram\n\n<p align=\"center\"><img width=\"1600\" alt=\"High Level Class Architecture Diagram\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/APPENDIX_A-High_Level_Class_Architecture_Diagram.png\"/></p>\n\n<a id=\"h5-sh2\"></a>\n\n## APPENDIX B – Stepped Wire Drawing Logic\nDrawing the step wire falls into three steps of logic.\n\nThe first step: when a wire is being pulled from one socket to another, and has not yet been connected.\n\nIn this step, the wire is simply drawn as a straight light from the starting socket to the mouse cursor, up until the point the wire is connected to another socket. This is when the wire drawing logic falls into the following two steps of logic.\n\nThe second step: Wire routing logic between two blocks where the input and output sockets are on same sides\n\n<p align=\"center\"><img width=\"1000\" alt=\"Wire Logic Step 2.0\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/APPENDIX_B-Wire_logic_step_2.PNG\"/></p>\n\nThe third step: Wire routing logic between two blocks where the input and output sockets are on opposite sides\n\n<p align=\"center\"><img width=\"1000\" alt=\"Wire Logic Step 3.0\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/APPENDIX_B-Wire_logic_step_3.1.PNG\"/></p>\n\n<p align=\"center\"><img width=\"1000\" alt=\"Wire Logic Step 3.1\" src=\"https://raw.githubusercontent.com/petercorke/bdsim/bdedit/bdsim/bdedit/figs/APPENDIX_B-Wire_logic_step_3.2.PNG\"/></p>\n\n## Embedded Links<a id=\"h5-sh3\"></a>\n\n<a id=\"h5-sh3-item1\"></a>\n1 - https://github.com/petercorke/bdsim\n\n<a id=\"h5-sh3-item2\"></a>\n2 - File located at path: https://github.com/petercorke/bdsim/blob/bdedit/bdsim/bin/bdedit.py\n\n<a id=\"h5-sh3-item3\"></a>\n3 - https://petercorke.github.io/bdsim/bdsim.blocks.html?highlight=Function#bdsim.blocks.functions.Function\n\n<a id=\"h5-sh3-item4\"></a>\n4 - Free paint.net download link - https://www.getpaint.net/download.html#download\n"
  },
  {
    "path": "bdsim/bdedit/__init__.py",
    "content": "# print(\"bdedit package __init__ start\")\nfrom .block import *\nfrom .block_wire import *\nfrom .block_socket import *\n\nfrom .block_graphics_block import *\nfrom .block_graphics_wire import *\nfrom .block_graphics_socket import *\n\n# from .block_importer import *\nfrom .block_param_window import *\nfrom .Icons import *\n\nfrom .interface import *\nfrom .interface_scene import *\nfrom .interface_graphics_scene import *\nfrom .interface_graphics_view import *\nfrom .interface_serialize import *\n\nfrom .bdedit import main\n\n# print(\"bdedit package __init__ end\")\n"
  },
  {
    "path": "bdsim/bdedit/bdedit.py",
    "content": "#!/usr/bin/env python3\n\n# Library imports\nimport os\nimport sys\nimport ctypes\nimport argparse\nfrom pathlib import Path\n\nfrom sys import platform\nfrom pathlib import Path\n\nfrom colored import fg, attr\n\n# PyQt5 imports\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtCore import QTimer\nfrom PyQt5.QtGui import QIcon\n\n# BdEdit imports\nfrom bdsim.bdedit.interface_manager import InterfaceWindow\n\n# Executable code to launch the BdEdit application window\ndef main():\n\n    print(fg(\"red\"))\n    print(\"bdedit is beta code and prone to random crashing, save your work often\")\n    print(attr(0))\n\n    # handle command line options, bdedit -h for details\n    parser = argparse.ArgumentParser(description=\"Interactive edit for bdsim models\")\n    parser.add_argument(\n        \"file\", type=str, nargs=\"?\", help=\"Load this model into interactive session\"\n    )\n    parser.add_argument(\n        \"--print\",\n        \"-p\",\n        nargs=\"?\",\n        action=\"store\",\n        const=\"\",\n        default=None,\n        help=\"Save model to screenshot and exit, can optionally specify a filename, PDF extension is default\",\n    )\n    parser.add_argument(\n        \"--debug\",\n        \"-d\",\n        action=\"store_const\",\n        const=True,\n        default=False,\n        help=\"Enable debugging\",\n    )\n    parser.add_argument(\n        \"--pdb\",\n        action=\"store_const\",\n        const=True,\n        default=False,\n        help=\"Enable pdb for spawned python subprocess\",\n    )\n    parser.add_argument(\n        \"--background\",\n        \"-b\",\n        type=str,\n        default=\"grey\",\n        choices=[\"white\", \"grey\"],\n        help=\"Set background color\",\n    )\n    parser.add_argument(\n        \"--fontsize\", \"-s\", type=int, default=\"12\", help=\"Set font size of block names\"\n    )\n    parser.add_argument(\n        \"--format\",\n        \"-f\",\n        type=str,\n        nargs=\"?\",\n        help=\"Specify screenshot extension type; PDF (default) or PNG\",\n    )\n    args, unparsed_args = parser.parse_known_args()\n\n    # args holds all the command line info:\n    #  args.file file name if given, else None\n    #  args.debug True if -d option given\n    #  args.print True if -p option given, load the file, save screenshot, then exit\n    #  args.fontsize integer fontsize if given, sets default size of block names\n    #  args.format PDF if unspecified, PDF or PNG if specified\n\n    # insert argv[0] into head of list of remaining args, and hand that to Qt\n    unparsed_args.insert(0, sys.argv[0])\n\n    # A QApplication instance is made, which is the window that holds everything\n    app = QApplication(unparsed_args)\n\n    # The resolution of the user's screen is extracted (used for determining\n    # the size of the application window)\n    screen_resolution = app.desktop().screenGeometry()\n\n    # Set the desktop toolbar icon for this application\n    icon = Path(__file__).parent.parent / \"bdedit\" / \"Icons\" / \"bdsim_logo.png\"\n    app.setWindowIcon(QIcon(str(icon)))\n\n    myappid = \"bdsim.bdsim.bin.bdedit.application\"  # arbitrary string for application\n    try:\n        if platform == \"win32\":\n            ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)\n        elif platform == \"darwin\":\n            ctypes.cdll.kernel32.SetCurrentProcessExplicitAppUserModelID(myappid)\n    except Exception as e:\n        # Toolbar icon for application could not be set.\n        pass\n\n    # Finally the window is displayed by creating an instance of Interface,\n    # which holds all the logic for how the application should appear and which\n    # connects all the other Classes through the Interface.\n    # window = Interface(screen_resolution, args.debug)\n    window = InterfaceWindow(screen_resolution, args.debug)\n    window.args = args\n\n    # Check what command line arguments have been passed, if any\n    if args.file or args.print or args.debug or args.fontsize or args.format:\n\n        # Call bdedit functionality based on passed args\n\n        window.centralWidget().scene.block_name_fontsize = args.fontsize\n\n        if args.file is not None:\n\n            # Attempt to load the .bd file\n            if os.path.isfile(args.file):\n                window.loadFromFilePath(args.file)\n            else:\n                raise ValueError(f\"bdfile {args.file} not found\")\n\n        # fire up the GUI\n        window.centralWidget().scene.grScene.updateBackgroundMode(args.background, True)\n\n        if args.print is not None:\n            # render a screenshot to file\n            def screenshot(model_path, screenshot_name):\n                # Set the background mode to white, no grid lines\n                window.centralWidget().scene.grScene.updateBackgroundMode(\n                    \"white\", False\n                )\n                window.centralWidget().scene.grScene.checkMode()\n\n                # Hide and then unselect all connector blocks present in the model\n                window.centralWidget().scene.hide_connector_blocks = True\n\n                for block in window.centralWidget().scene.blocks:\n                    if block.block_type in [\"Connector\", \"CONNECTOR\"]:\n                        block.grBlock.setSelected(False)\n\n                # Update the points where wires overlap within the scene to draw the wire separations\n                if window.centralWidget().scene.wires:\n                    window.centralWidget().scene.wires[0].checkIntersections()\n\n                window.centralWidget().save_image(\n                    model_path, screenshot_name\n                )  # in interface.py\n                sys.exit(0)\n\n            # figure out the filename to save it as\n            file = Path(args.print)\n\n            if args.print == \"\":\n                # no filename given on command line\n                # use the model file name, drop the path, and set extension pdf if none given\n\n                # wait till python 3.9 for the next line to work\n                # path = Path(args.file).with_stem(filename.stem + \"-screenshot\").with_suffix('.pdf').name\n\n                if args.format == \"png\":\n                    path = Path(args.file).with_suffix(\".png\")\n                else:\n                    path = Path(args.file).with_suffix(\".pdf\")\n\n                path = path.stem + path.suffix\n\n            else:\n                # filename was given on command line\n                path = Path(args.print)\n                if path.suffix == \"\":\n                    if args.format == \"png\":\n                        path = path.with_suffix(\".png\")\n                    else:\n                        path = path.with_suffix(\".pdf\")\n\n            # After 100ms non-blocking delay, screenshot the model\n            QTimer.singleShot(100, lambda: screenshot(args.file, str(path)))\n\n    # run the GUI until it exits\n    sys.exit(app.exec_())\n\n\nif __name__ == \"__main__\":\n    main()\n"
  },
  {
    "path": "bdsim/bdedit/block.py",
    "content": "# Library imports\nimport os\nimport json\nfrom collections import OrderedDict\n\n# BdEdit imports\nfrom bdsim.bdedit.block_socket import *\nfrom bdsim.bdedit.block_param_window import ParamWindow\nfrom bdsim.bdedit.block_graphics_block import GraphicsBlock\n\n# =============================================================================\n#\n#   Defining and setting global variables\n#\n# =============================================================================\n# Socket positioning variables (in relation to where they're drawn on the block)\nLEFT = 1\nTOP = 2\nRIGHT = 3\nBOTTOM = 4\n\n# Socket type classification variables\nINPUT = 1\nOUTPUT = 2\n\n# List of auto-imported blocks\nblocklist = []\n\n# Variable for enabling/disabling debug comments\nDEBUG = False\n\n\n# =============================================================================\n#\n#   Defining the parent Block Class, which is inherited by all blocks\n#\n# =============================================================================\nclass Block(Serializable):\n    \"\"\"\n    The ``Block`` Class extends the ``Serializable`` Class from BdEdit, and\n    defines how a block is represented, and has all the necessary methods\n    for creating, manipulating and interacting with a block.\n\n    This class includes information about the blocks':\n\n    - name;\n    - type;\n    - appearance;\n    - on-screen positioning;\n    - parameters, and their values;\n    - number of inputs and outputs.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, scene, window, pos=(0, 0)):\n        \"\"\"\n        This method initializes an instance of the ``Block`` Class.\n        It maps the following internal parameters of the block, initializing\n        them to their defaults values. These are overwritten when an instance of\n        the grandchild block is created. The parameters are defined as:\n\n\n        - title: the name of the ``Block``.\n          This defaults to the name of the name of the grandchild class, and\n          is incremented if an instance with the same default name already exists.\n\n        - type: the type of ``Block``.\n          This defaults to the type of the grandchild class, and is determined\n          through calling blockname(self.__class__) when a grandchild class is created.\n\n        - icon: the icon for this ``Block``.\n          This is a locally referenced string filepath, defined within the grandchild class.\n\n        - inputs: a list of containing input ``Sockets`` relating to this ``Block``.\n          The number of input sockets is restricted to 0 or n based on the inputsNum\n          variable defined within the child class.\n\n        - outputs: a list of containing output ``Sockets`` relating to this ``Block``.\n          The number of output sockets is restricted to 0 or n based on the outputsNum\n          variable defined within the child class.\n\n        - parameters: a list of editable parameters relating to this ``Block``.\n          This defaults to the list defined within the grandchild class, but follows\n          the following structure of being a list of lists, where each 'lists' is a list\n          defining the parameter as below:\n\n          - parameters = [\"name\", type, value, [restrictions]]\n            e.g. parameters = [[\"Gain\", float, gain, []], [\"Premul\", bool, premul, []]]\n\n          - name: is the name of the variable as a string\n          - type: is the required type the variable should be (e.g. int, str, float)\n          - value: is the default value the variable is set to should one not be provided\n          - restrictions: is a list (can be list of lists) containing further restrictions\n            applied to the parameter. These restrictions follow the following structure, of\n            being a list with a string as the first list element, followed by a list of\n            conditions being applied to the parameter as the second list element:\n\n            - restriction = [\"restriction name\", [condition(s)]]\n\n            - restriction name: can be only one of the following \"keywords\", \"range\", \"type\"\n              or \"signs\".\n            - condition(s): differ based on the restriction name used, and will be of the\n              following format:\n\n              - for keywords: a list of string words the parameter must exactly match to,\n                e.g. [\"keywords\", [\"sine\", \"square\", \"triangle\"]]\n              - for range: a list containing a min and max allowable value for this parameter,\n                e.g. [\"range\", [0, 1000]] or [\"range\", [-math.inf, math.inf]]\n              - for type: a list containing alternative types, with the last value repeating\n                the initial type required for this parameter,\n                e.g. [\"type\", [type(None), tuple]] (initial type = tuple) or [\"type\", [type(None), bool]] (initial type = bool)\n              - for signs: a list containing each allowable character this parameter can match,\n                e.g. [\"signs\", [\"*\", \"/\"]] or [\"signs\", [\"+\", \"-\"]]\n                currently this is used for drawing signs along certain input sockets, so only these characters are supported,\n\n\n        :param scene: a scene (or canvas) in which the Block is stored and\n                      shown (or painted into). Provided by the ``Interface``.\n        :type scene: ``Scene``, required\n        :param window: layout information of where all ``Widgets`` are located\n                       in the bdedit window. Provided by the ``Interface``.\n        :type window: ``QGridLayout``, required\n        :param title: set to grandchild class's default name \"__class__.__name__ Block\" when it is created\n        :type title: str, optional\n        :param pos: (x,y) coordinates of the block's positioning within the ``Scene``, defaults to (0,0)\n        :type pos: tuple of 2-ints, optional\n        \"\"\"\n\n        super().__init__()\n        self.scene = scene\n        self.window = window\n        self.position = pos\n\n        # Set block's orientation to be facing towards the right by default. If flipped is True, this means block is facing left\n        self.flipped = False\n\n        try:\n            self.setDefaultTitle(self.title)\n        except AttributeError:\n            # When trying to set title of connector block, it will throw an attribute error\n            # This is fine, as connector block isn't supposed to have a title\n            # print(\"block.py -> Error occured while setting default title\")\n            pass\n\n        # Lists that will contain the input/output sockets of the Block\n        self.inputs = []\n        self.outputs = []\n\n        # Variable for controlling whether or not a ParamWindow should be\n        # displayed for this instance of a Block\n        self._param_visible = False\n\n        # Initially, parameterWindow is set to None, later replaced by the ParamWindow class, if block should have one\n        self.parameterWindow = None\n\n        # Minimum spacing distance between Sockets\n        self.socket_spacing = 20\n\n        # print(\"creating block instance - after:\")\n        # [print(item) for item in self.__dict__.items()]\n        # print(\"_______________________________________\")\n\n        # self._createBlock(self.inputsNum, self.outputsNum)\n\n        # print(\"after block instance made:\")\n        # [print(item) for item in self.__dict__.items()]\n        # print(\"_______________________________________\")\n\n    # Todo - update docstring and inline comments\n    # -----------------------------------------------------------------------------\n    def _createBlock(self, inputs, outputs):\n        \"\"\"\n        This private method is inherited and called by the grandchild class, and\n        should only be called once when the block is being created.\n\n        It populates the block's internal parameters; calls for the block to be\n        drawn; creates the input and output sockets of the block; adds it to be\n        stored and drawn in the ``Scene``; and if the block has user-editable\n        parameters, initializes the private _createParamWindow method to create a\n        parameter window linked to editing this block instance's parameters.\n\n        :param inputs: number of input ``Sockets`` to create for this ``Block``\n        :type inputs: int, required\n        :param outputs: number of output ``Sockets`` to create for this ``Block``\n        :type outputs: int, required\n        \"\"\"\n\n        # * the graphics of the blocks are generated,\n        # * the input and output sockets are created and linked to the block,\n        # * the block information is stored within the Scene class,\n        # * the blocks' graphical information is stored within the graphical section of the Scene class\n        # * if the block has user-editable parameters, then a parameter window is generated for this block\n        # if allowed_to_generate:\n        self.grBlock = GraphicsBlock(self)\n\n        self.makeInputSockets(inputs, LEFT)\n        self.makeOutputSockets(outputs, RIGHT)\n\n        self.scene.addBlock(self)\n        self.scene.grScene.addItem(self.grBlock)\n\n        self._createParamWindow()\n\n        self.scene.has_been_modified = True\n\n    # -----------------------------------------------------------------------------\n    def _createParamWindow(self):\n        \"\"\"\n        This private method takes no inputs, and should only be called once\n        when generating a parameter window for it's associated block.\n\n        It creates an instance of the ``ParamWindow`` class relating to\n        this ``Block`` and references the 'self.window' variable stored within\n        the ``Block`` class to make the parameter window part of the bdedit window.\n        \"\"\"\n\n        # Creates a parameter window variable associated to this Block instance, and sets its\n        # visibility based on the private 'self._param_visible' variable\n        # (True - allowed to display, False - cannot be displayed).\n        self.parameterWindow = ParamWindow(self)\n        self.parameterWindow.setVisible(self._param_visible)\n        # ParamWindow instance is added to the application window\n        self.window.addWidget(self.parameterWindow, 1, 10, 9, 1)\n\n    # -----------------------------------------------------------------------------\n    def makeInputSockets(self, inputs, position, socketType=INPUT):\n        \"\"\"\n        This method is called to create a number of input ``Sockets`` for this ``Block``.\n\n        :param inputs: number of input sockets to create\n        :type inputs: int, required\n        :param position: an enum representing the position of where to place\n        the ``Socket`` on the ``Block`` currently only supports LEFT (1), or RIGHT (3).\n        :type position: enumerate, required\n        :param socketType: an enum representing the type of ``Socket`` to create.\n        This is used for the graphics of the socket, but was also intended to be used\n        to reduce two methods for creating input and output sockets, to a single method.\n        :type socketType: enumerate, optional, defaults to INPUT(1)\n        \"\"\"\n\n        # Input sockets are created, starting from index 0 to the number of 'inputs'\n        # For each index:\n        # * an instance of a Socket Class is created, which:\n        #   ** relates this Socket instance to this Block instance\n        #   ** sets the 'index' of this Socket as the current index (counter)\n        #   ** sets the 'position' of this Socket to the given position (LEFT or RIGHT)\n        #   ** sets the 'socketType' of this Socket to the given socketType (INPUT by default)\n        # * the instance is appended to this Block's list of inputs\n        counter = 0\n        while counter < inputs:\n            try:\n                if self.input_names:\n                    socket = Socket(\n                        node=self,\n                        index=counter,\n                        position=position,\n                        socket_type=socketType,\n                        socket_label=self.input_names[counter],\n                    )\n                else:\n                    socket = Socket(\n                        node=self,\n                        index=counter,\n                        position=position,\n                        socket_type=socketType,\n                    )\n            except (AttributeError, IndexError):\n                socket = Socket(\n                    node=self, index=counter, position=position, socket_type=socketType\n                )\n            counter += 1\n            self.inputs.append(socket)\n\n        # Some Blocks (PROD and SUM) have additional logic for drawing signs alongside\n        # the input sockets. The method below is checks and applies that logic if required.\n        self.updateSocketSigns()\n\n    # -----------------------------------------------------------------------------\n    def makeOutputSockets(self, outputs, position, socketType=OUTPUT):\n        \"\"\"\n        This method is called to create a number of outputs ``Sockets`` for this ``Block``.\n\n        :param outputs: number of output sockets to create\n        :type outputs: int, required\n        :param position: an enum representing the position of where to place\n        the ``Socket`` on the ``Block`` currently only supports LEFT (1), or RIGHT (3).\n        :type position: enumerate, required\n        :param socketType: an enum representing the type of ``Socket`` to create.\n        This is used for the graphics of the socket, but was also intended to be used\n        to reduce two methods for creating input and output sockets, to a single method.\n        :type socketType: enumerate, optional, defaults to OUTPUT(2)\n        \"\"\"\n\n        # Output sockets are created, starting from index 0 to the number of 'outputs'\n        # For each index:\n        # * an instance of a Socket Class is created, which:\n        #   ** relates this Socket instance to this Block instance\n        #   ** sets the 'index' of this Socket as the current index (counter)\n        #   ** sets the 'position' of this Socket to the given position (LEFT or RIGHT)\n        #   ** sets the 'socketType' of this Socket to the given socketType (OUTPUT by default)\n        # * the instance is appended to this Block's list of outputs\n        counter = 0\n        while counter < outputs:\n            try:\n                if self.output_names:\n                    socket = Socket(\n                        node=self,\n                        index=counter,\n                        position=position,\n                        socket_type=socketType,\n                        socket_label=self.output_names[counter],\n                    )\n                else:\n                    socket = Socket(\n                        node=self,\n                        index=counter,\n                        position=position,\n                        socket_type=socketType,\n                    )\n            except (AttributeError, IndexError):\n                socket = Socket(\n                    node=self, index=counter, position=position, socket_type=socketType\n                )\n            counter += 1\n            self.outputs.append(socket)\n\n    # -----------------------------------------------------------------------------\n    def toggleParamWindow(self):\n        \"\"\"\n        This method toggles the visibility of the ``ParamWindow`` of this ``Block``\n        \"\"\"\n\n        # Sets the visibility of the parameter window to opposite of what the\n        # variable 'self._param_visible' is set to, and flips the boolean state of\n        # that variable (True -> False, or False -> True)\n        if self.parameterWindow:\n            self.parameterWindow.setVisible(not self._param_visible)\n            self._param_visible = not self._param_visible\n\n    # -----------------------------------------------------------------------------\n    def closeParamWindow(self):\n        \"\"\"\n        This method closes the ``ParamWindow`` of this ``Block``\n        \"\"\"\n\n        # Sets the visibility of the parameter window to False\n        # and sets 'self._param_visible' False\n        self.parameterWindow.setVisible(False)\n        self._param_visible = False\n\n    # -----------------------------------------------------------------------------\n    def updateSocketSigns(self):\n        \"\"\"\n        As some Blocks - namely the ``PROD`` and ``SUM`` Blocks - have additional logic for\n        drawing signs (+,-,*,/) alongside the input sockets, this method updates\n        these signs of the socket, if the block type is a ``PROD`` or ``SUM`` Block\n        \"\"\"\n\n        # Checks if the block type is a Prod or Sum block\n        if (\n            self.block_type == \"PROD\"\n            or self.block_type == \"SUM\"\n            or self.block_type == \"Prod\"\n            or self.block_type == \"Sum\"\n        ):\n\n            # Iterates through user-editable parameters stored within the block and checks\n            # if one by the name of 'Operations' or 'Signs' exists (these block types should\n            # have them). These parameters hold characters (+,-,*,/) representing what signs\n            # should be displayed and the order they should be displayed in (left to right\n            # in the parameter, representing top to bottom when displayed on the block).\n            # Parameter is represented as a list of 4 items:\n            # parameter = [name, type, value, special_conditions]\n            for parameter in self.parameters:\n                # If parameter name is equal to:\n                if parameter[0] == \"ops\" or parameter[0] == \"signs\":\n                    index = 0\n\n                    # print(\"\\nblock: updatingSocketSigns()\")\n                    # [print(item) for item in self.__dict__.items()]\n                    # print(\"_______________________________________\\n\")\n\n                    # Sets the socket_sign of Socket within the block, equal to the respective\n                    # character (sign) stored within either the 'Operations' or 'Signs' parameter.\n                    # Note, since this method is only ever called after the number of input sockets\n                    # has been created, or after this number has been updated (when the user edits\n                    # the number of signs to display), the number of input sockets will always\n                    # exactly match the number of signs stored within the parameter.\n                    for sign in parameter[2]:\n                        self.inputs[index].socket_sign = sign\n                        index += 1\n\n    # -----------------------------------------------------------------------------\n    def setFocusOfBlocks(self):\n        \"\"\"\n        This method sends all ``Block`` instances within the ``Scene`` to back\n        and then sends the currently selected ``Block`` instance to front.\n        \"\"\"\n\n        # Iterates through each Block within block list stored in the Scene Class\n        # and sets the graphical component of each block to a zValue of 0.\n        for block in self.scene.blocks:\n            block.grBlock.setZValue(0.0)\n\n        # Then sets the graphical component of the currently selected block to a\n        # zValue of 1, which makes it display above all other blocks on screen.\n        self.grBlock.setZValue(1.0)\n\n    # -----------------------------------------------------------------------------\n    @property\n    def pos(self):\n        \"\"\"\n        This method is called to access the positional coordinates of this ``Block``\n        in terms of where it is displayed within the ``Scene``\n\n        :return: the (x,y) coordinates of this ``Block``\n        :rtype: tuple (int, int)\n        \"\"\"\n        return self.grBlock.pos()\n\n    # -----------------------------------------------------------------------------\n    def setPos(self, x, y):\n        \"\"\"\n        This method is called to set the positional coordinates of this ``Block``\n        in terms of where it is displayed within the ``Scene``\n\n        :param x: the x coordinate of this ``Block``\n        :type x: int, required\n        :param y: the y coordinate of this ``Block``\n        :type y: int, required\n        \"\"\"\n        self.grBlock.setPos(x, y)\n\n    # -----------------------------------------------------------------------------\n    def setTitle(self, name=None):\n        \"\"\"\n        This method is called to determine if a this ``Block`` can be named with the\n        provided name. It applies logic to check if the given name of type `str`,\n        and if no other ``Block`` instance already has the given name. If either of\n        these conditions are not met, the user will be notified to provide a\n        different name.\n\n        :param name: given name to be set for this ``Block``, defaults to None if\n        not provided\n        :type name: str, optional\n        :return: - nothing (if name successfully set);\n                 - [duplicate error message, given name] (if duplicate found);\n                 - invalid type error message (if name is not of type `str`).\n        :rtype: - nothing (if name successfully set);\n                - list of [str, str] (if duplicate found);\n                - str (if name is not of type `str`).\n        \"\"\"\n\n        # This method should only do something, if a name is given for the block\n        # Hence, only do something if the name is not None\n        if name is not None:\n            # The name only needs to be checked to be updated if it's different\n            # the this blocks' current name (title)\n            if name != self.title:\n                # If the given name is of type str\n                if isinstance(name, str):\n                    # Check if the given name already exists for any other block\n                    duplicates = self.scene.checkForDuplicates(name)\n\n                    # If the given name is not found to be a duplicate\n                    if not duplicates:\n                        # Set this blocks' title to the given name\n                        self.title = name\n                        return\n                    # Else the given name is a duplicate\n                    else:\n                        # So return a list containing a duplicate error message and the given name\n                        return [\"@DuplicateName@\", name]\n\n                # Else, the type of the given name is invalid\n                else:\n                    return \"@InvalidType@\"\n\n    # -----------------------------------------------------------------------------\n    def setDefaultTitle(self, name, increment=None):\n        \"\"\"\n        This method is called to give a block a generic name, and if that name\n        already exists, to increment it by 1.\n\n        :param name: the generic name to be given to this ``Block``\n        :type name: str, required\n        :param increment: the number to display next to the generic name, to make\n        it unique. Defaults to None if this is the first instance of this block type.\n        :type increment: int, optional\n        \"\"\"\n\n        # Creates a temporary copy of the given name\n        block_name = name\n\n        # If the given name is of type str\n        if isinstance(name, str):\n            # If this isn't the first instance of this block type, increment will\n            # be a number greater than 0, and this if statement will be run.\n            if increment is not None:\n                # The temporary copy of the given name has the increment added to it\n                # to later check if that will make it unique\n                block_name += \" \" + str(increment)\n                # The increment is increased by one in case the previous line doesn't\n                # make the name unique\n                increment += 1\n\n            # The copy of the given name is checked against being a duplicate\n            duplicates = self.scene.checkForDuplicates(block_name)\n\n            # If it is not a duplicate, the name of the current block is set to\n            # the copy of the given name (this will be with an increment, or the\n            # original given name if this is the first instance of this block type).\n            if not duplicates:\n                self.title = block_name\n            # Else, it is a duplicate, and this method will call itself to increment\n            # the given name and check against that name being a duplicate, until\n            # a non-duplicate generic name is found.\n            else:\n                # If this is a second instance of this block type (hence the increment\n                # would be None), this method calls itself with the increment set to 1\n                if increment is None:\n                    self.setDefaultTitle(name, 1)\n                # Else, this is more than a second instance of this block type, and\n                # the increment would of already been set, and internally incremented.\n                else:\n                    self.setDefaultTitle(name, increment)\n\n    # -----------------------------------------------------------------------------\n    def getSocketPosition(self, index, position):\n        \"\"\"\n        This method is called to determine the coordinates of where a given ``Socket``\n        should be positioned on the sides of the this ``Block``. The returned\n        coordinates are in reference to the coordinates of this ``Block``.\n\n        :param index: the index of this ``Socket`` in the list of sockets for this ``Block``\n        :type index: int, required\n        :param position: the (LEFT(1) or RIGHT(3)) side of the block this socket\n        should be displayed on.\n        :type position: enumerate, required\n        :return: the [x,y] coordinates at which to place this ``Socket`` instance.\n        :rtype: list of int, int\n        \"\"\"\n\n        # If the position of the Socket is given to be on the LEFT of the block,\n        # * x is returned as 0.\n        # * y is returned as the index of this socket multiplied by the socket\n        # spacing set within this block class, PLUS an offset, determined by the\n        # height at which the block's title is placed below the block, and\n        # the thickness of this block's outline, and how curved its corners are.\n        if position == LEFT:\n            x = 0\n            y = (\n                self.grBlock._padding\n                + self.grBlock.edge_size\n                + self.grBlock.title_height\n                + index * self.socket_spacing\n            )\n\n        # Else, the position of the Socket is given to be on the RIGHT of the block,\n        # * x is returned as the width of block.\n        # * y is returned as above.\n        elif position == RIGHT:\n            x = self.grBlock.width\n            y = (\n                self.grBlock._padding\n                + self.grBlock.edge_size\n                + self.grBlock.title_height\n                + index * self.socket_spacing\n            )\n        return [x, y]\n\n    # -----------------------------------------------------------------------------\n    def updateSocketPositions(self):\n        \"\"\"\n        This method updates flips the position (LEFT or RIGHT) of where the\n        input and output sockets needs to be placed within this ``Block``.\n        After the positions of all the Blocks' sockets are updated,\n        the updateConnectedEdges method is called to update the locations for\n        where the wires connect to.\n        \"\"\"\n\n        # Iterates through every input Socket this Block has\n        for i in range(0, len(self.inputs)):\n            # Flips the position of the input sockets (LEFT to RIGHT, or RIGHT to LEFT)\n            if self.inputs[i].position == LEFT:\n                self.inputs[i].position = RIGHT\n            else:\n                self.inputs[i].position = LEFT\n            # Grabs the coordinates for where this Socket should be drawn\n            [x, y] = self.getSocketPosition(i, self.inputs[i].position)\n            # And sets the position of the current socket to these coordinates\n            self.inputs[i].grSocket.setPos(*[float(x), float(y)])\n\n        # Iterates through every output Socket this Block has\n        for i in range(0, len(self.outputs)):\n            # Flips the position of the output sockets (RIGHT to LEFT, or LEFT to RIGHT)\n            if self.outputs[i].position == RIGHT:\n                self.outputs[i].position = LEFT\n            else:\n                self.outputs[i].position = RIGHT\n            # Grabs the coordinates for where this Socket should be drawn\n            [x, y] = self.getSocketPosition(i, self.outputs[i].position)\n            # And sets the position of the current socket to these coordinates\n            self.outputs[i].grSocket.setPos(*[float(x), float(y)])\n\n        self.updateConnectedEdges()\n\n    # -----------------------------------------------------------------------------\n    def updateConnectedEdges(self):\n        \"\"\"\n        This method calls for any and all ``Wire`` instances that are connected to\n        a ``Socket`` instance, to update where it is drawn TO and FROM.\n        \"\"\"\n\n        # For each socket that exists in this block\n        for socket in self.inputs + self.outputs:\n            # Update the wire(s) connected to this socket\n            for wire in socket.wires:\n                wire.updatePositions()\n\n    # -----------------------------------------------------------------------------\n    def updateWireRoutingLogic(self):\n        \"\"\"\n        Wire routing logic is automatically determined by bdedit when moving blocks,\n        however users can adjust certain segments of these wires. When the user\n        interacts with these segments, the wire routing logic follows the custom\n        routing path. When blocks are moved again after wires segments are adjusted\n        by the user, the wiring logic will revert to following the automatic routing\n        logic. This method updates which wires should be drawn following the automatic\n        routing logic.\n        \"\"\"\n        for socket in self.inputs + self.outputs:\n            for wire in socket.wires:\n                if wire:\n                    # If both blocks connected by these wires are selected, don't do\n                    # anything, as both are being moved in respects to each other,\n                    # so no need to update wiring logic.\n\n                    start_block = wire.start_socket.node\n                    end_block = wire.end_socket.node\n\n                    if (\n                        start_block.grBlock.isSelected()\n                        and end_block.grBlock.isSelected()\n                    ):\n                        pass\n                        # wire.grWire.customlogicOverride = True\n                        # start_block.updateSocketPositions()\n                        # end_block.updateSocketPositions()\n\n                    # Otherwise if only one block is selected, update the wiring logic\n                    # to be displayed based on the automatic wire routing logic.\n                    else:\n                        wire.grWire.customlogicOverride = False\n\n    # -----------------------------------------------------------------------------\n    def removeSockets(self, type):\n        \"\"\"\n        This method removes all sockets of given type, associated with this ``Block``.\n\n        :param type: the type of ``Socket`` to remove (\"Input\" for input type,\n        \"Output\" for output type)\n        :type type: str, required\n        \"\"\"\n\n        # Depending on the given type, either the inputs or outputs list - stored within\n        # the block - will be cleared.\n        if type == \"Input\":\n            self.inputs.clear()\n        elif type == \"Output\":\n            self.outputs.clear()\n\n    # -----------------------------------------------------------------------------\n    def remove(self):\n        \"\"\"\n        This method is called to remove:\n\n        - the selected ``Block`` instance;\n        - any sockets associated with this Block;\n        - any wires that were connected to this Blocks' sockets; and\n        - the parameter window associated with this Block (if one existed).\n        \"\"\"\n\n        # For each socket associated with this block, remove the connected wires\n        if DEBUG:\n            print(\"> Removing Block\", self)\n        if DEBUG:\n            print(\" - removing all wires from sockets\")\n        for socket in self.inputs + self.outputs:\n            for wire in socket.wires.copy():\n                # for wire in socket.wires:\n                if DEBUG:\n                    print(\"    - removing from socket:\", socket, \"wire:\", wire)\n                wire.remove()\n\n        # Remove the graphical representation of this block from the scene\n        # This will also remove the associated graphical representation of the\n        # blocks' sockets.\n        if DEBUG:\n            print(\" - removing grBlock\")\n        self.scene.grScene.removeItem(self.grBlock)\n        self.grBlock = None\n\n        # Remove the blocks' parameter window if one existed\n        if DEBUG:\n            print(\" - removing parameterWindow\")\n        if self.parameterWindow:\n            self.window.removeWidget(self.parameterWindow)\n            self.parameterWindow = None\n\n        # Finally, call the removeBlock method from within the Scene, which\n        # removes this block from the list of blocks stored in the Scene.\n        if DEBUG:\n            print(\" - removing block from the scene\")\n        self.scene.removeBlock(self)\n        if DEBUG:\n            print(\" - everything was done.\")\n\n    # -----------------------------------------------------------------------------\n    def serialize(self):\n        \"\"\"\n        This method is called to create an ordered dictionary of all of this Blocks'\n        parameters - necessary for the reconstruction of this Block - as key-value\n        pairs. This dictionary is later used for writing into a JSON file.\n\n        :return: an ``OrderedDict`` of [keys, values] pairs of all essential ``Block``\n                 parameters.\n        :rtype: ``OrderedDict`` ([keys, values]*)\n        \"\"\"\n\n        # The sockets associated with this block, have their own parameters that are\n        # required for their reconstruction, so the serialize method within the\n        # Socket class is called to package this information for each socket, also into\n        # an OrderedDict. These ordered dictionaries are then stored in a temporary\n        # inputs/outputs parameter and are returned as part of the OrderedDict of this Block.\n\n        # Similarly, the user-editable parameters associated with this Block must be\n        # remembered for the reconstruction of this block. However as some of them\n        # need to be stored as tuples and JSON does not support this, hence the\n        # TupleEncoder is used. Additionally, to reconstruct the Block's user-editable\n        # parameters, only the name and value of these parameters are needed, as their\n        # type and special_conditions should never change from their definition within\n        # their Class. (As a reminder, parameter = [name, type, value, special_conditions])\n        if self.block_type in [\"Connector\", \"CONNECTOR\"]:\n            inputs, outputs, parameters = [], [], []\n            for socket in self.inputs:\n                inputs.append(socket.serialize())\n            for socket in self.outputs:\n                outputs.append(socket.serialize())\n            return OrderedDict(\n                [\n                    (\"id\", self.id),\n                    (\"block_type\", self.block_type),\n                    (\"pos_x\", self.grBlock.scenePos().x()),\n                    (\"pos_y\", self.grBlock.scenePos().y()),\n                    (\"inputs\", inputs),\n                    (\"outputs\", outputs),\n                ]\n            )\n        else:\n            inputs, outputs, parameters = [], [], []\n            for socket in self.inputs:\n                inputs.append(socket.serialize())\n            for socket in self.outputs:\n                outputs.append(socket.serialize())\n            for parameter in self.parameters:\n                parameters.append([parameter[0], parameter[2]])\n\n            return OrderedDict(\n                [\n                    (\"id\", self.id),\n                    (\"block_type\", self.block_type),\n                    (\"title\", self.title),\n                    (\"pos_x\", self.grBlock.scenePos().x()),\n                    (\"pos_y\", self.grBlock.scenePos().y()),\n                    (\"width\", self.width),\n                    (\"height\", self.height),\n                    (\"flipped\", self.flipped),\n                    (\"inputsNum\", self.inputsNum),\n                    (\"outputsNum\", self.outputsNum),\n                    (\"inputs\", inputs),\n                    (\"outputs\", outputs),\n                    (\"parameters\", parameters),\n                ]\n            )\n\n    # -----------------------------------------------------------------------------\n    def deserialize(self, data, hashmap={}):\n        \"\"\"\n        This method is called to reconstruct a ``Block`` when loading a saved JSON\n        file containing all relevant information to recreate the ``Scene`` with all\n        its items.\n\n        :param data: a Dictionary of essential information for reconstructing a ``Block``\n        :type data: OrderedDict, required\n        :param hashmap: a Dictionary for directly mapping the essential block parameters\n                        to this instance of ``Block``, without having to individually map each parameter\n        :type hashmap: Dict, required\n        :return: True when completed successfully\n        :rtype: Boolean\n        \"\"\"\n        # The id of this Block is set to whatever was stored as its id in the JSON file.\n        self.id = data[\"id\"]\n\n        try:\n            # The remaining parameters associated to this Block are mapped to itself\n            # hashmap[data['id']] = self\n\n            if self.block_type not in [\"Connector\", \"CONNECTOR\"]:\n                self.title = data[\"title\"]\n                self.inputsNum = data[\"inputsNum\"]\n                self.outputsNum = data[\"outputsNum\"]\n                self.width = data[\"width\"]\n                self.height = data[\"height\"]\n\n                # If a model contains data on whether a block should be flipped, assign variable to that value\n                # If error occurs, model doesn't contain this variable, so ignore\n                try:\n                    if data[\"flipped\"]:\n                        self.flipped = data[\"flipped\"]\n                except KeyError:\n                    pass\n\n            # The position of the Block within the Scene, are set accordingly.\n            self.setPos(data[\"pos_x\"], data[\"pos_y\"])\n\n            # When block is drawn, by default it is created with its allocated number of input/output sockets.\n            # When deserializing a block, we want the sockets to be in the locations where they were saved.\n            # Hence, we must delete the default created input/output sockets to override them with the saved sockets.\n            if self.inputs:\n                # RemoveSockets is a method accessible only through a socket, while self.inputs is a list of sockets\n                # 'removeSockets' removes all sockets associated with a block.\n                self.inputs[0].removeSockets(\"Input\")\n            if self.outputs:\n                # Same usage of 'removeSocket' as above\n                self.outputs[0].removeSockets(\"Output\")\n\n            # The input and output lists for this Block are cleared\n            self.inputs = []\n            self.outputs = []\n\n            # The saved user-editable parameters associated with the Block, are written over the default ones\n            # this instance of the block was created with, after reconstruction.\n            # Iterator for parameters\n            if self.block_type not in [\"Connector\", \"CONNECTOR\"]:\n                i = 0\n\n                for paramName, paramVal in data[\"parameters\"]:\n                    # If debug mode is enabled, this code will print to console to validate that the\n                    # parameters are being overwritten into the same location they were previously stored in.\n                    if DEBUG:\n                        print(\"----------------------\")\n                    if DEBUG:\n                        print(\"Cautionary check\")\n                    if DEBUG:\n                        print(\n                            \"current value:\",\n                            [\n                                self.parameters[i][0],\n                                self.parameters[i][1],\n                                self.parameters[i][2],\n                            ],\n                        )\n                    if DEBUG:\n                        print(\n                            \"setting to value:\",\n                            [paramName, self.parameters[i][1], paramVal],\n                        )\n                    self.parameters[i][0] = paramName\n                    self.parameters[i][2] = paramVal\n\n                    # If there are subsystem, outport or inport blocks with labels for their sockets, extract that information into self.input_names and self.output_names as needed\n                    if self.block_type in [\"SUBSYSTEM\", \"OUTPORT\", \"INPORT\"]:\n\n                        if paramName == \"inport labels\":\n                            if paramVal:\n                                self.input_names = [str(j) for j in paramVal]\n\n                        if paramName == \"outport labels\":\n                            if paramVal:\n                                self.output_names = [str(j) for j in paramVal]\n\n                    i += 1\n\n            # And the saved (input and output) sockets are written into these lists respectively,\n            # deserializing the socket-relevant information while doing so.\n            for i, socket_data in enumerate(data[\"inputs\"]):\n                try:\n                    if self.input_names:\n                        new_socket = Socket(\n                            node=self,\n                            index=socket_data[\"index\"],\n                            position=socket_data[\"position\"],\n                            socket_type=socket_data[\"socket_type\"],\n                            socket_label=self.input_names[i],\n                        )\n                    else:\n                        new_socket = Socket(\n                            node=self,\n                            index=socket_data[\"index\"],\n                            position=socket_data[\"position\"],\n                            socket_type=socket_data[\"socket_type\"],\n                        )\n                except (AttributeError, IndexError):\n                    new_socket = Socket(\n                        node=self,\n                        index=socket_data[\"index\"],\n                        position=socket_data[\"position\"],\n                        socket_type=socket_data[\"socket_type\"],\n                    )\n                new_socket.deserialize(socket_data, hashmap)\n                self.inputs.append(new_socket)\n\n            self.updateSocketSigns()\n\n            for i, socket_data in enumerate(data[\"outputs\"]):\n                try:\n                    if self.output_names:\n                        new_socket = Socket(\n                            node=self,\n                            index=socket_data[\"index\"],\n                            position=socket_data[\"position\"],\n                            socket_type=socket_data[\"socket_type\"],\n                            socket_label=self.output_names[i],\n                        )\n                    else:\n                        new_socket = Socket(\n                            node=self,\n                            index=socket_data[\"index\"],\n                            position=socket_data[\"position\"],\n                            socket_type=socket_data[\"socket_type\"],\n                        )\n                except (AttributeError, IndexError):\n                    new_socket = Socket(\n                        node=self,\n                        index=socket_data[\"index\"],\n                        position=socket_data[\"position\"],\n                        socket_type=socket_data[\"socket_type\"],\n                    )\n                new_socket.deserialize(socket_data, hashmap)\n                self.outputs.append(new_socket)\n\n            if self.block_type not in [\"Connector\", \"CONNECTOR\"]:\n                if self.parameters:\n                    self._createParamWindow()\n\n            # print(\"block type, name: \", [self.block_type, self.title])\n            # print(\"input sockets:\")\n            # for socket in self.inputs:\n            #     if socket:\n            #         print(\"socket, id:\", [socket, id(socket)])\n            # print()\n            # print(\"output sockets:\")\n            # for socket in self.outputs:\n            #     if socket:\n            #         print(\"socket, id:\", [socket, id(socket)])\n            # print(\"----------------------\")\n\n            return True\n        except (ValueError, NameError, IndexError):\n            print(\n                f\"error deserializing block [{self.block_type}::{self.title}] - maybe JSON file has old function parameters\"\n            )\n\n\n# -----------------------------------------------------------------------------\ndef block(cls):\n    \"\"\"\n    This method is called whenever a grandchild class of the ``Block`` is called,\n    adding it to a list of usable blocks.\n\n    This code has been adapted from: https://github.com/petercorke/bdsim/blob/bdedit/bdsim/components.py\n\n    :param cls: the class of the ``Block`` Class's grandchild block Class.\n    :type cls: Class, required\n    \"\"\"\n    # If the given Block is a subclass of the Block Class, it is added to the\n    # blocklist global variable\n    if issubclass(cls, Block):\n        blocklist.append(cls)\n    # Otherwise an error message is printed to console\n    else:\n        print(\"Error: @block used on a non Block subclass\")\n\n\n# -----------------------------------------------------------------------------\ndef blockname(cls):\n    \"\"\"\n    This method strips any underscores from a grandchild Class of the ``Block``\n    Class, and capitalizes the Class.__name__ to be used as the the Class's name.\n\n    This code has been adapted from: https://github.com/petercorke/bdsim/blob/bdedit/bdsim/bdsim.py\n\n    :param cls: the class of the ``Block`` Class's grandchild block Class.\n    :type cls: Class, required\n    :return: a reformatted string of the block's class name\n    :rtype: str\n    \"\"\"\n    return cls.__name__.strip(\"_\").upper()\n"
  },
  {
    "path": "bdsim/bdedit/block_connector_block.py",
    "content": "# BdEdit imports\nfrom bdsim.bdedit.block import *\nfrom bdsim.bdedit.block_socket import *\nfrom bdsim.bdedit.block_graphics_block import *\n\n\n# =============================================================================\n#\n#   Defining the Connector Class, which allows for the redirecting of Wires\n#   to create more neater Block Diagrams.\n#\n# =============================================================================\nclass Connector(Block):\n    \"\"\"\n    The ``Connector`` Class is a subclass of ``Block``, and referred to as a\n    child class of ``Block``. It inherits all the methods and variables of its\n    parent class to behave as a Block. It allows for wires to be more neatly\n    redirected, acting as a node through which the wires can be moved around\n    more freely within the work area.\n\n    The idea of this Connector block was for it to be a single socket which\n    allows a wire to be redirected through it, however currently it works by\n    mimicking a Block that only has 1 input and 1 output socket. The same socket\n    logic that applies to a Block, also applies to the Connector Block.\n\n    That being:\n\n    - an input: can only have 1 Wire connecting into it\n    - an output: can have n Wires connecting into it\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, scene, window, title=\"Unnamed Connector Block\"):\n        \"\"\"\n        This method initializes an instance of the ``Connector`` Block Class.\n\n        :param scene: inherited through ``Block``\n        :type scene: ``Scene``, required\n        :param window: inherited through ``Block``\n        :type window: ``QGridLayout``, required\n        :param title: defaults to \"Unnamed Connector Block\"\n        :type title: str, optional\n        :param pos: inherited through ``Block``\n        :type pos: tuple of 2-ints, optional\n        \"\"\"\n\n        super().__init__(scene, window)\n\n        # Same variables inherited from the Block class\n        self.scene = scene\n        self.window = window\n\n        # No block title as the Connector Blocks have no name, as\n        # this type of block is more of a tool than a Block\n        # self.position = pos\n        # The Connector Block doesn't have its own subclass like the other Block types,\n        # hence some of the variables are defined in this class level, these being:\n        # * the block type\n        # * the block dimensions (width, height)\n        # * the grBlock (graphical representation of how this block looks)\n        # * the number of spawned input and output sockets (1 of each)\n        # * the paramWindow is disabled (this block doesn't have a paramWindow, as it is a tool)\n        self.block_type = blockname(self.__class__)\n        self.width = 13\n        self.height = 12\n\n        self.title = \"\"\n        self.parameters = []\n        self.block_url = \"\"\n\n        self.icon = \"\"\n        self.flipped = False\n        self.flipped_icon = \"\"\n\n        self.inputsNum = 1\n        self.outputsNum = 1\n\n        self.grBlock = GraphicsConnectorBlock(self)\n\n        self.makeInputSockets(self.inputsNum, LEFT, socketType=INPUT)\n        self.makeOutputSockets(self.outputsNum, RIGHT, socketType=OUTPUT)\n\n        self.parameterWindow = None\n\n        # The Connector block is automatically stored into the Scene,\n        # and visually added into the GraphicsScene\n        self.scene.addBlock(self)\n        self.scene.grScene.addItem(self.grBlock)\n\n        self.scene.has_been_modified = True\n"
  },
  {
    "path": "bdsim/bdedit/block_graphics_block.py",
    "content": "# Library imports\nimport sys\nimport traceback\n\n# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n# BdEdit imports\nfrom bdsim.bdedit.Icons import *\n\n# =============================================================================\n#\n#   Defining and setting global variables\n#\n# =============================================================================\n# Socket positioning variables - used for determining what side of the block the\n# socket should be drawn\nLEFT = 1\nRIGHT = 3\n\n\n# =============================================================================\n#\n#   Defining the GraphicsBlock Class, which is inherited by all Blocks and\n#   controls the graphical appearance of each Block.\n#\n# =============================================================================\nclass GraphicsBlock(QGraphicsItem):\n    \"\"\"\n    The ``GraphicsBlock`` Class extends the ``QGraphicsItem`` Class from PyQt5.\n    This class is responsible for graphically drawing Blocks within the GraphicsScene.\n    Using the provided Block dimensions, it specifies the Blocks' shape and colour.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, block, parent=None):\n        \"\"\"\n        This method initializes an instance of the ``GraphicsBlock`` Class.\n        It inherits the dimensions of its Block, and defines its shape and colour.\n\n        :param block: the Block this GraphicsBlock instance relates to\n        :type block: Block, required\n        :param parent: the parent widget this class instance belongs to (None)\n        :type parent: NoneType, optional, defaults to None\n        \"\"\"\n\n        super().__init__(parent)\n        # The block properties are inherited from the provided block\n        self.block = block\n        self.icon = self.block.icon\n        self.width = self.block.width\n        self.height = self.block.height\n\n        # The color mode of the block is also stored (Light or Dark mode)\n        self.mode = self.block.scene.grScene.mode\n\n        # Internal variable which dictate whether a title needs to be drawn\n        # The first time the Block is drawn, this is True, then it is set to\n        # False, and only changed to True when the title is called to update\n        self._draw_title = True\n\n        # These dimensions are not updated\n        self._default_width = self.block.width\n        self._default_height = self.block.height\n\n        # Pen thickness and block-related spacings are defined\n        self.edge_size = 10.0  # How rounded the rectangle corners are\n        self.title_height = (\n            25.0  # How many pixels underneath the block the title is displayed at\n        )\n        self._padding = (\n            5.0  # Minimum distance inside the block that things should be displayed at\n        )\n        self._line_thickness = 3.0  # Thickness of the block outline by default\n        self._selected_line_thickness = (\n            5.0  # Thickness of the block outline on selection\n        )\n\n        # Colours for pens are defined, and the text font is set\n        self._default_title_color = (\n            Qt.black\n        )  # Title colour (set to Light mode by default)\n        # self._pen_selected = QPen(QColor(\"#FFFFA637\"), self._selected_line_thickness)\n        self._pen_selected = QPen(\n            QColorConstants.Svg.orange, self._selected_line_thickness\n        )  # Orange\n        self._title_font = QFont(\"Arial\", self.block.scene.block_name_fontsize)\n\n        # Internal variable for catching fatal errors, and allowing user to save work before crashing\n        self.FATAL_ERROR = False\n\n        # Methods called to:\n        # * draw the title for the block\n        # * check current colour mode the block should display in (Light/Dark)\n        # * further initialize necessary block settings\n        self.initTitle()\n        self.checkMode()\n        self.initUI()\n\n        # Variable for storing whether block was moved or not\n        self.wasMoved = False\n        self.lastPos = self.pos()\n\n    # -----------------------------------------------------------------------------\n    def initUI(self):\n        \"\"\"\n        This method sets flags to allow for this Block to be movable and selectable.\n        \"\"\"\n        self.setFlag(QGraphicsItem.ItemIsSelectable)\n        self.setFlag(QGraphicsItem.ItemIsMovable)\n        self.setAcceptHoverEvents(True)\n\n    # -----------------------------------------------------------------------------\n    def initTitle(self):\n        \"\"\"\n        This method initializes a QGraphicsTextItem which will graphically represent\n        the title (name) of this Block.\n        \"\"\"\n        self.title_item = QGraphicsTextItem(self)\n        self.title_item.setDefaultTextColor(self._default_title_color)\n        self.title_item.setFont(self._title_font)\n\n    # -----------------------------------------------------------------------------\n    def titleLength(self):\n        \"\"\"\n        This method calculates and returns the length of this Blocks' title in pixels.\n\n        :return: the pixel length of this Blocks' title\n        :rtype: int\n        \"\"\"\n\n        # Using the font of the text and the block's title, determine the length of the\n        # title in terms of pixels\n        title_pixel_len = QFontMetrics(self._title_font).width(self.block.title)\n\n        # As the block width is an even number (100 pixels), to center properly, the\n        # width of the title must also be even\n        # If title width is odd, add 1 pixel to it to make it even\n        if title_pixel_len % 2 != 0:\n            title_pixel_len += 1\n        return title_pixel_len\n\n    # -----------------------------------------------------------------------------\n    def getTitle(self):\n        \"\"\"\n        This method returns the current title of this Block.\n\n        :return: Block title\n        :rtype: str\n        \"\"\"\n\n        return self.block.title\n\n    # -----------------------------------------------------------------------------\n    def setTitle(self):\n        \"\"\"\n        This method updates this Blocks' graphical title to the stored title of the Block.\n        \"\"\"\n\n        # Once the title has been set, this method will handle redrawing the title\n        # Hence the title doesn't need to be redrawn after\n        self._draw_title = False\n\n        # Graphical title is set to the block's title is set\n        self.title_item.setPlainText(self.block.title)\n\n        # Title length is found (using self.titleLength()), and centered under the block\n        self.title_item.setPos(\n            (self.width - self._padding - self.titleLength()) / 2,\n            self.height + self._padding,\n        )\n\n        # The GraphicsBlock instance is called to be updated\n        self.update()\n\n    # -----------------------------------------------------------------------------\n    def checkMode(self):\n        \"\"\"\n        This method checks the mode of the GraphicsScene's background (Light, Dark)\n        and updates the colour mode of the pens and brushes used to paint this Block.\n        \"\"\"\n\n        # If dark mode is selected, draw blocks tailored to dark mode\n        # if self.mode == \"Dark\":\n        #     self._title_color = Qt.white\n        #     self._pen_default = QPen(Qt.white, self._line_thickness)\n        #     self._brush_background = QBrush(Qt.white)\n        # # Else light or off mode is selected (No off mode for blocks), draw blocks tailored to light mode\n        # else:\n        self._title_color = Qt.black\n        # self._pen_default = QPen(QColor(\"#7F000000\"), self._line_thickness)\n        self._pen_default = QPen(QColorConstants.Svg.dimgrey, self._line_thickness)\n        self._brush_background = QBrush(QColor(\"#FFE1E0E8\"))\n\n        self.title_item.setDefaultTextColor(self._title_color)\n\n    # Todo - update code\n    # -----------------------------------------------------------------------------\n    def updateMode(self, value):\n        \"\"\"\n        This method updates the mode of the Block to the provided value (should only\n        ever be \"Light\", \"Dark\" or \"Off\").\n\n        :param value: current mode of the GraphicsScene's background (\"Light\", \"Dark\", \"Off\")\n        :type value: str, required\n        \"\"\"\n\n        self.mode = value\n        self.checkMode()\n        self.update()\n\n    # -----------------------------------------------------------------------------\n    def checkBlockHeight(self):\n        \"\"\"\n        This method checks if the current height of the Block is enough to fit all\n        the Sockets that are to be drawn, while following the set socket spacing.\n        It also handles the resizing of the Block (if there isn't enough space for\n        all the sockets), ensuring the sockets are evenly spaced while following\n        the set socket spacing.\n        \"\"\"\n\n        # The offset distance from the top of the Block to the first Socket.\n        # The same offset is used for from the bottom of the Block to the last Socket.\n        socket_spacer = self._padding + self.edge_size + self.title_height\n\n        # This code grabs the coordinates ([x,y]) of last input and output sockets if any exist\n        if self.block.inputs:\n            last_input = self.block.inputs[-1].getSocketPosition()\n        else:\n            last_input = [0, 0]\n\n        if self.block.outputs:\n            last_output = self.block.outputs[-1].getSocketPosition()\n        else:\n            last_output = [0, 0]\n\n        # The max height of the Block could depend on either the input or output sockets\n        # Hence the max height of both types are found (max height is the height at which\n        # the last socket should be placed, in order for sockets to be evenly spaced)\n\n        # Max height of input/output sockets - adds socket_spacer height to height of last input/output socket\n        max_input_socket_height = last_input[1] + socket_spacer\n        max_output_socket_height = last_output[1] + socket_spacer\n\n        # Max block height (determined by which ever has more sockets - inputs or outputs)\n        max_block_height = max(max_input_socket_height, max_output_socket_height)\n\n        # If max_block_height is greater than the default block height, set current_block_height to max_block_height\n        # Otherwise keep it at the default block height\n        if max_block_height > self._default_height:\n            self.block.height = max_block_height\n        else:\n            self.block.height = self._default_height\n\n        # Update the internal height of the GraphicsBlock to the updated height of the Block\n        self.height = self.block.height\n        self.update()\n\n    # -----------------------------------------------------------------------------\n    def hoverEnterEvent(self, event):\n        \"\"\"\n        When a ``GraphicsBlock`` is hovered over with the cursor, this method will display\n        a tooltip with the type of block underneath the mouse.\n        :param event: mouse hover detected over block\n        :type event: QGraphicsSceneHoverEvent\n        \"\"\"\n\n        # QToolTip.setFont(QFont(\"Ubuntu\", 10))\n        self.setToolTip(\"<b>\" + self.block.block_type + \"</b> block\")\n        # self.setToolTip(\"<b>\" + self.block.block_type + \"</b>\")\n\n    # -----------------------------------------------------------------------------\n    def boundingRect(self):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by ``GraphicsBlock``\n        which returns the area within which the GraphicsBlock can be interacted with.\n        When a mouse click event is detected within this area, this will trigger logic\n        that relates to a Block (that being, selecting/deselecting, moving, deleting,\n        flipping or opening a parameter window).\n\n        :return: a rectangle within which the Block can be interacted with\n        :rtype: QRectF\n        \"\"\"\n\n        return QRectF(0, 0, self.width, self.height)\n\n    # -----------------------------------------------------------------------------\n    def paint(self, painter, style, widget=None):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by ``GraphicsBlock``.\n        This method is automatically called by the GraphicsView Class whenever even\n        a slight user-interaction is detected within the Scene.\n\n        Before drawing, the dimensions of the Block are checked, to ensure they can\n        hold all the necessary Sockets. Then the following are drawn in order:\n\n        - the title of the block\n        - the fill of the block (a rounded rectangle)\n        - the outline of the block (a rounded rectangle)\n        - the icon of the block (if one exists)\n\n        :param painter: a painter (paint brush) that paints and fills the shape of this GraphicsBlock\n        :type painter: QPainter, automatically recognized and overwritten from this method\n        :param style: style of the painter (isn't used but must be defined)\n        :type style: QStyleOptionGraphicsItem, automatically recognized from this method\n        :param widget: the widget this class is being painted on (None)\n        :type widget: NoneType, optional, defaults to None\n        \"\"\"\n\n        try:\n\n            # Block dimensions are checked for to ensure there's enough space for all sockets\n            self.checkBlockHeight()\n\n            # Title will be redrawn, if needed\n            if self._draw_title:\n                self.setTitle()\n\n            # Background (fill) of the block is drawn\n            path_content = QPainterPath()\n            path_content.setFillRule(Qt.WindingFill)\n            path_content.addRoundedRect(\n                0, 0, self.width, self.height, self.edge_size, self.edge_size\n            )\n            path_content.addRect(0, self.title_height, self.edge_size, self.edge_size)\n            path_content.addRect(\n                self.width - self.edge_size,\n                self.title_height,\n                self.edge_size,\n                self.edge_size,\n            )\n            painter.setPen(Qt.NoPen)\n            painter.setBrush(self._brush_background)\n            painter.drawPath(path_content.simplified())\n\n            # Outline of the block is drawn\n            path_outline = QPainterPath()\n            path_outline.addRoundedRect(\n                0, 0, self.width, self.height, self.edge_size, self.edge_size\n            )\n            painter.setPen(\n                self._pen_default if not self.isSelected() else self._pen_selected\n            )\n            painter.setBrush(Qt.NoBrush)\n            painter.drawPath(path_outline.simplified())\n\n            # Icon of the block is drawn overtop the blocks' background\n            if QtCore.QFile.exists(self.icon):\n                if self.block.flipped and QtCore.QFile.exists(self.block.flipped_icon):\n                    icon_image = QImage(self.block.flipped_icon)\n                    # icon_item = QPixmap(self.block.flipped_icon).scaledToWidth(50) if self.block.flipped_icon else QPixmap(self.block.flipped_icon)  # Icons are scaled down to 50 pixels\n                else:\n                    icon_image = QImage(self.icon)\n                    # icon_item = QPixmap(self.icon).scaledToWidth(50) if self.icon else QPixmap(self.icon)\n                # target = QRect((self.width - icon_item.width()) / 2, (self.height - icon_item.height()) / 2, self.width, self.height)\n                # source = QRect(0, 0, self.width, self.height)\n                painter.drawImage(\n                    QRectF(\n                        (self.width - (icon_image.width()) / 5) / 2,\n                        (self.height - (icon_image.height()) / 5) / 2,\n                        50,\n                        50,\n                    ),\n                    icon_image,\n                )\n                # painter.drawPixmap(target, icon_item, source)\n\n        except Exception as e:\n            if self.FATAL_ERROR == False:\n                print(\n                    \"--------------------------------------------------------------------------\"\n                )\n                print(\n                    \"Caught fatal exception while trying to draw blocks. Please save your work.\"\n                )\n                print(\n                    \"--------------------------------------------------------------------------\"\n                )\n                traceback.print_exc(file=sys.stderr)\n                self.FATAL_ERROR = True\n\n    # -----------------------------------------------------------------------------\n    def mousePressEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by\n        ``GraphicsBlock`` to detect, and assign logic to a right mouse press event.\n\n        Currently a detected mouse press event on the GraphicsBlock will select\n        or deselect it.\n\n        - If selected, the GraphicsBlock will be sent to front and will appear on\n          top of other blocks.\n        - Additionally, if the right mouse button is pressed and a GraphicsBlock\n          is selected, a parameter window will be toggled for this Block.\n\n        :param event: a mouse press event (Left, Middle or Right)\n        :type event: QMousePressEvent, automatically recognized by the inbuilt function\n        \"\"\"\n\n        # When the current GraphicsBlock is pressed on, it is sent to the front\n        # of the work area (in the GraphicsScene)\n        self.block.setFocusOfBlocks()\n\n        # If the GraphicsBlock is currently selected when the right mouse button\n        # is pressed, the parameter window will be toggled (On/Off)\n        if event.button() == Qt.RightButton:\n            self.block.toggleParamWindow()\n\n        super().mousePressEvent(event)\n\n    # Todo - add documentation\n    # -----------------------------------------------------------------------------\n    def mouseReleaseEvent(self, event):\n\n        super().mouseReleaseEvent(event)\n\n        # If block has been moved, update the variable within the model, to then update the\n        # title of the model, to indicate that there is unsaved progress\n        if self.wasMoved:\n            self.wasMoved = False\n            self.block.scene.has_been_modified = True\n            self.block.scene.history.storeHistory(\"Block moved\")\n\n\nclass GraphicsConnectorBlock(QGraphicsItem):\n    \"\"\"\n    The ``GraphicsConnectorBlock`` Class extends the ``QGraphicsItem`` Class from PyQt5.\n    This class is responsible for graphically drawing Connector Blocks within the\n    GraphicsScene.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, block, parent=None):\n        \"\"\"\n        This method initializes an instance of the ``GraphicsConnectorBlock`` Class\n        (otherwise known as the Graphics Class of the Connector Block).\n\n        :param block: the Connector Block this GraphicsConnectorBlock instance relates to\n        :type block: Connector Block\n        :param parent: the parent widget this class instance belongs to (None)\n        :type parent: NoneType, optional, defaults to None\n        \"\"\"\n\n        super().__init__(parent)\n        self.block = block\n        self.icon = self.block.icon\n\n        self._draw_title = False\n\n        self.width = self.block.width\n        self.height = self.block.height\n\n        # As the connector block consists of two sockets (1 input, 1 output) which\n        # use the following commands in determining where they need to be placed,\n        # these commands must be included, but are set to 0 as no shape is drawn for\n        # the connector block, aside from these two sockets.\n        self.edge_size = 0\n        self.title_height = 0\n        self._padding = 0\n\n        # Definition for the line thickness when the Connector block is selected\n        # Internal padding is half this value\n        # Corner rounding is by how many pixels the corners are rounded of the selected box that is drawn\n        self._selected_line_thickness = 5.0\n        self._internal_padding = 2.5\n        self._corner_rounding = 10\n\n        # Color of the selected line is set\n        # self._pen_selected = QPen(QColor(\"#FFFFA637\"), self._selected_line_thickness)   # Orange\n        self._pen_selected = QPen(\n            QColorConstants.Svg.orange, self._selected_line_thickness\n        )  # Orange\n        # Color of wire to be drawn between sockets, when connector block is hidden (to make solid line)\n        self._color = QColor(\"#000000\")\n\n        # Internal variable for catching fatal errors, and allowing user to save work before crashing\n        self.FATAL_ERROR = False\n\n        # Further initialize necessary Connector Block settings\n        self.initUI()\n        self.wasMoved = False\n        self.lastPos = self.pos()\n\n    # -----------------------------------------------------------------------------\n    def initUI(self):\n        \"\"\"\n        This method sets flags to allow for this Connector Block to be movable and selectable.\n        \"\"\"\n\n        self.setFlag(QGraphicsItem.ItemIsSelectable)\n        self.setFlag(QGraphicsItem.ItemIsMovable)\n\n        # When first created, the Connector block spawns highlighted\n        self.setSelected(True)\n\n    # -----------------------------------------------------------------------------\n    def boundingRect(self):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by ``GraphicsConnectorBlock``\n        which returns the area within which the GraphicsConnectorBlock can be interacted with.\n        When a mouse click event is detected within this area, this will trigger logic\n        that relates to a Block (that being, selecting/deselecting, moving, deleting,\n        flipping or opening a parameter window. Or if its Sockets are clicked on,\n        this will trigger a wire to be created or ended).\n\n        :return: a rectangle within which the Block can be interacted with\n        :rtype: QRectF\n        \"\"\"\n\n        W = self.width\n        P = self._internal_padding\n        # return QRectF(\n        #     1 - W - P,\n        #     1 - W - P,\n        #     3 * W + P,\n        #     2 * W + P\n        # ).normalized()\n\n        # Alternative selection area that is larger, but will overlap wires directly\n        # one grid block step above the connector block, when the connector block is\n        # selected.\n        return QRectF(\n            1 - 1.5 * W - P, 1 - 1.5 * W - P, 4 * W + P, 3 * W + P\n        ).normalized()\n\n    # -----------------------------------------------------------------------------\n    def paint(self, painter, style, widget=None):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by\n        ``GraphicsConnectorBlock`` (otherwise referred to as the Graphics Class of\n        the Connector Block. This method is automatically called by the GraphicsView\n        Class whenever even a slight user-interaction is detected within the Scene.\n\n        When the Connector Block is selected, this method will draw an orange\n        outline around the Connector Block, within which it can be interacted with.\n\n        :param painter:a painter (paint brush) that paints and fills the shape of this GraphicsConnectorBlock\n        :type painter: QPainter, automatically recognized and overwritten from this method\n        :param style: style of the painter (isn't used but must be defined)\n        :type style: QStyleOptionGraphicsItem, automatically recognized from this method\n        :param widget: the widget this class is being painted on (None)\n        :type widget: NoneType, optional, defaults to None\n        \"\"\"\n        try:\n            if self.isSelected():\n                # Draws orange outline around the Connector Block when it is selected\n                path_outline = QPainterPath()\n                # The size of the rectangle drawn, is dictated by the boundingRect (interactive area)\n                path_outline.addRoundedRect(\n                    self.boundingRect(), self._corner_rounding, self._corner_rounding\n                )\n                painter.setPen(self._pen_selected)\n                painter.setBrush(Qt.NoBrush)\n                painter.drawPath(path_outline.simplified())\n\n            # If the user has chosen to hide the connector blocks, redraw the sockets to be hidden\n            if self.block.scene.hide_connector_blocks:\n                # Grab the [x,y] coordinates of both the input and output sockets of the\n                # connector block, and create a wire path to be drawn between them\n                input_pos = self.block.inputs[0].getSocketPosition()\n                output_pos = self.block.outputs[0].getSocketPosition()\n\n                multi = 1\n\n                # If connector block is flipped, draw the wire path in the opposite direction\n                if self.block.inputs[0].position == RIGHT:\n                    multi = -1\n\n                wire_path = QPainterPath(\n                    QPointF(input_pos[0] + (multi * 4.5), input_pos[1])\n                )\n                wire_path.lineTo(output_pos[0] - (multi * 4.5), output_pos[1])\n\n                # Set the paint brush width and colour\n                wire_pen = QPen(self._color)\n                wire_pen.setWidth(5)\n                painter.setPen(wire_pen)\n                painter.drawPath(wire_path)\n\n        except Exception as e:\n            if self.FATAL_ERROR == False:\n                print(\n                    \"------------------------------------------------------------------------------------\"\n                )\n                print(\n                    \"Caught fatal exception while trying to draw connector blocks. Please save your work.\"\n                )\n                print(\n                    \"------------------------------------------------------------------------------------\"\n                )\n                traceback.print_exc(file=sys.stderr)\n                self.FATAL_ERROR = True\n\n    # -----------------------------------------------------------------------------\n    def mousePressEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by\n        ``GraphicsConnectorBlock`` to detect, and assign logic to a right mouse press event.\n\n        Currently a detected mouse press event on the GraphicsConnectorBlock will\n        select or deselect it.\n\n        Additionally if selected, the GraphicsBlock will be sent to front and will\n        appear on top of other blocks.\n\n        :param event: a mouse press event (Left, Middle or Right)\n        :type event: QMousePressEvent, automatically recognized by the inbuilt function\n        \"\"\"\n\n        # When the current GraphicsSocketBlock is pressed on, it is sent to the front\n        # of the work area (in the GraphicsScene)\n        self.block.setFocusOfBlocks()\n\n        super().mousePressEvent(event)\n\n    # Todo - add documentation\n    # -----------------------------------------------------------------------------\n    def mouseReleaseEvent(self, event):\n        super().mouseReleaseEvent(event)\n\n        # If block has been moved, update the variable within the model, to then update the\n        # title of the model, to indicate that there is unsaved progress\n        if self.wasMoved:\n            self.wasMoved = False\n            self.block.scene.has_been_modified = True\n            self.block.scene.history.storeHistory(\"Connector Block moved\")\n"
  },
  {
    "path": "bdsim/bdedit/block_graphics_socket.py",
    "content": "# Library imports\nimport sys\nimport traceback\nfrom PIL import ImageFont\n\n# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n\n# =============================================================================\n#\n#   Defining and setting global variables\n#\n# =============================================================================\n# Socket positioning variables - used for determining what side of the block the\n# socket should be drawn\nLEFT = 1\nRIGHT = 3\n\n# Socket type classification variables\nINPUT = 1\nOUTPUT = 2\n\n# Input Socket sign classification variables\nPLUS = \"+\"\nMINUS = \"-\"\nMULTIPLY = \"*\"\nDIVIDE = \"/\"\n\n\n# =============================================================================\n#\n#   Defining the GraphicsSocket Class, which is inherited by all Sockets, and\n#   controls the graphical appearance of each Socket.\n#\n# =============================================================================\nclass GraphicsSocket(QGraphicsItem):\n    \"\"\"\n    The ``GraphicsSocket`` Class extends the ``QGraphicsItem`` Class from PyQt5.\n    This class is responsible for graphically drawing Sockets on Blocks. It\n    specifies the shape, colour, style and dimensions of the Socket and also\n    implements the logic for drawing signs alongside the input sockets of ``PROD``\n    and ``SUM``` Blocks.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, socket):\n        \"\"\"\n        This method initializes an instance of the ``GraphicsSocket`` Class. It\n        defines the shapes and sizes for a given input or output Socket. Depending\n        on the socket_type, stored within the provided Socket, the shape and colour\n        of the given Socket is decided.\n\n        :param socket: the Socket this GraphicsSocket instance relates to\n        :type socket: Socket\n        \"\"\"\n\n        self.socket = socket\n        # The GraphicsBlock class is initialized for the Block Class this Socket relates to\n        super().__init__(socket.node.grBlock)\n\n        # Sizes for the various socket shapes are defined\n        self.radius = 6.0\n        self.triangle_left = 6\n        self.triangle_right = 8\n        self.triangle_up = 6\n        self.square = 6\n\n        # Outlines of the shapes and signs are defined\n        self.outline_width = 1.0\n        self.sign_width = 1.5\n\n        # Fill colors of the socket shapes are defined\n        self._color_background_input = QColor(\"#3483eb\")  # Blue\n        self._color_background_output = QColor(\"#f54242\")  # Red\n        self._color_background_connector = QColor(\n            \"#42f587\"\n        )  # Lime Green (currently not used)\n        self._color_outline = QColor(\"#000000\")  # Black\n\n        # Painter pens are assigned a colour and outline thickness\n        self._pen = QPen(self._color_outline)\n        self._pen.setWidthF(self.outline_width)\n        self._sign_pen = QPen(self._color_outline)\n        self._sign_pen.setWidthF(self.sign_width)\n        self._char_font = QFont(\"Arial\", 14)\n\n        self.setFlag(QGraphicsItem.ItemIsSelectable)\n        self.setBrush()\n\n        # Internal variable for catching fatal errors, and allowing user to save work before crashing\n        self.FATAL_ERROR = False\n\n    def setBrush(self):\n        # Depending on the socket type, the painter brush is set\n        if self.socket.socket_type == INPUT:\n            self._brush = QBrush(self._color_background_input)\n        elif self.socket.socket_type == OUTPUT:\n            self._brush = QBrush(self._color_background_output)\n\n    # Todo - update docs, and inline comments\n    # -----------------------------------------------------------------------------\n    def paint(self, painter, style, widget=None):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by ``GraphicsSocket``.\n        This method is automatically called by the GraphicsView Class whenever even\n        a slight user-interaction is detected within the Scene.\n\n        It dictates how both input and output Sockets are painted on their relating Block.\n        The position at which to draw the Socket is determined internally by the Socket\n        class, so when the GraphicsSocket class paints the Socket, it is painted with\n        respects to the point where the Socket should be.\n\n        :param painter: a painter (paint brush) that paints and fills the shape of this GraphicsSocket\n        :type painter: QPainter, automatically recognized and overwritten from this method\n        :param style: style of the painter (isn't used but must be defined)\n        :type style: QStyleOptionGraphicsItem, automatically recognized from this method\n        :param widget: the widget this class is being painted on (None)\n        :type widget: NoneType, optional, Defaults to None\n        \"\"\"\n\n        # Painter pen(outline) and brush(fill) are set\n        painter.setPen(self._pen)\n        try:\n            painter.setBrush(self._brush)\n        except AttributeError as e:\n            # For some reason, brush was not set, set it again based on socket type\n            self.setBrush()\n\n        # If sockets don't need to be hidden, draw them normally, otherwise don't draw them at all\n        if not self.shouldSocketsBeHidden():\n            # Multi is an internal variable that dictates the direction the socket shapes\n            # should point (this comes into affect when the block sockets are flipped, and the\n            # output triangle socket shape should point either right (default), or left (flipped))\n            multi = 1\n            offset = 0\n\n            # If the socket has a name (character) to display, find the characters' dimensions\n            # Dimensions of the socket sign - contains [width, height] of character\n            if self.socket.socket_sign:\n                (char_width, char_height) = self.charDimensions()\n            else:\n                (char_width, char_height) = [0, 0]\n\n            # If the socket is flipped, adjust the internal multi variable\n            if self.socket.position == RIGHT:\n                multi = -1\n                if self.socket.socket_sign:\n                    offset = char_width\n\n            # This code paints a square for the input socket\n            if self.socket.socket_type == INPUT:\n                painter.drawRect(\n                    -self.square, -self.square, 2 * self.square, 2 * self.square\n                )\n                # If the input socket has a sign (will be true for the PROD and SUM Blocks)\n                # paint the relevant sign (+,-,*,/) next to the input socket\n                try:\n                    if self.socket.socket_sign is not None:\n                        path = self.getSignPath(self.socket.socket_sign, multi)\n                        if path is None:\n                            painter.setPen(self._sign_pen)\n                            painter.setFont(self._char_font)\n                            painter.drawText(\n                                (10 + offset) * multi,\n                                char_height,\n                                self.socket.socket_sign,\n                            )\n                        else:\n                            # The painter path for the respective sign depends on the sign relating to this socket\n                            painter.setPen(self._sign_pen)\n                            painter.drawPath(path)\n                except Exception as e:\n                    if self.FATAL_ERROR == False:\n                        print(\n                            \"---------------------------------------------------------------------------------------\"\n                        )\n                        print(\n                            \"Caught fatal exception while trying to draw input socket labels. Please save your work.\"\n                        )\n                        print(\n                            \"---------------------------------------------------------------------------------------\"\n                        )\n                        traceback.print_exc(file=sys.stderr)\n                        self.FATAL_ERROR = True\n\n            # This code paints a triangle for the output socket\n            if self.socket.socket_type == OUTPUT:\n                path = QPainterPath()\n                path.moveTo(multi * self.triangle_left, multi * self.triangle_up)\n                path.lineTo(-multi * self.triangle_right, 0)\n                path.lineTo(multi * self.triangle_left, -multi * self.triangle_up)\n                path.lineTo(multi * self.triangle_left, multi * self.triangle_up)\n                painter.drawPath(path)\n\n                try:\n                    if self.socket.socket_sign is not None:\n                        painter.setPen(self._sign_pen)\n                        painter.setFont(self._char_font)\n                        painter.drawText(\n                            (10 + offset) * multi, char_height, self.socket.socket_sign\n                        )\n                except Exception as e:\n                    if self.FATAL_ERROR == False:\n                        print(\n                            \"----------------------------------------------------------------------------------------\"\n                        )\n                        print(\n                            \"Caught fatal exception while trying to draw output socket labels. Please save your work.\"\n                        )\n                        print(\n                            \"----------------------------------------------------------------------------------------\"\n                        )\n                        traceback.print_exc(file=sys.stderr)\n                        self.FATAL_ERROR = True\n\n    # -----------------------------------------------------------------------------\n    def paintPlus(self, multi):\n        \"\"\"\n        This method creates a painter path for drawing the '+' character next\n        to an input socket.\n\n        :param multi: internal variable (1 when default orientation, -1 when flipped)\n        :type multi: int, required, 1 or -1\n        :return: the painter path to draw this sign\n        :rtype: QPainterPath\n        \"\"\"\n\n        path = QPainterPath(QPointF(multi * 2.5 * self.square, 0))\n        path.lineTo(multi * 4.5 * self.square - multi * 2, 0)\n        path.moveTo(multi * 3.5 * self.square - multi * 1, -self.square + 1)\n        path.lineTo(multi * 3.5 * self.square - multi * 1, self.square - 1)\n        return path\n\n    # -----------------------------------------------------------------------------\n    def paintMinus(self, multi):\n        \"\"\"\n        This method creates a painter path for drawing the '-' character next\n        to an input socket.\n\n        :param multi: internal variable (1 when default orientation, -1 when flipped)\n        :type multi: int, required, 1 or -1\n        :return: the painter path to draw this sign\n        :rtype: QPainterPath\n        \"\"\"\n\n        path = QPainterPath(QPointF(multi * 2.5 * self.square, 0))\n        path.lineTo(multi * 4.5 * self.square - multi * 2, 0)\n        return path\n\n    # -----------------------------------------------------------------------------\n    def paintMultiply(self, multi):\n        \"\"\"\n        This method creates a painter path for drawing the 'x' character next\n        to an input socket.\n\n        :param multi: internal variable (1 when default orientation, -1 when flipped)\n        :type multi: int, required, 1 or -1\n        :return: the painter path to draw this sign\n        :rtype: QPainterPath\n        \"\"\"\n\n        path = QPainterPath(QPointF(multi * 2.5 * self.square, -self.square + 1))\n        path.lineTo(multi * 4.5 * self.square - multi * 2, self.square - 1)\n        path.moveTo(multi * 4.5 * self.square - multi * 2, -self.square + 1)\n        path.lineTo(multi * 2.5 * self.square, self.square - 1)\n        return path\n\n    # -----------------------------------------------------------------------------\n    def paintDivide(self, multi):\n        \"\"\"\n        This method creates a painter path for drawing a divide sign character next\n        to an input socket.\n\n        :param multi: internal variable (1 when default orientation, -1 when flipped)\n        :type multi: int, required, 1 or -1\n        :return: the painter path to draw this sign\n        :rtype: QPainterPath\n        \"\"\"\n\n        path = QPainterPath(QPointF(multi * 2.5 * self.square, 0))\n        path.lineTo(multi * 4.5 * self.square - 1, 0)\n        path.moveTo(multi * 3.5 * self.square - 1, -self.square + 1)\n        path.addEllipse(multi * 3.5 * self.square - 1, -self.square + 1, 1, 1)\n        path.moveTo(multi * 3.5 * self.square - 1, self.square - 2)\n        path.addEllipse(multi * 3.5 * self.square - 1, self.square - 2, 1, 1)\n        return path\n\n    # Todo - doc comments\n    # -----------------------------------------------------------------------------\n    def charDimensions(self):\n\n        # Find how many pixels - height wise - this sockets' character is\n        (width, baseline), (\n            offset_x,\n            offset_y,\n        ) = self.socket.node.scene._system_font.font.getsize(self.socket.socket_sign)\n\n        char_width = QFontMetrics(self._char_font).width(self.socket.socket_sign)\n        height = 5\n\n        # For letters like: a,c,e,m,n,o,r,s,u,v,w,x,z\n        if baseline == 8 and offset_y == 5:\n            height = 5\n        # For letters like: b,d,f,h,i,k,l\n        elif baseline == 10 and offset_y == 3:\n            height = 7\n        # For letters like: g,p,q,y\n        elif baseline == 11 and offset_y == 5:\n            height = 4\n        # For letter: t\n        elif baseline == 11 and offset_y == 2:\n            height = 7\n\n        dimension = [char_width, height]\n\n        return dimension\n\n    # -----------------------------------------------------------------------------\n    def getSignPath(self, sign, multi):\n        \"\"\"\n        This method determines and returns what method should be called to paint\n        the sign (+,-,*,/) next to an input socket (for PROD and SUM blocks only).\n\n        :param sign: the sign associated with the current Socket (can be '+','-','*', or '/')\n        :type sign: str, required\n        :param multi: internal variable (1 when default orientation, -1 when flipped)\n        :type multi: int, required, 1 or -1\n        :return: the relevant painter path method for drawing the desired sign\n        :rtype: QPainterPath\n        \"\"\"\n\n        if sign == PLUS:\n            return self.paintPlus(multi)\n        if sign == MINUS:\n            return self.paintMinus(multi)\n        if sign == MULTIPLY:\n            return self.paintMultiply(multi)\n        if sign == DIVIDE:\n            return self.paintDivide(multi)\n\n    # Todo - doc comments\n    # -----------------------------------------------------------------------------\n    def shouldSocketsBeHidden(self):\n\n        # Check if the sockets belong to a connector type block\n        if (\n            self.socket.node.block_type == \"CONNECTOR\"\n            or self.socket.node.block_type == \"Connector\"\n        ):\n            # Check if the toolbar checkbox for hiding connector blocks has been selected\n            if self.socket.node.scene.hide_connector_blocks:\n                return True\n            else:\n                return False\n        else:\n            return False\n\n    # -----------------------------------------------------------------------------\n    def boundingRect(self):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by ``GraphicsSocket``\n        which returns the area within which the GraphicsSocket can be interacted with.\n        When a mouse click event is detected within this area, this will trigger logic\n        that relates to a Socket (that being, the generating or completion of a Wire).\n\n        :return: a rectangle within which the Socket can be interacted with\n        :rtype: QRectF\n        \"\"\"\n\n        return QRectF(\n            -self.radius - self.outline_width,\n            -self.radius - self.outline_width,\n            2 * (self.radius + self.outline_width),\n            2 * (self.radius + self.outline_width),\n        )\n"
  },
  {
    "path": "bdsim/bdedit/block_graphics_wire.py",
    "content": "# Library imports\nimport sys\nimport traceback\nfrom math import dist\n\n# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n# =============================================================================\n#\n#   Defining and setting global variables\n#\n# =============================================================================\n# Socket positioning variables - used for determining what side of the block the\n# socket should be drawn\nLEFT = 1\nTOP = 2\nRIGHT = 3\nBOTTOM = 4\n\n# Variable for enabling/disabling debug comments\nDEBUG = False\nDEBUG_COORDINATES = False\n\n\n# =============================================================================\n#\n#   Defining the GraphicsWire Class, which is inherited by all Wires and controls\n#   the graphical appearance of each Wire.\n#\n# =============================================================================\nclass GraphicsWire(QGraphicsPathItem):\n\n    # Handles for displaying cursors when trying to move wire segments\n    handleHSeg1 = 0\n    handleVSeg1 = 1\n    handleHSeg2 = 2\n    handleVSeg2 = 3\n    handleHSeg3 = 4\n\n    handleSize = +4.0\n\n    handleCursors = {\n        handleHSeg1: Qt.ArrowCursor,\n        handleVSeg1: Qt.SizeHorCursor,\n        handleHSeg2: Qt.SizeVerCursor,\n        handleVSeg2: Qt.SizeHorCursor,\n        handleHSeg3: Qt.ArrowCursor,\n    }\n\n    handleSegments = 5\n\n    \"\"\"\n    The ``GraphicsWire`` Class extends the ``QGraphicsPathItem`` Class from PyQt5.\n    This class is responsible for graphically drawing Wires between Sockets.\n\n    This class takes a Wire as an input and then looks for the coordinates of the\n    start and end socket defined within it. Then based on these coordinates,\n    connects them with a Wire of the selected type. It is also used to redraw\n    the wires when they are moved around, and if a wire is selected it will\n    redraw the wire thicker and in a different colour.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, wire):\n        \"\"\"\n        This method initializes an instance of the ``GraphicsWire`` Class. It\n        initially specifies the starting and ending sockets as being None, sets\n        the Wire to always be drawn underneath other items within the GraphicsScene,\n        and defines the colors with which the wire can be drawn.\n\n        :param wire: the Wire Class instance this GraphicsWire relates to\n        :type wire: Wire\n        \"\"\"\n\n        super().__init__()\n\n        # Dictionary for storing which mouse cursor to display when mouse hovering over\n        # vertical or horizontal wire segment\n        self.segment_handles = {}\n        self.handleSelected = None\n        self.mousePressPos = None\n\n        self.wire = wire\n\n        # Setting the colour, pens, and pen thickness\n        self._color = QColorConstants.Svg.black\n        self._color_selected = QColorConstants.Svg.orange\n\n        # self._pen = QPen(self._color, 5, Qt.SolidLine, Qt.SquareCap, Qt.BevelJoin)\n        self._pen = QPen(self._color, 5, Qt.SolidLine, Qt.SquareCap, Qt.RoundJoin)\n        self._pen_selected = QPen(\n            self._color_selected, 8, Qt.SolidLine, Qt.SquareCap, Qt.BevelJoin\n        )\n\n        # Initializing the start and end sockets\n        self.posSource = [0, 0]\n        self.posDestination = [100, 100]\n\n        self.posSource_Orientation = None\n        self.posDestination_Orientation = None\n\n        # Method called to further intialize necessary block settings\n        self.initUI()\n\n        # Internal variables for:\n        # * knowing if wire segments were moved since diagram was saved\n        # * setting which routing logic to display (custom or hard-coded)\n        # * catching fatal errors, and allowing user to save work before crashing\n        self.wasMoved = False\n        self.customlogicOverride = False\n        self.FATAL_ERROR = False\n\n    # -----------------------------------------------------------------------------\n    def initUI(self):\n        \"\"\"\n        This method sets flags to allow for this Wire to be selectable and be\n        displayed at the correct z-level.\n        \"\"\"\n\n        # Setting the wire to be selectable and drawn behind all items\n        self.setFlag(QGraphicsItem.ItemIsSelectable)\n        self.setFlag(QGraphicsItem.ItemSendsGeometryChanges)\n        self.setFlag(QGraphicsItem.ItemIsFocusable)\n        self.setAcceptHoverEvents(True)\n        self.setZValue(-1)\n\n    # -----------------------------------------------------------------------------\n    def setSource(self, x, y):\n        \"\"\"\n        This method sets the point from where the Wire will start. This is\n        based on the position of the start Socket.\n\n        :param x: x coordinate of the start Socket\n        :type x: int, required\n        :param y: y coordinate of the start Socket\n        :type y: int, required\n        \"\"\"\n\n        self.posSource = [x, y]\n\n    # -----------------------------------------------------------------------------\n    def setDestination(self, x, y):\n        \"\"\"\n        This method sets the point of where the Wire will end. This is\n        based on the position of the end Socket.\n\n        :param x: x coordinate of the end Socket\n        :type x: int, required\n        :param y: y coordinate of the end Socket\n        :type y: int, required\n        \"\"\"\n\n        self.posDestination = [x, y]\n\n    # -----------------------------------------------------------------------------\n    def setSourceOrientation(self, orientation):\n        \"\"\"\n        This method sets the orientation (position) of the source (start)\n        Socket - in terms of where it is drawn on the block (LEFT/RIGHT) - to\n        the provided orientation.\n\n        :param orientation: where on the Block the start Socket is drawn (LEFT(1) or RIGHT(2))\n        :type orientation: enumerate, required\n        \"\"\"\n\n        self.posSource_Orientation = orientation\n\n    # -----------------------------------------------------------------------------\n    def setDestinationOrientation(self, orientation):\n        \"\"\"\n        This method sets the orientation (position) of the destination (end)\n        Socket - in terms of where it is drawn on the block (LEFT/RIGHT) - to\n        the provided orientation.\n\n        :param orientation: where on the Block the end Socket is drawn (LEFT(1) or RIGHT(2))\n        :type orientation: enumerate, required\n        \"\"\"\n\n        self.posDestination_Orientation = orientation\n\n    # Todo add doc to describe purpose of this method (overrides the shape this drawn path takes, with custom path)\n    # This method is used by PyQt to interpret the bounding box area within which this line can be interacted with\n    # -----------------------------------------------------------------------------\n    def shape(self):\n        return self.polyPath()\n\n    # -----------------------------------------------------------------------------\n    def paint(self, painter, style, widget=None):\n        \"\"\"\n        This is an inbuilt method of QGraphicsItem, that is overwritten by ``GraphicsWire``.\n        This method is automatically called by the GraphicsView Class whenever even\n        a slight user-interaction is detected within the Scene.\n\n        It sets up the painter object and draws the line based on the path that\n        will be set by the specific implementation of GraphicsWire that is\n        calling paint. Then the painter will select the way the wire will be\n        drawn depending on whether or not the wire is selected.\n\n        :param painter: a painter that paints the path (line) of this GraphicsWire\n        :type painter: QPainter, automatically recognized and overwritten from this method\n        :param style: style of the painter (isn't used but must be defined)\n        :type style: QStyleOptionGraphicsItem, automatically recognized from this method\n        :param widget: the widget this class is being painted on (None)\n        :type widget: NoneType, optional, Defaults to None\n        \"\"\"\n\n        # Update the wire with the drawn intersection point(s)\n        try:\n            self.setPath(self.updatePath())\n            painter.setPen(self._pen if not self.isSelected() else self._pen_selected)\n            painter.setBrush(Qt.NoBrush)\n            painter.drawPath(self.path())\n\n            # if self.isSelected():\n            #     painter.setRenderHint(QPainter.Antialiasing)\n            #     painter.setBrush(QBrush(QColor(\"#FFFF4538\")))\n            #     painter.setPen(QPen(QColor(0, 0, 0, 255), 1.0, Qt.SolidLine, Qt.RoundCap, Qt.RoundJoin))\n            #     for handle, rect in self.segment_handles.items():\n            #         if rect:\n            #             painter.drawRect(rect)\n\n        except Exception as e:\n            if self.FATAL_ERROR == False:\n                print(\n                    \"-------------------------------------------------------------------------\"\n                )\n                print(\n                    \"Caught fatal exception while trying to draw wires. Please save your work.\"\n                )\n                print(\n                    \"-------------------------------------------------------------------------\"\n                )\n                traceback.print_exc(file=sys.stderr)\n                self.FATAL_ERROR = True\n\n    # Todo - add docstring to this new method, add inline comments (makes custom polygon around drawn line)\n    # -----------------------------------------------------------------------------\n    def polyPath(self):\n        if self.wire.wire_coordinates:\n            newpolyPath = QPainterPath()\n\n            width = 8\n\n            self.wire_points = []\n            (p1x, p1y) = self.wire.wire_coordinates[0]\n            self.wire_points.append(QPointF(p1x, p1y))\n\n            for i, (x, y) in enumerate(self.wire.wire_coordinates):\n                if i == 0 or i == len(self.wire.wire_coordinates):\n                    self.wire_points.append(QPointF(x, y + width))\n                else:\n                    self.wire_points.append(QPointF(x + width, y + width))\n\n            for i, (x, y) in enumerate(reversed(self.wire.wire_coordinates)):\n                if i == 0 or i == len(self.wire.wire_coordinates):\n                    self.wire_points.append(QPointF(x, y - width))\n                else:\n                    self.wire_points.append(QPointF(x - width, y - width))\n\n            poly = QPolygonF(self.wire_points)\n            newpolyPath.addPolygon(poly)\n\n            return newpolyPath\n        else:\n            return self.updatePath()\n\n    # -----------------------------------------------------------------------------\n    def updatePath(self):\n        \"\"\"\n        This method is inherited and overwritten (currently) by the GraphicsWireDirect,\n        GraphicsWireBezier or GraphicsWireStep classes, which dictate the pathing\n        logic of the wire between the start and end socket.\n        \"\"\"\n\n        raise NotImplemented(\"This method is to be over written by child class\")\n\n    # -----------------------------------------------------------------------------\n    def updateCursorSegments(self, segments):\n        \"\"\"\n        This method updates which mouse cursor should be displayed for each line segment of\n        the wire, depending on how many wire segments there are, which is given as an input.\n        :param segments: Number of line segments in this wire\n        :type segments: int\n        \"\"\"\n\n        # Upate cursor handles\n        if segments == 5:\n            self.handleCursors[self.handleHSeg1] = Qt.ArrowCursor\n            self.handleCursors[self.handleVSeg1] = Qt.SizeHorCursor\n            self.handleCursors[self.handleHSeg2] = Qt.SizeVerCursor\n            self.handleCursors[self.handleVSeg2] = Qt.SizeHorCursor\n            self.handleCursors[self.handleHSeg3] = Qt.ArrowCursor\n            self.handleSegments = 5\n\n        elif segments == 3:\n            self.handleCursors = self.handleCursors.fromkeys(\n                self.handleCursors.keys(), Qt.ArrowCursor\n            )\n            self.handleCursors[self.handleVSeg1] = Qt.SizeHorCursor\n            self.handleSegments = 3\n\n        else:\n            self.handleCursors = self.handleCursors.fromkeys(\n                self.handleCursors.keys(), Qt.ArrowCursor\n            )\n            self.handleSegments = segments\n\n    # -----------------------------------------------------------------------------\n    def updateLineSegments(self):\n        \"\"\"\n        This method uses the coordinates of the points this wire goes through, to\n        determine the coordinates that make up the horizontal and vertical line\n        segments of this wire (this logic is only applicable to GraphicsWireStep).\n        \"\"\"\n\n        # If the wire coordinates exist\n        if self.wire.wire_coordinates:\n            # Clear current horizontal and vertical segemnt lists, and clear cursor handles\n            self.wire.horizontal_segments.clear()\n            self.wire.vertical_segments.clear()\n            self.segment_handles = self.segment_handles.fromkeys(\n                self.segment_handles.keys(), None\n            )\n\n            # Find max number of segments in our line\n            max_seg = len(self.wire.wire_coordinates) - 1\n\n            # From first to 2nd last coordinate point of the wire\n            for counter in range(0, max_seg):\n                # Find top left and btm right points\n                top_left = min(\n                    (\n                        self.wire.wire_coordinates[counter],\n                        self.wire.wire_coordinates[counter + 1],\n                    )\n                )\n                btm_right = max(\n                    (\n                        self.wire.wire_coordinates[counter],\n                        self.wire.wire_coordinates[counter + 1],\n                    )\n                )\n                s = self.handleSize\n\n                # Line segments always alternate, from horizontal to vertical to horizontal etc.\n                # Even iterations of coordinate points are always the beginning to horizontal segments\n                # Append a line represented as ((x1,y2),(x2,y2)) to either horizontal or vertical line segment list\n                if counter % 2 == 0:\n                    # Current and next coordinates are added into the horizontal line segments list\n                    self.wire.horizontal_segments.append(\n                        [\n                            self.wire.wire_coordinates[counter],\n                            self.wire.wire_coordinates[counter + 1],\n                        ]\n                    )\n                    # Update rectangles for horizontal segments\n                    self.segment_handles[counter] = QRectF(\n                        QPointF(top_left[0] + s, top_left[1] - s),\n                        QPointF(btm_right[0] - s, btm_right[1] + s),\n                    )\n\n                else:\n                    # Current and next coordinates are added into the vertical line segments list\n                    self.wire.vertical_segments.append(\n                        [\n                            self.wire.wire_coordinates[counter],\n                            self.wire.wire_coordinates[counter + 1],\n                        ]\n                    )\n                    # Update rectangles for vertical segments\n                    self.segment_handles[counter] = QRectF(\n                        QPointF(top_left[0] - s, top_left[1] + s),\n                        QPointF(btm_right[0] + s, btm_right[1] - s),\n                    )\n\n            # Upate cursor handles\n            if self.handleSegments != max_seg:\n                self.updateCursorSegments(max_seg)\n\n    # -----------------------------------------------------------------------------\n    def updateWireCoordinates(self, new_coordinates):\n        \"\"\"\n        This method checks if the list of coordinate points this wire passes through,\n        has changed and needs to be updated. This method reduces the computational\n        resources required to otherwise re-write the list of coordinate points for\n        this wire, every time a user-interaction is detected within the GraphicsView.\n\n        :param new_coordinates: proposed coordinate points for this Wire\n        :type new_coordinates: list\n        \"\"\"\n\n        # Update current wire coordinates, if the new coordinates are different\n        # Also update the horizontal and vertical line segments\n        if new_coordinates != self.wire.wire_coordinates:\n            self.wire.wire_coordinates.clear()\n            self.wire.wire_coordinates = new_coordinates\n            self.updateLineSegments()\n\n            # If in DEBUG mode, this code will print the coordinates list and the\n            # separated horizontal and vertical line segments of this Wire\n            if DEBUG_COORDINATES:\n                print(\"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\")\n            if DEBUG_COORDINATES:\n                print(\"coordinates:\", [self.wire.wire_coordinates])\n            if DEBUG_COORDINATES:\n                print(\"\\nhorizontal lines:\", [self.wire.horizontal_segments])\n            if DEBUG_COORDINATES:\n                print(\"\\nvertical lines:\", [self.wire.vertical_segments])\n            if DEBUG_COORDINATES:\n                print(\"\\nline segments:\")\n            if DEBUG_COORDINATES:\n                [\n                    print(\"segment\" + str(i) + \":\", segment)\n                    for i, segment in enumerate(self.segment_handles.items())\n                ]\n            if DEBUG_COORDINATES:\n                print(\"-------------------------------------------------------\")\n\n    # -----------------------------------------------------------------------------\n    def handleAt(self, point):\n        \"\"\"\n        Returns the resize handle below the given point.\n        \"\"\"\n        for (\n            k,\n            v,\n        ) in self.segment_handles.items():\n            if v is None:\n                return None\n            elif v.contains(point):\n                return k\n        return None\n\n    # -----------------------------------------------------------------------------\n    def hoverMoveEvent(self, moveEvent):\n        \"\"\"\n        Executed when the mouse moves over the shape (NOT PRESSED).\n        \"\"\"\n        if self.isSelected():\n            handle = self.handleAt(moveEvent.pos())\n            # print(\"handle:\", handle)\n            cursor = Qt.ArrowCursor if handle is None else self.handleCursors[handle]\n            self.setCursor(cursor)\n        super().hoverMoveEvent(moveEvent)\n\n    # -----------------------------------------------------------------------------\n    def hoverLeaveEvent(self, moveEvent):\n        \"\"\"\n        Executed when the mouse leaves the shape (NOT PRESSED).\n        \"\"\"\n        self.setCursor(Qt.ArrowCursor)\n        super().hoverLeaveEvent(moveEvent)\n\n    # -----------------------------------------------------------------------------\n    def mousePressEvent(self, mouseEvent):\n        \"\"\"\n        Executed when the mouse is pressed on the item.\n        \"\"\"\n        self.wire.setFocusOfWire()\n\n        self.handleSelected = self.handleAt(mouseEvent.pos())\n        if self.handleSelected is not None:\n            self.mousePressPos = mouseEvent.pos()\n            self.mousePressRect = self.segment_handles[self.handleSelected]\n\n        super().mousePressEvent(mouseEvent)\n\n    # -----------------------------------------------------------------------------\n    def mouseMoveEvent(self, mouseEvent):\n        \"\"\"\n        Executed when the mouse is being moved over the item while being pressed.\n        \"\"\"\n\n        if self.handleSelected is not None:\n            if not self.customlogicOverride:\n                self.customlogicOverride = True\n\n            self.interactiveResize(mouseEvent.pos())\n            self.wasMoved = True\n            self.wire.checkIntersections()\n        else:\n            super().mouseMoveEvent(mouseEvent)\n\n    # -----------------------------------------------------------------------------\n    def mouseReleaseEvent(self, mouseEvent):\n        \"\"\"\n        Executed when the mouse is released from the item.\n        \"\"\"\n        super().mouseReleaseEvent(mouseEvent)\n        self.handleSelected = None\n        self.mousePressPos = None\n        self.mousePressRect = None\n        self.update()\n\n        # If wire segments have been moved, update the variable within the model, to then\n        # update the title of the model, to indicate that there is unsaved progress\n        if self.wasMoved:\n            self.wasMoved = False\n            self.wire.scene.has_been_modified = True\n            self.wire.scene.history.storeHistory(\"Wire segment moved\")\n\n    # -----------------------------------------------------------------------------\n    def interactiveResize(self, mousePos):\n        \"\"\"\n        Perform shape interactive resize.\n        \"\"\"\n        diff = QPointF(0, 0)\n\n        x_diff = mousePos.x() - self.mousePressPos.x()\n        y_diff = mousePos.y() - self.mousePressPos.y()\n\n        # Quantize resizing of grouping box\n        spacing = 10\n        x = round(x_diff / spacing) * spacing\n        y = round(y_diff / spacing) * spacing\n\n        # Calculate how far the mouse has moved from the point it was initially clicked from\n        fromCenter = self.mousePressRect.center()\n        toX = fromCenter.x() + x\n        toY = fromCenter.y() + y\n\n        custom_wire_coordinates = self.wire.wire_coordinates.copy()\n\n        self.prepareGeometryChange()\n\n        # If there are three segments, 1st and last segments cannot be moved (which are horizontally attacked to the sockets)\n        # so this leaves only the vertical segment connecting them. If that segment is dragged, adjust the points accordingly.\n        # If any other segments are being dragged, don't do anything\n        if self.handleSegments == 3:\n\n            if self.handleSelected == self.handleVSeg1:\n                # Only 1 vertical segment in this case, so take the first vert segment [0]\n                segment = self.wire.vertical_segments[0].copy()\n                # Copy that segment, and add the difference the mouse has moved to the x [0] coord of the two points that make up this segment\n                for i, point in enumerate(segment.copy()):\n                    new_point = list(point)\n                    new_point[0] = toX\n                    segment[i] = tuple(new_point)\n                # Override the points making up this semgent in the temporary wire_coordinates -> 2nd and 3rd points [1:3]\n                custom_wire_coordinates[1:3] = segment\n\n        # Otherwise if there are five segments, since first and last segment cannot be moved, this leaves us with 3 segments which can\n        # Two vertical segments, and one horizontal segment. If any of those three are selected, adjust the points accordingly.\n        elif self.handleSegments == 5:\n\n            if self.handleSelected == self.handleHSeg2:\n                # There are three horizontal segments to choose from, 1st and 3rd (last) cannot be moved, this means our segment is #2 [1].\n                segment = self.wire.horizontal_segments[1].copy()\n                # Copy that segment, and add the difference the mouse has moved to the y [1]) coord of the two points that make up this segment\n                for i, point in enumerate(segment.copy()):\n                    new_point = list(point)\n                    new_point[1] = toY\n                    segment[i] = tuple(new_point)\n                # Override the points making up this semgent in the temporary wire_coordinates -> 3rd and 4th points [2:4]\n                custom_wire_coordinates[2:4] = segment\n\n            elif self.handleSelected in [self.handleVSeg1, self.handleVSeg2]:\n                # There are two vertical segments to choose from, either can be moved as they do not attach directly to a socket.\n                if self.handleSelected == self.handleVSeg1:\n                    segment = self.wire.vertical_segments[0].copy()\n                else:\n                    segment = self.wire.vertical_segments[1].copy()\n                # Copy that segment, and add the difference the mouse has moved to the x [0]) coord of the two points that make up this segment\n                for i, point in enumerate(segment.copy()):\n                    new_point = list(point)\n                    new_point[0] = toX\n                    segment[i] = tuple(new_point)\n                # Override the points making up this semgent in the temporary wire_coordinates. Since we can either select the 1st or 2nd\n                # vertical segment, these points correspond to 2nd and 3rd points [1:3] or the 4th and 5th points [3:5]\n                if self.handleSelected == self.handleVSeg1:\n                    custom_wire_coordinates[1:3] = segment\n                else:\n                    custom_wire_coordinates[3:5] = segment\n\n        self.updateWireCoordinates(custom_wire_coordinates)\n\n        self.updatePath()\n\n    # -----------------------------------------------------------------------------\n    def adjustCustomRoutingWireCoordinates(self):\n        # When both blocks connected to a wire are being moved, both start and end sockets\n        # that this wire is connected to will move the same amount. So we will just grab\n        # the data from the start_socket.\n\n        # Start sockets could be an input or output socket, so find its true position w.r.t its block\n        start_point = (\n            self.wire.start_socket.node.grBlock.pos()\n            + self.wire.start_socket.grSocket.pos()\n        )\n        start_coords = (start_point.x(), start_point.y())\n\n        # print(\"\\nsocket coords:\", [start_coords])\n        # print(\"wire coords:\", self.wire.wire_coordinates)\n\n        # Wire can be drawn from either input to output socket, or output to input socket. This means\n        # our start_socket can either be the first or last point in the wire.wire_coordinates list\n        # Check which of these are closest to our start_socket_coords, then take the difference between those\n\n        dist1 = dist(start_coords, self.wire.wire_coordinates[0])\n        dist2 = dist(start_coords, self.wire.wire_coordinates[-1])\n\n        # Take difference between start_socket_coords and whichever point is closest from wire.wire_coordinates\n        if dist1 < dist2:\n            diff = [\n                start_coords[0] - self.wire.wire_coordinates[0][0],\n                start_coords[1] - self.wire.wire_coordinates[0][1],\n            ]\n        else:\n            diff = [\n                start_coords[0] - self.wire.wire_coordinates[-1][0],\n                start_coords[1] - self.wire.wire_coordinates[-1][1],\n            ]\n\n        # print(\"difference:\", diff)\n\n        # If there is a difference, then adjust the wire coordinates\n        if diff == [0, 0]:\n            return\n\n        # Adjust wire.wire_coordinates by subtracting that diff from each point\n        new_wire_coordinates = []\n        for point in self.wire.wire_coordinates:\n            new_point = (point[0] + diff[0], point[1] + diff[1])\n            new_wire_coordinates.append(new_point)\n\n        # print(\"old wire coords before:\", self.wire.wire_coordinates)\n        # print(\"new_wire_coords:       \", new_wire_coordinates)\n\n        # Once points are adjusted, replace the wire.wire_coordinates list with this list\n        self.updateWireCoordinates(new_wire_coordinates)\n        # print(\"old wire coords after: \", self.wire.wire_coordinates)\n\n\nclass GraphicsWireDirect(GraphicsWire):\n    \"\"\"\n    The ``GraphicsWireDirect`` Class extends the ``GraphicsWire`` Class from BdEdit.\n    This class is responsible for providing a straight painter path that the\n    GraphicsWire class should follow when drawing the Wire. This wire type will draw\n    a straight line between two Sockets. It will take the shortest distance between\n    these two points, and will go through other Blocks to do so.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def updatePath(self):\n        \"\"\"\n        This method creates a painter path that connects two points (start/end sockets)\n        with a straight line.\n        \"\"\"\n\n        # A straight line is drawn between the two provided points\n        path = QPainterPath(QPointF(self.posSource[0], self.posSource[1]))\n        path.lineTo(self.posDestination[0], self.posDestination[1])\n        return path\n\n\nclass GraphicsWireBezier(GraphicsWire):\n    \"\"\"\n    The ``GraphicsWireBezier`` Class extends the ``GraphicsWire`` Class from BdEdit.\n    This class is responsible for providing a bezier painter path that the\n    GraphicsWire class should follow when drawing the Wire. This wire type option\n    looks good in the first direction it is drawn (e.g. left-to-right) but will not\n    wrap logically when blocks are flipped or moved past each other (e.g. such that\n    the wire would now be right-to-left).\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def updatePath(self):\n        \"\"\"\n        This method creates a painter path that connects two points (start/end sockets)\n        with a bezier line. This line is drawn as a cubic (think sine wave).\n        \"\"\"\n\n        # The start and end coordinates are grabbed into variables s and d\n        s = self.posSource\n        d = self.posDestination\n\n        # This code decides the direction the bezier should point from the start socket\n        # either left or right of the start socket.\n        dist = (d[0] - s[0]) * 0.5\n        if s[0] > d[0]:\n            dist *= -1\n\n        # Then a cubic line is drawn between the two provided points\n        path = QPainterPath(QPointF(self.posSource[0], self.posSource[1]))\n        path.cubicTo(\n            s[0] + dist,\n            s[1],\n            d[0] - dist,\n            d[1] - dist,\n            self.posDestination[0],\n            self.posDestination[1],\n        )\n        return path\n\n\nclass GraphicsWireStep(GraphicsWire):\n    \"\"\"\n    The ``GraphicsWireStep`` Class extends the ``GraphicsWire`` Class from BdEdit.\n    This class is responsible for providing a stepped painter path that the\n    GraphicsWire class should follow when drawing the Wire. This is the default wire\n    style used within BdEdit, and has the most supporting logic built around it.\n\n    This wire option draws a straight line between two sockets when the two blocks\n    side by side at equal heights, are connected with a wire in the middle.\n\n    Otherwise if the two blocks are at varying heights, a stepped line will be drawn\n    from the starting socket, with 90 degree bends at each point the wire must turn\n    to reach the end socket.\n    \"\"\"\n\n    def updatePath(self):\n        if self.customlogicOverride:\n\n            self.adjustCustomRoutingWireCoordinates()\n\n            # The path of the wire is set to be drawn with either\n            # custom routing logic or with hard-coded routing logic\n            for i, (x, y) in enumerate(self.wire.wire_coordinates):\n                if i == 0:\n                    path = QPainterPath(QPointF(x, y))\n                elif i == len(self.wire.wire_coordinates):\n                    path.lineTo(x, y)\n                    path.moveTo(x, y)\n                else:\n                    path.lineTo(x, y)\n            return path\n        else:\n            return self.wireRoutingLogic()\n\n    # -----------------------------------------------------------------------------\n    def wireRoutingLogic(self):\n        \"\"\"\n        This method creates a painter path that connects two points (start/end sockets)\n        with a stepped line. This path is returned as a straight line if two blocks\n        at equal heights, are connected with a wire on the inside of each of the blocks.\n        Otherwise the path is returned as a stepped line with 90 degree bends at each\n        point the wire must turn.\n\n        The logic for when this wire should turn is calculated internally. Please refer\n        to the technical document accompanying the BdEdit code for visual explanations\n        for how this logic is determined.\n        \"\"\"\n\n        try:\n            # _____________________________________ Preparing Wire related variables ______________________________________\n\n            # List into which the coordinate points of the wire will be appended into when\n            # this wire is updated. This will be compared against the current list of this\n            # wires' coordinates, to check if it needs to be updated\n            temporary_wire_coordinates = []\n            # This variable prevents a stepped wire from being drawn until it is connected\n            # to the end socket. Until then a straight line will be drawn\n            wire_completed = False\n\n            # Block padding is the space at which wires will be wrapped around blocks\n            block_padding = 20\n\n            # The title height is extracted from the block this wire starts from\n            title_height = self.wire.start_socket.node.grBlock.title_height - 5\n\n            # __________________________________ Extracting Logic of Start/End Sockets ____________________________________\n\n            # The global (scene) x,y coordinates of the source (start) and destination (end) sockets are extracted\n            sx = self.posSource[0]\n            sy = self.posSource[1]\n            dx = self.posDestination[0]\n            dy = self.posDestination[1]\n            # The horizontal distance between these two sockets is found\n            xDist = (dx - sx) / 2\n\n            # The index at which the start socket is drawn on its block is extracted + 1\n            # (0th index will be our first index, as this variable is used as a multiplier)\n            s_index = self.wire.start_socket.index + 1\n\n            # Dimensions of the start sockets' block are extracted\n            source_block_width = self.wire.start_socket.node.width\n            source_block_height = self.wire.start_socket.node.height\n\n            # The local (in reference to its block) x-y coordinates of the start socket\n            s_Offset = self.wire.start_socket.getSocketPosition()\n\n            # Same logic (as above) is extracted for the destination (end) socket if it has been set\n            if self.wire.end_socket is not None:\n                d_index = self.wire.end_socket.index + 1\n                destination_block_width = self.wire.end_socket.node.width\n                destination_block_height = self.wire.end_socket.node.height\n                d_Offset = self.wire.end_socket.getSocketPosition()\n            else:\n                d_index = 0\n                destination_block_width = 0\n                destination_block_height = 0\n                d_Offset = [0, 0]\n\n            # The previous temporary coordinates of this wire are cleared, and the new start point coordinate is added\n            temporary_wire_coordinates.clear()\n            temporary_wire_coordinates.append((sx, sy))\n\n            # ###########################################  Start of Wire Logic  ##########################################\n\n            # ======================================  If Wire hasn't been completed  =====================================\n            if self.wire.end_socket is None:\n                # If two sockets haven't been connected yet\n\n                # Don't do anything, start and end points of the path have already been defined, so a straight line will be drawn\n                if DEBUG:\n                    print(\"Wire style: O\")\n                pass\n\n            # =========================  Start & End Sockets are on the same side of two Blocks  =========================\n            elif self.posSource_Orientation == self.posDestination_Orientation:\n                # If sockets are both on the same side (both coming out of the left or right)\n\n                # -----------------------------------  Start Socket LEFT OF End Socket  ----------------------------------\n                if sx < dx:\n                    # - - - - - - - - - - - - Continue with Extracted Logic of Start/End Sockets - - - - - - - - - - - - -\n                    # Continue path from source\n                    # Destination_block & Source_block are kept the same\n                    pass\n\n                # ------------------------------  Start Socket EQUAL or RIGHT OF End Socket  -----------------------------\n                else:\n                    # - - - - - - - - - - - Re-Extract Logic of Start/End Sockets (Switching them) - - - - - - - - - - - -\n                    # Use the same logic as for above, but swap positions of start socket with end socket\n                    sx, sy = self.posDestination[0], self.posDestination[1]\n                    dx, dy = self.posSource[0], self.posSource[1]\n\n                    # Destination_block & Source_block = node of start_socket and end_socket respectively\n                    d_index = self.wire.start_socket.index + 1\n                    destination_block_width = self.wire.start_socket.node.width\n                    destination_block_height = self.wire.start_socket.node.height\n\n                    # Switch the indexes of the sockets\n                    if self.wire.end_socket is not None:\n                        s_index = self.wire.end_socket.index + 1\n                        source_block_width = self.wire.end_socket.node.width\n                        source_block_height = self.wire.end_socket.node.height\n                    else:\n                        s_index = 0\n                        source_block_width = 0\n                        source_block_height = 0\n\n                    # Restart path from destination\n                    temporary_wire_coordinates.clear()\n                    temporary_wire_coordinates.append((sx, sy))\n\n                # -------------------------------  End Socket on RHS of Destination Block  -------------------------------\n                if self.posDestination_Orientation == RIGHT:\n                    # xDist is from RHS of source block, to LHS of destination block\n                    xDist = (dx - destination_block_width - sx) / 2\n\n                    # Top of the destination block is above source block\n                    # Should be dy > sy, but graphics view draws the y-axis inverted\n                    if dy - d_Offset[1] - (d_index * block_padding) < sy:\n\n                        # Bottom of destination block is above top of source block OR\n                        # LHS of destination block is further left than RHS of source block\n\n                        # Wire from multiple sockets spaced from bottom of destination block at index (no overlap)\n                        if (\n                            dy\n                            - d_Offset[1]\n                            + destination_block_height\n                            + title_height\n                            + (d_index * block_padding)\n                            < sy\n                        ) or (sx + xDist <= sx + (block_padding / 2)):\n                            if DEBUG:\n                                print(\"Wire style: A\")\n                            # Draw C (inverted equivalent) line from S up to D, clipped to RHS of destination block\n                            # ----------------------\n                            #       (d-block)-<-|\n                            #                   |\n                            #  (s-block)->------|\n                            # ----------------------\n\n                            temporary_wire_coordinates.append(\n                                (dx + (d_index * block_padding), sy)\n                            )\n                            temporary_wire_coordinates.append(\n                                (dx + (d_index * block_padding), dy)\n                            )\n\n                        # Bottom of destination block is equal to or below top of source block\n                        else:\n                            if DEBUG:\n                                print(\"Wire style: B\")\n                            # Draw wrapped line between source and destination block, then above and around destination block\n                            # --------------------------------\n                            #              |---------------|\n                            #              |               |\n                            #              |   (d-block)-<-|\n                            #              |\n                            #  (s-block)->-|\n                            # --------------------------------\n\n                            temporary_wire_coordinates.append((sx + xDist, sy))\n                            temporary_wire_coordinates.append(\n                                (\n                                    sx + xDist,\n                                    dy - d_Offset[1] - (d_index * block_padding),\n                                )\n                            )\n                            temporary_wire_coordinates.append(\n                                (\n                                    dx + d_index * block_padding,\n                                    dy - d_Offset[1] - (d_index * block_padding),\n                                )\n                            )\n                            temporary_wire_coordinates.append(\n                                (dx + d_index * block_padding, dy)\n                            )\n\n                    # Top of destination block is equal to or below source block socket\n                    else:\n                        if DEBUG:\n                            print(\"Wire style: C\")\n                        # Draw C (inverted equivalent) line from S down to D, clipped to RHS of destination block\n                        # ------------------------\n                        #   (s-block)->---------|\n                        #                       |\n                        #           (d-block)-<-|\n                        # ------------------------\n\n                        temporary_wire_coordinates.append(\n                            (dx + d_index * block_padding, sy)\n                        )\n                        temporary_wire_coordinates.append(\n                            (dx + d_index * block_padding, dy)\n                        )\n\n                # -------------------------------  End Socket on LHS of Destination Block  -------------------------------\n                else:\n                    # xDist is from RHS of source block, to LHS of destination block\n                    xDist = (dx - (sx + source_block_width)) / 2\n\n                    # Should be sy > dy, but graphics view draws the y-axis inverted\n                    # Top of source block is above destination block\n                    if sy - s_Offset[1] - (s_index * block_padding) < dy:\n                        # Bottom of source block is above top of destination block OR\n                        # RHS of source block further left than LHS of destination block\n\n                        # Wire from multiple sockets spaced from bottom of source block at index (no overlap)\n                        if (\n                            sy\n                            - s_Offset[1]\n                            + source_block_height\n                            + title_height\n                            + (s_index * block_padding)\n                            < dy\n                        ) or (dx + xDist <= dx + (block_padding / 2)):\n                            if DEBUG:\n                                print(\"Wire style: D\")\n                            # Draw C line from S down to D, clipped to LHS of source block\n                            # ----------------------\n                            #  |--<-(s-block)\n                            #  |\n                            #  |----->-(d-block)\n                            # ----------------------\n\n                            temporary_wire_coordinates.append(\n                                (sx - (s_index * block_padding), sy)\n                            )\n                            temporary_wire_coordinates.append(\n                                (sx - (s_index * block_padding), dy)\n                            )\n\n                        # Bottom of source block is equal to or below top of destination block\n                        else:\n                            if DEBUG:\n                                print(\"Wire style: E\")\n                            # Draw wrapped line above and around the source block, then between the source and destination block\n                            # --------------------------------\n                            #  |---------------|\n                            #  |               |\n                            #  |-<-(s-block)   |\n                            #                  |\n                            #                  |->-(d-block)\n                            # --------------------------------\n\n                            temporary_wire_coordinates.append(\n                                (sx - s_index * block_padding, sy)\n                            )\n                            temporary_wire_coordinates.append(\n                                (\n                                    sx - s_index * block_padding,\n                                    sy - s_Offset[1] - (s_index * block_padding),\n                                )\n                            )\n                            temporary_wire_coordinates.append(\n                                (\n                                    sx + source_block_width + xDist,\n                                    sy - s_Offset[1] - (s_index * block_padding),\n                                )\n                            )\n                            temporary_wire_coordinates.append(\n                                (sx + source_block_width + xDist, dy)\n                            )\n\n                    # Top of source block is equal to or below destination block\n                    else:\n                        if DEBUG:\n                            print(\"Wire style: F\")\n                        # Draw C line from S up to D, clipped to LHS of source block\n                        # --------------------\n                        # |------->-(d-block)\n                        # |\n                        # |-<-(s-block)\n                        # --------------------\n\n                        temporary_wire_coordinates.append(\n                            (sx - s_index * block_padding, sy)\n                        )\n                        temporary_wire_coordinates.append(\n                            (sx - s_index * block_padding, dy)\n                        )\n\n                # Update boolean that wire is completed, as to get here, the end point of the wire must be dropped\n                wire_completed = True\n\n            # ========================  Start & End Sockets are on opposite sides of two blocks  =========================\n            elif self.posSource_Orientation != self.posDestination_Orientation:\n                # Otherwise sockets are on different sides (out from left into right, or out of right into left)\n\n                # --------------------------------  Start Socket on LHS of Source Block  ---------------------------------\n                if self.posSource_Orientation == LEFT:\n                    # - - - - - - - - - - - - Continue with Extracted Logic of Start/End Sockets - - - - - - - - - - - - -\n                    # Continue path from source\n                    # Destination_block & Source_block are kept the same\n                    xDist = (sx - dx) / 2\n\n                # --------------------------------  Start Socket on RHS of Source Block  ---------------------------------\n                else:\n                    # - - - - - - - - - - - Re-Extract Logic of Start/End Sockets (Switching them) - - - - - - - - - - - -\n                    # Use the same logic as for above, but swap positions of start socket with end socket\n                    sx, sy = self.posDestination[0], self.posDestination[1]\n                    dx, dy = self.posSource[0], self.posSource[1]\n\n                    # Destination_block & Source_block = node of start_socket and end_socket respectively\n                    d_index = self.wire.start_socket.index + 1\n                    destination_block_width = self.wire.start_socket.node.width\n                    destination_block_height = self.wire.start_socket.node.height\n                    d_Offset = self.wire.start_socket.getSocketPosition()\n\n                    # Switch the indexes of the sockets\n                    if self.wire.end_socket is not None:\n                        s_index = self.wire.end_socket.index + 1\n                        source_block_width = self.wire.end_socket.node.width\n                        source_block_height = self.wire.end_socket.node.height\n                        s_Offset = self.wire.end_socket.getSocketPosition()\n                    else:\n                        s_index = 0\n                        source_block_width = 0\n                        source_block_height = 0\n                        s_Offset = [0, 0]\n\n                    # Restart path from destination\n                    temporary_wire_coordinates.clear()\n                    temporary_wire_coordinates.append((sx, sy))\n\n                # ----------------------------------  Start Socket RIGHT OF End Socket  ----------------------------------\n                if sx > dx:\n                    # If start socket is not on same height as end socket\n                    # Otherwise a straight line will be drawn when this logic is passed through\n                    if sy != dy:\n                        if DEBUG:\n                            print(\"Wire style: G\")\n                        # Draw normal step line\n                        # ---------------------------\n                        #              |-<-(s-block)\n                        #              |\n                        #  (d-block)-<-|\n                        # ---------------------------\n\n                        temporary_wire_coordinates.append((sx - xDist, sy))\n                        temporary_wire_coordinates.append((sx - xDist, dy))\n\n                # ------------------------------  Start Socket EQUAL or LEFT OF End Socket  ------------------------------\n                else:\n\n                    # Source block is above destination block\n                    if sy - s_Offset[1] - (s_index * block_padding) < dy - d_Offset[\n                        1\n                    ] - (d_index * block_padding):\n                        # Distance between bottom of source block and top of destination block\n                        yDist = (\n                            (dy - d_Offset[1])\n                            - (sy - s_Offset[1] + source_block_height + title_height)\n                        ) / 2\n\n                        # Bottom of source block is above top of destination block OR\n                        # --\n                        if (sy - s_Offset[1] + source_block_height + title_height) < (\n                            dy - d_Offset[1] - block_padding\n                        ):\n                            if DEBUG:\n                                print(\"Wire style: H\")\n                            # Draw S line\n                            #  |---<-(s-block)\n                            #  |\n                            #  |--------------|\n                            #                 |\n                            #    (d-block)-<--|\n                            # ------------------\n\n                            temporary_wire_coordinates.append(\n                                (sx - (s_index * block_padding), sy)\n                            )\n                            temporary_wire_coordinates.append(\n                                (\n                                    sx - (s_index * block_padding),\n                                    dy - d_Offset[1] - yDist,\n                                )\n                            )\n                            temporary_wire_coordinates.append(\n                                (\n                                    dx + (d_index * block_padding),\n                                    dy - d_Offset[1] - yDist,\n                                )\n                            )\n                            temporary_wire_coordinates.append(\n                                (dx + (d_index * block_padding), dy)\n                            )\n\n                        # Bottom of source block is at level with or below top of destination block\n                        else:\n\n                            # RHS of destination block is further left than RHS of source block\n                            if (dx + block_padding) < (\n                                sx + source_block_width + block_padding\n                            ):\n                                if DEBUG:\n                                    print(\"Wire style: I\")\n                                # Draw line going around the top of the source block, clipped to RHS of source block + padding\n                                # --------------------------------------------------\n                                #     |--------------|            |--------------|\n                                #     |              |            |              |\n                                #     |-<-(s-block)  |     or     |-<-(s-block)  |\n                                #  (d-block)-<-------|               (d-block)-<-|\n                                # --------------------------------------------------\n\n                                temporary_wire_coordinates.append(\n                                    (sx - (s_index * block_padding), sy)\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        sx - (s_index * block_padding),\n                                        sy - s_Offset[1] - (s_index * block_padding),\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        sx\n                                        + source_block_width\n                                        + (s_index * block_padding),\n                                        sy - s_Offset[1] - (s_index * block_padding),\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        sx\n                                        + source_block_width\n                                        + (s_index * block_padding),\n                                        dy,\n                                    )\n                                )\n                                # path.lineTo(sx + source_block_width + block_padding, sy - s_Offset[1] - (s_index * block_padding))\n                                # path.lineTo(sx + source_block_width + block_padding, dy)\n\n                            # RHS of destination block is equal to or right of RHS of source block\n                            else:\n                                if DEBUG:\n                                    print(\"Wire style: J\")\n                                # Draw line going around the top of the source block, clipped to RHS of destination block + padding\n                                # -------------------------------------------------------------------------\n                                #  |-----------------------------|           |---------------------------|\n                                #  |                             |           |                           |\n                                #  |-<-(s-block)                 |    or     |-<-(s-block)   (d-block)-<-|\n                                #                    (d-block)-<-|\n                                # -------------------------------------------------------------------------\n\n                                temporary_wire_coordinates.append(\n                                    (sx - (s_index * block_padding), sy)\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        sx - (s_index * block_padding),\n                                        sy - s_Offset[1] - (s_index * block_padding),\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        dx + (d_index * block_padding),\n                                        sy - s_Offset[1] - (s_index * block_padding),\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (dx + (d_index * block_padding), dy)\n                                )\n\n                    # Source block is below destination block\n                    else:\n                        # Distance between top of source block and bottom of destination block\n                        yDist = (\n                            (sy - s_Offset[1])\n                            - (\n                                dy\n                                - d_Offset[1]\n                                + destination_block_height\n                                + title_height\n                            )\n                        ) / 2\n\n                        # Top of source block is below bottom of destination block OR\n                        # --\n                        if (sy - s_Offset[1] - block_padding) > (\n                            dy - d_Offset[1] + destination_block_height + title_height\n                        ):\n                            if DEBUG:\n                                print(\"Wire style: K\")\n                            # Draw Z line\n                            # -----------------------\n                            #        (d-block)-<--|\n                            #                     |\n                            #  |------------------|\n                            #  |\n                            #  |-<-(s-block)\n                            # -----------------------\n\n                            temporary_wire_coordinates.append(\n                                (sx - (s_index * block_padding), sy)\n                            )\n                            temporary_wire_coordinates.append(\n                                (\n                                    sx - (s_index * block_padding),\n                                    sy - yDist - s_Offset[1],\n                                )\n                            )\n                            temporary_wire_coordinates.append(\n                                (\n                                    dx + (s_index * block_padding),\n                                    sy - yDist - s_Offset[1],\n                                )\n                            )\n                            temporary_wire_coordinates.append(\n                                (dx + (s_index * block_padding), dy)\n                            )\n\n                        # Top of source block is at level with or above bottom of destination block\n                        else:\n\n                            # LHS of destination is further left than LHS of source block\n                            if (dx - destination_block_width - block_padding) < (\n                                sx - block_padding\n                            ):\n                                if DEBUG:\n                                    print(\"Wire style: L\")\n                                # Draw line going around the top of the destination block, clipped to the LHS of destination block minus padding\n                                # ------------------------\n                                #  |--------------|\n                                #  |              |\n                                #  |  (d-block)-<-|\n                                #  |\n                                #  |----------<-(s-block)\n                                # ------------------------\n\n                                temporary_wire_coordinates.append(\n                                    (\n                                        dx\n                                        - destination_block_width\n                                        - (s_index * block_padding),\n                                        sy,\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        dx\n                                        - destination_block_width\n                                        - (s_index * block_padding),\n                                        dy - d_Offset[1] - (d_index * block_padding),\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        dx + d_index * block_padding,\n                                        dy - d_Offset[1] - (d_index * block_padding),\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (dx + d_index * block_padding, dy)\n                                )\n\n                            # LHS of destination is equal to or right of LHS of source block\n                            else:\n                                if DEBUG:\n                                    print(\"Wire style: M\")\n                                # Draw line going around the top of the destination block, clipped to the LHS of source block minus padding\n                                # ----------------------\n                                #  |----------------|\n                                #  |                |\n                                #  |    (d-block)-<-|\n                                #  |\n                                #  |-<-(s-block)\n                                # ----------------------\n\n                                temporary_wire_coordinates.append(\n                                    (sx - s_index * block_padding, sy)\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        sx - s_index * block_padding,\n                                        dy - d_Offset[1] - (d_index * block_padding),\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (\n                                        dx + d_index * block_padding,\n                                        dy - d_Offset[1] - (d_index * block_padding),\n                                    )\n                                )\n                                temporary_wire_coordinates.append(\n                                    (dx + d_index * block_padding, dy)\n                                )\n\n                # Update boolean that wire is completed, as to get here, the end point of the wire must be dropped\n                wire_completed = True\n\n            # ############################################  End of Wire Logic  ###########################################\n\n            # Finally the Wire is finished, by connecting the path to the destination (end) Socket coordinates\n            # that coordinate is also added as the final coordinate point of the wire to the temporary coordinates list\n            temporary_wire_coordinates.append((dx, dy))\n\n            # The path of the wire is set to be drawn under the path logic that has just been calculated\n            for i, (x, y) in enumerate(temporary_wire_coordinates):\n                if i == 0:\n                    path = QPainterPath(QPointF(x, y))\n                elif i == len(temporary_wire_coordinates):\n                    path.lineTo(x, y)\n                    path.moveTo(x, y)\n                else:\n                    path.lineTo(x, y)\n\n            # If the wire has been dropped on a destination socket (and is not being dragged around), update its coordinates\n            if wire_completed:\n                self.updateWireCoordinates(temporary_wire_coordinates)\n            return path\n        except Exception as e:\n            if self.FATAL_ERROR == False:\n                print(\n                    \"------------------------------------------------------------------------------------\"\n                )\n                print(\n                    \"Caught fatal exception while trying to calculate wire bends. Please save your work.\"\n                )\n                print(\n                    \"------------------------------------------------------------------------------------\"\n                )\n                traceback.print_exc(file=sys.stderr)\n                self.FATAL_ERROR = True\n"
  },
  {
    "path": "bdsim/bdedit/block_importer.py",
    "content": "# !/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport re\nimport inspect\nimport copy\nimport numpy as np\nimport importlib.util\nimport inspect\nimport os.path\nfrom pathlib import Path\n\nfrom bdsim.bdedit.block import blockname, blocklist, Block\n\n# from examples import docstring_parser as parser\nimport bdsim\n\n\ndef import_blocks(scene, window):\n\n    size_map = {\n        \"InPort\": [50, 100],\n        \"OutPort\": [50, 100],\n        \"SubSystem\": [200, 150],\n        \"DiffSteer\": [150, 100],\n        \"VehiclePlot\": [125, 100],\n        \"MultiRotor\": [125, 100],\n        \"IDyn\": [125, 100],\n        \"FDyn\": [125, 100],\n        \"Tr2Delta\": [125, 100],\n        \"MultiRotorMixer\": [125, 100],\n        \"JTraj\": [125, 100],\n    }\n\n    # Make in/out labels parameter for subsystem blocks\n    inlabels_param = [\n        \"inport labels\",\n        list,\n        None,\n        [[\"type\", [type(None), list]]],\n        \"List of names for respective inport sockets\",\n    ]\n    outlabels_param = [\n        \"outport labels\",\n        list,\n        None,\n        [[\"type\", [type(None), list]]],\n        \"List of names for respective outport sockets\",\n    ]\n\n    # block_list = parser.docstring_parser()\n    sim = bdsim.BDSim()  # create simulator\n    block_list = sim._blocklibrary\n\n    block_library = []\n    imported_block_groups = []\n\n    # for i, block in enumerate(block_list.items()):\n\n    for block_type, block_ds in sim.blockinfo().items():\n        # if i == 4:\n        # blocks is a dic of tuples\n        # (block_type, {block_docstring_data})\n\n        # print(f\"reading definition of block {block_type}\")\n\n        # block_type = block[0].upper()   # Block type\n        # block_ds = block[1]     # Block docstring\n\n        # block_name = block_type.lower().capitalize() + \" Block\"\n        block_name = block_ds[\"classname\"] + \" Block\"\n        block_classname = block_ds[\"classname\"]\n        block_parentclass = block_ds[\"blockclass\"]\n        block_path = block_ds[\"path\"]\n        block_icon = os.path.join(block_path[0], \"Icons\", block_type.lower() + \".png\")\n\n        # # Make a block instance of the given class\n        # try:\n        #     # Grab number of input/output sockets for block, once it has been instantiated\n        #     if block_ds[\"nin\"] < 0 or block_ds[\"nout\"] < 0:\n        #         block_instance = block_ds[\"class\"]()\n        #         block_inputsNum = block_instance.nin\n        #         block_outputsNum = block_instance.nout\n        #     else:\n        #         block_inputsNum = block_ds[\"nin\"]\n        #         block_outputsNum = block_ds[\"nout\"]\n        #\n        # except Exception as e:\n        #     # When exception occurs here it is related to an assertion being raised in bdsim\n        #     # This can be ignored as we only need the nin/nout values once the block is instantiated\n        #     block_inputsNum = block_instance.nin\n        #     block_outputsNum = block_instance.nout\n\n        # Grab values assigned to this block's nin and nout class variables\n        # If the variables are >= 0, copy the values, otherwise if negative, set equal to 1 (aside from some blocks)\n        # If nin or nout not defined as a class variable, assign value of 0 (no inputs or outputs)\n        if hasattr(block_ds[\"class\"], \"nin\"):\n            if block_name in [\"Sum Block\", \"Prod Block\", \"Traj Block\"]:\n                if block_name == \"Traj Block\":\n                    block_inputsNum = 0\n                else:\n                    block_inputsNum = 2\n            else:\n                if block_ds[\"class\"].nin > -1:\n                    block_inputsNum = block_ds[\"class\"].nin\n                else:\n                    block_inputsNum = 1\n        else:\n            block_inputsNum = 0\n\n        if hasattr(block_ds[\"class\"], \"nout\"):\n            if block_ds[\"class\"].nout > -1:\n                block_outputsNum = block_ds[\"class\"].nout\n            else:\n                block_outputsNum = 1\n        else:\n            block_outputsNum = 0\n\n        # Grab the names of the input/output sockets\n        block_input_names, block_output_names = [], []\n\n        if hasattr(block_ds[\"class\"], \"inlabels\"):\n            for input_socket_name in block_ds[\"class\"].inlabels:\n                block_input_names.append(input_socket_name)\n\n        if hasattr(block_ds[\"class\"], \"outlabels\"):\n            for output_socket_name in block_ds[\"class\"].outlabels:\n                block_output_names.append(output_socket_name)\n\n        # Reconstruct URL from block type and path\n        block_group = block_ds[\"module\"].split(\".\")[-1]\n        try:\n            block_url = block_ds[\"url\"]\n        except KeyError:\n            block_url = None\n\n        block_parameters = (\n            []\n        )  # Once name, type, value, restrictions are extracted, this will be populated\n\n        for param in block_ds[\"params\"].items():\n            # Extract parameter name\n            param_name = param[0]\n            if param[1][1]:\n                param_tooltip = param[1][1]\n            else:\n                param_tooltip = \"\"\n\n            # Extract parameter type\n            # Split string based on white spaces\n            # if one type - no white spaces\n            # if multiple types - several white spaces\n            try:\n                param_type_docstring = param[1][0].split()\n\n                # Remove any left over commas or dashes (shouldn't be needed for type)\n                for i, item in enumerate(param_type_docstring):\n                    param_type_docstring[i] = item.strip(\",-.\")\n\n                # 1st value should be the type, with following values being either\n                # * other accepted types,\n                # * the optional keyword (also indicates if value should have a default),\n                # * or human-readable string\n\n                # 1. go through each word in the split string, searching for likely terms (sequence, string, etc)\n                # 2. match found strings to their desired interpretation, sequence = list/tuple/range, string = str\n                # 3. create list of strings matched to required types\n                # 4. evaluate and assign first item from that list of types, as the param type\n                # 5. create list for holding found restrictions\n\n                # 5.\n                param_restrictions = []\n\n                # ---------------------------------------------------------------------------------------\n                # Section for extracting parameter type information (and restriction if relating to type)\n                # ---------------------------------------------------------------------------------------\n\n                # 3.\n                found_types = []\n                found_size_restrictions = []\n                found_range_restrictions = []\n                found_symbol_restrictions = []\n                found_keyword_restrictions = []\n\n                # 1.\n                for item in param_type_docstring:\n                    # Go through and try to evaluate the first type, if it works assign that as the param type\n                    try:\n                        # 2.\n                        param_type = eval(item)\n\n                        # Check to see if evaluated item is NOT a class type, e.g. NOT <class 'int'>.\n                        # In this case, wrap the evaluated item in type()\n                        if not inspect.isclass(param_type):\n                            found_types.append(type(param_type))\n\n                            # This should only occur for the callable or any, type, but just to be safe we can check that it is one of those\n                            # and then append the 'str' type to pass through any user input from bdedit, as this will be validated in bdsim.\n                            if isinstance(param_type, type(callable)):\n                                found_types.append(str)\n\n                        # If a tuple type has been found, convert this to list\n                        if issubclass(param_type, tuple):\n                            param_type = list\n\n                        # Otherwise, if item is in the form of a string, append that value to list of found types\n                        else:\n                            found_types.append(param_type)\n\n                    # If evaluation fails - most likely human readible string instead of actual type\n                    except:\n                        regex_search = re.findall(\n                            r\"array_like\\([0-9]\\)|array_like\", item\n                        )\n\n                        # If current word is array_like\n                        if regex_search:\n\n                            # Search each array_like word found in type docstring, looking for size restriction\n                            for match in regex_search:\n                                element_restriction_match = re.findall(r\"[0-9]\", match)\n\n                                # If an element size restriction has been detected\n                                if element_restriction_match:\n\n                                    # If size restriction is already entered, this will stop it from being entered multiple times\n                                    restriction_to_insert = eval(\n                                        element_restriction_match[0]\n                                    )\n                                    if (\n                                        not restriction_to_insert\n                                        in found_size_restrictions\n                                    ):\n                                        found_size_restrictions.append(\n                                            restriction_to_insert\n                                        )\n\n                                # Todo - add size 0 if no regex size found\n                                else:\n                                    pass\n\n                            # If array_like has already been added, this will stop it from being entered multiple times\n                            # Lists can be interpreted easily and converted into a numpy array, so in JSON these will be stored as lists\n                            # type_to_insert = type(np.array([]))\n\n                            # If size restrictions were found, then this parameter is limited to being either a list of dict\n                            if found_size_restrictions:\n                                types_to_insert = [list, dict]\n                            # If no size restriction was found, then parameter retains all of array_like properties\n                            else:\n                                types_to_insert = [list, dict, int, float]\n\n                            for found_type in types_to_insert:\n                                if found_type not in found_types:\n                                    found_types.append(found_type)\n\n                        elif item.lower() in [\"string\"]:\n                            if str not in found_types:\n                                found_types.append(str)\n\n                        elif item.lower() in [\"sequence\", \"string\"]:\n                            # 2.\n                            if list not in found_types:\n                                found_types.append(list)\n\n                        else:\n                            pass\n\n                # 4.\n                # If any known types have been found, set the parameter type\n                if found_types:\n                    # Extract first detected type as the default type\n                    param_type = found_types[0]\n                else:\n                    # If no param type was found from the docstrings, this parameter most likely has a bdsim defined class\n                    # These will be passed through as a str type, and evaluated on bdsim's end. If any issues occur, it is\n                    # the user's job to ensure a suitable and meaningful value is entered for the parameter\n                    param_type = str\n                    found_types.append(str)\n\n                # -----------------------------------------------------------------------------------------\n                # Section for extracting parameter value information (and restriction if relating to value)\n                # -----------------------------------------------------------------------------------------\n\n                param_value = None\n\n                # Extract parameter value information\n                param_value_docstring = param[1][1].split()\n\n                # String docstring of commas\n                for i, item in enumerate(param_value_docstring):\n                    param_value_docstring[i] = item.strip(\",.\")\n\n                # Parse the docstring ignoring words until finding a known \"defaults to:\"\n                for i in range(0, len(param_value_docstring) - 1):\n\n                    if param_value_docstring[i] in [\"range\"]:\n                        # This parameter must be within a certain range, extract the provided range values\n                        # These should be in the form of \"range [a,b]\"\n                        # Hence we can check if evaluating the word after range gives a list of length 2\n\n                        try:\n                            next_item = eval(param_value_docstring[i + 1])\n\n                            if isinstance(next_item, list) and len(next_item) == 2:\n                                # Add a,b of range to restriction items\n                                found_range_restrictions.append(next_item[0])\n                                found_range_restrictions.append(next_item[1])\n                            else:\n                                # Either not list or greater than 2, so unexpected format, return error\n                                # found_range_restrictions.append(\"Unexpected format for: range restriction\")\n                                print(\n                                    \"Unexpected format for: range restriction. Occured in:\",\n                                    block_name,\n                                    param_name,\n                                )\n                        except:\n                            # Word cannot be evaluated\n                            # found_range_restrictions.append(\"Unexpected format for: range restriction\")\n                            print(\n                                \"Unexpected format for: range restriction. Occured in:\",\n                                block_name,\n                                param_name,\n                            )\n\n                    if param_value_docstring[i] in [\n                        \"accepted\"\n                    ] and param_value_docstring[i + 1] in [\"characters:\"]:\n                        # Value is restricted to being certain characters, these are seperated by the word 'or'\n                        # Iterate through every 2nd value after 'accepted characters:' (seperated by 'or')\n                        for j in range(i + 2, len(param_value_docstring), 2):\n                            # If special character (.isalnum() returns False), append to list of detected signs\n                            if not param_value_docstring[j].isalnum():\n                                found_symbol_restrictions.append(\n                                    param_value_docstring[j]\n                                )\n\n                            # If the next value isn't 'or', we have reached end of character list\n                            if param_value_docstring[j + 1] not in [\"or\"]:\n                                break\n\n                    if param_value_docstring[i] in [\n                        \"defaults\"\n                    ] and param_value_docstring[i + 1] in [\"to\"]:\n                        # Value only has 1 default, which should follow after the word 'to'\n                        # Try to evaluate value, if successful, this is some form of non string\n                        try:\n                            param_value = eval(param_value_docstring[i + 2])\n\n                        # If unsuccesful, trying to eval a string, so set default value as str instead\n                        except NameError:\n                            param_value = param_value_docstring[i + 2]\n\n                    elif param_value_docstring[i] in [\"one\"] and param_value_docstring[\n                        i + 1\n                    ] in [\"of:\"]:\n                        # Value has list of possible options, parse list to find value after which is '[default]'\n                        found_default_value = False\n\n                        for j in range(i + 2, len(param_value_docstring)):\n                            # Append found value (if not '[default]', to list of keyword restrictions)\n                            if param_value_docstring[j] not in [\"[default]\"]:\n                                found_keyword_restrictions.append(\n                                    param_value_docstring[j].strip(\"'\").lower()\n                                )\n\n                            # Check if this is the default value, (next value should say '[default]')\n                            if not found_default_value and param_value_docstring[\n                                j + 1\n                            ] in [\"[default]\"]:\n                                # Default value found in list of possible values\n\n                                # Try to evaluate value, if successful, then some form of non string\n                                try:\n                                    param_value = eval(param_value_docstring[j])\n\n                                # If unsuccesful, trying to eval a string, so set default value as str instead\n                                except NameError:\n                                    param_value = param_value_docstring[j]\n\n                                found_default_value = True\n\n                        # If no defualt value was found, param_value will stay as None for safety\n\n                        # if not found_default_value:\n                        #     param_value = None\n\n                        # Important break!\n                        # Once the inner loop has gone through the remainder of the words from the docstring, and\n                        # found the default value and the other keywords, we need to break out of the outer loop, to\n                        # continue to the next parameter\n                        break\n\n                # If any keyword restrictions were found\n                if found_keyword_restrictions:\n                    restriction = [\"keywords\"]\n                    # Append the found keyword restrictions into the restriction\n                    restriction.append(found_keyword_restrictions)\n                    param_restrictions.append(restriction)\n\n                # If any range restrictions were found\n                if found_range_restrictions:\n                    restriction = [\"range\"]\n                    # Append the found range restrictions into the restriction\n                    restriction.append(found_range_restrictions)\n                    param_restrictions.append(restriction)\n\n                # If any size restrictions were found\n                if found_size_restrictions:\n                    restriction = [\"size\"]\n                    # Append the found size restrictions into the restriction\n                    restriction.append(found_size_restrictions)\n                    param_restrictions.append(restriction)\n\n                # If any symbol restrictions were found\n                if found_symbol_restrictions:\n                    restriction = [\"symbol\"]\n                    # Append the found symbol restrictions into the restriction\n                    restriction.append(found_symbol_restrictions)\n                    param_restrictions.append(restriction)\n\n                # Check if parameter value is None, if so, add NoneType to type restriction\n                if param_value is None:\n                    # If Nonetype has already been added, this will stop it from being entered multiple times\n                    type_to_insert = type(None)\n                    if not type_to_insert in found_types:\n                        found_types.append(type_to_insert)\n\n                # If several types for a parameter are detected, create a parameter restriction accordingly\n                if len(found_types) > 1 or type(None) in found_types:\n                    found_type_restrictions = []\n                    for item in found_types:\n                        found_type_restrictions.insert(0, item)\n                    restriction = [\"type\"]\n                    restriction.append(found_type_restrictions)\n\n                    param_restrictions.append(restriction)\n\n                # Using the extracted information, construct the parameter list\n                block_parameters.append(\n                    [\n                        param_name,\n                        param_type,\n                        param_value,\n                        param_restrictions,\n                        param_tooltip,\n                    ]\n                )\n\n            except Exception as e:\n                print(\n                    \"@@@@@@@ Fatal error: Cannot parse parameter info to construct parameter for block: -> '\"\n                    + block_type\n                    + \"', parameter name: -> '\"\n                    + param_name\n                    + \"'.@@@@@@\"\n                )\n                print(\"@@@@@@@ Printing exception below: @@@@@@@\")\n                print(e)\n\n        if block_classname in [\"SubSystem\", \"OutPort\"]:\n            block_parameters.append(inlabels_param)\n\n        if block_classname in [\"SubSystem\", \"InPort\"]:\n            block_parameters.append(outlabels_param)\n\n        # -----------------------------------------------------------------------------------------------------\n        # Section for importing block class from its module, and assigning to it the extracted information\n        # -----------------------------------------------------------------------------------------------------\n\n        try:\n\n            def __block_init__(self):\n\n                Block.__init__(self, scene, window)\n\n                self.title = copy.copy(self.title)\n                self.block_type = copy.copy(self.block_type)\n                self.parameters = copy.deepcopy(self.parameters)\n                self.inputsNum = copy.copy(self.inputsNum)\n                self.outputsNum = copy.copy(self.outputsNum)\n                self.input_names = copy.deepcopy(self.input_names)\n                self.output_names = copy.deepcopy(self.output_names)\n                self.icon = copy.copy(self.icon)\n                self.flipped_icon = os.path.join(\n                    os.path.splitext(copy.copy(self.icon))[0] + \"_flipped.png\"\n                )\n                self.block_url = copy.copy(self.block_url)\n                self.width = copy.copy(self.width)\n                self.height = copy.copy(self.height)\n\n                self._createBlock(self.inputsNum, self.outputsNum)\n\n            # Default size for all blocks\n            size = [100, 100]\n            try:\n                size = size_map[block_classname]\n            except KeyError:\n                pass\n\n            # Dynamically create class for this block\n            # Assign the extracted block variables to this block\n            new_block_class = type(\n                block_classname,\n                (Block,),\n                {\n                    \"__init__\": __block_init__,\n                    \"title\": block_name,\n                    \"block_type\": block_type,\n                    \"parameters\": block_parameters,\n                    \"inputsNum\": block_inputsNum,\n                    \"outputsNum\": block_outputsNum,\n                    \"input_names\": block_input_names,\n                    \"output_names\": block_output_names,\n                    \"icon\": block_icon,\n                    \"block_url\": block_url,\n                    \"width\": size[0],\n                    \"height\": size[1],\n                },\n            )\n\n            # Add this block to blocklist\n            blocklist.append(new_block_class)\n\n            # # If this block belongs to a new group of blocks, for which a list hasn't been made yet\n            # # then make a list in the block_library, to hold those blocks\n            # if block_parentclass not in imported_block_groups:\n            #     imported_block_groups.append(block_parentclass)\n            #     block_library.append([block_parentclass, []])\n            #\n            # # Add this block to the group of blocks it belongs to\n            # for i, group in enumerate(block_library):\n            #     # 1st element of group, will always be the group name (sinks, sources, functions, etc)\n            #     if group[0] == block_parentclass:\n            #         block_library[i][1].append([blockname(new_block_class), new_block_class])\n            #         break\n\n            # -----------------------------------------------------------------------------------------------\n\n            # If this block belongs to a new group of blocks, for which a list hasn't been made yet\n            # then make a list in the block_library, to hold those blocks\n            if block_group not in imported_block_groups:\n                imported_block_groups.append(block_group)\n                block_library.append([block_group, []])\n\n            # Add this block to the group of blocks it belongs to\n            for i, group in enumerate(block_library):\n                # 1st element of group, will always be the group name (sinks, sources, functions, etc)\n                if group[0] == block_group:\n                    block_library[i][1].append(\n                        [blockname(new_block_class), new_block_class]\n                    )\n                    break\n\n        except KeyError:\n            print(\n                \"Error: attempted to create a block class that isn't supported. Attempted class type: \",\n                block_classname,\n            )\n\n    return block_library\n"
  },
  {
    "path": "bdsim/bdedit/block_main_block.py",
    "content": "# BdEdit imports\nfrom bdsim.bdedit.block import *\nfrom bdsim.bdedit.block_socket import *\nfrom bdsim.bdedit.block_graphics_block import *\n\n\n# =============================================================================\n#\n#   Defining the Main Block Class, which allows for the loaded/built model to\n#   be invoked as a subprocess when that model is run\n#\n# =============================================================================\n# Todo - update doc string\nclass Main(Block):\n    \"\"\" \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, scene, window, file_name=None, name=\"Main Block\", pos=(0, 0)):\n        \"\"\" \"\"\"\n\n        super().__init__(scene, window)\n\n        # Same variables inherited from the Block class\n        self.scene = scene\n        self.window = window\n\n        self.block_type = blockname(self.__class__)\n        self.width = 100\n        self.height = 100\n\n        self.setDefaultTitle(name)\n\n        self.parameters = [[\"file name\", str, file_name, []]]\n\n        self.block_url = \"\"\n        self.icon = \":/Icons_Reference/Icons/main.png\"\n        self.flipped = False\n        self.flipped_icon = os.path.join(\n            os.path.splitext(self.icon)[0] + \"_flipped.png\"\n        )\n\n        self.inputsNum = 0\n        self.outputsNum = 0\n\n        self.grBlock = GraphicsBlock(self)\n\n        self.parameterWindow = None\n\n        # The Main block is automatically stored into the Scene,\n        # and visually added into the GraphicsScene\n        self.scene.addBlock(self)\n        self.scene.grScene.addItem(self.grBlock)\n\n        self._createParamWindow()\n\n        self.scene.has_been_modified = True\n"
  },
  {
    "path": "bdsim/bdedit/block_param_window.py",
    "content": "# Library imports\nimport ast\nimport math\n\n# PyQt5 Imports\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtGui import QPixmap, QDesktopServices\nfrom PyQt5.QtCore import Qt, QRect\n\n# BdEdit imports\nfrom bdsim.bdedit.Icons import *\n\n# =============================================================================\n#\n#   Defining and setting global variables\n#\n# =============================================================================\n# Socket positioning variables - used for determining what side of the block the\n# socket should be drawn\nLEFT = 1\nRIGHT = 3\n\n# Socket sign variables - used for logic associated with drawing symbols for the\n# PROD and SUM blocks\nPLUS = \"+\"\nMINUS = \"-\"\nMULTIPLY = \"*\"\nDIVIDE = \"/\"\n\n# Variable for enabling/disabling debug comments\nDEBUG = False\n\n\n# =============================================================================\n#\n#   Defining the ParamWindow Class, which holds information of how the parameter\n#   window - that holds all the user-editable block parameters - appears. It also\n#   contains the logic for creating the ParamWindow and the logic for sanity\n#   checking the block parameters once they have been edited by the user.\n#\n# =============================================================================\nclass ParamWindow(QWidget):\n    \"\"\"\n    The ``ParamWindow`` Class extends the ``QWidget`` Class from PyQt5.\n    The ParamWindow Class controls:\n\n    - how the parameter window appears visually,\n    - where it is located within the BdEdit application window,\n    - the displayed parameters from the Block the parameter window is related to,\n    - sanity checking on user-edits to the Block parameters,\n    - pop-up user feedback for successful or unsuccessful Block parameter edits.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, block, parent=None):\n        \"\"\"\n        This method initializes an instance of the ``ParamWindow`` Class.\n\n        :param block: the Block this ParamWindow instance relates to\n        :type block: ``Block``\n        :param parent: the parent widget this ParamWindow belongs to (should be None)\n        :type parent: None, optional\n        \"\"\"\n\n        super().__init__(parent)\n\n        # The Block this parameter window relates to is stored internally,\n        # so are its parameters\n        self.block = block\n        self.parameters = self.block.parameters\n\n        # Parameter_values is a list into which the text responses of the user\n        # will be appended to, when they make changes to a Block parameter\n        self.parameter_values = []\n\n        # The parameter window will display vertically on the RHS of the BdEdit\n        # application window, hence its layout manager will be a vertical one\n        self.layout = QVBoxLayout()\n\n        # Definition of with of the parameter window, and the lines holding\n        # the block parameters inside it. The width is fixed to 300 pixels, scaled\n        # to what 300 pixels should look like on 2560 screen width resolution\n        self._parameter_line_width = 150\n        self._width = 300 * self.block.window.scale\n        self.setFixedWidth(self._width)\n\n        # Variable to update title of model when parameter values have been changed,\n        # to indicate that there is unsaved progress\n        self.paramsWereChanged = False\n\n        # Further initializing necessary parameter window settings, and calling\n        # the method that will build the it\n        self.initUI()\n        self.buildParamWindow()\n\n    # -----------------------------------------------------------------------------\n    def initUI(self):\n        \"\"\"\n        This method adds a 'Parameter Window' label to the ParamWindow, sets the\n        alignment of items within the parameter window, sets the background to\n        auto fill, and finally, sets the layout manager of the ParamWindow.\n        \"\"\"\n\n        # The follow label is added to the parameter window, naming it\n        # Items within the parameter window layout manager are set to align towards the top\n        param_window_label = QLabel(\"<font size=8><b>Block settings</font>\")\n        param_window_label.setAlignment(Qt.AlignCenter)\n        self.layout.addWidget(param_window_label)\n        self.layout.setAlignment(Qt.AlignTop)\n\n        # Its background is filled\n        self.setAutoFillBackground(True)\n        self.setLayout(self.layout)\n\n    # -----------------------------------------------------------------------------\n    def displayDocumentationURL(self):\n        \"\"\"\n        This method opens the url link associated with this blocks' documentation.\n        \"\"\"\n\n        QDesktopServices.openUrl(QtCore.QUrl(self.block.block_url))\n\n    # -----------------------------------------------------------------------------\n    def closeQMessageBox(self):\n        \"\"\"\n        This method closes a pop-up user-feedback message if one already exists\n        within the parameter window. This prevents multiple messages from being\n        displayed at the same time, and ensure the message the user sees, is the\n        most relevant one.\n        \"\"\"\n\n        # If a message widget already exists in the ParamWindow, remove it\n        # ParamWindow (self) has several widgets already, some of which hold QLabels, QEditLines or a QPushButton\n        # Iterate through all of ParamWindow's widgets\n        for widget in self.children():\n            # Grab the children of the ParamWindow's child widget\n            widgets_children = widget.children()\n            # Iterate through all this widget's children widgets\n            for child in widgets_children:\n                # If a child widget happens to be a QMessageBox, then remove that widget from the ParamWindow layout\n                if child.__class__ == QMessageBox:\n                    self.layout.removeWidget(widget)\n                    break\n\n    # -----------------------------------------------------------------------------\n    def displayPopUpMessage(self, title, text, messageType):\n        \"\"\"\n        This method displays a pop-up user-feedback message within the parameter window,\n        notifying them of either a successful or unsuccessful update to the Blocks'\n        parameters. This method will also trigger the message to auto-close, after 1.5\n        seconds for a successful update, and after 5 seconds for an unsuccessful update.\n        If at any point the user updates the Block parameters before this time is elapsed,\n        the current (old) message will be removed and replaced by the most relevant message.\n        An unsuccessful update attempt will also issue an error sound when the message is\n        opened.\n\n        :param title: the title of the message box displayed\n        :type title: str\n        :param text: the text that fills the body of the displayed message box\n        :type text: str\n        :param messageType: variable that calls what type of message to display (\"Success\", \"Error\")\n        :type messageType: str\n        \"\"\"\n\n        def closeMessage():\n            self.timer.stop()\n            self.message.close()\n\n        # If a message box is already displayed within the ParamWindow, it will be closed\n        self.closeQMessageBox()\n\n        # Create a widget to wrap the QMessageBox into, that it may be displayed in the ParamWindow\n        self.popUp = QWidget()\n        self.popUp.layout = QVBoxLayout()\n        self.message = QMessageBox(self)\n\n        # Manually set the width of the QMessageBox layout to control text wrapping\n        # The layout is a grid, so setting width of 1st row/column cell will set width of the widget\n        self.message.item = self.message.layout().itemAtPosition(0, 1)\n        self.message.item.widget().setFixedWidth(self.width() - 100)\n\n        # If an error message - critical icon, if success message - green tick icon\n        if messageType == \"Error\":\n            self.message.setIcon(QMessageBox.Critical)\n            self.message.setIconPixmap(QPixmap(\":/Icons_Reference/Icons/error.png\"))\n            message_duration = 5\n        elif messageType == \"Success\":\n            self.message.setIconPixmap(QPixmap(\":/Icons_Reference/Icons/success.png\"))\n            message_duration = 1.5\n\n        # Set the title and text for the message\n        self.message.setText(\"<font><b>\" + title + \"</font>\")\n        self.message.setInformativeText(text)\n        # Set style (adding a black border around messagebox)\n        self.message.setStyleSheet(\"QMessageBox { border : 1px solid black;}\")\n        # Set message modality to be non-blocking (by default, QMessageBox blocks other actions until closed)\n        self.message.setWindowModality(Qt.NonModal)\n        # Add the QMessageBox to the popUp widget, then add to the layout of the ParamWindow widget\n        self.popUp.layout.addWidget(self.message)\n        self.popUp.setLayout(self.popUp.layout)\n        self.layout.addWidget(self.popUp)\n\n        # Create timer to keep message opened for 5 seconds if error, 1.5 seconds if success\n        self.timer = QtCore.QTimer()\n        self.timer.setInterval(int(message_duration * 1000))\n        self.timer.timeout.connect(closeMessage)\n        self.timer.start()\n\n    # -----------------------------------------------------------------------------\n    def buildParamWindow(self):\n        \"\"\"\n        This method handles the building of the ParamWindow instance. These instances\n        will always look exactly the same in terms of the information they contain,\n        however the Block parameters and the block type will vary depending on the Block\n        this ParamWindow relates to.\n\n        The ParamWindow is built by adding items into the QWidget that represents this\n        parameter window. For each item added into the QWidget, a label is displayed on\n        the left-hand-side, and either the non-editable value (label) is displayed on the\n        right-hand-side, or an editable line is displayed and populated with the respective\n        parameters' current value.\n\n        The ParamWindow is populated by, first, adding a non-editable line displaying the\n        selected Blocks' type. Next, the Blocks' current title is added with an editable\n        line. Following this, each Block parameter looped through and added with an editable\n        line in which the current value of the Block parameter is populated. Changing this\n        value will prompt the sanity checking of the value entered, which is handled by\n        the updateBlockParameters() method.\n        \"\"\"\n\n        # Make the first row, which contains two labels for the block's type\n        self.row1 = QWidget()\n        self.row1.layout = QHBoxLayout()\n        # Make a label of the block type\n        self.block_type_label = QLabel(\"<font size=4><b>type: </font>\")\n        # Make an editable line for the type, and populate it with the current block type\n        self.block_type = QLabel(\n            \"<font size=4>\" + str(self.block.block_type) + \" Block </font>\"\n        )\n        # Set the width of the editable line to the above-defined width (150 pixels)\n        self.block_type.setFixedWidth(self._parameter_line_width)\n        # Add the label and editable line into our row widget\n        self.row1.layout.addWidget(self.block_type_label, alignment=Qt.AlignCenter)\n        self.row1.layout.addWidget(self.block_type, alignment=Qt.AlignCenter)\n\n        # Add out type row widget to the layout of the parameter window\n        self.row1.setLayout(self.row1.layout)\n        self.layout.addWidget(self.row1)\n\n        # Make the second row, which contains the label and editable line for the block's title\n        self.row2 = QWidget()\n        self.row2.layout = QHBoxLayout()\n\n        # Make a label of the block title\n        self.title_label = QLabel(\"<font size=4><b>name: </font>\")\n        # Make an editable line for the title, and populate it with the current block title\n        self.title_line = QLineEdit(self.block.title)\n        # Set the width of the editable line to the above-defined width (150 pixels)\n        self.title_line.setFixedWidth(self._parameter_line_width)\n        # Add the label and editable line into our row widget\n        self.row2.layout.addWidget(self.title_label, alignment=Qt.AlignCenter)\n        self.row2.layout.addWidget(self.title_line)\n\n        # Add out title row widget to the layout of the parameter window\n        self.row2.setLayout(self.row2.layout)\n        self.layout.addWidget(self.row2)\n\n        # If the block has parameters, build part of the paramWindow that displays those\n        if self.parameters:\n            # For each block parameter\n            for parameter in self.parameters:\n                # Create a QWidget that will represent the row that parameter is displayed in\n                self.row_x = QWidget()\n                self.row_x.layout = QHBoxLayout()\n\n                # Make a label of that parameters' name\n                self.label = QLabel(\n                    \"<font size=3><b>\" + parameter[0] + \": \" + \"</font>\"\n                )\n                try:\n                    self.label.setToolTip(parameter[4])\n                except IndexError:\n                    print(parameter)\n\n                # If the parameter type is a boolean, create the intractable space as a checkbox, otherwise\n                # make an editable line for that parameter, and populate it with the parameters' current value\n                if not issubclass(parameter[1], bool):\n                    self.line = QLineEdit(str(parameter[2]))\n                else:\n                    try:\n                        self.line = QCheckBox()\n                        self.line.setChecked(parameter[2])\n                    except TypeError:\n                        print(\"bad thing\")\n\n                # Set the width of the editable line to the above-defined width (150 pixels)\n                self.line.setFixedWidth(self._parameter_line_width)\n                # Append the current value of the parameter into the following list (for later comparison)\n                self.parameter_values.append(self.line)\n                # Add the label and editable line into our row widget\n                self.row_x.layout.addWidget(self.label, alignment=Qt.AlignCenter)\n                self.row_x.layout.addWidget(self.line, alignment=Qt.AlignCenter)\n\n                # Add out row widget to the layout of the parameter window\n                self.row_x.setLayout(self.row_x.layout)\n                self.layout.addWidget(self.row_x)\n\n        # Finally add an update button, which will trigger the sanity checking of the\n        # current values within the editable lines\n        self.update_button = QPushButton(\"Update Parameters\")\n        self.update_button.clicked.connect(self.updateBlockParameters)\n        self.layout.addWidget(self.update_button)\n\n        # Add a button linked to the URL of this block's documentation\n        self.block_url_Button = QPushButton(\"View documentation\")\n        self.block_url_Button.clicked.connect(self.displayDocumentationURL)\n        self.layout.addWidget(self.block_url_Button)\n\n    # -----------------------------------------------------------------------------\n    def updateBlockParameters(self):\n        \"\"\"\n        This method calls for each of the parameters within the parameter window to be\n        sanity checked by the getSafeValue() method, which determines whether or not\n        a provided value is compatible with the parameter type (defined in the Block\n        Class) and is safe to override the current value. If that check is returned\n        to be safe, this method will handle the updating of the Block parameters, as\n        well as triggering a successful update attempt message.\n\n        If the check is returned as not safe, meaning the given value is not compatible,\n        an unsuccessful update attempt error message will be prompted, notifying the\n        user of the incompatible parameter value they have set, and either what the\n        compatible types or values are. This logic also applies when a user changes the\n        blocks' title to one that already exists, which will cause a duplicate error\n        message to display.\n\n        Some parameters values directly affect the GraphicsBlock of the Block they relate\n        to. For example, blocks that can have multiple input or output sockets, will\n        have a parameter that controls how many of these sockets the block has. And once\n        edited, this method will trigger an appropriate number of sockets to be created\n        or deleted. This parameter can also affect the GraphicsBlock when too many sockets\n        are created, requiring the block to be resized. The triggering of this resizing\n        will also be issued from within this method.\n        \"\"\"\n\n        # -----------------------------------------------------------------------------\n        def makeBadInputErrorMsg(options):\n            \"\"\"\n            This method returns the correct text that should be displayed within the body\n            of the pop-up user-feedback message. The text that is displayed here is extracted\n            from the associated extra-options as defined in the relating Block.\n\n            :param options: the extra-options associated with this parameter (defined in this Block)\n            :type options: list, of str, list\n            :return: the formatted message to be displayed\n            :rtype: str\n            \"\"\"\n\n            # Start with an empty message\n            message = \"\"\n            # Num_options is the number of lists (of accepted keywords, types, range, symbol) inside the option list\n            num_options = len(options)\n            # Check the options that have been assigned to this parameter\n            for option in options:\n                # If the options consist keywords that this parameter is restricted to\n                if option[0] == \"keywords\":\n                    message += \"one of <font><b>\" + str(option[1]) + \"</font>\"\n                # If the options consist of a range this parameters is restricted to\n                elif option[0] == \"range\":\n                    message += (\n                        \"a value between <font><b>\"\n                        + str(option[1][0])\n                        + \"</font> and <font><b>\"\n                        + str(option[1][1])\n                        + \"</font>\"\n                    )\n                # If the options consist of additional types this parameter is restricted to\n                elif option[0] == \"type\":\n                    typeString = []\n                    for optionType in option[1]:\n                        typeString.append(optionType.__name__)\n                    message += \"of type <font><b>\" + str(typeString) + \"</font>\"\n                # If the options consist of certain sign characters this parameter is restricted to\n                elif option[0] == \"symbol\":\n                    message += \"a combination of <font><b>\" + str(option[1]) + \"</font>\"\n                # If the options consists of a size restriction on how many elements are allowed in the list\n                elif option[0] == \"size\":\n                    message += (\n                        \"limited to a size of <font><b>\" + str(option[1]) + \"</font>\"\n                    )\n\n                # If a parameter has multiple options (e.g. range and type restrictions)\n                # separate the options with \"or\" until only 1 option remains\n                if num_options > 1:\n                    message += \" or \"\n                    num_options -= 1\n\n            return message\n\n        # Update the title\n        duplicate_title = []\n        # UpdateName is returned as None if there are no issues with setting a title\n        # If title is a duplicate, a list of [\"@DuplicateName@\", given_name] is returned\n        updateName = self.block.setTitle(self.title_line.text())\n        self.block.grBlock._draw_title = True\n        if updateName:\n            if updateName[0] == \"@DuplicateName@\":\n                duplicate_title.append(updateName[1])\n        else:\n            self.paramsWereChanged = True\n\n        # Iterator for loop\n        i = -1\n\n        # An error message can consist of an invalid_input (incorrect parameter type)\n        # or a bad_input (incompatible with option restrictions), and initially these\n        # are set to being empty. If parameters cannot be set due to errors, these will\n        # be appended into these empty lists\n        invalid_input, bad_inputs, bad_socket_labels = [], [], []\n\n        # Check if the block has parameters, if so, go through the sanity checking of each parameter value\n        if self.parameters:\n\n            # For each definition of a parameter, in the blocks' defined parameters\n            for [paramName, paramType, paramVal, paramOptions, _] in self.parameters:\n                i += 1\n\n                # If parameter type is boolean, then retrieve checked state of checkbox, otherwise\n                # extract the text from the editable line as the value to set the parameter to\n                if not issubclass(paramType, bool):\n                    inputValue = self.parameter_values[i].text()\n                else:\n                    inputValue = str(self.parameter_values[i].isChecked())\n\n                # If a value has been provided for that parameter, perform sanity checking on that input\n                if inputValue:\n                    if self.parameters[i][0] in [\"nin\", \"ops\", \"signs\", \"nout\"]:\n                        inputInCompatibleFormat = self.getSafeValue(\n                            inputValue, paramType, paramOptions\n                        )\n                    else:\n                        if inputValue.startswith(\"=\"):\n                            inputInCompatibleFormat = inputValue\n                        else:\n                            inputInCompatibleFormat = self.getSafeValue(\n                                inputValue, paramType, paramOptions\n                            )\n\n                    # If in DEBUG mode, this code will return the name, type, current value of the parameter attempting to update\n                    # and then for the value that will override the parameter, the value, type(of the value), and whether it is or isn't compatible\n                    if DEBUG:\n                        print(\n                            \"paramName, paramType, paramVal - inputValue, type, compatible\",\n                            [\n                                paramName,\n                                paramType,\n                                paramVal,\n                                \"-\",\n                                inputValue,\n                                type(inputValue),\n                                inputInCompatibleFormat,\n                            ],\n                        )\n\n                    # Once the sanity check has been performed, if the type is valid, check for parameter restrictions\n                    if inputInCompatibleFormat != \"@InvalidType@\":\n\n                        # If the sanity check returns that the parameter doesn't meet its restrictions\n                        if inputInCompatibleFormat == \"@BadFormat@\":\n                            # Append the parameter edited, and the parameter options, as a bad_input\n                            bad_inputs.append([paramName, paramOptions])\n                        else:\n\n                            # Otherwise if both sanity checks pass, value is safe to update, so\n                            # Check if the given value is different to what is already set as the param value\n                            # If it is the same, don't update the value\n                            if inputInCompatibleFormat == paramVal:\n                                pass\n\n                            # Otherwise update the value\n                            else:\n                                # Set the current parameter equal to edited parameter value\n                                self.parameters[i][2] = inputInCompatibleFormat\n                                self.paramsWereChanged = True\n\n                                # If self.parameter relates to controlling the number of inputs a block has\n                                if self.parameters[i][0] in [\"nin\", \"ops\", \"signs\"]:\n\n                                    # Grab the number of required input sockets\n                                    if self.parameters[i][0] == \"nin\":\n                                        num_sockets = self.parameters[i][2]\n                                    else:\n                                        num_sockets = len(\n                                            self.parameter_values[i].text()\n                                        )\n\n                                    # Don't do anything, if the provided number of input sockets matches the number the block already has,\n                                    # or if the symbols (+,-,*,/) for the block haven't changed\n                                    # if len(self.block.inputs) == num_sockets and inputInCompatibleFormat == paramVal:\n                                    #     pass\n                                    # else:\n                                    # If the given number of input sockets matches the number the block already has, or if the number of\n                                    # symbols (+,-,*,/) for the block hasn't changed\n                                    if len(self.block.inputs) == num_sockets:\n                                        # If the values of the signs hasn't changed, then don't do anything\n                                        if inputInCompatibleFormat == paramVal:\n                                            pass\n                                        # If the values of the signs has changed (but the number of signs is still the same), just\n                                        # update the signs without removing the wires\n                                        else:\n                                            # Split the socket signs by number of characters given\n                                            chars = [\n                                                char for char in inputInCompatibleFormat\n                                            ]\n\n                                            # Go through each of the chars from the string of symbols for this block's signs\n                                            # and set the respective socket to that symbol\n                                            for j, char in enumerate(chars):\n                                                self.block.inputs[j].socket_sign = char\n\n                                    else:\n                                        # If the block already has input sockets, grab their orientation (LEFT / RIGHT) then delete\n                                        # Else, draw input socket with default orientation (LEFT) and no need to delete as block has no input sockets\n                                        if self.block.inputs:\n                                            orientation = self.block.inputs[0].position\n                                            # Remove all current input sockets\n                                            self.block.inputs[0].removeSockets(\"Input\")\n                                        else:\n                                            orientation = LEFT\n                                        # Recreate input sockets to the number provided\n                                        # If self.block is a SUM or PROD block, this will also update the input sockets' sign (+,_,*,/)\n                                        self.block.inputsNum = num_sockets\n                                        self.block.makeInputSockets(\n                                            self.block.inputsNum, orientation\n                                        )\n\n                                # If self.parameter relates to controlling the number of outputs a block has\n                                if self.parameters[i][0] in [\"nout\"]:\n                                    # Grab number of required output sockets\n                                    num_sockets = self.parameters[i][2]\n                                    # If provided number of output sockets matches the number the block already has, don't do anything\n                                    if len(self.block.outputs) == num_sockets:\n                                        pass\n                                    else:\n                                        # If the block already has output sockets, grab their orientation (LEFT / RIGHT) then delete\n                                        # Else, draw output socket with default orientation (RIGHT) and no need to delete as block has no output sockets\n                                        if self.block.outputs:\n                                            orientation = self.block.outputs[0].position\n                                            # Remove all current output sockets\n                                            self.block.outputs[0].removeSockets(\n                                                \"Output\"\n                                            )\n                                        else:\n                                            orientation = RIGHT\n                                        # Recreate output sockets to the number provided\n                                        self.block.outputsNum = num_sockets\n                                        self.block.makeOutputSockets(\n                                            self.block.outputsNum, orientation\n                                        )\n\n                                # If self.parameter relates to controlling the names of inport labels on subsystem blocks\n                                if self.parameters[i][0] == \"inport labels\":\n                                    # First check if labels are given for the sockets, if not, don't do anything special\n                                    if self.parameters[i][2] is not None:\n                                        input_length = len(self.parameters[i][2])\n                                        if input_length > 0:\n                                            # Find number of inputs controlled by nin\n                                            found_nin = False\n                                            for params in self.parameters:\n                                                if params[0] == \"nin\":\n                                                    num_nin_sockets = params[2]\n                                                    found_nin = True\n                                                    break\n                                            # Check if nin parameter was found, if not, return error as we need to know how many sockets to draw\n                                            if found_nin == False:\n                                                print(\n                                                    \"Error: Cannot draw InPort labels as no 'nin' parameter was found to know how many sockets to draw.\"\n                                                )\n                                            else:\n                                                # If nin parameter was found, check if number of given InPort labels matches number of sockets\n                                                if input_length != num_nin_sockets:\n                                                    bad_socket_labels.append(\n                                                        [paramName, paramOptions]\n                                                    )\n                                                else:\n                                                    # If parameter value hasn't changed, don't do anything\n                                                    if (\n                                                        inputInCompatibleFormat\n                                                        == paramVal\n                                                    ):\n                                                        pass\n                                                    else:\n                                                        # If the block already has input sockets, grab their orientation (LEFT / RIGHT) then delete\n                                                        # Else, draw input socket with default orientation (LEFT) and no need to delete as block has no input sockets\n                                                        self.block.input_names = [\n                                                            str(j)\n                                                            for j in self.parameters[i][\n                                                                2\n                                                            ]\n                                                        ]\n                                                        if self.block.inputs:\n                                                            for k, socket in enumerate(\n                                                                self.block.inputs\n                                                            ):\n                                                                socket.updateSocketSign(\n                                                                    self.block.input_names[\n                                                                        k\n                                                                    ]\n                                                                )\n\n                                    # Otherwise if the parameter value is None or [], then remove all the socket labels for a block if there are any.\n                                    elif not self.parameters[i][2]:\n                                        if self.block.inputs:\n                                            if self.block.input_names:\n                                                for socket in self.block.inputs:\n                                                    socket.updateSocketSign(None)\n\n                                # If self.parameter relates to controlling the names of outport labels on subsystem blocks\n                                if self.parameters[i][0] == \"outport labels\":\n                                    # First check if labels are given for the sockets, if not, don't do anything special\n                                    if self.parameters[i][2] is not None:\n                                        input_length = len(self.parameters[i][2])\n                                        if input_length > 0:\n                                            # Find number of outputs controlled by nout\n                                            found_nout = False\n                                            for params in self.parameters:\n                                                if params[0] == \"nout\":\n                                                    num_nout_sockets = params[2]\n                                                    found_nout = True\n                                                    break\n                                            # Check if nout parameter was found, if not, return error as we need to know how many sockets to draw\n                                            if found_nout == False:\n                                                print(\n                                                    \"Error: Cannot draw OutPort labels as no 'nout' parameter was found to know how many sockets to draw.\"\n                                                )\n                                            else:\n                                                # If nout parameter was found, check if number of given OutPort labels matches number of sockets\n                                                if input_length != num_nout_sockets:\n                                                    bad_socket_labels.append(\n                                                        [paramName, paramOptions]\n                                                    )\n                                                else:\n                                                    # If parameter value hasn't changed, don't do anything\n                                                    if (\n                                                        inputInCompatibleFormat\n                                                        == paramVal\n                                                    ):\n                                                        pass\n                                                    else:\n                                                        # If the block already has output sockets, grab their orientation (LEFT / RIGHT) then delete\n                                                        # Else, draw output socket with default orientation (RIGHT) and no need to delete as block has no output sockets\n                                                        self.block.output_names = [\n                                                            str(j)\n                                                            for j in self.parameters[i][\n                                                                2\n                                                            ]\n                                                        ]\n                                                        if self.block.outputs:\n                                                            for k, socket in enumerate(\n                                                                self.block.outputs\n                                                            ):\n                                                                socket.updateSocketSign(\n                                                                    self.block.output_names[\n                                                                        k\n                                                                    ]\n                                                                )\n\n                                    # Otherwise if the parameter value is None or [], then remove all the socket labels for a block if there are any.\n                                    elif not self.parameters[i][2]:\n                                        if self.block.outputs:\n                                            if self.block.output_names:\n                                                for socket in self.block.outputs:\n                                                    socket.updateSocketSign(None)\n\n                    # Else the edited value is of the wrong type, display an error message\n                    else:\n                        # Append the parameter edited, and the required type, as an invalid_input\n                        invalid_input.append([paramName, paramType])\n\n                # Else no value was given for that input, display an error message\n                else:\n                    # Append the parameter edited, and the required type, as an invalid_input\n                    invalid_input.append([paramName, paramType])\n\n        # Once all the parameters are sanity checked,\n        # If the title has been set to a duplicate name, display a duplicate error message\n        if duplicate_title:\n            errorMessageText = \"\"\n            errorMessageTitle = \"Duplicate Block Title\"\n            errorMessageText += (\n                \"A block named '<font><b>\"\n                + duplicate_title[0]\n                + \"</font>' already exists, please choose another.\"\n            )\n            self.displayPopUpMessage(errorMessageTitle, errorMessageText, \"Error\")\n\n        # If any parameters have been returned with invalid types, display an invalid type error message\n        elif invalid_input:\n            errorMessageText = \"\"\n            errorMessageTitle = \"Input Types Not Compatible\"\n            for incompatibleInputs in invalid_input:\n                errorMessageText += (\n                    \"Expected '\"\n                    + \"<font><b>\"\n                    + incompatibleInputs[0]\n                    + \"</font>' to be type <font><b>\"\n                    + incompatibleInputs[1].__name__\n                    + \"</font>\"\n                )\n                errorMessageText += \"<br>\"\n            self.displayPopUpMessage(errorMessageTitle, errorMessageText, \"Error\")\n\n        # If any parameters don't meet their option restrictions, display a bad input error message\n        elif bad_inputs:\n            errorMessageText = \"\"\n            errorMessageTitle = \"Input Value Not Allowed\"\n            for badInput in bad_inputs:\n                # Different error message based on type of option\n                errorMessageText += (\n                    \"Parameter '\" + \"<font><b>\" + badInput[0] + \"</font>' must be \"\n                )\n                errorMessageText += makeBadInputErrorMsg(badInput[1])\n                errorMessageText += \"<br>\"\n            self.displayPopUpMessage(errorMessageTitle, errorMessageText, \"Error\")\n\n        # If labels are given for InPort, OutPort or SubSystem blocks which don't match the respective nin/nout value for number of sockets, display a bad socket label input error message\n        elif bad_socket_labels:\n            errorMessageText = \"\"\n            errorMessageTitle = \"Inconsistent Number of Given Socket Labels\"\n            for badSocketLabel in bad_socket_labels:\n                # Different error message based on type of option\n                errorMessageText += (\n                    \"Parameter '\"\n                    + \"<font><b>\"\n                    + badSocketLabel[0]\n                    + \"</font>' must correspond to number of nin/nout sockets.\"\n                )\n            self.displayPopUpMessage(errorMessageTitle, errorMessageText, \"Error\")\n\n        # Otherwise if there were no issues with updating the block parameters, display a success message, yay!\n        else:\n            successMessageText = \"Successfully updated block parameter values!\"\n            successMessageTitle = \"Success!\"\n            self.displayPopUpMessage(successMessageTitle, successMessageText, \"Success\")\n\n        # If a parameter update has changed a value then update the title of the model,\n        # to indicate that there is unsaved progress\n        if self.paramsWereChanged:\n            self.paramsWereChanged = False\n            self.block.scene.has_been_modified = True\n            self.block.scene.history.storeHistory(\"Block parameters updated\")\n\n        # Finally, notify the GraphicsBlock to update itself, should the number of sockets, or the block\n        # height have been called to change\n        self.block.grBlock.update()\n\n    @staticmethod\n    # -----------------------------------------------------------------------------\n    def getSafeValue(inputValue, requiredType, requiredOptions):\n        \"\"\"\n        This method takes an input value (which is the value a parameter is being checked\n        if it can be updated to), and checks whether it matches an allowable type that\n        has been defined for that parameter within the grandchild Block Class. If the\n        input value doesn't match the required type, an invalid type str will be returned.\n        If the input value does match the required type, it is further checked, whether\n        it matches any further restrictions placed onto that parameter from within the\n        grandchild Block Class. If the value doesn't meet the criteria of the restrictions,\n        a bad input str will be returned. If the input does match the criteria of the\n        restriction, it will be converted to the type it must be in and returned.\n\n        :param inputValue: the value which the parameter would be updated to\n        :type inputValue: str\n        :param requiredType: the value type which is required for this parameter\n        :type requiredType: type, determined by the grandchild Block Class\n        :param requiredOptions: a list of restrictions placed onto this parameter\n        :type requiredOptions: list\n        :return: - str (if incompatible type or restriction criteria not met),\n                 - requiredType (if compatible type and restrictions are met)\n        :rtype: type, determined by the grandchild Block Class\n        \"\"\"\n\n        # -----------------------------------------------------------------------------\n        def isValueInOption(value, options):\n            \"\"\"\n            This method checks whether the edited parameter value meets the option\n            restrictions placed on it by the Block it was defined in. The option\n            restrictions consist of a list equivalent to:\n\n            - [[\"restriction type1\" [restrictions]], [\"restriction type2\" [restrictions]]].\n\n            The edited parameter is checked whether it meets the conditions of 'restrictions'\n            for each 'restriction type'.\n\n            :param value: the edited parameter value being checked\n            :type value: any\n            :param options: the list of restriction options placed on this parameter\n            :type options: list\n            :return: - value (if meets criteria of placed restriction),\n                     - bad_format (if criteria is not met)\n            :rtype: - any (if criteria met), - str (if criteria not met)\n            \"\"\"\n\n            # If the parameter has restrictions placed on it\n            if options:\n                returnValue = \"@BadFormat@\"\n                # For each restriction that is placed onto the parameter\n                for option in options:\n\n                    # If the placed restriction is a set of keywords,\n                    if option[0] == \"keywords\":\n                        # Check if the given value matches one of those keywords\n                        if value.lower() in option[1]:\n                            returnValue = value\n                            break\n\n                    # If the placed restriction is a range of values\n                    elif option[0] == \"range\":\n                        # Check if given value is within that range\n                        if option[1][0] <= value <= option[1][1]:\n                            returnValue = value\n                            break\n\n                    # If the placed restriction are additional accepted types\n                    elif option[0] == \"type\":\n                        # Check if the None is one of the accepted types\n                        if type(None) in option[1]:\n                            # If the value given is None, return None\n                            if isinstance(value, str) and value.lower() in [\"none\"]:\n                                returnValue = None\n                                break\n\n                        # Check if given value matches any accepted types\n                        if type(value) in option[1]:\n                            returnValue = value\n                            break\n\n                    # If the placed restriction are a set of allowable character symbol\n                    elif option[0] == \"symbol\":\n                        # Check if value is a string\n                        if isinstance(value, str):\n                            # First get the max possible wrong characters in this string\n                            num_of_wrong_symbols = len(value)\n                            # Check each character within the given value against the set of allowable characters\n                            for sign in value:\n                                # For every character in the set of allowable characters, reduce the number\n                                # of wrong characters by 1\n                                if sign in option[1]:\n                                    num_of_wrong_symbols -= 1\n                            # If all characters within the string match a set of allowable characters\n                            if num_of_wrong_symbols == 0:\n                                returnValue = value\n                                break\n\n                        # Otherwise return badformat\n                        else:\n                            returnValue = \"@BadFormat@\"\n                            break\n\n                    # If the placed restriction are to the number of elements the parameter can have\n                    elif option[0] == \"size\":\n                        # Try to evalute the param value, and catch if it is a string\n                        try:\n                            # If input isn't a word (is a tuple, list, dict, num) try to evaluate it\n                            try:\n                                param_val = eval(value)\n                            # If a type error is thrown, then the input might already have been evaluated previously\n                            except TypeError:\n                                param_val = value\n\n                            # Check if the size of parameter is measureable, if not then its an int or float\n                            try:\n                                param_length = len(param_val)\n                                # If the size of the parameter meets one of the allowable sizes (e.g. 0, 2 or 4) then return the value\n                                if param_length in option[1]:\n                                    returnValue = value\n                                else:\n                                    returnValue = \"@BadFormat@\"\n                                break\n                            # If parameter isn't measureable, return bad format as param is an int/float, and size of a singular number cannot be checked\n                            except TypeError:\n                                returnValue = \"@BadFormat@\"\n                                break\n\n                        # If input is a word, evaluating it will try to match it to a variable name, which doesn't exist,\n                        # so in this case, don't check the size restriction on this parameter value\n                        except NameError:\n                            pass\n\n                # Return the value that has been set to be returned\n                return returnValue\n\n            # Else, if no restrictions are placed on this parameter, return the value\n            else:\n                return value\n\n        try:\n            # If input must be string, only strings can be accepted\n            if issubclass(requiredType, str):\n                # If the input is not a number, but an acceptable string\n                if isinstance(inputValue, str):\n\n                    # Check if no input has been given\n                    if len(inputValue) == 0:\n                        return \"@InvalidType@\"\n                    else:\n                        # return isValueInOption(inputValue.lower(), requiredOptions)\n                        return isValueInOption(inputValue, requiredOptions)\n\n                        # # Check if the input is made up of normal characters [a-zA-z0-9]\n                        # if inputValue.isalnum():\n                        #     return isValueInOption(inputValue.lower(), requiredOptions)\n                        #\n                        # # Otherwise the input has special characters (=,-,+,*,/,:,etc)\n                        # else:\n                        #     # Check if string contains '=', as this is restricted to variable name definitions, and is not allowed for regular strings\n                        #     if \"=\" in inputValue:\n                        #         outcome = isValueInOption(inputValue, requiredOptions)\n                        #         if outcome == \"@BadFormat@\":\n                        #             return outcome\n                        #         else:\n                        #             return \"@InvalidType@\"\n                        #     else:\n                        #         return isValueInOption(inputValue.lower(), requiredOptions)\n                else:\n                    return \"@InvalidType@\"\n\n            # If input must be bool, only booleans can be accepted\n            elif issubclass(requiredType, bool):\n                # All input starts off as text, so True/False will be 'True'/'False'\n                if isinstance(inputValue, str):\n                    # Check if the string matches true/false, and return accordingly\n                    if inputValue in [\"True\", \"true\"]:\n                        return True\n                    elif inputValue in [\"False\", \"false\"]:\n                        return False\n                    # Otherwise if string is None, check if this boolean parameter allows that type\n                    elif inputValue.lower() in [\"none\"]:\n                        return isValueInOption(inputValue.lower(), requiredOptions)\n                    else:\n                        return \"@InvalidType@\"\n                else:\n                    return \"@InvalidType@\"\n\n            # If input must be int, floats can be converted to int\n            elif issubclass(requiredType, int):\n                # Try applying int() to the input value, if possible, check restrictions on value\n                try:\n                    requiredType(inputValue)\n                    return isValueInOption(requiredType(inputValue), requiredOptions)\n                except ValueError:\n                    # If applying int() doesn't work but value is None, check if this is an allowable type\n                    if inputValue.lower() in [\"none\"]:\n                        return isValueInOption(inputValue, requiredOptions)\n                    else:\n                        return \"@InvalidType@\"\n\n            # If input must be float, int can be converted to float\n            elif issubclass(requiredType, float):\n                # All inputValues come in as a string, so first check if this evaluated string is a float\n                try:\n                    evaluated_value = eval(inputValue)\n\n                    # If value can be evaluated safely, check if the value is an instance of float\n                    if isinstance(evaluated_value, float):\n                        # If so, check further restrictions on this parameter, return the outcome\n                        return isValueInOption(evaluated_value, requiredOptions)\n\n                    # If value is not a float, but is none, check if this is an allowable type\n                    elif inputValue.lower() in [\"none\"]:\n                        return isValueInOption(inputValue, requiredOptions)\n\n                    # If value is not a float, and None is not allowed, return invalid type\n                    else:\n                        try:\n                            float_value = float(evaluated_value)\n                            return isValueInOption(float_value, requiredOptions)\n                        except (ValueError, TypeError):\n                            return \"@InvalidType@\"\n\n                # If any exceptions arise while trying to evaluate, then the value is incorrect\n                except:\n                    return \"@InvalidType@\"\n\n            # If input must be a list, only list can be accepted\n            elif (\n                issubclass(requiredType, list)\n                or issubclass(requiredType, tuple)\n                or issubclass(requiredType, dict)\n            ):\n                try:\n                    # If the input value can be evaluated as a list, tuple or dict, check restrictions on value\n                    ast.literal_eval(inputValue)\n                    if inputValue.lower() in [\"none\"]:\n                        return isValueInOption(inputValue, requiredOptions)\n                    else:\n                        return isValueInOption(\n                            ast.literal_eval(inputValue), requiredOptions\n                        )\n                except ValueError:\n                    return \"@InvalidType@\"\n\n            # If input can be of type 'any', allow any value to be saved. This will also process the 'callable' type, in the same way.\n            elif issubclass(requiredType, type(any)):\n                # Return the outcome of check this input against any restrictions for this parameter\n                # Type any or callable should be allowed to pass through a string\n                return isValueInOption(inputValue, requiredOptions)\n\n        except Exception as e:\n            print(e)\n            print(\n                \"Fatal Error: Recent changes to a parameter have caused an unforseen error.\\nKnown info about parameter causing the error: given value ->\",\n                inputValue,\n                \"expected type ->\",\n                requiredType,\n                \"parameter restrictions ->\",\n                requiredOptions,\n            )\n            return \"@InvalidType@\"\n"
  },
  {
    "path": "bdsim/bdedit/block_socket.py",
    "content": "# Library imports\nfrom collections import OrderedDict\n\n# BdEdit imports\nfrom bdsim.bdedit.interface_serialize import Serializable\nfrom bdsim.bdedit.block_graphics_socket import GraphicsSocket\n\n# =============================================================================\n#\n#   Defining and setting global variables\n#\n# =============================================================================\n# Socket positioning variables (in relation to where they're drawn on the block)\nLEFT = 1\nTOP = 2\nRIGHT = 3\nBOTTOM = 4\n\n# Socket type classification variables\nINPUT = 1\nOUTPUT = 2\nCONNECTOR = 3\n\n# Variable for enabling/disabling debug comments\nDEBUG = False\n\n\n# =============================================================================\n#\n#   Defining the Socket Class, which controls the type of Socket drawn, its\n#   position within the Block it relates to, and allows for Wires to connect\n#   to the Block through these Sockets.\n#\n# =============================================================================\nclass Socket(Serializable):\n    \"\"\"\n    The ``Socket`` Class extends the ``Serializable`` Class from BdEdit, and\n    defines how a socket is represented, and has all the necessary methods\n    for creating, manipulating and interacting with a socket. This class allows\n    for Wires to be connected to Blocks, while also controlling where on the\n    Block the Sockets are drawn, and how they appear.\n\n    This class includes information about the sockets':\n\n    - type;\n    - index;\n    - position;\n    - appearance;\n    - parent Block; and\n    - connected wire(s).\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(\n        self,\n        node,\n        index=0,\n        position=LEFT,\n        socket_type=INPUT,\n        multi_wire=True,\n        socket_label=None,\n    ):\n        \"\"\"\n        This method initializes an instance of the ``Socket`` Class.\n\n        :param node: the associated Block this Socket relates to\n        :type node: Block, required\n        :param index: the height (along the side of the Block) this Socket should be drawn at\n        :type index: int, optional, defaults to 0\n        :param position: the side ( LEFT(1) or RIGHT(3) ) this Socket should be drawn on\n        :type position: enumerate, optional, defaults to LEFT(1)\n        :param socket_type: this Socket's type (INPUT(1) or OUTPUT(2))\n        :type socket_type: enumerate, optional, defaults to INPUT(1)\n        :param multi_wire: boolean of whether this Socket has multiple wires\n        :type multi_wire: bool, optional, defaults to True\n        \"\"\"\n        super().__init__()\n\n        self.node = node\n        self.index = index\n        self.position = position\n        self.socket_type = socket_type\n        self.socket_sign = socket_label\n        self.is_multi_wire = multi_wire\n        self.grSocket = GraphicsSocket(self)\n\n        self.grSocket.setPos(*self.node.getSocketPosition(index, position))\n\n        self.wires = []\n\n    # -----------------------------------------------------------------------------\n    def getSocketPosition(self):\n        \"\"\"\n        This method retrieves and returns the [x,y] coordinates for where the\n        current Socket should be drawn.\n\n        :return: the [x,y] coordinates at which to place this Socket.\n        :rtype: list of int, int\n        \"\"\"\n\n        res = self.node.getSocketPosition(self.index, self.position)\n        return res\n\n    # -----------------------------------------------------------------------------\n    def setConnectedEdge(self, wire):\n        \"\"\"\n        This method adds the given wire to the list of Wires that are connected to\n        this Socket.\n\n        :param wire: the wire connecting to this Socket\n        :type wire: Wire, required\n        \"\"\"\n\n        self.wires.append(wire)\n\n    # -----------------------------------------------------------------------------\n    def hasEdge(self):\n        \"\"\"\n        This method returns True if the current Socket has Wires connected to it,\n        and False if no Wires are connected to it.\n\n        :return: - True (If wires are connected to this Socket)\n                 - False (If no wires are connected to this Socket)\n        :rtype: bool\n        \"\"\"\n\n        return self.wires is not None\n\n    # -----------------------------------------------------------------------------\n    def removeWire(self, wire):\n        \"\"\"\n        This method removes the given Wire from the list of Wires connected to this\n        Socket, if it is connected to this Socket.\n\n        :param wire: the wire to be removed\n        :type wire: Wire, required\n        \"\"\"\n\n        if wire in self.wires:\n            self.wires.remove(wire)\n        else:\n            print(\"Socket remove edge not in list\")\n\n    # -----------------------------------------------------------------------------\n    def removeAllWires(self):\n        \"\"\"\n        This method removes all Wires connected to this Socket.\n        \"\"\"\n\n        # While there are Wires in this Socket's list of Wires, remove the first Wire\n        while self.wires:\n            wire = self.wires.pop(0)\n            wire.remove()\n\n    # -----------------------------------------------------------------------------\n    def isInputSocket(self):\n        \"\"\"\n        This method returns True if the current Socket is an input socket.\n\n        :return: - True (If current Socket is an input Socket)\n                 - False (If current Socket is not an input Socket)\n        :rtype: bool\n        \"\"\"\n\n        isInputSocket = False\n        # Compare the id of the current socket against the id's of sockets\n        # within the associated Blocks' list of input sockets\n        for socket in self.node.inputs:\n            # If current socket is in that list, it is an input socket\n            if self.id == socket.id:\n                isInputSocket = True\n                break\n        return isInputSocket\n\n    # -----------------------------------------------------------------------------\n    def isOutputSocket(self):\n        \"\"\"\n        This method returns True if the current Socket is an output socket.\n\n        :return: - True (If current Socket is an output Socket)\n                 - False (If current Socket is not an output Socket)\n        :rtype: bool\n        \"\"\"\n        isOutputSocket = False\n        # Compare the id of the current socket against the id's of sockets\n        # within the associated Blocks' list of output sockets\n        for socket in self.node.outputs:\n            # If current socket is in that list, it is an output socket\n            if self.id == socket.id:\n                isOutputSocket = True\n                break\n        return isOutputSocket\n\n    # -----------------------------------------------------------------------------\n    def updateSocketSign(self, value):\n        \"\"\"\n        This method updates the value of the socket label assigned to this socket.\n        As none but a select few blocks (SubSystem, OutPort, InPort) support dynamic\n        updating of the socket labels, this method should not be used  unless it is\n        for one of the mentioned blocks.\n\n        :param value: new value to assign for socket label\n        :type value: str, int, None or []\n        \"\"\"\n        try:\n            self.socket_sign = value\n        except Exception:\n            self.socket_sign = None\n\n    # -----------------------------------------------------------------------------\n    def removeSockets(self, type):\n        \"\"\"\n        This method removes all of the input or output Sockets, relating to this\n        Block, as specified by the type.\n\n        This method removes all sockets of given type, associated with this ``Block``.\n\n        :param type: the type of Socket to remove (\"Input\" or \"Output\")\n        :type type: str, required\n        \"\"\"\n\n        # If in DEBUG mode, this code will return the type of Socket that has just\n        # been removed, and that the socket removal process has started. When this\n        # process is finished, a done message will be printed.\n        if DEBUG:\n            print(\"# Removing \" + type + \" Sockets\", self)\n        if DEBUG:\n            print(\" - removing grSockets\")\n\n        # This allows one method to be used for deleting input OR output sockets\n        if type == \"Input\":\n            socketTypes = self.node.inputs\n        elif type == \"Output\":\n            socketTypes = self.node.outputs\n\n        # For each socket within the list determined by either Input or Output\n        # socket type\n        for socket in socketTypes:\n            # Remove the graphics parent item (the associated graphics block class)\n            # Remove the graphics socket class\n            socket.grSocket.setParentItem(None)\n            socket.grSocket = None\n            # If this socket has any wires attached to it, remove them\n            if socket.hasEdge():\n                for wire in socket.wires:\n                    wire.remove()\n\n        # Finally remove the socket class from the associated block\n        self.node.removeSockets(type)\n\n        if DEBUG:\n            print(\" - everything is done.\")\n\n    # -----------------------------------------------------------------------------\n    def serialize(self):\n        \"\"\"\n        This method is called to create an ordered dictionary of all of this Sockets'\n        parameters - necessary for the reconstruction of this Socket - as key-value\n        pairs. This dictionary is later used for writing into a JSON file.\n\n        :return: an ``OrderedDict`` of [keys, values] pairs of all essential ``Socket``\n                 parameters.\n        :rtype: ``OrderedDict`` ([keys, values]*)\n        \"\"\"\n\n        return OrderedDict(\n            [\n                (\"id\", self.id),\n                (\"index\", self.index),\n                (\"multi_wire\", self.is_multi_wire),\n                (\"position\", self.position),\n                (\"socket_type\", self.socket_type),\n            ]\n        )\n\n    # -----------------------------------------------------------------------------\n    def deserialize(self, data, hashmap={}):\n        \"\"\"\n        This method is called to reconstruct a ``Socket`` when loading a saved JSON\n        file containing all relevant information to recreate the ``Scene`` with all\n        its items.\n\n        :param data: a Dictionary of essential information for reconstructing a ``Socket``\n        :type data: OrderedDict, required\n        :param hashmap: a Dictionary for directly mapping the essential socket variables\n                        to this instance of ``Socket``, without having to individually map each variable\n        :type hashmap: Dict, required\n        :return: True when completed successfully\n        :rtype: Boolean\n        \"\"\"\n\n        # The id of this Socket is set to whatever was stored as its id in the JSON file.\n        self.id = data[\"id\"]\n        # The remaining variables associated to this Socket are mapped to itself\n        hashmap[data[\"id\"]] = self\n\n        return True\n"
  },
  {
    "path": "bdsim/bdedit/block_wire.py",
    "content": "# Library imports\nimport time\nimport copy\nfrom collections import OrderedDict\n\n# BdEdit imports\nfrom bdsim.bdedit.block_graphics_wire import *\nfrom bdsim.bdedit.interface_serialize import Serializable\n\n# =============================================================================\n#\n#   Defining and setting global variables\n#\n# =============================================================================\n# Wire type variables for choosing between the 3 possible wire styles\nWIRE_TYPE_DIRECT = 1\nWIRE_TYPE_BEZIER = 2\nWIRE_TYPE_STEP = 3\n\n# Variable for enabling/disabling debug comments\nDEBUG = False\nDEBUG_OVERLAP = False\n\n\n# =============================================================================\n#\n#   Defining the Wire Class, which is used to define the Wires that connect the\n#   blocks via the sockets, each wire has a start socket and a end socket and a\n#   wire type that defines how the wires will be drawn. The code also updates\n#   the wires as the blocks are moved around so they stay connected.\n#\n# =============================================================================\nclass Wire(Serializable):\n    \"\"\"\n    The ``Wire`` Class extends the ``Serializable`` Class from BdEdit, and\n    defines how a wire is represented, and has all the necessary methods\n    for creating, manipulating and interacting with a wire. This class connects\n    start and end sockets to a created wire. The style of wire being drawn is\n    also controlled by this Class:\n\n    - a straight wire will have type DIRECT(1),\n    - a curved or wave-like wire will have type BEZIER(2),\n    - a stepped wire will have type STEP(3)\n\n    This class includes information about the wires':\n\n    - style;\n    - end_socket;\n    - start_socket;\n    - point-to-point coordinates;\n    - horizontal and vertical line segments;\n    - intersection points with other wires (has been disabled).\n\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, scene, start_socket=None, end_socket=None, wire_type=3):\n        \"\"\"\n        This method initializes an instance of the ``Wire`` Class.\n\n        :param scene: a scene (or canvas) in which the Wire is stored and shown (or painted into). Provided by the ``Interface``.\n        :type scene: ``Scene``, required\n        :param start_socket: the start Socket of this Wire\n        :type start_socket: Socket, optional, defaults to None (automatically set)\n        :param end_socket: the end Socket of this Wire\n        :type end_socket: Socket, optional, defaults to None (automatically set)\n        :param wire_type: the wire style of this Wire (DIRECT(1), BEZIER(2), STEP(3))\n        :type wire_type: enumerate, optional, defaults to STEP(3) (automatically set)\n        \"\"\"\n\n        super().__init__()\n\n        self.scene = scene\n\n        # By default the Wire starts with no sockets, these are automatically\n        # set by decorators when a Wire instance is created\n        self._start_socket = None\n        self._end_socket = None\n\n        self.start_socket = start_socket\n        self.end_socket = end_socket\n        self.wire_type = wire_type\n\n        self.wire_coordinates = []\n        self.horizontal_segments = []\n        self.vertical_segments = []\n        self.intersections = []\n\n        # Once created, the wire is added to the Scene\n        self.scene.addWire(self)\n\n    # -----------------------------------------------------------------------------\n    @property\n    def start_socket(self):\n        \"\"\"\n        This method is a decorate that gets the start socket of this Wire.\n\n        :return: the start Socket of this Wire\n        :rtype: Socket\n        \"\"\"\n\n        return self._start_socket\n\n    # -----------------------------------------------------------------------------\n    @start_socket.setter\n    def start_socket(self, value):\n        \"\"\"\n        This method is a decorator that sets the start socket of this Wire to the\n        given value (which is a Socket).\n\n        :param value: the Socket being assigned\n        :type value: Socket\n        \"\"\"\n\n        # If this wire was assigned to some socket before, delete this wire instance from that socket\n        if self._start_socket is not None:\n            self._start_socket.removeWire(self)\n\n        # Assign a new start socket for this wire\n        self._start_socket = value\n\n        # Add this wire to the associated Socket (in the Socket Class)\n        if self.start_socket is not None:\n            self.start_socket.setConnectedEdge(self)\n\n    # -----------------------------------------------------------------------------\n    @property\n    def end_socket(self):\n        \"\"\"\n        This method is a decorate that gets the end socket of this Wire.\n\n        :return: the end Socket of this Wire\n        :rtype: Socket\n        \"\"\"\n\n        return self._end_socket\n\n    # -----------------------------------------------------------------------------\n    @end_socket.setter\n    def end_socket(self, value):\n        \"\"\"\n        This method is a decorator that sets the end socket of this Wire to the\n        given value (which is a Socket).\n\n        :param value: the Socket being assigned\n        :type value: Socket\n        \"\"\"\n\n        # If this wire was assigned to some socket before, delete this wire instance from that socket\n        if self._end_socket is not None:\n            self._end_socket.removeWire(self)\n\n        # Assign a new start socket for this wire\n        self._end_socket = value\n\n        # Add this wire to the associated Socket (in the Socket Class)\n        if self.end_socket is not None:\n            self.end_socket.setConnectedEdge(self)\n\n    # -----------------------------------------------------------------------------\n    @property\n    def wire_type(self):\n        \"\"\"\n        This method is a decorate that gets the wire type (or style) of this Wire.\n\n        :return: the style of this Wire (DIRECT(1), BEZIER(2), STEP(3))\n        :rtype: enumerate\n        \"\"\"\n\n        return self._wire_type\n\n    # -----------------------------------------------------------------------------\n    @wire_type.setter\n    def wire_type(self, value):\n        \"\"\"\n        This method is a decorator that sets the wire type (or style) of this Wire to the\n        given value (which is an enum). This method will determine how the wire is drawn.\n        By default the wire type is set to draw STEP(3) wires, however other line styles\n        can also be added here. The wire type dictate which corresponding GraphicsWire\n        class is called to draw the wire.\n\n        :param value: the wire type this Wire is being set to\n        :type value: enumerate\n        \"\"\"\n\n        # If this was already previously assigned, remove its GraphicsWire\n        if hasattr(self, \"grWire\") and self.grWire is not None:\n            self.scene.grScene.removeItem(self.grWire)\n\n        # Assign a new wire type for this wire\n        self._wire_type = value\n\n        # Depending on the updated wire_type of this Wire, create a\n        # instance of a GraphicsWire for this Wire\n        if self.wire_type == WIRE_TYPE_DIRECT:\n            self.grWire = GraphicsWireDirect(self)\n        elif self.wire_type == WIRE_TYPE_STEP:\n            self.grWire = GraphicsWireStep(self)\n        else:\n            self.grWire = GraphicsWireBezier(self)\n\n        # Add the wire to the GraphicsScene\n        self.scene.grScene.addItem(self.grWire)\n\n        # If a start socket has been assigned, update where the Wire is drawn from\n        if self.start_socket is not None:\n            self.updatePositions()\n\n    def setFocusOfWire(self):\n        \"\"\"\n        This method sends all ``Wire`` instances within the ``Scene`` to back\n        and then sends the currently selected ``Wire`` instance to front.\n        \"\"\"\n\n        # Iterates through each wire within wire list stored in the Scene Class\n        # and sets the graphical component of each wire to a zValue of -2.\n        for wire in self.scene.wires:\n            wire.grWire.setZValue(-2)\n\n        # Then sets the graphical component of the currently selected wire to a\n        # zValue of -1, which makes it display above all other wires on screen.\n        self.grWire.setZValue(-1)\n\n    # -----------------------------------------------------------------------------\n    def updatePositions(self):\n        \"\"\"\n        This method grabs the new positions of sockets on blocks as they are moved\n        around within the scene, in order to determine the positions which the\n        wire should connect. The redrawing of the wire to these positions will also\n        be handled within this method.\n        \"\"\"\n\n        # Grabs the current position (LEFT/RIGHT) of the starting socket\n        # and sets the associated source (start) socket orientation (position) within\n        # the GraphicsWire Class\n        source_pos_orientation = self.start_socket.position\n        self.grWire.setSourceOrientation(source_pos_orientation)\n\n        # Grabs the position of the start socket and splits it into x,y coordinates\n        # then assigns the position of the source (start) socket to these coordinates\n        source_pos = self.start_socket.getSocketPosition()\n        source_pos[0] += self.start_socket.node.grBlock.pos().x()\n        source_pos[1] += self.start_socket.node.grBlock.pos().y()\n        self.grWire.setSource(*source_pos)\n\n        # If an end socket has been set for this wire, the same logic as above will\n        # be applied, otherwise the destination (end) socket will be set to the coordinates\n        # of the source (start) socket. This will be fixed when the wire is completed and remade.\n        if self.end_socket is not None:\n            destination_pos_orientation = self.end_socket.position\n            self.grWire.setDestinationOrientation(destination_pos_orientation)\n\n            end_pos = self.end_socket.getSocketPosition()\n            end_pos[0] += self.end_socket.node.grBlock.pos().x()\n            end_pos[1] += self.end_socket.node.grBlock.pos().y()\n            self.grWire.setDestination(*end_pos)\n        else:\n            self.grWire.setDestination(*source_pos)\n\n        # The wire is called to be updated\n        self.grWire.update()\n\n    # -----------------------------------------------------------------------------\n    def remove_from_sockets(self):\n        \"\"\"\n        This method will un-assign the start and end sockets of this Wire.\n        \"\"\"\n\n        self.end_socket = None\n        self.start_socket = None\n\n    # -----------------------------------------------------------------------------\n    def remove(self):\n        \"\"\"\n        This method will remove the selected Wire from the Scene, un-assign\n        the Sockets that related to it, and remove the Wire from these Sockets.\n        \"\"\"\n\n        if self in self.scene.wires:\n            if DEBUG:\n                print(\"# Removing Wire\", self)\n            if DEBUG:\n                print(\" - hiding grWire\")\n            self.grWire.hide()\n\n            if DEBUG:\n                print(\" - removing grWire\")\n            self.scene.grScene.removeItem(self.grWire)\n\n            if DEBUG:\n                print(\" - removing wire from all sockets\", self)\n            self.remove_from_sockets()\n\n            if DEBUG:\n                print(\" - removing wire from scene\")\n            try:\n                self.scene.removeWire(self)\n            except ValueError as e:\n                print(\"Error removing wire:\", e)\n                pass\n\n            if DEBUG:\n                print(\" - updating wire intersection points\")\n            if self.scene.wires:\n                self.scene.wires[0].checkIntersections()\n\n            if DEBUG:\n                print(\" - everything is done.\")\n        else:\n            if DEBUG:\n                print(\"# Wire already removed\")\n\n    # -----------------------------------------------------------------------------\n    def serialize(self):\n        \"\"\"\n        This method is called to create an ordered dictionary of all of this Wires'\n        parameters - necessary for the reconstruction of this Wire - as key-value\n        pairs. This dictionary is later used for writing into a JSON file.\n\n        :return: an ``OrderedDict`` of [keys, values] pairs of all essential ``Wire``\n                 parameters.\n        :rtype: OrderedDict, ([keys, values]*)\n        \"\"\"\n\n        if self.grWire.customlogicOverride:\n            wire_coords = copy.copy(self.wire_coordinates)\n        else:\n            wire_coords = []\n\n        return OrderedDict(\n            [\n                (\"id\", self.id),\n                (\"start_socket\", self.start_socket.id),\n                (\"end_socket\", self.end_socket.id),\n                (\"wire_type\", self.wire_type),\n                (\"custom_routing\", self.grWire.customlogicOverride),\n                (\"wire_coordinates\", wire_coords),\n            ]\n        )\n\n    # -----------------------------------------------------------------------------\n    def deserialize(self, data, hashmap={}):\n        \"\"\"\n        This method is called to reconstruct a ``Wire`` when loading a saved JSON\n        file containing all relevant information to recreate the ``Scene`` with all\n        its items.\n\n        :param data: a Dictionary of essential information for reconstructing a ``Wire``\n        :type data: OrderedDict, required\n        :param hashmap: a Dictionary for directly mapping the essential wire variables\n                        to this instance of ``Wire``, without having to individually map each variable\n        :type hashmap: Dict, required\n        :return: True when completed successfully\n        :rtype: Boolean\n        \"\"\"\n\n        # The id, and other variables of this Wire are set to whatever was stored\n        # as its id and other variables in the JSON file.\n        self.id = data[\"id\"]\n        # self.start_socket = data['start_socket']\n        # self.end_socket = data['end_socket']\n        self.start_socket = hashmap[data[\"start_socket\"]]\n        self.end_socket = hashmap[data[\"end_socket\"]]\n        self.wire_type = data[\"wire_type\"]\n\n        # For newer custom routing logic. If custom_routing exists within the saved JSON\n        # data, and that variable is true, override the current wire_coordiantes of the wire\n        # to the ones saved in the file.\n        try:\n            if data[\"custom_routing\"]:\n                self.grWire.customlogicOverride = data[\"custom_routing\"]\n                try:\n                    if data[\"wire_coordinates\"]:\n                        # Wire coordinates is supposed to be a list of tuples, but in JSON they\n                        # are stored as a list of lists. So convert the points to tuples\n                        new_wire_coordinates = []\n                        for point in data[\"wire_coordinates\"]:\n                            new_wire_coordinates.append(tuple(point))\n                        self.grWire.updateWireCoordinates(new_wire_coordinates)\n                except KeyError:\n                    pass\n        except KeyError:\n            pass\n\n        return True\n\n    # -----------------------------------------------------------------------------\n    def checkIntersections(self):\n        \"\"\"\n        This method checks all active wires in the scene for intersections with other\n        wires. This method will be called any time a mouse movement is detected in\n        the GraphicsView class, which will cause the GraphicsScene to draw points\n        at these intersections to separate the wires.\n\n        To reduce computation for finding these intersection points, only vertical\n        line segments of wires are checked for intersections. This is because an\n        intersection point can only occur when a horizontal line segment of one wire\n        meets a vertical line segment of another wire, and every single wire has a\n        horizontal segment (as sockets are drawn on the LEFT or RIGHT sides of a Block).\n\n        When this method is called, the current intersection points are deleted, as\n        all wires are checked against in this method, and as such, any new (or previous)\n        intersection points will be appended into a list of intersection points that\n        is stored within the GraphicsScene Class.\n        \"\"\"\n\n        # Clear the intersection list stored within the scene of any previous intersection points\n        self.scene.intersection_list.clear()\n\n        # Grab the number of wires currently in the scene\n        number_of_wires = len(self.scene.wires)\n\n        # If there are more than 1 wires, check for overlapping\n        if number_of_wires > 1:\n\n            # Iterate through each wire in list of wires\n            for i in range(0, number_of_wires):\n\n                # If the wire has a vertical segment, check intersections against other wires\n                # Else ignore (as wire only has horizontal segments, and these cant create an intersection point\n                # unless a vertical line passes through them)\n\n                wire_has_vert = self.scene.wires[i].vertical_segments\n                if wire_has_vert:\n\n                    # Check each vertical segment against horizontal segments of other wires\n                    for vertical_segment in wire_has_vert:\n\n                        for j in range(0, number_of_wires):\n\n                            # If j==i this means the same wire is being checked, ignore checking this wire (cannot overlap with itself)\n                            if j == i:\n                                pass\n                            # Or if wire 'j' starts from the same socket as 'i', ignore this wire\n                            elif (\n                                self.scene.wires[j].start_socket\n                                == self.scene.wires[i].start_socket\n                            ):\n                                pass\n                            else:\n\n                                # Iterate through each horizontal segments of the wire being checked\n                                for horizontal_segment in self.scene.wires[\n                                    j\n                                ].horizontal_segments:\n\n                                    # In a vertical wire with points [(a1,b1), (a2,b2)], the horizontal coordinates will be\n                                    # equal, hence the wire is essentially [(a,b1), (a,b2)]\n\n                                    # In a horizontal wire with points [(x1,y1), (x2,y2)], the vertical coordinates will be\n                                    # equal, hence the wire is essentially [(x1,y), (x2,y)]\n\n                                    # If vertical points of wire with a vertical segment, are intersecting the y coordinate\n                                    # of a horizontal segment of the wire being checked against\n                                    # Essentially checking if b1 <= y <= b2 (if y is between b1 and b2)\n                                    if (\n                                        vertical_segment[0][1]\n                                        <= horizontal_segment[0][1]\n                                        <= vertical_segment[1][1]\n                                        or vertical_segment[0][1]\n                                        >= horizontal_segment[0][1]\n                                        >= vertical_segment[1][1]\n                                    ):\n                                        if DEBUG_OVERLAP:\n                                            print(\n                                                \"y coords of vert segment within y coord of horizontal seg\"\n                                            )\n\n                                        # There may be a possible intersection, so now\n                                        # check if the horizontal points of wire with a vertical segment, intersects through\n                                        # the x coordinate of a horizontal segment of the wire being checked against\n                                        # Essentially checking if x1 <= a <= x2 (if a is between x1 and x2)\n                                        if (\n                                            horizontal_segment[0][0]\n                                            <= vertical_segment[0][0]\n                                            <= horizontal_segment[1][0]\n                                            or horizontal_segment[0][0]\n                                            >= vertical_segment[0][0]\n                                            >= horizontal_segment[1][0]\n                                        ):\n                                            if DEBUG_OVERLAP:\n                                                print(\n                                                    \"x coord of vert segment within x coords of horizontal seg\"\n                                                )\n\n                                            # The intersection point is (a, y)\n                                            # (a -> x coord from vertical segment, y -> y coord from horizontal segment)\n\n                                            # An intersection is found, append the point to the wire's list of intersections\n                                            # self.intersections.append((vertical_segment[0][0], horizontal_segment[0][1]))\n\n                                            # Append intersection point into list of intersection points (stored within the scene)\n                                            if (\n                                                vertical_segment[0][0],\n                                                horizontal_segment[0][1],\n                                            ) not in self.scene.intersection_list:\n                                                self.scene.intersection_list.append(\n                                                    (\n                                                        vertical_segment[0][0],\n                                                        horizontal_segment[0][1],\n                                                    )\n                                                )\n"
  },
  {
    "path": "bdsim/bdedit/docs/.buildinfo",
    "content": "# Sphinx build info version 1\n# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.\nconfig: 9b83c4d3849f0701fab540b588e30695\ntags: 645f666f9bcd5a90fca523b33c5a78b7\n"
  },
  {
    "path": "bdsim/bdedit/docs/_sources/bdedit.rst.txt",
    "content": "bdedit package\n==============\n\nSubmodules\n----------\n\nbdedit.Icons module\n-------------------\n\n.. automodule:: bdedit.Icons\n   :members:\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.block module\n-------------------\n\n.. automodule:: bdedit.block\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.block\\_graphics\\_block module\n------------------------------------\n\n.. automodule:: bdedit.block_graphics_block\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.block\\_graphics\\_socket module\n-------------------------------------\n\n.. automodule:: bdedit.block_graphics_socket\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.block\\_graphics\\_wire module\n-----------------------------------\n\n.. automodule:: bdedit.block_graphics_wire\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.block\\_param\\_window module\n----------------------------------\n\n.. automodule:: bdedit.block_param_window\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.block\\_socket module\n---------------------------\n\n.. automodule:: bdedit.block_socket\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.block\\_socket\\_block module\n----------------------------------\n\n.. automodule:: bdedit.block_socket_block\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.block\\_wire module\n-------------------------\n\n.. automodule:: bdedit.block_wire\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.interface module\n-----------------------\n\n.. automodule:: bdedit.interface\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.interface\\_graphics\\_scene module\n----------------------------------------\n\n.. automodule:: bdedit.interface_graphics_scene\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.interface\\_graphics\\_view module\n---------------------------------------\n\n.. automodule:: bdedit.interface_graphics_view\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.interface\\_scene module\n------------------------------\n\n.. automodule:: bdedit.interface_scene\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nbdedit.interface\\_serialize module\n----------------------------------\n\n.. automodule:: bdedit.interface_serialize\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n\nModule contents\n---------------\n\n.. automodule:: bdedit\n   :members:\n   :special-members: __init__\n   :undoc-members:\n   :show-inheritance:\n"
  },
  {
    "path": "bdsim/bdedit/docs/_sources/index.rst.txt",
    "content": ".. BdEdit documentation master file, created by\n   sphinx-quickstart on Wed Jun  9 03:42:11 2021.\n   You can adapt this file completely to your liking, but it should at least\n   contain the root `toctree` directive.\n\nWelcome to BdEdit's documentation!\n==================================\n\n.. toctree::\n   :maxdepth: 2\n   :caption: Contents:\n\n   modules\n\nIndices and tables\n==================\n\n* :ref:`genindex`\n* :ref:`modindex`\n* :ref:`search`\n"
  },
  {
    "path": "bdsim/bdedit/docs/_sources/modules.rst.txt",
    "content": "bdedit\n======\n\n.. toctree::\n   :maxdepth: 4\n\n   bdedit\n"
  },
  {
    "path": "bdsim/bdedit/docs/_static/alabaster.css",
    "content": "@import url(\"basic.css\");\n\n/* -- page layout ----------------------------------------------------------- */\n\nbody {\n    font-family: Georgia, serif;\n    font-size: 17px;\n    background-color: #fff;\n    color: #000;\n    margin: 0;\n    padding: 0;\n}\n\n\ndiv.document {\n    width: 940px;\n    margin: 30px auto 0 auto;\n}\n\ndiv.documentwrapper {\n    float: left;\n    width: 100%;\n}\n\ndiv.bodywrapper {\n    margin: 0 0 0 220px;\n}\n\ndiv.sphinxsidebar {\n    width: 220px;\n    font-size: 14px;\n    line-height: 1.5;\n}\n\nhr {\n    border: 1px solid #B1B4B6;\n}\n\ndiv.body {\n    background-color: #fff;\n    color: #3E4349;\n    padding: 0 30px 0 30px;\n}\n\ndiv.body > .section {\n    text-align: left;\n}\n\ndiv.footer {\n    width: 940px;\n    margin: 20px auto 30px auto;\n    font-size: 14px;\n    color: #888;\n    text-align: right;\n}\n\ndiv.footer a {\n    color: #888;\n}\n\np.caption {\n    font-family: inherit;\n    font-size: inherit;\n}\n\n\ndiv.relations {\n    display: none;\n}\n\n\ndiv.sphinxsidebar a {\n    color: #444;\n    text-decoration: none;\n    border-bottom: 1px dotted #999;\n}\n\ndiv.sphinxsidebar a:hover {\n    border-bottom: 1px solid #999;\n}\n\ndiv.sphinxsidebarwrapper {\n    padding: 18px 10px;\n}\n\ndiv.sphinxsidebarwrapper p.logo {\n    padding: 0;\n    margin: -10px 0 0 0px;\n    text-align: center;\n}\n\ndiv.sphinxsidebarwrapper h1.logo {\n    margin-top: -10px;\n    text-align: center;\n    margin-bottom: 5px;\n    text-align: left;\n}\n\ndiv.sphinxsidebarwrapper h1.logo-name {\n    margin-top: 0px;\n}\n\ndiv.sphinxsidebarwrapper p.blurb {\n    margin-top: 0;\n    font-style: normal;\n}\n\ndiv.sphinxsidebar h3,\ndiv.sphinxsidebar h4 {\n    font-family: Georgia, serif;\n    color: #444;\n    font-size: 24px;\n    font-weight: normal;\n    margin: 0 0 5px 0;\n    padding: 0;\n}\n\ndiv.sphinxsidebar h4 {\n    font-size: 20px;\n}\n\ndiv.sphinxsidebar h3 a {\n    color: #444;\n}\n\ndiv.sphinxsidebar p.logo a,\ndiv.sphinxsidebar h3 a,\ndiv.sphinxsidebar p.logo a:hover,\ndiv.sphinxsidebar h3 a:hover {\n    border: none;\n}\n\ndiv.sphinxsidebar p {\n    color: #555;\n    margin: 10px 0;\n}\n\ndiv.sphinxsidebar ul {\n    margin: 10px 0;\n    padding: 0;\n    color: #000;\n}\n\ndiv.sphinxsidebar ul li.toctree-l1 > a {\n    font-size: 120%;\n}\n\ndiv.sphinxsidebar ul li.toctree-l2 > a {\n    font-size: 110%;\n}\n\ndiv.sphinxsidebar input {\n    border: 1px solid #CCC;\n    font-family: Georgia, serif;\n    font-size: 1em;\n}\n\ndiv.sphinxsidebar hr {\n    border: none;\n    height: 1px;\n    color: #AAA;\n    background: #AAA;\n\n    text-align: left;\n    margin-left: 0;\n    width: 50%;\n}\n\ndiv.sphinxsidebar .badge {\n    border-bottom: none;\n}\n\ndiv.sphinxsidebar .badge:hover {\n    border-bottom: none;\n}\n\n/* To address an issue with donation coming after search */\ndiv.sphinxsidebar h3.donation {\n    margin-top: 10px;\n}\n\n/* -- body styles ----------------------------------------------------------- */\n\na {\n    color: #004B6B;\n    text-decoration: underline;\n}\n\na:hover {\n    color: #6D4100;\n    text-decoration: underline;\n}\n\ndiv.body h1,\ndiv.body h2,\ndiv.body h3,\ndiv.body h4,\ndiv.body h5,\ndiv.body h6 {\n    font-family: Georgia, serif;\n    font-weight: normal;\n    margin: 30px 0px 10px 0px;\n    padding: 0;\n}\n\ndiv.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }\ndiv.body h2 { font-size: 180%; }\ndiv.body h3 { font-size: 150%; }\ndiv.body h4 { font-size: 130%; }\ndiv.body h5 { font-size: 100%; }\ndiv.body h6 { font-size: 100%; }\n\na.headerlink {\n    color: #DDD;\n    padding: 0 4px;\n    text-decoration: none;\n}\n\na.headerlink:hover {\n    color: #444;\n    background: #EAEAEA;\n}\n\ndiv.body p, div.body dd, div.body li {\n    line-height: 1.4em;\n}\n\ndiv.admonition {\n    margin: 20px 0px;\n    padding: 10px 30px;\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.admonition tt.xref, div.admonition code.xref, div.admonition a tt {\n    background-color: #FBFBFB;\n    border-bottom: 1px solid #fafafa;\n}\n\ndiv.admonition p.admonition-title {\n    font-family: Georgia, serif;\n    font-weight: normal;\n    font-size: 24px;\n    margin: 0 0 10px 0;\n    padding: 0;\n    line-height: 1;\n}\n\ndiv.admonition p.last {\n    margin-bottom: 0;\n}\n\ndiv.highlight {\n    background-color: #fff;\n}\n\ndt:target, .highlight {\n    background: #FAF3E8;\n}\n\ndiv.warning {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n}\n\ndiv.danger {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n    -moz-box-shadow: 2px 2px 4px #D52C2C;\n    -webkit-box-shadow: 2px 2px 4px #D52C2C;\n    box-shadow: 2px 2px 4px #D52C2C;\n}\n\ndiv.error {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n    -moz-box-shadow: 2px 2px 4px #D52C2C;\n    -webkit-box-shadow: 2px 2px 4px #D52C2C;\n    box-shadow: 2px 2px 4px #D52C2C;\n}\n\ndiv.caution {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n}\n\ndiv.attention {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n}\n\ndiv.important {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.note {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.tip {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.hint {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.seealso {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.topic {\n    background-color: #EEE;\n}\n\np.admonition-title {\n    display: inline;\n}\n\np.admonition-title:after {\n    content: \":\";\n}\n\npre, tt, code {\n    font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;\n    font-size: 0.9em;\n}\n\n.hll {\n    background-color: #FFC;\n    margin: 0 -12px;\n    padding: 0 12px;\n    display: block;\n}\n\nimg.screenshot {\n}\n\ntt.descname, tt.descclassname, code.descname, code.descclassname {\n    font-size: 0.95em;\n}\n\ntt.descname, code.descname {\n    padding-right: 0.08em;\n}\n\nimg.screenshot {\n    -moz-box-shadow: 2px 2px 4px #EEE;\n    -webkit-box-shadow: 2px 2px 4px #EEE;\n    box-shadow: 2px 2px 4px #EEE;\n}\n\ntable.docutils {\n    border: 1px solid #888;\n    -moz-box-shadow: 2px 2px 4px #EEE;\n    -webkit-box-shadow: 2px 2px 4px #EEE;\n    box-shadow: 2px 2px 4px #EEE;\n}\n\ntable.docutils td, table.docutils th {\n    border: 1px solid #888;\n    padding: 0.25em 0.7em;\n}\n\ntable.field-list, table.footnote {\n    border: none;\n    -moz-box-shadow: none;\n    -webkit-box-shadow: none;\n    box-shadow: none;\n}\n\ntable.footnote {\n    margin: 15px 0;\n    width: 100%;\n    border: 1px solid #EEE;\n    background: #FDFDFD;\n    font-size: 0.9em;\n}\n\ntable.footnote + table.footnote {\n    margin-top: -15px;\n    border-top: none;\n}\n\ntable.field-list th {\n    padding: 0 0.8em 0 0;\n}\n\ntable.field-list td {\n    padding: 0;\n}\n\ntable.field-list p {\n    margin-bottom: 0.8em;\n}\n\n/* Cloned from\n * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68\n */\n.field-name {\n    -moz-hyphens: manual;\n    -ms-hyphens: manual;\n    -webkit-hyphens: manual;\n    hyphens: manual;\n}\n\ntable.footnote td.label {\n    width: .1px;\n    padding: 0.3em 0 0.3em 0.5em;\n}\n\ntable.footnote td {\n    padding: 0.3em 0.5em;\n}\n\ndl {\n    margin: 0;\n    padding: 0;\n}\n\ndl dd {\n    margin-left: 30px;\n}\n\nblockquote {\n    margin: 0 0 0 30px;\n    padding: 0;\n}\n\nul, ol {\n    /* Matches the 30px from the narrow-screen \"li > ul\" selector below */\n    margin: 10px 0 10px 30px;\n    padding: 0;\n}\n\npre {\n    background: #EEE;\n    padding: 7px 30px;\n    margin: 15px 0px;\n    line-height: 1.3em;\n}\n\ndiv.viewcode-block:target {\n    background: #ffd;\n}\n\ndl pre, blockquote pre, li pre {\n    margin-left: 0;\n    padding-left: 30px;\n}\n\ntt, code {\n    background-color: #ecf0f3;\n    color: #222;\n    /* padding: 1px 2px; */\n}\n\ntt.xref, code.xref, a tt {\n    background-color: #FBFBFB;\n    border-bottom: 1px solid #fff;\n}\n\na.reference {\n    text-decoration: none;\n    border-bottom: 1px dotted #004B6B;\n}\n\n/* Don't put an underline on images */\na.image-reference, a.image-reference:hover {\n    border-bottom: none;\n}\n\na.reference:hover {\n    border-bottom: 1px solid #6D4100;\n}\n\na.footnote-reference {\n    text-decoration: none;\n    font-size: 0.7em;\n    vertical-align: top;\n    border-bottom: 1px dotted #004B6B;\n}\n\na.footnote-reference:hover {\n    border-bottom: 1px solid #6D4100;\n}\n\na:hover tt, a:hover code {\n    background: #EEE;\n}\n\n\n@media screen and (max-width: 870px) {\n\n    div.sphinxsidebar {\n    \tdisplay: none;\n    }\n\n    div.document {\n       width: 100%;\n\n    }\n\n    div.documentwrapper {\n    \tmargin-left: 0;\n    \tmargin-top: 0;\n    \tmargin-right: 0;\n    \tmargin-bottom: 0;\n    }\n\n    div.bodywrapper {\n    \tmargin-top: 0;\n    \tmargin-right: 0;\n    \tmargin-bottom: 0;\n    \tmargin-left: 0;\n    }\n\n    ul {\n    \tmargin-left: 0;\n    }\n\n\tli > ul {\n        /* Matches the 30px from the \"ul, ol\" selector above */\n\t\tmargin-left: 30px;\n\t}\n\n    .document {\n    \twidth: auto;\n    }\n\n    .footer {\n    \twidth: auto;\n    }\n\n    .bodywrapper {\n    \tmargin: 0;\n    }\n\n    .footer {\n    \twidth: auto;\n    }\n\n    .github {\n        display: none;\n    }\n\n\n\n}\n\n\n\n@media screen and (max-width: 875px) {\n\n    body {\n        margin: 0;\n        padding: 20px 30px;\n    }\n\n    div.documentwrapper {\n        float: none;\n        background: #fff;\n    }\n\n    div.sphinxsidebar {\n        display: block;\n        float: none;\n        width: 102.5%;\n        margin: 50px -30px -20px -30px;\n        padding: 10px 20px;\n        background: #333;\n        color: #FFF;\n    }\n\n    div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,\n    div.sphinxsidebar h3 a {\n        color: #fff;\n    }\n\n    div.sphinxsidebar a {\n        color: #AAA;\n    }\n\n    div.sphinxsidebar p.logo {\n        display: none;\n    }\n\n    div.document {\n        width: 100%;\n        margin: 0;\n    }\n\n    div.footer {\n        display: none;\n    }\n\n    div.bodywrapper {\n        margin: 0;\n    }\n\n    div.body {\n        min-height: 0;\n        padding: 0;\n    }\n\n    .rtd_doc_footer {\n        display: none;\n    }\n\n    .document {\n        width: auto;\n    }\n\n    .footer {\n        width: auto;\n    }\n\n    .footer {\n        width: auto;\n    }\n\n    .github {\n        display: none;\n    }\n}\n\n\n/* misc. */\n\n.revsys-inline {\n    display: none!important;\n}\n\n/* Make nested-list/multi-paragraph items look better in Releases changelog\n * pages. Without this, docutils' magical list fuckery causes inconsistent\n * formatting between different release sub-lists.\n */\ndiv#changelog > div.section > ul > li > p:only-child {\n    margin-bottom: 0;\n}\n\n/* Hide fugly table cell borders in ..bibliography:: directive output */\ntable.docutils.citation, table.docutils.citation td, table.docutils.citation th {\n  border: none;\n  /* Below needed in some edge cases; if not applied, bottom shadows appear */\n  -moz-box-shadow: none;\n  -webkit-box-shadow: none;\n  box-shadow: none;\n}\n\n\n/* relbar */\n\n.related {\n    line-height: 30px;\n    width: 100%;\n    font-size: 0.9rem;\n}\n\n.related.top {\n    border-bottom: 1px solid #EEE;\n    margin-bottom: 20px;\n}\n\n.related.bottom {\n    border-top: 1px solid #EEE;\n}\n\n.related ul {\n    padding: 0;\n    margin: 0;\n    list-style: none;\n}\n\n.related li {\n    display: inline;\n}\n\nnav#rellinks {\n    float: right;\n}\n\nnav#rellinks li+li:before {\n    content: \"|\";\n}\n\nnav#breadcrumbs li+li:before {\n    content: \"\\00BB\";\n}\n\n/* Hide certain items when printing */\n@media print {\n    div.related {\n        display: none;\n    }\n}"
  },
  {
    "path": "bdsim/bdedit/docs/_static/basic.css",
    "content": "/*\n * basic.css\n * ~~~~~~~~~\n *\n * Sphinx stylesheet -- basic theme.\n *\n * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\n/* -- main layout ----------------------------------------------------------- */\n\ndiv.clearer {\n    clear: both;\n}\n\ndiv.section::after {\n    display: block;\n    content: '';\n    clear: left;\n}\n\n/* -- relbar ---------------------------------------------------------------- */\n\ndiv.related {\n    width: 100%;\n    font-size: 90%;\n}\n\ndiv.related h3 {\n    display: none;\n}\n\ndiv.related ul {\n    margin: 0;\n    padding: 0 0 0 10px;\n    list-style: none;\n}\n\ndiv.related li {\n    display: inline;\n}\n\ndiv.related li.right {\n    float: right;\n    margin-right: 5px;\n}\n\n/* -- sidebar --------------------------------------------------------------- */\n\ndiv.sphinxsidebarwrapper {\n    padding: 10px 5px 0 10px;\n}\n\ndiv.sphinxsidebar {\n    float: left;\n    width: 230px;\n    margin-left: -100%;\n    font-size: 90%;\n    word-wrap: break-word;\n    overflow-wrap : break-word;\n}\n\ndiv.sphinxsidebar ul {\n    list-style: none;\n}\n\ndiv.sphinxsidebar ul ul,\ndiv.sphinxsidebar ul.want-points {\n    margin-left: 20px;\n    list-style: square;\n}\n\ndiv.sphinxsidebar ul ul {\n    margin-top: 0;\n    margin-bottom: 0;\n}\n\ndiv.sphinxsidebar form {\n    margin-top: 10px;\n}\n\ndiv.sphinxsidebar input {\n    border: 1px solid #98dbcc;\n    font-family: sans-serif;\n    font-size: 1em;\n}\n\ndiv.sphinxsidebar #searchbox form.search {\n    overflow: hidden;\n}\n\ndiv.sphinxsidebar #searchbox input[type=\"text\"] {\n    float: left;\n    width: 80%;\n    padding: 0.25em;\n    box-sizing: border-box;\n}\n\ndiv.sphinxsidebar #searchbox input[type=\"submit\"] {\n    float: left;\n    width: 20%;\n    border-left: none;\n    padding: 0.25em;\n    box-sizing: border-box;\n}\n\n\nimg {\n    border: 0;\n    max-width: 100%;\n}\n\n/* -- search page ----------------------------------------------------------- */\n\nul.search {\n    margin: 10px 0 0 20px;\n    padding: 0;\n}\n\nul.search li {\n    padding: 5px 0 5px 20px;\n    background-image: url(file.png);\n    background-repeat: no-repeat;\n    background-position: 0 7px;\n}\n\nul.search li a {\n    font-weight: bold;\n}\n\nul.search li p.context {\n    color: #888;\n    margin: 2px 0 0 30px;\n    text-align: left;\n}\n\nul.keywordmatches li.goodmatch a {\n    font-weight: bold;\n}\n\n/* -- index page ------------------------------------------------------------ */\n\ntable.contentstable {\n    width: 90%;\n    margin-left: auto;\n    margin-right: auto;\n}\n\ntable.contentstable p.biglink {\n    line-height: 150%;\n}\n\na.biglink {\n    font-size: 1.3em;\n}\n\nspan.linkdescr {\n    font-style: italic;\n    padding-top: 5px;\n    font-size: 90%;\n}\n\n/* -- general index --------------------------------------------------------- */\n\ntable.indextable {\n    width: 100%;\n}\n\ntable.indextable td {\n    text-align: left;\n    vertical-align: top;\n}\n\ntable.indextable ul {\n    margin-top: 0;\n    margin-bottom: 0;\n    list-style-type: none;\n}\n\ntable.indextable > tbody > tr > td > ul {\n    padding-left: 0em;\n}\n\ntable.indextable tr.pcap {\n    height: 10px;\n}\n\ntable.indextable tr.cap {\n    margin-top: 10px;\n    background-color: #f2f2f2;\n}\n\nimg.toggler {\n    margin-right: 3px;\n    margin-top: 3px;\n    cursor: pointer;\n}\n\ndiv.modindex-jumpbox {\n    border-top: 1px solid #ddd;\n    border-bottom: 1px solid #ddd;\n    margin: 1em 0 1em 0;\n    padding: 0.4em;\n}\n\ndiv.genindex-jumpbox {\n    border-top: 1px solid #ddd;\n    border-bottom: 1px solid #ddd;\n    margin: 1em 0 1em 0;\n    padding: 0.4em;\n}\n\n/* -- domain module index --------------------------------------------------- */\n\ntable.modindextable td {\n    padding: 2px;\n    border-collapse: collapse;\n}\n\n/* -- general body styles --------------------------------------------------- */\n\ndiv.body {\n    min-width: 450px;\n    max-width: 800px;\n}\n\ndiv.body p, div.body dd, div.body li, div.body blockquote {\n    -moz-hyphens: auto;\n    -ms-hyphens: auto;\n    -webkit-hyphens: auto;\n    hyphens: auto;\n}\n\na.headerlink {\n    visibility: hidden;\n}\n\na.brackets:before,\nspan.brackets > a:before{\n    content: \"[\";\n}\n\na.brackets:after,\nspan.brackets > a:after {\n    content: \"]\";\n}\n\nh1:hover > a.headerlink,\nh2:hover > a.headerlink,\nh3:hover > a.headerlink,\nh4:hover > a.headerlink,\nh5:hover > a.headerlink,\nh6:hover > a.headerlink,\ndt:hover > a.headerlink,\ncaption:hover > a.headerlink,\np.caption:hover > a.headerlink,\ndiv.code-block-caption:hover > a.headerlink {\n    visibility: visible;\n}\n\ndiv.body p.caption {\n    text-align: inherit;\n}\n\ndiv.body td {\n    text-align: left;\n}\n\n.first {\n    margin-top: 0 !important;\n}\n\np.rubric {\n    margin-top: 30px;\n    font-weight: bold;\n}\n\nimg.align-left, figure.align-left, .figure.align-left, object.align-left {\n    clear: left;\n    float: left;\n    margin-right: 1em;\n}\n\nimg.align-right, figure.align-right, .figure.align-right, object.align-right {\n    clear: right;\n    float: right;\n    margin-left: 1em;\n}\n\nimg.align-center, figure.align-center, .figure.align-center, object.align-center {\n  display: block;\n  margin-left: auto;\n  margin-right: auto;\n}\n\nimg.align-default, figure.align-default, .figure.align-default {\n  display: block;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n.align-left {\n    text-align: left;\n}\n\n.align-center {\n    text-align: center;\n}\n\n.align-default {\n    text-align: center;\n}\n\n.align-right {\n    text-align: right;\n}\n\n/* -- sidebars -------------------------------------------------------------- */\n\ndiv.sidebar,\naside.sidebar {\n    margin: 0 0 0.5em 1em;\n    border: 1px solid #ddb;\n    padding: 7px;\n    background-color: #ffe;\n    width: 40%;\n    float: right;\n    clear: right;\n    overflow-x: auto;\n}\n\np.sidebar-title {\n    font-weight: bold;\n}\n\ndiv.admonition, div.topic, blockquote {\n    clear: left;\n}\n\n/* -- topics ---------------------------------------------------------------- */\n\ndiv.topic {\n    border: 1px solid #ccc;\n    padding: 7px;\n    margin: 10px 0 10px 0;\n}\n\np.topic-title {\n    font-size: 1.1em;\n    font-weight: bold;\n    margin-top: 10px;\n}\n\n/* -- admonitions ----------------------------------------------------------- */\n\ndiv.admonition {\n    margin-top: 10px;\n    margin-bottom: 10px;\n    padding: 7px;\n}\n\ndiv.admonition dt {\n    font-weight: bold;\n}\n\np.admonition-title {\n    margin: 0px 10px 5px 0px;\n    font-weight: bold;\n}\n\ndiv.body p.centered {\n    text-align: center;\n    margin-top: 25px;\n}\n\n/* -- content of sidebars/topics/admonitions -------------------------------- */\n\ndiv.sidebar > :last-child,\naside.sidebar > :last-child,\ndiv.topic > :last-child,\ndiv.admonition > :last-child {\n    margin-bottom: 0;\n}\n\ndiv.sidebar::after,\naside.sidebar::after,\ndiv.topic::after,\ndiv.admonition::after,\nblockquote::after {\n    display: block;\n    content: '';\n    clear: both;\n}\n\n/* -- tables ---------------------------------------------------------------- */\n\ntable.docutils {\n    margin-top: 10px;\n    margin-bottom: 10px;\n    border: 0;\n    border-collapse: collapse;\n}\n\ntable.align-center {\n    margin-left: auto;\n    margin-right: auto;\n}\n\ntable.align-default {\n    margin-left: auto;\n    margin-right: auto;\n}\n\ntable caption span.caption-number {\n    font-style: italic;\n}\n\ntable caption span.caption-text {\n}\n\ntable.docutils td, table.docutils th {\n    padding: 1px 8px 1px 5px;\n    border-top: 0;\n    border-left: 0;\n    border-right: 0;\n    border-bottom: 1px solid #aaa;\n}\n\ntable.footnote td, table.footnote th {\n    border: 0 !important;\n}\n\nth {\n    text-align: left;\n    padding-right: 5px;\n}\n\ntable.citation {\n    border-left: solid 1px gray;\n    margin-left: 1px;\n}\n\ntable.citation td {\n    border-bottom: none;\n}\n\nth > :first-child,\ntd > :first-child {\n    margin-top: 0px;\n}\n\nth > :last-child,\ntd > :last-child {\n    margin-bottom: 0px;\n}\n\n/* -- figures --------------------------------------------------------------- */\n\ndiv.figure, figure {\n    margin: 0.5em;\n    padding: 0.5em;\n}\n\ndiv.figure p.caption, figcaption {\n    padding: 0.3em;\n}\n\ndiv.figure p.caption span.caption-number,\nfigcaption span.caption-number {\n    font-style: italic;\n}\n\ndiv.figure p.caption span.caption-text,\nfigcaption span.caption-text {\n}\n\n/* -- field list styles ----------------------------------------------------- */\n\ntable.field-list td, table.field-list th {\n    border: 0 !important;\n}\n\n.field-list ul {\n    margin: 0;\n    padding-left: 1em;\n}\n\n.field-list p {\n    margin: 0;\n}\n\n.field-name {\n    -moz-hyphens: manual;\n    -ms-hyphens: manual;\n    -webkit-hyphens: manual;\n    hyphens: manual;\n}\n\n/* -- hlist styles ---------------------------------------------------------- */\n\ntable.hlist {\n    margin: 1em 0;\n}\n\ntable.hlist td {\n    vertical-align: top;\n}\n\n/* -- object description styles --------------------------------------------- */\n\n.sig {\n\tfont-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;\n}\n\n.sig-name, code.descname {\n    background-color: transparent;\n    font-weight: bold;\n}\n\n.sig-name {\n\tfont-size: 1.1em;\n}\n\ncode.descname {\n    font-size: 1.2em;\n}\n\n.sig-prename, code.descclassname {\n    background-color: transparent;\n}\n\n.optional {\n    font-size: 1.3em;\n}\n\n.sig-paren {\n    font-size: larger;\n}\n\n.sig-param.n {\n\tfont-style: italic;\n}\n\n/* C++ specific styling */\n\n.sig-inline.c-texpr,\n.sig-inline.cpp-texpr {\n\tfont-family: unset;\n}\n\n.sig.c   .k, .sig.c   .kt,\n.sig.cpp .k, .sig.cpp .kt {\n\tcolor: #0033B3;\n}\n\n.sig.c   .m,\n.sig.cpp .m {\n\tcolor: #1750EB;\n}\n\n.sig.c   .s, .sig.c   .sc,\n.sig.cpp .s, .sig.cpp .sc {\n\tcolor: #067D17;\n}\n\n\n/* -- other body styles ----------------------------------------------------- */\n\nol.arabic {\n    list-style: decimal;\n}\n\nol.loweralpha {\n    list-style: lower-alpha;\n}\n\nol.upperalpha {\n    list-style: upper-alpha;\n}\n\nol.lowerroman {\n    list-style: lower-roman;\n}\n\nol.upperroman {\n    list-style: upper-roman;\n}\n\n:not(li) > ol > li:first-child > :first-child,\n:not(li) > ul > li:first-child > :first-child {\n    margin-top: 0px;\n}\n\n:not(li) > ol > li:last-child > :last-child,\n:not(li) > ul > li:last-child > :last-child {\n    margin-bottom: 0px;\n}\n\nol.simple ol p,\nol.simple ul p,\nul.simple ol p,\nul.simple ul p {\n    margin-top: 0;\n}\n\nol.simple > li:not(:first-child) > p,\nul.simple > li:not(:first-child) > p {\n    margin-top: 0;\n}\n\nol.simple p,\nul.simple p {\n    margin-bottom: 0;\n}\n\ndl.footnote > dt,\ndl.citation > dt {\n    float: left;\n    margin-right: 0.5em;\n}\n\ndl.footnote > dd,\ndl.citation > dd {\n    margin-bottom: 0em;\n}\n\ndl.footnote > dd:after,\ndl.citation > dd:after {\n    content: \"\";\n    clear: both;\n}\n\ndl.field-list {\n    display: grid;\n    grid-template-columns: fit-content(30%) auto;\n}\n\ndl.field-list > dt {\n    font-weight: bold;\n    word-break: break-word;\n    padding-left: 0.5em;\n    padding-right: 5px;\n}\n\ndl.field-list > dt:after {\n    content: \":\";\n}\n\ndl.field-list > dd {\n    padding-left: 0.5em;\n    margin-top: 0em;\n    margin-left: 0em;\n    margin-bottom: 0em;\n}\n\ndl {\n    margin-bottom: 15px;\n}\n\ndd > :first-child {\n    margin-top: 0px;\n}\n\ndd ul, dd table {\n    margin-bottom: 10px;\n}\n\ndd {\n    margin-top: 3px;\n    margin-bottom: 10px;\n    margin-left: 30px;\n}\n\ndl > dd:last-child,\ndl > dd:last-child > :last-child {\n    margin-bottom: 0;\n}\n\ndt:target, span.highlighted {\n    background-color: #fbe54e;\n}\n\nrect.highlighted {\n    fill: #fbe54e;\n}\n\ndl.glossary dt {\n    font-weight: bold;\n    font-size: 1.1em;\n}\n\n.versionmodified {\n    font-style: italic;\n}\n\n.system-message {\n    background-color: #fda;\n    padding: 5px;\n    border: 3px solid red;\n}\n\n.footnote:target  {\n    background-color: #ffa;\n}\n\n.line-block {\n    display: block;\n    margin-top: 1em;\n    margin-bottom: 1em;\n}\n\n.line-block .line-block {\n    margin-top: 0;\n    margin-bottom: 0;\n    margin-left: 1.5em;\n}\n\n.guilabel, .menuselection {\n    font-family: sans-serif;\n}\n\n.accelerator {\n    text-decoration: underline;\n}\n\n.classifier {\n    font-style: oblique;\n}\n\n.classifier:before {\n    font-style: normal;\n    margin: 0.5em;\n    content: \":\";\n}\n\nabbr, acronym {\n    border-bottom: dotted 1px;\n    cursor: help;\n}\n\n/* -- code displays --------------------------------------------------------- */\n\npre {\n    overflow: auto;\n    overflow-y: hidden;  /* fixes display issues on Chrome browsers */\n}\n\npre, div[class*=\"highlight-\"] {\n    clear: both;\n}\n\nspan.pre {\n    -moz-hyphens: none;\n    -ms-hyphens: none;\n    -webkit-hyphens: none;\n    hyphens: none;\n}\n\ndiv[class*=\"highlight-\"] {\n    margin: 1em 0;\n}\n\ntd.linenos pre {\n    border: 0;\n    background-color: transparent;\n    color: #aaa;\n}\n\ntable.highlighttable {\n    display: block;\n}\n\ntable.highlighttable tbody {\n    display: block;\n}\n\ntable.highlighttable tr {\n    display: flex;\n}\n\ntable.highlighttable td {\n    margin: 0;\n    padding: 0;\n}\n\ntable.highlighttable td.linenos {\n    padding-right: 0.5em;\n}\n\ntable.highlighttable td.code {\n    flex: 1;\n    overflow: hidden;\n}\n\n.highlight .hll {\n    display: block;\n}\n\ndiv.highlight pre,\ntable.highlighttable pre {\n    margin: 0;\n}\n\ndiv.code-block-caption + div {\n    margin-top: 0;\n}\n\ndiv.code-block-caption {\n    margin-top: 1em;\n    padding: 2px 5px;\n    font-size: small;\n}\n\ndiv.code-block-caption code {\n    background-color: transparent;\n}\n\ntable.highlighttable td.linenos,\nspan.linenos,\ndiv.doctest > div.highlight span.gp {  /* gp: Generic.Prompt */\n  user-select: none;\n  -webkit-user-select: text; /* Safari fallback only */\n  -webkit-user-select: none; /* Chrome/Safari */\n  -moz-user-select: none; /* Firefox */\n  -ms-user-select: none; /* IE10+ */\n}\n\ndiv.code-block-caption span.caption-number {\n    padding: 0.1em 0.3em;\n    font-style: italic;\n}\n\ndiv.code-block-caption span.caption-text {\n}\n\ndiv.literal-block-wrapper {\n    margin: 1em 0;\n}\n\ncode.xref, a code {\n    background-color: transparent;\n    font-weight: bold;\n}\n\nh1 code, h2 code, h3 code, h4 code, h5 code, h6 code {\n    background-color: transparent;\n}\n\n.viewcode-link {\n    float: right;\n}\n\n.viewcode-back {\n    float: right;\n    font-family: sans-serif;\n}\n\ndiv.viewcode-block:target {\n    margin: -1px -10px;\n    padding: 0 10px;\n}\n\n/* -- math display ---------------------------------------------------------- */\n\nimg.math {\n    vertical-align: middle;\n}\n\ndiv.body div.math p {\n    text-align: center;\n}\n\nspan.eqno {\n    float: right;\n}\n\nspan.eqno a.headerlink {\n    position: absolute;\n    z-index: 1;\n}\n\ndiv.math:hover a.headerlink {\n    visibility: visible;\n}\n\n/* -- printout stylesheet --------------------------------------------------- */\n\n@media print {\n    div.document,\n    div.documentwrapper,\n    div.bodywrapper {\n        margin: 0 !important;\n        width: 100%;\n    }\n\n    div.sphinxsidebar,\n    div.related,\n    div.footer,\n    #top-link {\n        display: none;\n    }\n}"
  },
  {
    "path": "bdsim/bdedit/docs/_static/css/badge_only.css",
    "content": ".fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:\"\"}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format(\"embedded-opentype\"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format(\"woff2\"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format(\"woff\"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format(\"truetype\"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format(\"svg\")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:\"\\f02d\"}.fa-caret-down:before,.icon-caret-down:before{content:\"\\f0d7\"}.fa-caret-up:before,.icon-caret-up:before{content:\"\\f0d8\"}.fa-caret-left:before,.icon-caret-left:before{content:\"\\f0d9\"}.fa-caret-right:before,.icon-caret-right:before{content:\"\\f0da\"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:\"\";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}"
  },
  {
    "path": "bdsim/bdedit/docs/_static/css/theme.css",
    "content": "html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:\"\";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^=\"#\"]:after,a[href^=\"javascript:\"]:after{content:\"\"}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a,.wy-menu-vertical li.current>a span.toctree-expand:before,.wy-menu-vertical li.on a,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li span.toctree-expand:before,.wy-nav-top a,.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:\"\"}.clearfix:after{clear:both}/*!\n *  Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome\n *  License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format(\"embedded-opentype\"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format(\"woff2\"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format(\"woff\"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format(\"truetype\"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format(\"svg\");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li span.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p.caption .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a span.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a span.fa-pull-left.toctree-expand,.wy-menu-vertical li span.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p.caption .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a span.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a span.fa-pull-right.toctree-expand,.wy-menu-vertical li span.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p.caption .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a span.pull-left.toctree-expand,.wy-menu-vertical li.on a span.pull-left.toctree-expand,.wy-menu-vertical li span.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p.caption .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a span.pull-right.toctree-expand,.wy-menu-vertical li.on a span.pull-right.toctree-expand,.wy-menu-vertical li span.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)\";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)\";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)\";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)\";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:\"\"}.fa-music:before{content:\"\"}.fa-search:before,.icon-search:before{content:\"\"}.fa-envelope-o:before{content:\"\"}.fa-heart:before{content:\"\"}.fa-star:before{content:\"\"}.fa-star-o:before{content:\"\"}.fa-user:before{content:\"\"}.fa-film:before{content:\"\"}.fa-th-large:before{content:\"\"}.fa-th:before{content:\"\"}.fa-th-list:before{content:\"\"}.fa-check:before{content:\"\"}.fa-close:before,.fa-remove:before,.fa-times:before{content:\"\"}.fa-search-plus:before{content:\"\"}.fa-search-minus:before{content:\"\"}.fa-power-off:before{content:\"\"}.fa-signal:before{content:\"\"}.fa-cog:before,.fa-gear:before{content:\"\"}.fa-trash-o:before{content:\"\"}.fa-home:before,.icon-home:before{content:\"\"}.fa-file-o:before{content:\"\"}.fa-clock-o:before{content:\"\"}.fa-road:before{content:\"\"}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:\"\"}.fa-arrow-circle-o-down:before{content:\"\"}.fa-arrow-circle-o-up:before{content:\"\"}.fa-inbox:before{content:\"\"}.fa-play-circle-o:before{content:\"\"}.fa-repeat:before,.fa-rotate-right:before{content:\"\"}.fa-refresh:before{content:\"\"}.fa-list-alt:before{content:\"\"}.fa-lock:before{content:\"\"}.fa-flag:before{content:\"\"}.fa-headphones:before{content:\"\"}.fa-volume-off:before{content:\"\"}.fa-volume-down:before{content:\"\"}.fa-volume-up:before{content:\"\"}.fa-qrcode:before{content:\"\"}.fa-barcode:before{content:\"\"}.fa-tag:before{content:\"\"}.fa-tags:before{content:\"\"}.fa-book:before,.icon-book:before{content:\"\"}.fa-bookmark:before{content:\"\"}.fa-print:before{content:\"\"}.fa-camera:before{content:\"\"}.fa-font:before{content:\"\"}.fa-bold:before{content:\"\"}.fa-italic:before{content:\"\"}.fa-text-height:before{content:\"\"}.fa-text-width:before{content:\"\"}.fa-align-left:before{content:\"\"}.fa-align-center:before{content:\"\"}.fa-align-right:before{content:\"\"}.fa-align-justify:before{content:\"\"}.fa-list:before{content:\"\"}.fa-dedent:before,.fa-outdent:before{content:\"\"}.fa-indent:before{content:\"\"}.fa-video-camera:before{content:\"\"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:\"\"}.fa-pencil:before{content:\"\"}.fa-map-marker:before{content:\"\"}.fa-adjust:before{content:\"\"}.fa-tint:before{content:\"\"}.fa-edit:before,.fa-pencil-square-o:before{content:\"\"}.fa-share-square-o:before{content:\"\"}.fa-check-square-o:before{content:\"\"}.fa-arrows:before{content:\"\"}.fa-step-backward:before{content:\"\"}.fa-fast-backward:before{content:\"\"}.fa-backward:before{content:\"\"}.fa-play:before{content:\"\"}.fa-pause:before{content:\"\"}.fa-stop:before{content:\"\"}.fa-forward:before{content:\"\"}.fa-fast-forward:before{content:\"\"}.fa-step-forward:before{content:\"\"}.fa-eject:before{content:\"\"}.fa-chevron-left:before{content:\"\"}.fa-chevron-right:before{content:\"\"}.fa-plus-circle:before{content:\"\"}.fa-minus-circle:before{content:\"\"}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:\"\"}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:\"\"}.fa-question-circle:before{content:\"\"}.fa-info-circle:before{content:\"\"}.fa-crosshairs:before{content:\"\"}.fa-times-circle-o:before{content:\"\"}.fa-check-circle-o:before{content:\"\"}.fa-ban:before{content:\"\"}.fa-arrow-left:before{content:\"\"}.fa-arrow-right:before{content:\"\"}.fa-arrow-up:before{content:\"\"}.fa-arrow-down:before{content:\"\"}.fa-mail-forward:before,.fa-share:before{content:\"\"}.fa-expand:before{content:\"\"}.fa-compress:before{content:\"\"}.fa-plus:before{content:\"\"}.fa-minus:before{content:\"\"}.fa-asterisk:before{content:\"\"}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:\"\"}.fa-gift:before{content:\"\"}.fa-leaf:before{content:\"\"}.fa-fire:before,.icon-fire:before{content:\"\"}.fa-eye:before{content:\"\"}.fa-eye-slash:before{content:\"\"}.fa-exclamation-triangle:before,.fa-warning:before{content:\"\"}.fa-plane:before{content:\"\"}.fa-calendar:before{content:\"\"}.fa-random:before{content:\"\"}.fa-comment:before{content:\"\"}.fa-magnet:before{content:\"\"}.fa-chevron-up:before{content:\"\"}.fa-chevron-down:before{content:\"\"}.fa-retweet:before{content:\"\"}.fa-shopping-cart:before{content:\"\"}.fa-folder:before{content:\"\"}.fa-folder-open:before{content:\"\"}.fa-arrows-v:before{content:\"\"}.fa-arrows-h:before{content:\"\"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:\"\"}.fa-twitter-square:before{content:\"\"}.fa-facebook-square:before{content:\"\"}.fa-camera-retro:before{content:\"\"}.fa-key:before{content:\"\"}.fa-cogs:before,.fa-gears:before{content:\"\"}.fa-comments:before{content:\"\"}.fa-thumbs-o-up:before{content:\"\"}.fa-thumbs-o-down:before{content:\"\"}.fa-star-half:before{content:\"\"}.fa-heart-o:before{content:\"\"}.fa-sign-out:before{content:\"\"}.fa-linkedin-square:before{content:\"\"}.fa-thumb-tack:before{content:\"\"}.fa-external-link:before{content:\"\"}.fa-sign-in:before{content:\"\"}.fa-trophy:before{content:\"\"}.fa-github-square:before{content:\"\"}.fa-upload:before{content:\"\"}.fa-lemon-o:before{content:\"\"}.fa-phone:before{content:\"\"}.fa-square-o:before{content:\"\"}.fa-bookmark-o:before{content:\"\"}.fa-phone-square:before{content:\"\"}.fa-twitter:before{content:\"\"}.fa-facebook-f:before,.fa-facebook:before{content:\"\"}.fa-github:before,.icon-github:before{content:\"\"}.fa-unlock:before{content:\"\"}.fa-credit-card:before{content:\"\"}.fa-feed:before,.fa-rss:before{content:\"\"}.fa-hdd-o:before{content:\"\"}.fa-bullhorn:before{content:\"\"}.fa-bell:before{content:\"\"}.fa-certificate:before{content:\"\"}.fa-hand-o-right:before{content:\"\"}.fa-hand-o-left:before{content:\"\"}.fa-hand-o-up:before{content:\"\"}.fa-hand-o-down:before{content:\"\"}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:\"\"}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:\"\"}.fa-arrow-circle-up:before{content:\"\"}.fa-arrow-circle-down:before{content:\"\"}.fa-globe:before{content:\"\"}.fa-wrench:before{content:\"\"}.fa-tasks:before{content:\"\"}.fa-filter:before{content:\"\"}.fa-briefcase:before{content:\"\"}.fa-arrows-alt:before{content:\"\"}.fa-group:before,.fa-users:before{content:\"\"}.fa-chain:before,.fa-link:before,.icon-link:before{content:\"\"}.fa-cloud:before{content:\"\"}.fa-flask:before{content:\"\"}.fa-cut:before,.fa-scissors:before{content:\"\"}.fa-copy:before,.fa-files-o:before{content:\"\"}.fa-paperclip:before{content:\"\"}.fa-floppy-o:before,.fa-save:before{content:\"\"}.fa-square:before{content:\"\"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:\"\"}.fa-list-ul:before{content:\"\"}.fa-list-ol:before{content:\"\"}.fa-strikethrough:before{content:\"\"}.fa-underline:before{content:\"\"}.fa-table:before{content:\"\"}.fa-magic:before{content:\"\"}.fa-truck:before{content:\"\"}.fa-pinterest:before{content:\"\"}.fa-pinterest-square:before{content:\"\"}.fa-google-plus-square:before{content:\"\"}.fa-google-plus:before{content:\"\"}.fa-money:before{content:\"\"}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:\"\"}.fa-caret-up:before{content:\"\"}.fa-caret-left:before{content:\"\"}.fa-caret-right:before{content:\"\"}.fa-columns:before{content:\"\"}.fa-sort:before,.fa-unsorted:before{content:\"\"}.fa-sort-desc:before,.fa-sort-down:before{content:\"\"}.fa-sort-asc:before,.fa-sort-up:before{content:\"\"}.fa-envelope:before{content:\"\"}.fa-linkedin:before{content:\"\"}.fa-rotate-left:before,.fa-undo:before{content:\"\"}.fa-gavel:before,.fa-legal:before{content:\"\"}.fa-dashboard:before,.fa-tachometer:before{content:\"\"}.fa-comment-o:before{content:\"\"}.fa-comments-o:before{content:\"\"}.fa-bolt:before,.fa-flash:before{content:\"\"}.fa-sitemap:before{content:\"\"}.fa-umbrella:before{content:\"\"}.fa-clipboard:before,.fa-paste:before{content:\"\"}.fa-lightbulb-o:before{content:\"\"}.fa-exchange:before{content:\"\"}.fa-cloud-download:before{content:\"\"}.fa-cloud-upload:before{content:\"\"}.fa-user-md:before{content:\"\"}.fa-stethoscope:before{content:\"\"}.fa-suitcase:before{content:\"\"}.fa-bell-o:before{content:\"\"}.fa-coffee:before{content:\"\"}.fa-cutlery:before{content:\"\"}.fa-file-text-o:before{content:\"\"}.fa-building-o:before{content:\"\"}.fa-hospital-o:before{content:\"\"}.fa-ambulance:before{content:\"\"}.fa-medkit:before{content:\"\"}.fa-fighter-jet:before{content:\"\"}.fa-beer:before{content:\"\"}.fa-h-square:before{content:\"\"}.fa-plus-square:before{content:\"\"}.fa-angle-double-left:before{content:\"\"}.fa-angle-double-right:before{content:\"\"}.fa-angle-double-up:before{content:\"\"}.fa-angle-double-down:before{content:\"\"}.fa-angle-left:before{content:\"\"}.fa-angle-right:before{content:\"\"}.fa-angle-up:before{content:\"\"}.fa-angle-down:before{content:\"\"}.fa-desktop:before{content:\"\"}.fa-laptop:before{content:\"\"}.fa-tablet:before{content:\"\"}.fa-mobile-phone:before,.fa-mobile:before{content:\"\"}.fa-circle-o:before{content:\"\"}.fa-quote-left:before{content:\"\"}.fa-quote-right:before{content:\"\"}.fa-spinner:before{content:\"\"}.fa-circle:before{content:\"\"}.fa-mail-reply:before,.fa-reply:before{content:\"\"}.fa-github-alt:before{content:\"\"}.fa-folder-o:before{content:\"\"}.fa-folder-open-o:before{content:\"\"}.fa-smile-o:before{content:\"\"}.fa-frown-o:before{content:\"\"}.fa-meh-o:before{content:\"\"}.fa-gamepad:before{content:\"\"}.fa-keyboard-o:before{content:\"\"}.fa-flag-o:before{content:\"\"}.fa-flag-checkered:before{content:\"\"}.fa-terminal:before{content:\"\"}.fa-code:before{content:\"\"}.fa-mail-reply-all:before,.fa-reply-all:before{content:\"\"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:\"\"}.fa-location-arrow:before{content:\"\"}.fa-crop:before{content:\"\"}.fa-code-fork:before{content:\"\"}.fa-chain-broken:before,.fa-unlink:before{content:\"\"}.fa-question:before{content:\"\"}.fa-info:before{content:\"\"}.fa-exclamation:before{content:\"\"}.fa-superscript:before{content:\"\"}.fa-subscript:before{content:\"\"}.fa-eraser:before{content:\"\"}.fa-puzzle-piece:before{content:\"\"}.fa-microphone:before{content:\"\"}.fa-microphone-slash:before{content:\"\"}.fa-shield:before{content:\"\"}.fa-calendar-o:before{content:\"\"}.fa-fire-extinguisher:before{content:\"\"}.fa-rocket:before{content:\"\"}.fa-maxcdn:before{content:\"\"}.fa-chevron-circle-left:before{content:\"\"}.fa-chevron-circle-right:before{content:\"\"}.fa-chevron-circle-up:before{content:\"\"}.fa-chevron-circle-down:before{content:\"\"}.fa-html5:before{content:\"\"}.fa-css3:before{content:\"\"}.fa-anchor:before{content:\"\"}.fa-unlock-alt:before{content:\"\"}.fa-bullseye:before{content:\"\"}.fa-ellipsis-h:before{content:\"\"}.fa-ellipsis-v:before{content:\"\"}.fa-rss-square:before{content:\"\"}.fa-play-circle:before{content:\"\"}.fa-ticket:before{content:\"\"}.fa-minus-square:before{content:\"\"}.fa-minus-square-o:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before{content:\"\"}.fa-level-up:before{content:\"\"}.fa-level-down:before{content:\"\"}.fa-check-square:before{content:\"\"}.fa-pencil-square:before{content:\"\"}.fa-external-link-square:before{content:\"\"}.fa-share-square:before{content:\"\"}.fa-compass:before{content:\"\"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:\"\"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:\"\"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:\"\"}.fa-eur:before,.fa-euro:before{content:\"\"}.fa-gbp:before{content:\"\"}.fa-dollar:before,.fa-usd:before{content:\"\"}.fa-inr:before,.fa-rupee:before{content:\"\"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:\"\"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:\"\"}.fa-krw:before,.fa-won:before{content:\"\"}.fa-bitcoin:before,.fa-btc:before{content:\"\"}.fa-file:before{content:\"\"}.fa-file-text:before{content:\"\"}.fa-sort-alpha-asc:before{content:\"\"}.fa-sort-alpha-desc:before{content:\"\"}.fa-sort-amount-asc:before{content:\"\"}.fa-sort-amount-desc:before{content:\"\"}.fa-sort-numeric-asc:before{content:\"\"}.fa-sort-numeric-desc:before{content:\"\"}.fa-thumbs-up:before{content:\"\"}.fa-thumbs-down:before{content:\"\"}.fa-youtube-square:before{content:\"\"}.fa-youtube:before{content:\"\"}.fa-xing:before{content:\"\"}.fa-xing-square:before{content:\"\"}.fa-youtube-play:before{content:\"\"}.fa-dropbox:before{content:\"\"}.fa-stack-overflow:before{content:\"\"}.fa-instagram:before{content:\"\"}.fa-flickr:before{content:\"\"}.fa-adn:before{content:\"\"}.fa-bitbucket:before,.icon-bitbucket:before{content:\"\"}.fa-bitbucket-square:before{content:\"\"}.fa-tumblr:before{content:\"\"}.fa-tumblr-square:before{content:\"\"}.fa-long-arrow-down:before{content:\"\"}.fa-long-arrow-up:before{content:\"\"}.fa-long-arrow-left:before{content:\"\"}.fa-long-arrow-right:before{content:\"\"}.fa-apple:before{content:\"\"}.fa-windows:before{content:\"\"}.fa-android:before{content:\"\"}.fa-linux:before{content:\"\"}.fa-dribbble:before{content:\"\"}.fa-skype:before{content:\"\"}.fa-foursquare:before{content:\"\"}.fa-trello:before{content:\"\"}.fa-female:before{content:\"\"}.fa-male:before{content:\"\"}.fa-gittip:before,.fa-gratipay:before{content:\"\"}.fa-sun-o:before{content:\"\"}.fa-moon-o:before{content:\"\"}.fa-archive:before{content:\"\"}.fa-bug:before{content:\"\"}.fa-vk:before{content:\"\"}.fa-weibo:before{content:\"\"}.fa-renren:before{content:\"\"}.fa-pagelines:before{content:\"\"}.fa-stack-exchange:before{content:\"\"}.fa-arrow-circle-o-right:before{content:\"\"}.fa-arrow-circle-o-left:before{content:\"\"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:\"\"}.fa-dot-circle-o:before{content:\"\"}.fa-wheelchair:before{content:\"\"}.fa-vimeo-square:before{content:\"\"}.fa-try:before,.fa-turkish-lira:before{content:\"\"}.fa-plus-square-o:before,.wy-menu-vertical li span.toctree-expand:before{content:\"\"}.fa-space-shuttle:before{content:\"\"}.fa-slack:before{content:\"\"}.fa-envelope-square:before{content:\"\"}.fa-wordpress:before{content:\"\"}.fa-openid:before{content:\"\"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:\"\"}.fa-graduation-cap:before,.fa-mortar-board:before{content:\"\"}.fa-yahoo:before{content:\"\"}.fa-google:before{content:\"\"}.fa-reddit:before{content:\"\"}.fa-reddit-square:before{content:\"\"}.fa-stumbleupon-circle:before{content:\"\"}.fa-stumbleupon:before{content:\"\"}.fa-delicious:before{content:\"\"}.fa-digg:before{content:\"\"}.fa-pied-piper-pp:before{content:\"\"}.fa-pied-piper-alt:before{content:\"\"}.fa-drupal:before{content:\"\"}.fa-joomla:before{content:\"\"}.fa-language:before{content:\"\"}.fa-fax:before{content:\"\"}.fa-building:before{content:\"\"}.fa-child:before{content:\"\"}.fa-paw:before{content:\"\"}.fa-spoon:before{content:\"\"}.fa-cube:before{content:\"\"}.fa-cubes:before{content:\"\"}.fa-behance:before{content:\"\"}.fa-behance-square:before{content:\"\"}.fa-steam:before{content:\"\"}.fa-steam-square:before{content:\"\"}.fa-recycle:before{content:\"\"}.fa-automobile:before,.fa-car:before{content:\"\"}.fa-cab:before,.fa-taxi:before{content:\"\"}.fa-tree:before{content:\"\"}.fa-spotify:before{content:\"\"}.fa-deviantart:before{content:\"\"}.fa-soundcloud:before{content:\"\"}.fa-database:before{content:\"\"}.fa-file-pdf-o:before{content:\"\"}.fa-file-word-o:before{content:\"\"}.fa-file-excel-o:before{content:\"\"}.fa-file-powerpoint-o:before{content:\"\"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:\"\"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:\"\"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:\"\"}.fa-file-movie-o:before,.fa-file-video-o:before{content:\"\"}.fa-file-code-o:before{content:\"\"}.fa-vine:before{content:\"\"}.fa-codepen:before{content:\"\"}.fa-jsfiddle:before{content:\"\"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:\"\"}.fa-circle-o-notch:before{content:\"\"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:\"\"}.fa-empire:before,.fa-ge:before{content:\"\"}.fa-git-square:before{content:\"\"}.fa-git:before{content:\"\"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:\"\"}.fa-tencent-weibo:before{content:\"\"}.fa-qq:before{content:\"\"}.fa-wechat:before,.fa-weixin:before{content:\"\"}.fa-paper-plane:before,.fa-send:before{content:\"\"}.fa-paper-plane-o:before,.fa-send-o:before{content:\"\"}.fa-history:before{content:\"\"}.fa-circle-thin:before{content:\"\"}.fa-header:before{content:\"\"}.fa-paragraph:before{content:\"\"}.fa-sliders:before{content:\"\"}.fa-share-alt:before{content:\"\"}.fa-share-alt-square:before{content:\"\"}.fa-bomb:before{content:\"\"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:\"\"}.fa-tty:before{content:\"\"}.fa-binoculars:before{content:\"\"}.fa-plug:before{content:\"\"}.fa-slideshare:before{content:\"\"}.fa-twitch:before{content:\"\"}.fa-yelp:before{content:\"\"}.fa-newspaper-o:before{content:\"\"}.fa-wifi:before{content:\"\"}.fa-calculator:before{content:\"\"}.fa-paypal:before{content:\"\"}.fa-google-wallet:before{content:\"\"}.fa-cc-visa:before{content:\"\"}.fa-cc-mastercard:before{content:\"\"}.fa-cc-discover:before{content:\"\"}.fa-cc-amex:before{content:\"\"}.fa-cc-paypal:before{content:\"\"}.fa-cc-stripe:before{content:\"\"}.fa-bell-slash:before{content:\"\"}.fa-bell-slash-o:before{content:\"\"}.fa-trash:before{content:\"\"}.fa-copyright:before{content:\"\"}.fa-at:before{content:\"\"}.fa-eyedropper:before{content:\"\"}.fa-paint-brush:before{content:\"\"}.fa-birthday-cake:before{content:\"\"}.fa-area-chart:before{content:\"\"}.fa-pie-chart:before{content:\"\"}.fa-line-chart:before{content:\"\"}.fa-lastfm:before{content:\"\"}.fa-lastfm-square:before{content:\"\"}.fa-toggle-off:before{content:\"\"}.fa-toggle-on:before{content:\"\"}.fa-bicycle:before{content:\"\"}.fa-bus:before{content:\"\"}.fa-ioxhost:before{content:\"\"}.fa-angellist:before{content:\"\"}.fa-cc:before{content:\"\"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:\"\"}.fa-meanpath:before{content:\"\"}.fa-buysellads:before{content:\"\"}.fa-connectdevelop:before{content:\"\"}.fa-dashcube:before{content:\"\"}.fa-forumbee:before{content:\"\"}.fa-leanpub:before{content:\"\"}.fa-sellsy:before{content:\"\"}.fa-shirtsinbulk:before{content:\"\"}.fa-simplybuilt:before{content:\"\"}.fa-skyatlas:before{content:\"\"}.fa-cart-plus:before{content:\"\"}.fa-cart-arrow-down:before{content:\"\"}.fa-diamond:before{content:\"\"}.fa-ship:before{content:\"\"}.fa-user-secret:before{content:\"\"}.fa-motorcycle:before{content:\"\"}.fa-street-view:before{content:\"\"}.fa-heartbeat:before{content:\"\"}.fa-venus:before{content:\"\"}.fa-mars:before{content:\"\"}.fa-mercury:before{content:\"\"}.fa-intersex:before,.fa-transgender:before{content:\"\"}.fa-transgender-alt:before{content:\"\"}.fa-venus-double:before{content:\"\"}.fa-mars-double:before{content:\"\"}.fa-venus-mars:before{content:\"\"}.fa-mars-stroke:before{content:\"\"}.fa-mars-stroke-v:before{content:\"\"}.fa-mars-stroke-h:before{content:\"\"}.fa-neuter:before{content:\"\"}.fa-genderless:before{content:\"\"}.fa-facebook-official:before{content:\"\"}.fa-pinterest-p:before{content:\"\"}.fa-whatsapp:before{content:\"\"}.fa-server:before{content:\"\"}.fa-user-plus:before{content:\"\"}.fa-user-times:before{content:\"\"}.fa-bed:before,.fa-hotel:before{content:\"\"}.fa-viacoin:before{content:\"\"}.fa-train:before{content:\"\"}.fa-subway:before{content:\"\"}.fa-medium:before{content:\"\"}.fa-y-combinator:before,.fa-yc:before{content:\"\"}.fa-optin-monster:before{content:\"\"}.fa-opencart:before{content:\"\"}.fa-expeditedssl:before{content:\"\"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:\"\"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:\"\"}.fa-battery-2:before,.fa-battery-half:before{content:\"\"}.fa-battery-1:before,.fa-battery-quarter:before{content:\"\"}.fa-battery-0:before,.fa-battery-empty:before{content:\"\"}.fa-mouse-pointer:before{content:\"\"}.fa-i-cursor:before{content:\"\"}.fa-object-group:before{content:\"\"}.fa-object-ungroup:before{content:\"\"}.fa-sticky-note:before{content:\"\"}.fa-sticky-note-o:before{content:\"\"}.fa-cc-jcb:before{content:\"\"}.fa-cc-diners-club:before{content:\"\"}.fa-clone:before{content:\"\"}.fa-balance-scale:before{content:\"\"}.fa-hourglass-o:before{content:\"\"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:\"\"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:\"\"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:\"\"}.fa-hourglass:before{content:\"\"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:\"\"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:\"\"}.fa-hand-scissors-o:before{content:\"\"}.fa-hand-lizard-o:before{content:\"\"}.fa-hand-spock-o:before{content:\"\"}.fa-hand-pointer-o:before{content:\"\"}.fa-hand-peace-o:before{content:\"\"}.fa-trademark:before{content:\"\"}.fa-registered:before{content:\"\"}.fa-creative-commons:before{content:\"\"}.fa-gg:before{content:\"\"}.fa-gg-circle:before{content:\"\"}.fa-tripadvisor:before{content:\"\"}.fa-odnoklassniki:before{content:\"\"}.fa-odnoklassniki-square:before{content:\"\"}.fa-get-pocket:before{content:\"\"}.fa-wikipedia-w:before{content:\"\"}.fa-safari:before{content:\"\"}.fa-chrome:before{content:\"\"}.fa-firefox:before{content:\"\"}.fa-opera:before{content:\"\"}.fa-internet-explorer:before{content:\"\"}.fa-television:before,.fa-tv:before{content:\"\"}.fa-contao:before{content:\"\"}.fa-500px:before{content:\"\"}.fa-amazon:before{content:\"\"}.fa-calendar-plus-o:before{content:\"\"}.fa-calendar-minus-o:before{content:\"\"}.fa-calendar-times-o:before{content:\"\"}.fa-calendar-check-o:before{content:\"\"}.fa-industry:before{content:\"\"}.fa-map-pin:before{content:\"\"}.fa-map-signs:before{content:\"\"}.fa-map-o:before{content:\"\"}.fa-map:before{content:\"\"}.fa-commenting:before{content:\"\"}.fa-commenting-o:before{content:\"\"}.fa-houzz:before{content:\"\"}.fa-vimeo:before{content:\"\"}.fa-black-tie:before{content:\"\"}.fa-fonticons:before{content:\"\"}.fa-reddit-alien:before{content:\"\"}.fa-edge:before{content:\"\"}.fa-credit-card-alt:before{content:\"\"}.fa-codiepie:before{content:\"\"}.fa-modx:before{content:\"\"}.fa-fort-awesome:before{content:\"\"}.fa-usb:before{content:\"\"}.fa-product-hunt:before{content:\"\"}.fa-mixcloud:before{content:\"\"}.fa-scribd:before{content:\"\"}.fa-pause-circle:before{content:\"\"}.fa-pause-circle-o:before{content:\"\"}.fa-stop-circle:before{content:\"\"}.fa-stop-circle-o:before{content:\"\"}.fa-shopping-bag:before{content:\"\"}.fa-shopping-basket:before{content:\"\"}.fa-hashtag:before{content:\"\"}.fa-bluetooth:before{content:\"\"}.fa-bluetooth-b:before{content:\"\"}.fa-percent:before{content:\"\"}.fa-gitlab:before,.icon-gitlab:before{content:\"\"}.fa-wpbeginner:before{content:\"\"}.fa-wpforms:before{content:\"\"}.fa-envira:before{content:\"\"}.fa-universal-access:before{content:\"\"}.fa-wheelchair-alt:before{content:\"\"}.fa-question-circle-o:before{content:\"\"}.fa-blind:before{content:\"\"}.fa-audio-description:before{content:\"\"}.fa-volume-control-phone:before{content:\"\"}.fa-braille:before{content:\"\"}.fa-assistive-listening-systems:before{content:\"\"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:\"\"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:\"\"}.fa-glide:before{content:\"\"}.fa-glide-g:before{content:\"\"}.fa-sign-language:before,.fa-signing:before{content:\"\"}.fa-low-vision:before{content:\"\"}.fa-viadeo:before{content:\"\"}.fa-viadeo-square:before{content:\"\"}.fa-snapchat:before{content:\"\"}.fa-snapchat-ghost:before{content:\"\"}.fa-snapchat-square:before{content:\"\"}.fa-pied-piper:before{content:\"\"}.fa-first-order:before{content:\"\"}.fa-yoast:before{content:\"\"}.fa-themeisle:before{content:\"\"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:\"\"}.fa-fa:before,.fa-font-awesome:before{content:\"\"}.fa-handshake-o:before{content:\"\"}.fa-envelope-open:before{content:\"\"}.fa-envelope-open-o:before{content:\"\"}.fa-linode:before{content:\"\"}.fa-address-book:before{content:\"\"}.fa-address-book-o:before{content:\"\"}.fa-address-card:before,.fa-vcard:before{content:\"\"}.fa-address-card-o:before,.fa-vcard-o:before{content:\"\"}.fa-user-circle:before{content:\"\"}.fa-user-circle-o:before{content:\"\"}.fa-user-o:before{content:\"\"}.fa-id-badge:before{content:\"\"}.fa-drivers-license:before,.fa-id-card:before{content:\"\"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:\"\"}.fa-quora:before{content:\"\"}.fa-free-code-camp:before{content:\"\"}.fa-telegram:before{content:\"\"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:\"\"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:\"\"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:\"\"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:\"\"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:\"\"}.fa-shower:before{content:\"\"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:\"\"}.fa-podcast:before{content:\"\"}.fa-window-maximize:before{content:\"\"}.fa-window-minimize:before{content:\"\"}.fa-window-restore:before{content:\"\"}.fa-times-rectangle:before,.fa-window-close:before{content:\"\"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:\"\"}.fa-bandcamp:before{content:\"\"}.fa-grav:before{content:\"\"}.fa-etsy:before{content:\"\"}.fa-imdb:before{content:\"\"}.fa-ravelry:before{content:\"\"}.fa-eercast:before{content:\"\"}.fa-microchip:before{content:\"\"}.fa-snowflake-o:before{content:\"\"}.fa-superpowers:before{content:\"\"}.fa-wpexplorer:before{content:\"\"}.fa-meetup:before{content:\"\"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li span.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a span.toctree-expand:before,.wy-menu-vertical li.on a span.toctree-expand:before,.wy-menu-vertical li span.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand,.wy-menu-vertical li a span.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li span.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p.caption .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a span.toctree-expand,.btn .wy-menu-vertical li.on a span.toctree-expand,.btn .wy-menu-vertical li span.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p.caption .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a span.toctree-expand,.nav .wy-menu-vertical li.on a span.toctree-expand,.nav .wy-menu-vertical li span.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p.caption .btn .headerlink,.rst-content p.caption .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn span.toctree-expand,.wy-menu-vertical li.current>a .btn span.toctree-expand,.wy-menu-vertical li.current>a .nav span.toctree-expand,.wy-menu-vertical li .nav span.toctree-expand,.wy-menu-vertical li.on a .btn span.toctree-expand,.wy-menu-vertical li.on a .nav span.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p.caption .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li span.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p.caption .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li span.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p.caption .btn .fa-large.headerlink,.rst-content p.caption .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn span.fa-large.toctree-expand,.wy-menu-vertical li .nav span.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p.caption .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li span.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p.caption .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li span.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p.caption .btn .fa-spin.headerlink,.rst-content p.caption .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn span.fa-spin.toctree-expand,.wy-menu-vertical li .nav span.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p.caption .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li span.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p.caption .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li span.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p.caption .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li span.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p.caption .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini span.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:\"\"}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:\" \";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:\"\"}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:\" *\";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:\"\";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol li,.rst-content ol.arabic li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content ol.arabic li p:last-child,.rst-content ol.arabic li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol li ul li,.rst-content ol.arabic li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:\"\"}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.rst-content .wy-breadcrumbs li tt,.wy-breadcrumbs li .rst-content tt,.wy-breadcrumbs li code{padding:5px;border:none;background:none}.rst-content .wy-breadcrumbs li tt.literal,.wy-breadcrumbs li .rst-content tt.literal,.wy-breadcrumbs li code.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:\"\"}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li span.toctree-expand{display:block;float:left;margin-left:-1.2em;font-size:.8em;line-height:1.6em;color:#4d4d4d}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover span.toctree-expand,.wy-menu-vertical li.on a:hover span.toctree-expand{color:grey}.wy-menu-vertical li.current>a span.toctree-expand,.wy-menu-vertical li.on a span.toctree-expand{display:block;font-size:.8em;line-height:1.6em;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover span.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover span.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover span.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover span.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover span.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover span.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover span.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover span.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover span.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 span.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 span.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover span.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active span.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:\"\"}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:\"\"}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:\"\"}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:\"\"}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p.caption .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p.caption .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li span.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version span.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content img{max-width:100%;height:auto}.rst-content div.figure{margin-bottom:24px}.rst-content div.figure p.caption{font-style:italic}.rst-content div.figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:\"\\f08e\";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp{user-select:none;pointer-events:none}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content table>caption .headerlink{visibility:hidden;font-size:14px}.rst-content .code-block-caption .headerlink:after,.rst-content .toctree-wrapper>p.caption .headerlink:after,.rst-content dl dt .headerlink:after,.rst-content h1 .headerlink:after,.rst-content h2 .headerlink:after,.rst-content h3 .headerlink:after,.rst-content h4 .headerlink:after,.rst-content h5 .headerlink:after,.rst-content h6 .headerlink:after,.rst-content p.caption .headerlink:after,.rst-content table>caption .headerlink:after{content:\"\\f0c1\";font-family:FontAwesome}.rst-content .code-block-caption:hover .headerlink:after,.rst-content .toctree-wrapper>p.caption:hover .headerlink:after,.rst-content dl dt:hover .headerlink:after,.rst-content h1:hover .headerlink:after,.rst-content h2:hover .headerlink:after,.rst-content h3:hover .headerlink:after,.rst-content h4:hover .headerlink:after,.rst-content h5:hover .headerlink:after,.rst-content h6:hover .headerlink:after,.rst-content p.caption:hover .headerlink:after,.rst-content table>caption:hover .headerlink:after{visibility:visible}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .hlist{width:100%}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl dt span.classifier:before{content:\" : \"}html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.field-list>dt:after,html.writer-html5 .rst-content dl.footnote>dt:after{content:\":\"}html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.footnote>dt>span.brackets{margin-right:.5rem}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:\"[\"}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:\"]\"}html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{font-style:italic}html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.footnote>dd p,html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{font-size:inherit;line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code,html.writer-html4 .rst-content dl:not(.docutils) tt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format(\"woff2\"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format(\"woff\");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format(\"woff2\"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format(\"woff\");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format(\"woff2\"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format(\"woff\");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format(\"woff2\"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format(\"woff\");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format(\"woff2\"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format(\"woff\");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format(\"woff2\"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format(\"woff\");font-display:block}"
  },
  {
    "path": "bdsim/bdedit/docs/_static/custom.css",
    "content": "/* This file intentionally left blank. */\n"
  },
  {
    "path": "bdsim/bdedit/docs/_static/doctools.js",
    "content": "/*\n * doctools.js\n * ~~~~~~~~~~~\n *\n * Sphinx JavaScript utilities for all documentation.\n *\n * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\n/**\n * select a different prefix for underscore\n */\n$u = _.noConflict();\n\n/**\n * make the code below compatible with browsers without\n * an installed firebug like debugger\nif (!window.console || !console.firebug) {\n  var names = [\"log\", \"debug\", \"info\", \"warn\", \"error\", \"assert\", \"dir\",\n    \"dirxml\", \"group\", \"groupEnd\", \"time\", \"timeEnd\", \"count\", \"trace\",\n    \"profile\", \"profileEnd\"];\n  window.console = {};\n  for (var i = 0; i < names.length; ++i)\n    window.console[names[i]] = function() {};\n}\n */\n\n/**\n * small helper function to urldecode strings\n *\n * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL\n */\njQuery.urldecode = function(x) {\n  if (!x) {\n    return x\n  }\n  return decodeURIComponent(x.replace(/\\+/g, ' '));\n};\n\n/**\n * small helper function to urlencode strings\n */\njQuery.urlencode = encodeURIComponent;\n\n/**\n * This function returns the parsed url parameters of the\n * current request. Multiple values per key are supported,\n * it will always return arrays of strings for the value parts.\n */\njQuery.getQueryParameters = function(s) {\n  if (typeof s === 'undefined')\n    s = document.location.search;\n  var parts = s.substr(s.indexOf('?') + 1).split('&');\n  var result = {};\n  for (var i = 0; i < parts.length; i++) {\n    var tmp = parts[i].split('=', 2);\n    var key = jQuery.urldecode(tmp[0]);\n    var value = jQuery.urldecode(tmp[1]);\n    if (key in result)\n      result[key].push(value);\n    else\n      result[key] = [value];\n  }\n  return result;\n};\n\n/**\n * highlight a given string on a jquery object by wrapping it in\n * span elements with the given class name.\n */\njQuery.fn.highlightText = function(text, className) {\n  function highlight(node, addItems) {\n    if (node.nodeType === 3) {\n      var val = node.nodeValue;\n      var pos = val.toLowerCase().indexOf(text);\n      if (pos >= 0 &&\n          !jQuery(node.parentNode).hasClass(className) &&\n          !jQuery(node.parentNode).hasClass(\"nohighlight\")) {\n        var span;\n        var isInSVG = jQuery(node).closest(\"body, svg, foreignObject\").is(\"svg\");\n        if (isInSVG) {\n          span = document.createElementNS(\"http://www.w3.org/2000/svg\", \"tspan\");\n        } else {\n          span = document.createElement(\"span\");\n          span.className = className;\n        }\n        span.appendChild(document.createTextNode(val.substr(pos, text.length)));\n        node.parentNode.insertBefore(span, node.parentNode.insertBefore(\n          document.createTextNode(val.substr(pos + text.length)),\n          node.nextSibling));\n        node.nodeValue = val.substr(0, pos);\n        if (isInSVG) {\n          var rect = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n          var bbox = node.parentElement.getBBox();\n          rect.x.baseVal.value = bbox.x;\n          rect.y.baseVal.value = bbox.y;\n          rect.width.baseVal.value = bbox.width;\n          rect.height.baseVal.value = bbox.height;\n          rect.setAttribute('class', className);\n          addItems.push({\n              \"parent\": node.parentNode,\n              \"target\": rect});\n        }\n      }\n    }\n    else if (!jQuery(node).is(\"button, select, textarea\")) {\n      jQuery.each(node.childNodes, function() {\n        highlight(this, addItems);\n      });\n    }\n  }\n  var addItems = [];\n  var result = this.each(function() {\n    highlight(this, addItems);\n  });\n  for (var i = 0; i < addItems.length; ++i) {\n    jQuery(addItems[i].parent).before(addItems[i].target);\n  }\n  return result;\n};\n\n/*\n * backward compatibility for jQuery.browser\n * This will be supported until firefox bug is fixed.\n */\nif (!jQuery.browser) {\n  jQuery.uaMatch = function(ua) {\n    ua = ua.toLowerCase();\n\n    var match = /(chrome)[ \\/]([\\w.]+)/.exec(ua) ||\n      /(webkit)[ \\/]([\\w.]+)/.exec(ua) ||\n      /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec(ua) ||\n      /(msie) ([\\w.]+)/.exec(ua) ||\n      ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec(ua) ||\n      [];\n\n    return {\n      browser: match[ 1 ] || \"\",\n      version: match[ 2 ] || \"0\"\n    };\n  };\n  jQuery.browser = {};\n  jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;\n}\n\n/**\n * Small JavaScript module for the documentation.\n */\nvar Documentation = {\n\n  init : function() {\n    this.fixFirefoxAnchorBug();\n    this.highlightSearchWords();\n    this.initIndexTable();\n    if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {\n      this.initOnKeyListeners();\n    }\n  },\n\n  /**\n   * i18n support\n   */\n  TRANSLATIONS : {},\n  PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },\n  LOCALE : 'unknown',\n\n  // gettext and ngettext don't access this so that the functions\n  // can safely bound to a different name (_ = Documentation.gettext)\n  gettext : function(string) {\n    var translated = Documentation.TRANSLATIONS[string];\n    if (typeof translated === 'undefined')\n      return string;\n    return (typeof translated === 'string') ? translated : translated[0];\n  },\n\n  ngettext : function(singular, plural, n) {\n    var translated = Documentation.TRANSLATIONS[singular];\n    if (typeof translated === 'undefined')\n      return (n == 1) ? singular : plural;\n    return translated[Documentation.PLURALEXPR(n)];\n  },\n\n  addTranslations : function(catalog) {\n    for (var key in catalog.messages)\n      this.TRANSLATIONS[key] = catalog.messages[key];\n    this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');\n    this.LOCALE = catalog.locale;\n  },\n\n  /**\n   * add context elements like header anchor links\n   */\n  addContextElements : function() {\n    $('div[id] > :header:first').each(function() {\n      $('<a class=\"headerlink\">\\u00B6</a>').\n      attr('href', '#' + this.id).\n      attr('title', _('Permalink to this headline')).\n      appendTo(this);\n    });\n    $('dt[id]').each(function() {\n      $('<a class=\"headerlink\">\\u00B6</a>').\n      attr('href', '#' + this.id).\n      attr('title', _('Permalink to this definition')).\n      appendTo(this);\n    });\n  },\n\n  /**\n   * workaround a firefox stupidity\n   * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075\n   */\n  fixFirefoxAnchorBug : function() {\n    if (document.location.hash && $.browser.mozilla)\n      window.setTimeout(function() {\n        document.location.href += '';\n      }, 10);\n  },\n\n  /**\n   * highlight the search words provided in the url in the text\n   */\n  highlightSearchWords : function() {\n    var params = $.getQueryParameters();\n    var terms = (params.highlight) ? params.highlight[0].split(/\\s+/) : [];\n    if (terms.length) {\n      var body = $('div.body');\n      if (!body.length) {\n        body = $('body');\n      }\n      window.setTimeout(function() {\n        $.each(terms, function() {\n          body.highlightText(this.toLowerCase(), 'highlighted');\n        });\n      }, 10);\n      $('<p class=\"highlight-link\"><a href=\"javascript:Documentation.' +\n        'hideSearchWords()\">' + _('Hide Search Matches') + '</a></p>')\n          .appendTo($('#searchbox'));\n    }\n  },\n\n  /**\n   * init the domain index toggle buttons\n   */\n  initIndexTable : function() {\n    var togglers = $('img.toggler').click(function() {\n      var src = $(this).attr('src');\n      var idnum = $(this).attr('id').substr(7);\n      $('tr.cg-' + idnum).toggle();\n      if (src.substr(-9) === 'minus.png')\n        $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');\n      else\n        $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');\n    }).css('display', '');\n    if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {\n        togglers.click();\n    }\n  },\n\n  /**\n   * helper function to hide the search marks again\n   */\n  hideSearchWords : function() {\n    $('#searchbox .highlight-link').fadeOut(300);\n    $('span.highlighted').removeClass('highlighted');\n  },\n\n  /**\n   * make the url absolute\n   */\n  makeURL : function(relativeURL) {\n    return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;\n  },\n\n  /**\n   * get the current relative url\n   */\n  getCurrentURL : function() {\n    var path = document.location.pathname;\n    var parts = path.split(/\\//);\n    $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\\//), function() {\n      if (this === '..')\n        parts.pop();\n    });\n    var url = parts.join('/');\n    return path.substring(url.lastIndexOf('/') + 1, path.length - 1);\n  },\n\n  initOnKeyListeners: function() {\n    $(document).keydown(function(event) {\n      var activeElementType = document.activeElement.tagName;\n      // don't navigate when in search box, textarea, dropdown or button\n      if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'\n          && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey\n          && !event.shiftKey) {\n        switch (event.keyCode) {\n          case 37: // left\n            var prevHref = $('link[rel=\"prev\"]').prop('href');\n            if (prevHref) {\n              window.location.href = prevHref;\n              return false;\n            }\n          case 39: // right\n            var nextHref = $('link[rel=\"next\"]').prop('href');\n            if (nextHref) {\n              window.location.href = nextHref;\n              return false;\n            }\n        }\n      }\n    });\n  }\n};\n\n// quick alias for translations\n_ = Documentation.gettext;\n\n$(document).ready(function() {\n  Documentation.init();\n});\n"
  },
  {
    "path": "bdsim/bdedit/docs/_static/documentation_options.js",
    "content": "var DOCUMENTATION_OPTIONS = {\n    URL_ROOT: document.getElementById(\"documentation_options\").getAttribute('data-url_root'),\n    VERSION: '',\n    LANGUAGE: 'None',\n    COLLAPSE_INDEX: false,\n    BUILDER: 'html',\n    FILE_SUFFIX: '.html',\n    LINK_SUFFIX: '.html',\n    HAS_SOURCE: true,\n    SOURCELINK_SUFFIX: '.txt',\n    NAVIGATION_WITH_KEYS: false\n};"
  },
  {
    "path": "bdsim/bdedit/docs/_static/jquery-3.5.1.js",
    "content": "/*!\n * jQuery JavaScript Library v3.5.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2020-05-04T22:49Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n      // Support: Chrome <=57, Firefox <=52\n      // In some browsers, typeof returns \"function\" for HTML <object> elements\n      // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n      // We don't want to classify *any* DOM node as a function.\n      return typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n  };\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = \"3.5.1\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( _i, name ) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.5\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2020-03-14\n */\n( function( window ) {\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ( {} ).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpushNative = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\n\t// Use a stripped-down indexOf as it's faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[ i ] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|\" +\n\t\t\"ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\n\t\t// \"Attribute values must be CSS identifiers [capture 5]\n\t\t// or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" +\n\t\twhitespace + \"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" +\n\t\twhitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace +\n\t\t\"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" +\n\t\t\twhitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" +\n\t\t\twhitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace +\n\t\t\t\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace +\n\t\t\t\"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = \"0x\" + escape.slice( 1 ) - 0x10000;\n\n\t\treturn nonHex ?\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\tnonHex :\n\n\t\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t\t// Support: IE <=11+\n\t\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t\t// surrogate pair\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === \"\\0\" ) {\n\t\t\t\treturn \"\\uFFFD\";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + \"\\\\\" +\n\t\t\t\tch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn \"\\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === \"fieldset\";\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( ( target[ j++ ] = els[ i++ ] ) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t( nodeType !== 1 || context.nodeName.toLowerCase() !== \"object\" ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we're not changing the context.\n\t\t\t\t\tif ( newContext !== context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( \"id\" ) ) ) {\n\t\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( \"id\", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? \"#\" + nid : \":scope\" ) + \" \" +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( \"fieldset\" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split( \"|\" ),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[ i ] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( ( cur = cur.nextSibling ) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn ( name === \"input\" || name === \"button\" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem.namespaceURI,\n\t\tdocElem = ( elem.ownerDocument || elem ).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( preferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\n\t// Safari 4 - 5 only, Opera <=11.6 - 12.x only\n\t// IE/Edge & older browsers don't support the :scope pseudo-class.\n\t// Support: Safari 6.0 only\n\t// Safari 6.0 supports :scope but it's an alias of :root there.\n\tsupport.scope = assert( function( el ) {\n\t\tdocElem.appendChild( el ).appendChild( document.createElement( \"div\" ) );\n\t\treturn typeof el.querySelectorAll !== \"undefined\" &&\n\t\t\t!el.querySelectorAll( \":scope fieldset div\" ).length;\n\t} );\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert( function( el ) {\n\t\tel.className = \"i\";\n\t\treturn !el.getAttribute( \"className\" );\n\t} );\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert( function( el ) {\n\t\tel.appendChild( document.createComment( \"\" ) );\n\t\treturn !el.getElementsByTagName( \"*\" ).length;\n\t} );\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[ \"ID\" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"id\" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[ \"ID\" ] =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode( \"id\" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[ \"TAG\" ] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[ \"CLASS\" ] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {\n\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert( function( el ) {\n\n\t\t\tvar input;\n\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n\t\t\t\t\"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n\t\t\t\t\"<option selected=''></option></select>\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll( \"[msallowcapture^='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !el.querySelectorAll( \"[selected]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"~=\" );\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t\t// IE 11/Edge don't find elements on a `[name='']` query in some cases.\n\t\t\t// Adding a temporary attribute to the document before the selection works\n\t\t\t// around the issue.\n\t\t\t// Interestingly, IE 10 & older don't seem to have the issue.\n\t\t\tinput = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"name\", \"\" );\n\t\t\tel.appendChild( input );\n\t\t\tif ( !el.querySelectorAll( \"[name='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" +\n\t\t\t\t\twhitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll( \":checked\" ).length ) {\n\t\t\t\trbuggyQSA.push( \":checked\" );\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push( \".#.+[+~]\" );\n\t\t\t}\n\n\t\t\t// Support: Firefox <=3.6 - 5 only\n\t\t\t// Old Firefox doesn't throw on a badly-escaped identifier.\n\t\t\tel.querySelectorAll( \"\\\\\\f\" );\n\t\t\trbuggyQSA.push( \"[\\\\r\\\\n\\\\f]\" );\n\t\t} );\n\n\t\tassert( function( el ) {\n\t\t\tel.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n\t\t\t\t\"<select disabled='disabled'><option/></select>\";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll( \"[name=d]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll( \":enabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll( \":disabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: Opera 10 - 11 only\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll( \"*,:x\" );\n\t\t\trbuggyQSA.push( \",.*:\" );\n\t\t} );\n\t}\n\n\tif ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector ) ) ) ) {\n\n\t\tassert( function( el ) {\n\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, \"*\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t} );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( \"|\" ) );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( \"|\" ) );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t) );\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( ( b = b.parentNode ) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a == document || a.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b == document || b.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\treturn a == document ? -1 :\n\t\t\t\tb == document ? 1 :\n\t\t\t\t/* eslint-enable eqeqeq */\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[ i ] === bp[ i ] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[ i ], bp[ i ] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\tap[ i ] == preferredDoc ? -1 :\n\t\t\tbp[ i ] == preferredDoc ? 1 :\n\t\t\t/* eslint-enable eqeqeq */\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t// fragment in IE 9\n\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn ( sel + \"\" ).replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] ||\n\t\t\t\tmatch[ 5 ] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === \"~=\" ) {\n\t\t\t\tmatch[ 3 ] = \" \" + match[ 3 ] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === \"nth\" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === \"even\" || match[ 3 ] === \"odd\" ) );\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === \"odd\" );\n\n\t\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr[ \"CHILD\" ].test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( \"(^|\" + whitespace +\n\t\t\t\t\t\")\" + className + \"(\" + whitespace + \"|$)\" ) ) && classCache(\n\t\t\t\t\t\tclassName, function( elem ) {\n\t\t\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\t\t\ttypeof elem.className === \"string\" && elem.className ||\n\t\t\t\t\t\t\t\ttypeof elem.getAttribute !== \"undefined\" &&\n\t\t\t\t\t\t\t\t\telem.getAttribute( \"class\" ) ||\n\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\t/* eslint-disable max-len */\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t\t/* eslint-enable max-len */\n\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\t\"has\": markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\t\"contains\": markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || \"\" ) ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( \"xml:lang\" ) || elem.getAttribute( \"lang\" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement &&\n\t\t\t\t( !document.hasFocus || document.hasFocus() ) &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": createDisabledPseudo( false ),\n\t\t\"disabled\": createDisabledPseudo( true ),\n\n\t\t\"checked\": function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn ( nodeName === \"input\" && !!elem.checked ) ||\n\t\t\t\t( nodeName === \"option\" && !!elem.selected );\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t//   but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[ \"empty\" ]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( ( attr = elem.getAttribute( \"type\" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\t\"last\": createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\t\"eq\": createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\t\"even\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"odd\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"lt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ?\n\t\t\t\targument + length :\n\t\t\t\targument > length ?\n\t\t\t\t\tlength :\n\t\t\t\t\targument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"gt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos[ \"nth\" ] = Expr.pseudos[ \"eq\" ];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rcombinators.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrim, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] ||\n\t\t\t\t\t\t\t( outerCache[ elem.uniqueID ] = {} );\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = uniqueCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts(\n\t\t\t\tselector || \"*\",\n\t\t\t\tcontext.nodeType ? [ context ] : context,\n\t\t\t\t[]\n\t\t\t),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ \" \" ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\ttokens\n\t\t\t\t\t\t.slice( 0, i - 1 )\n\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" } )\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[ \"TAG\" ]( \"*\", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache(\n\t\t\tselector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers )\n\t\t);\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === \"ID\" &&\n\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find[ \"ID\" ]( token.matches[ 0 ]\n\t\t\t\t.replace( runescape, funescape ), context ) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[ \"needsContext\" ].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split( \"\" ).sort( sortOrder ).join( \"\" ) === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( \"fieldset\" ) ) & 1;\n} );\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert( function( el ) {\n\tel.innerHTML = \"<a href='#'></a>\";\n\treturn el.firstChild.getAttribute( \"href\" ) === \"#\";\n} ) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert( function( el ) {\n\tel.innerHTML = \"<input/>\";\n\tel.firstChild.setAttribute( \"value\", \"\" );\n\treturn el.firstChild.getAttribute( \"value\" ) === \"\";\n} ) ) {\n\taddHandle( \"value\", function( elem, _name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert( function( el ) {\n\treturn el.getAttribute( \"disabled\" ) == null;\n} ) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\t\tnull;\n\t\t}\n\t} );\n}\n\nreturn Sizzle;\n\n} )( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n  return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n};\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// <object> elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the master Deferred\n\t\t\tmaster = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tmaster.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( master.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn master.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n\t\t}\n\n\t\treturn master.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\tvalue :\n\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (#9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces <option> tags with their contents when inserted outside of\n\t// the select element.\n\tdiv.innerHTML = \"<option></option>\";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, \"<select multiple='multiple'>\", \"</select>\" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 - 11+\n// focus() and blur() are asynchronous, except when they are no-op.\n// So expect focus to be synchronous when the element is already active,\n// and blur to be synchronous when the element is not already active.\n// (focus and blur are always synchronous in other supported browsers,\n// this just defines when we can count on it).\nfunction expectSync( elem, type ) {\n\treturn ( elem === safeActiveElement() ) === ( type === \"focus\" );\n}\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\t\tdataPriv.get( this, \"events\" ) || Object.create( null )\n\t\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", returnTrue );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, expectSync ) {\n\n\t// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !expectSync ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar notAsync, result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\t// Saved data should be false in such cases, but might be a leftover capture object\n\t\t\t\t// from an async native handler (gh-4350)\n\t\t\t\tif ( !saved.length ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t// focus() and blur() are asynchronous\n\t\t\t\t\tnotAsync = expectSync( this, type );\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tif ( saved !== result || notAsync ) {\n\t\t\t\t\t\tdataPriv.set( this, type, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t}\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn result.value;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering the\n\t\t\t\t// native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved.length ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, {\n\t\t\t\t\tvalue: jQuery.event.trigger(\n\n\t\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t\t// Extend with the prototype to reset the above stopImmediatePropagation()\n\t\t\t\t\t\tjQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\n\t\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\t\tthis\n\t\t\t\t\t)\n\t\t\t\t} );\n\n\t\t\t\t// Abort handling of the native event\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (#504, #13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\n\twhich: function( event ) {\n\t\tvar button = event.button;\n\n\t\t// Add which for key events\n\t\tif ( event.which == null && rkeyEvent.test( event.type ) ) {\n\t\t\treturn event.charCode != null ? event.charCode : event.keyCode;\n\t\t}\n\n\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\tif ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n\t\t\tif ( button & 1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif ( button & 2 ) {\n\t\t\t\treturn 3;\n\t\t\t}\n\n\t\t\tif ( button & 4 ) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn event.which;\n\t}\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, expectSync );\n\n\t\t\t// Return false to allow normal processing in the caller\n\t\t\treturn false;\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, \"handle events\" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase()  !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( \"table\" );\n\t\t\t\ttr = document.createElement( \"tr\" );\n\t\t\t\ttrChild = document.createElement( \"div\" );\n\n\t\t\t\ttable.style.cssText = \"position:absolute;left:-11111px\";\n\t\t\t\ttr.style.height = \"1px\";\n\t\t\t\ttrChild.style.height = \"9px\";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = parseInt( trStyle.height ) > 3;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t//   .css('filter') (IE 9 only, #12537)\n\t//   .css('--customProperty) (#3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trcustomProp = /^--/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === \"margin\" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn't suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, \"tr\" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === \"auto\" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"animationIterationCount\": true,\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"gridArea\": true,\n\t\t\"gridColumn\": true,\n\t\t\"gridColumnEnd\": true,\n\t\t\"gridColumnStart\": true,\n\t\t\"gridRow\": true,\n\t\t\"gridRowEnd\": true,\n\t\t\"gridRowStart\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t\t} ) :\n\t\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\t// Use proper attribute retrieval(#12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar className, i, self, classNames;\n\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\ti = 0;\n\t\t\t\tself = jQuery( this );\n\t\t\t\tclassNames = classesToArray( value );\n\n\t\t\t\twhile ( ( className = classNames[ i++ ] ) ) {\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = (\n\t\t\t\t\tdataPriv.get( cur, \"events\" ) || Object.create( null )\n\t\t\t\t)[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\n\t\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {\n\t\txml = undefined;\n\t}\n\n\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\tjQuery.error( \"Invalid XML: \" + data );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} )\n\t\t.filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} )\n\t\t.map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\toriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script\n\t\t\tif ( !isSuccess && jQuery.inArray( \"script\", s.dataTypes ) > -1 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === \"content-type\" ) {\n\t\t\ts.contentType = s.headers[ i ] || \"\";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (#11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\"  ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( \"load error\", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce.guid++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tif ( typeof props.top === \"number\" ) {\n\t\t\t\tprops.top += \"px\";\n\t\t\t}\n\t\t\tif ( typeof props.left === \"number\" ) {\n\t\t\t\tprops.left += \"px\";\n\t\t\t}\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t//    documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( _i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name },\n\t\tfunction( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( _i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t},\n\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t}\n} );\n\njQuery.each( ( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( _i, name ) {\n\n\t\t// Handle event binding\n\t\tjQuery.fn[ name ] = function( data, fn ) {\n\t\t\treturn arguments.length > 0 ?\n\t\t\t\tthis.on( name, null, data, fn ) :\n\t\t\t\tthis.trigger( name );\n\t\t};\n\t} );\n\n\n\n\n// Support: Android <=4.0 only\n// Make sure we trim BOM and NBSP\nvar rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\njQuery.trim = function( text ) {\n\treturn text == null ?\n\t\t\"\" :\n\t\t( text + \"\" ).replace( rtrim, \"\" );\n};\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n\tdefine( \"jquery\", [], function() {\n\t\treturn jQuery;\n\t} );\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( typeof noGlobal === \"undefined\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n"
  },
  {
    "path": "bdsim/bdedit/docs/_static/jquery.js",
    "content": "/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */\n!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error(\"jQuery requires a window with a document\");return t(e)}:t(e)}(\"undefined\"!=typeof window?window:this,function(C,e){\"use strict\";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return\"function\"==typeof e&&\"number\"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement(\"script\");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+\"\":\"object\"==typeof e||\"function\"==typeof e?n[o.call(e)]||\"object\":typeof e}var f=\"3.5.1\",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&\"length\"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for(\"boolean\"==typeof a&&(l=a,a=arguments[s]||{},s++),\"object\"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],\"__proto__\"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:\"jQuery\"+(f+Math.random()).replace(/\\D/g,\"\"),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||\"[object Object]\"!==o.call(e))&&(!(t=r(e))||\"function\"==typeof(n=v.call(t,\"constructor\")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,\"string\"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),\"function\"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"),function(e,t){n[\"[object \"+t+\"]\"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S=\"sizzle\"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R=\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",M=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",I=\"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\"+M+\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",W=\"\\\\[\"+M+\"*(\"+I+\")(?:\"+M+\"*([*^$|!~]?=)\"+M+\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\"+I+\"))|)\"+M+\"*\\\\]\",F=\":(\"+I+\")(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\"+W+\")*)|.*)\\\\)|)\",B=new RegExp(M+\"+\",\"g\"),$=new RegExp(\"^\"+M+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+M+\"+$\",\"g\"),_=new RegExp(\"^\"+M+\"*,\"+M+\"*\"),z=new RegExp(\"^\"+M+\"*([>+~]|\"+M+\")\"+M+\"*\"),U=new RegExp(M+\"|>\"),X=new RegExp(F),V=new RegExp(\"^\"+I+\"$\"),G={ID:new RegExp(\"^#(\"+I+\")\"),CLASS:new RegExp(\"^\\\\.(\"+I+\")\"),TAG:new RegExp(\"^(\"+I+\"|[*])\"),ATTR:new RegExp(\"^\"+W),PSEUDO:new RegExp(\"^\"+F),CHILD:new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\"+M+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+M+\"*(?:([+-]|)\"+M+\"*(\\\\d+)|))\"+M+\"*\\\\)|)\",\"i\"),bool:new RegExp(\"^(?:\"+R+\")$\",\"i\"),needsContext:new RegExp(\"^\"+M+\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+M+\"*((?:-\\\\d)?\\\\d*)\"+M+\"*\\\\)|)(?=[^-]|$)\",\"i\")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\\d$/i,K=/^[^{]+\\{\\s*\\[native \\w/,Z=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,ee=/[+~]/,te=new RegExp(\"\\\\\\\\[\\\\da-fA-F]{1,6}\"+M+\"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\",\"g\"),ne=function(e,t){var n=\"0x\"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,ie=function(e,t){return t?\"\\0\"===e?\"\\ufffd\":e.slice(0,-1)+\"\\\\\"+e.charCodeAt(e.length-1).toString(16)+\" \":\"\\\\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&\"fieldset\"===e.nodeName.toLowerCase()},{dir:\"parentNode\",next:\"legend\"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],\"string\"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+\" \"]&&(!v||!v.test(t))&&(1!==p||\"object\"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute(\"id\"))?s=s.replace(re,ie):e.setAttribute(\"id\",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?\"#\"+s:\":scope\")+\" \"+xe(l[o]);c=l.join(\",\")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute(\"id\")}}}return g(t.replace($,\"$1\"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+\" \")>b.cacheLength&&delete e[r.shift()],e[t+\" \"]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement(\"fieldset\");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split(\"|\"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return\"input\"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return(\"input\"===t||\"button\"===t)&&e.type===n}}function ge(t){return function(e){return\"form\"in e?e.parentNode&&!1===e.disabled?\"label\"in e?\"label\"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:\"label\"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&\"undefined\"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||\"HTML\")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener(\"unload\",oe,!1):n.attachEvent&&n.attachEvent(\"onunload\",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement(\"div\")),\"undefined\"!=typeof e.querySelectorAll&&!e.querySelectorAll(\":scope fieldset div\").length}),d.attributes=ce(function(e){return e.className=\"i\",!e.getAttribute(\"className\")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment(\"\")),!e.getElementsByTagName(\"*\").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute(\"id\")===t}},b.find.ID=function(e,t){if(\"undefined\"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t=\"undefined\"!=typeof e.getAttributeNode&&e.getAttributeNode(\"id\");return t&&t.value===n}},b.find.ID=function(e,t){if(\"undefined\"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode(\"id\"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode(\"id\"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return\"undefined\"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if(\"*\"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if(\"undefined\"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML=\"<a id='\"+S+\"'></a><select id='\"+S+\"-\\r\\\\' msallowcapture=''><option selected=''></option></select>\",e.querySelectorAll(\"[msallowcapture^='']\").length&&v.push(\"[*^$]=\"+M+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\"[selected]\").length||v.push(\"\\\\[\"+M+\"*(?:value|\"+R+\")\"),e.querySelectorAll(\"[id~=\"+S+\"-]\").length||v.push(\"~=\"),(t=C.createElement(\"input\")).setAttribute(\"name\",\"\"),e.appendChild(t),e.querySelectorAll(\"[name='']\").length||v.push(\"\\\\[\"+M+\"*name\"+M+\"*=\"+M+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\":checked\").length||v.push(\":checked\"),e.querySelectorAll(\"a#\"+S+\"+*\").length||v.push(\".#.+[+~]\"),e.querySelectorAll(\"\\\\\\f\"),v.push(\"[\\\\r\\\\n\\\\f]\")}),ce(function(e){e.innerHTML=\"<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>\";var t=C.createElement(\"input\");t.setAttribute(\"type\",\"hidden\"),e.appendChild(t).setAttribute(\"name\",\"D\"),e.querySelectorAll(\"[name=d]\").length&&v.push(\"name\"+M+\"*[*^$|!~]?=\"),2!==e.querySelectorAll(\":enabled\").length&&v.push(\":enabled\",\":disabled\"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(\":disabled\").length&&v.push(\":enabled\",\":disabled\"),e.querySelectorAll(\"*,:x\"),v.push(\",.*:\")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,\"*\"),c.call(e,\"[s!='']:x\"),s.push(\"!=\",F)}),v=v.length&&new RegExp(v.join(\"|\")),s=s.length&&new RegExp(s.join(\"|\")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+\" \"]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+\"\").replace(re,ie)},se.error=function(e){throw new Error(\"Syntax error, unrecognized expression: \"+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n=\"\",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if(\"string\"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||\"\").replace(te,ne),\"~=\"===e[2]&&(e[3]=\" \"+e[3]+\" \"),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),\"nth\"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(\"even\"===e[3]||\"odd\"===e[3])),e[5]=+(e[7]+e[8]||\"odd\"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||\"\":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(\")\",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return\"*\"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+\" \"];return t||(t=new RegExp(\"(^|\"+M+\")\"+e+\"(\"+M+\"|$)\"))&&m(e,function(e){return t.test(\"string\"==typeof e.className&&e.className||\"undefined\"!=typeof e.getAttribute&&e.getAttribute(\"class\")||\"\")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?\"!=\"===r:!r||(t+=\"\",\"=\"===r?t===i:\"!=\"===r?t!==i:\"^=\"===r?i&&0===t.indexOf(i):\"*=\"===r?i&&-1<t.indexOf(i):\"$=\"===r?i&&t.slice(-i.length)===i:\"~=\"===r?-1<(\" \"+t.replace(B,\" \")+\" \").indexOf(i):\"|=\"===r&&(t===i||t.slice(0,i.length+1)===i+\"-\"))}},CHILD:function(h,e,t,g,v){var y=\"nth\"!==h.slice(0,3),m=\"last\"!==h.slice(-4),x=\"of-type\"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?\"nextSibling\":\"previousSibling\",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l=\"only\"===h&&!u&&\"nextSibling\"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error(\"unsupported pseudo: \"+e);return a[S]?a(o):1<a.length?(t=[e,e,\"\",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,\"$1\"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||\"\")||se.error(\"unsupported lang: \"+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute(\"xml:lang\")||e.getAttribute(\"lang\"))return(t=t.toLowerCase())===n||0===t.indexOf(n+\"-\")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&!!e.checked||\"option\"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&\"button\"===e.type||\"button\"===t},text:function(e){var t;return\"input\"===e.nodeName.toLowerCase()&&\"text\"===e.type&&(null==(t=e.getAttribute(\"type\"))||\"text\"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r=\"\";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&\"parentNode\"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||\"*\",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[\" \"],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:\" \"===e[s-2].type?\"*\":\"\"})).replace($,\"$1\"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+\" \"];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($,\" \")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+\" \"];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l=\"0\",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG(\"*\",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l=\"function\"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&\"ID\"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split(\"\").sort(D).join(\"\")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement(\"fieldset\"))}),ce(function(e){return e.innerHTML=\"<a href='#'></a>\",\"#\"===e.firstChild.getAttribute(\"href\")})||fe(\"type|href|height|width\",function(e,t,n){if(!n)return e.getAttribute(t,\"type\"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML=\"<input/>\",e.firstChild.setAttribute(\"value\",\"\"),\"\"===e.firstChild.getAttribute(\"value\")})||fe(\"value\",function(e,t,n){if(!n&&\"input\"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute(\"disabled\")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[\":\"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):\"string\"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=\":not(\"+e+\")\"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if(\"string\"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,\"string\"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,\"string\"==typeof e){if(!(r=\"<\"===e[0]&&\">\"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a=\"string\"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?\"string\"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,\"parentNode\")},parentsUntil:function(e,t,n){return h(e,\"parentNode\",n)},next:function(e){return O(e,\"nextSibling\")},prev:function(e){return O(e,\"previousSibling\")},nextAll:function(e){return h(e,\"nextSibling\")},prevAll:function(e){return h(e,\"previousSibling\")},nextUntil:function(e,t,n){return h(e,\"nextSibling\",n)},prevUntil:function(e,t,n){return h(e,\"previousSibling\",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,\"template\")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return\"Until\"!==r.slice(-5)&&(t=e),t&&\"string\"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\\x20\\t\\r\\n\\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r=\"string\"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:\"\")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&\"string\"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t=\"\",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=\"\"),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[[\"notify\",\"progress\",S.Callbacks(\"memory\"),S.Callbacks(\"memory\"),2],[\"resolve\",\"done\",S.Callbacks(\"once memory\"),S.Callbacks(\"once memory\"),0,\"resolved\"],[\"reject\",\"fail\",S.Callbacks(\"once memory\"),S.Callbacks(\"once memory\"),1,\"rejected\"]],i=\"pending\",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},\"catch\":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+\"With\"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError(\"Thenable self-resolution\");t=e&&(\"object\"==typeof e||\"function\"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+\"With\"](this===s?void 0:this,arguments),this},s[t[0]+\"With\"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),\"pending\"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn(\"jQuery.Deferred exception: \"+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener(\"DOMContentLoaded\",B),C.removeEventListener(\"load\",B),S.ready()}S.fn.ready=function(e){return F.then(e)[\"catch\"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,\"complete\"===E.readyState||\"loading\"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener(\"DOMContentLoaded\",B),C.addEventListener(\"load\",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if(\"object\"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,\"ms-\").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if(\"string\"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&\"string\"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r=\"data-\"+t.replace(K,\"-$&\").toLowerCase(),\"string\"==typeof(n=e.getAttribute(r))){try{n=\"true\"===(i=n)||\"false\"!==i&&(\"null\"===i?null:i===+i+\"\"?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,\"hasDataAttrs\"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf(\"data-\")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,\"hasDataAttrs\",!0)}return i}return\"object\"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||\"fx\")+\"queue\",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||\"fx\";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);\"inprogress\"===i&&(i=n.shift(),r--),i&&(\"fx\"===t&&n.unshift(\"inprogress\"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+\"queueHooks\";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks(\"once memory\").add(function(){Y.remove(e,[t+\"queue\",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return\"string\"!=typeof t&&(n=t,t=\"fx\",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),\"fx\"===t&&\"inprogress\"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||\"fx\",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};\"string\"!=typeof e&&(t=e,e=void 0),e=e||\"fx\";while(a--)(n=Y.get(o[a],e+\"queueHooks\"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,te=new RegExp(\"^(?:([+-])=|)(\"+ee+\")([a-z%]*)$\",\"i\"),ne=[\"Top\",\"Right\",\"Bottom\",\"Left\"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return\"none\"===(e=t||e).style.display||\"\"===e.style.display&&ie(e)&&\"none\"===S.css(e,\"display\")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,\"\")},u=s(),l=n&&n[3]||(S.cssNumber[t]?\"\":\"px\"),c=e.nodeType&&(S.cssNumber[t]||\"px\"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?(\"none\"===n&&(l[c]=Y.get(r,\"display\")||null,l[c]||(r.style.display=\"\")),\"\"===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,\"display\"),o.parentNode.removeChild(o),\"none\"===u&&(u=\"block\"),ue[s]=u)))):\"none\"!==n&&(l[c]=\"none\",Y.set(r,\"display\",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return\"boolean\"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i,he=/^$|^module$|\\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement(\"div\")),(fe=E.createElement(\"input\")).setAttribute(\"type\",\"radio\"),fe.setAttribute(\"checked\",\"checked\"),fe.setAttribute(\"name\",\"t\"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML=\"<textarea>x</textarea>\",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML=\"<option></option>\",y.option=!!ce.lastChild;var ge={thead:[1,\"<table>\",\"</table>\"],col:[2,\"<table><colgroup>\",\"</colgroup></table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],_default:[0,\"\",\"\"]};function ve(e,t){var n;return n=\"undefined\"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||\"*\"):\"undefined\"!=typeof e.querySelectorAll?e.querySelectorAll(t||\"*\"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],\"globalEval\",!t||Y.get(t[n],\"globalEval\"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,\"<select multiple='multiple'>\",\"</select>\"]);var me=/<|&#?\\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if(\"object\"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement(\"div\")),s=(de.exec(o)||[\"\",\"\"])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=\"\"}else p.push(t.createTextNode(o));f.textContent=\"\",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),\"script\"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||\"\")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==(\"focus\"===t)}function ke(e,t,n,r,i,o){var a,s;if(\"object\"==typeof t){for(s in\"string\"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&(\"string\"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return\"undefined\"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||\"\").match(P)||[\"\"]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||\"\").split(\".\").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(\".\")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||\"\").match(P)||[\"\"]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||\"\").split(\".\").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&(\"**\"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,\"handle events\")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,\"events\")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!(\"click\"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(\"click\"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+\" \"]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Ae(t,\"click\",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Ae(t,\"click\"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Y.get(t,\"click\")||A(t,\"a\")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,\"char\":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:\"focusin\",blur:\"focusout\"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\",pointerenter:\"pointerover\",pointerleave:\"pointerout\"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+\".\"+r.namespace:r.origType,r.selector,r.handler),this;if(\"object\"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&\"function\"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\\s*(?:[^=]|=\\s*.checked.)/i,je=/^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;function qe(e,t){return A(e,\"table\")&&A(11!==t.nodeType?t:t.firstChild,\"tr\")&&S(e).children(\"tbody\")[0]||e}function Le(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}function He(e){return\"true/\"===(e.type||\"\").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute(\"type\"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,\"handle events\"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&\"string\"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,\"script\"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,\"script\"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||\"\")&&!Y.access(u,\"globalEval\")&&S.contains(l,u)&&(u.src&&\"module\"!==(u.type||\"\").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute(\"nonce\")},l):b(u.textContent.replace(je,\"\"),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,\"script\")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,\"input\"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:\"input\"!==l&&\"textarea\"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,\"script\")).length&&ye(a,!f&&ve(e,\"script\")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent=\"\");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if(\"string\"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||[\"\",\"\"])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp(\"^(\"+ee+\")(?!px)[a-z%]+$\",\"i\"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join(\"|\"),\"i\");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(\"\"!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+\"\":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText=\"position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0\",l.style.cssText=\"position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%\",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n=\"1%\"!==e.top,s=12===t(e.marginLeft),l.style.right=\"60%\",o=36===t(e.right),r=36===t(e.width),l.style.position=\"absolute\",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement(\"div\"),l=E.createElement(\"div\");l.style&&(l.style.backgroundClip=\"content-box\",l.cloneNode(!0).style.backgroundClip=\"\",y.clearCloneStyle=\"content-box\"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement(\"table\"),t=E.createElement(\"tr\"),n=E.createElement(\"div\"),e.style.cssText=\"position:absolute;left:-11111px\",t.style.height=\"1px\",n.style.height=\"9px\",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=[\"Webkit\",\"Moz\",\"ms\"],ze=E.createElement(\"div\").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:\"absolute\",visibility:\"hidden\",display:\"block\"},Qe={letterSpacing:\"0\",fontWeight:\"400\"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||\"px\"):t}function Ke(e,t,n,r,i,o){var a=\"width\"===t?1:0,s=0,u=0;if(n===(r?\"border\":\"content\"))return 0;for(;a<4;a+=2)\"margin\"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?(\"content\"===n&&(u-=S.css(e,\"padding\"+ne[a],!0,i)),\"margin\"!==n&&(u-=S.css(e,\"border\"+ne[a]+\"Width\",!0,i))):(u+=S.css(e,\"padding\"+ne[a],!0,i),\"padding\"!==n?u+=S.css(e,\"border\"+ne[a]+\"Width\",!0,i):s+=S.css(e,\"border\"+ne[a]+\"Width\",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e[\"offset\"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&\"border-box\"===S.css(e,\"boxSizing\",!1,r),o=i,a=Be(e,t,r),s=\"offset\"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a=\"auto\"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,\"tr\")||\"auto\"===a||!parseFloat(a)&&\"inline\"===S.css(e,\"display\",!1,r))&&e.getClientRects().length&&(i=\"border-box\"===S.css(e,\"boxSizing\",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?\"border\":\"content\"),o,r,a)+\"px\"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,\"opacity\");return\"\"===n?\"1\":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&\"get\"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];\"string\"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o=\"number\"),null!=n&&n==n&&(\"number\"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?\"\":\"px\")),y.clearCloneStyle||\"\"!==n||0!==t.indexOf(\"background\")||(l[t]=\"inherit\"),a&&\"set\"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&\"get\"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),\"normal\"===i&&t in Qe&&(i=Qe[t]),\"\"===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each([\"height\",\"width\"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,\"display\"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&\"absolute\"===i.position,a=(o||n)&&\"border-box\"===S.css(e,\"boxSizing\",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e[\"offset\"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,\"border\",!1,i)-.5)),s&&(r=te.exec(t))&&\"px\"!==(r[3]||\"px\")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,\"marginLeft\"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+\"px\"}),S.each({margin:\"\",padding:\"\",border:\"Width\"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r=\"string\"==typeof e?e.split(\" \"):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},\"margin\"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?\"\":\"px\")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,\"\"))&&\"auto\"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:\"swing\"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i[\"margin\"+(n=ne[r])]=i[\"padding\"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners[\"*\"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&\"expand\"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{\"*\":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=[\"*\"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f=\"width\"in t||\"height\"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,\"fxshow\");for(r in n.queue||(null==(a=S._queueHooks(e,\"fx\")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,\"fx\").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||\"toggle\"===i,i===(g?\"hide\":\"show\")){if(\"show\"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,\"display\")),\"none\"===(c=S.css(e,\"display\"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,\"display\"),le([e]))),(\"inline\"===c||\"inline-block\"===c&&null!=l)&&\"none\"===S.css(e,\"float\")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l=\"none\"===c?\"\":c)),h.display=\"inline-block\")),n.overflow&&(h.overflow=\"hidden\",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?\"hidden\"in v&&(g=v.hidden):v=Y.access(e,\"fxshow\",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,\"fxshow\"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&\"object\"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:\"number\"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue=\"fx\"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css(\"opacity\",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,\"finish\"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return\"string\"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||\"fx\",[]),this.each(function(){var e=!0,t=null!=i&&i+\"queueHooks\",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||\"fx\"),this.each(function(){var e,t=Y.get(this),n=t[a+\"queue\"],r=t[a+\"queueHooks\"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each([\"toggle\",\"show\",\"hide\"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||\"boolean\"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt(\"show\"),slideUp:lt(\"hide\"),slideToggle:lt(\"toggle\"),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||\"fx\",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement(\"input\"),it=E.createElement(\"select\").appendChild(E.createElement(\"option\")),rt.type=\"checkbox\",y.checkOn=\"\"!==rt.value,y.optSelected=it.selected,(rt=E.createElement(\"input\")).value=\"t\",rt.type=\"radio\",y.radioValue=\"t\"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return\"undefined\"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&\"set\"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+\"\"),n):i&&\"get\"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&\"radio\"===t&&A(e,\"input\")){var n=e.value;return e.setAttribute(\"type\",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(\" \")}function yt(e){return e.getAttribute&&e.getAttribute(\"class\")||\"\"}function mt(e){return Array.isArray(e)?e:\"string\"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&\"set\"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&\"get\"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,\"tabindex\");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{\"for\":\"htmlFor\",\"class\":\"className\"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&\" \"+vt(i)+\" \"){a=0;while(o=e[a++])r.indexOf(\" \"+o+\" \")<0&&(r+=o+\" \");i!==(s=vt(r))&&n.setAttribute(\"class\",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr(\"class\",\"\");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&\" \"+vt(i)+\" \"){a=0;while(o=e[a++])while(-1<r.indexOf(\" \"+o+\" \"))r=r.replace(\" \"+o+\" \",\" \");i!==(s=vt(r))&&n.setAttribute(\"class\",s)}return this},toggleClass:function(i,t){var o=typeof i,a=\"string\"===o||Array.isArray(i);return\"boolean\"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&\"boolean\"!==o||((e=yt(this))&&Y.set(this,\"__className__\",e),this.setAttribute&&this.setAttribute(\"class\",e||!1===i?\"\":Y.get(this,\"__className__\")||\"\"))})},hasClass:function(e){var t,n,r=0;t=\" \"+e+\" \";while(n=this[r++])if(1===n.nodeType&&-1<(\" \"+vt(yt(n))+\" \").indexOf(t))return!0;return!1}});var xt=/\\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t=\"\":\"number\"==typeof t?t+=\"\":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?\"\":e+\"\"})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&\"set\"in r&&void 0!==r.set(this,t,\"value\")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&\"get\"in r&&void 0!==(e=r.get(t,\"value\"))?e:\"string\"==typeof(e=t.value)?e.replace(xt,\"\"):null==e?\"\":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,\"value\");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a=\"select-one\"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,\"optgroup\"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each([\"radio\",\"checkbox\"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute(\"value\")?\"on\":e.value})}),y.focusin=\"onfocusin\"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,\"type\")?e.type:e,h=v.call(e,\"namespace\")?e.namespace.split(\".\"):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(\".\")&&(d=(h=d.split(\".\")).shift(),h.sort()),u=d.indexOf(\":\")<0&&\"on\"+d,(e=e[S.expando]?e:new S.Event(d,\"object\"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join(\".\"),e.rnamespace=e.namespace?new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,\"events\")||Object.create(null))[e.type]&&Y.get(o,\"handle\"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:\"focusin\",blur:\"focusout\"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\\?/;S.parseXML=function(e){var t;if(!e||\"string\"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,\"text/xml\")}catch(e){t=void 0}return t&&!t.getElementsByTagName(\"parsererror\").length||S.error(\"Invalid XML: \"+e),t};var St=/\\[\\]$/,kt=/\\r?\\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+\"[\"+(\"object\"==typeof t&&null!=t?e:\"\")+\"]\",t,r,i)});else if(r||\"object\"!==w(e))i(n,e);else for(t in e)Dt(n+\"[\"+t+\"]\",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+\"=\"+encodeURIComponent(null==n?\"\":n)};if(null==e)return\"\";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join(\"&\")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,\"elements\");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(\":disabled\")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,\"\\r\\n\")}}):{name:t.name,value:n.replace(kt,\"\\r\\n\")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \\t]*([^\\r\\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\\/\\//,Rt={},Mt={},It=\"*/\".concat(\"*\"),Wt=E.createElement(\"a\");function Ft(o){return function(e,t){\"string\"!=typeof e&&(t=e,e=\"*\");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])\"+\"===n[0]?(n=n.slice(1)||\"*\",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return\"string\"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s[\"*\"]&&l(\"*\")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:\"GET\",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":It,text:\"text/plain\",html:\"text/html\",xml:\"application/xml, text/xml\",json:\"application/json, text/javascript\"},contents:{xml:/\\bxml\\b/,html:/\\bhtml/,json:/\\bjson\\b/},responseFields:{xml:\"responseXML\",text:\"responseText\",json:\"responseJSON\"},converters:{\"* text\":String,\"text html\":!0,\"text json\":JSON.parse,\"text xml\":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){\"object\"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks(\"once memory\"),w=v.statusCode||{},a={},s={},u=\"canceled\",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+\" \"]=(n[t[1].toLowerCase()+\" \"]||[]).concat(t[2])}t=n[e.toLowerCase()+\" \"]}return null==t?null:t.join(\", \")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+\"\").replace(Pt,Tt.protocol+\"//\"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||\"*\").toLowerCase().match(P)||[\"\"],null==v.crossDomain){r=E.createElement(\"a\");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+\"//\"+Wt.host!=r.protocol+\"//\"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&\"string\"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger(\"ajaxStart\"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,\"\"),v.hasContent?v.data&&v.processData&&0===(v.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&(v.data=v.data.replace(jt,\"+\")):(o=v.url.slice(f.length),v.data&&(v.processData||\"string\"==typeof v.data)&&(f+=(Et.test(f)?\"&\":\"?\")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,\"$1\"),o=(Et.test(f)?\"&\":\"?\")+\"_=\"+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader(\"If-Modified-Since\",S.lastModified[f]),S.etag[f]&&T.setRequestHeader(\"If-None-Match\",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader(\"Content-Type\",v.contentType),T.setRequestHeader(\"Accept\",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+(\"*\"!==v.dataTypes[0]?\", \"+It+\"; q=0.01\":\"\"):v.accepts[\"*\"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u=\"abort\",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger(\"ajaxSend\",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort(\"timeout\")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,\"No Transport\");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||\"\",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while(\"*\"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader(\"Content-Type\"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+\" \"+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray(\"script\",v.dataTypes)&&(v.converters[\"text script\"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if(\"*\"===o)o=u;else if(\"*\"!==u&&u!==o){if(!(a=l[u+\" \"+o]||l[\"* \"+o]))for(i in l)if((s=i.split(\" \"))[1]===o&&(a=l[u+\" \"+s[0]]||l[\"* \"+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e[\"throws\"])t=a(t);else try{t=a(t)}catch(e){return{state:\"parsererror\",error:a?e:\"No conversion from \"+u+\" to \"+o}}}return{state:\"success\",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader(\"Last-Modified\"))&&(S.lastModified[f]=u),(u=T.getResponseHeader(\"etag\"))&&(S.etag[f]=u)),204===e||\"HEAD\"===v.type?l=\"nocontent\":304===e?l=\"notmodified\":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l=\"error\",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+\"\",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?\"ajaxSuccess\":\"ajaxError\",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger(\"ajaxComplete\",[T,v]),--S.active||S.event.trigger(\"ajaxStop\")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,\"json\")},getScript:function(e,t){return S.get(e,void 0,t,\"script\")}}),S.each([\"get\",\"post\"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)\"content-type\"===t.toLowerCase()&&(e.contentType=e.headers[t]||\"\")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:\"GET\",dataType:\"script\",cache:!0,async:!1,global:!1,converters:{\"text script\":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not(\"body\").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&\"withCredentials\"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e[\"X-Requested-With\"]||(e[\"X-Requested-With\"]=\"XMLHttpRequest\"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,\"abort\"===e?r.abort():\"error\"===e?\"number\"!=typeof r.status?t(0,\"error\"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,\"text\"!==(r.responseType||\"text\")||\"string\"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o(\"error\"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o(\"abort\");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/\\b(?:java|ecma)script\\b/},converters:{\"text script\":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter(\"script\",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type=\"GET\")}),S.ajaxTransport(\"script\",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S(\"<script>\").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on(\"load error\",i=function(e){r.remove(),i=null,e&&t(\"error\"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\\?(?=&|$)|\\?\\?/;S.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){var e=Xt.pop()||S.expando+\"_\"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter(\"json jsonp\",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?\"url\":\"string\"==typeof e.data&&0===(e.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&Vt.test(e.data)&&\"data\");if(a||\"jsonp\"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,\"$1\"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?\"&\":\"?\")+e.jsonp+\"=\"+r),e.converters[\"script json\"]=function(){return o||S.error(r+\" was not called\"),o[0]},e.dataTypes[0]=\"json\",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),\"script\"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument(\"\").body).innerHTML=\"<form></form><form></form>\",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return\"string\"!=typeof e?[]:(\"boolean\"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument(\"\")).createElement(\"base\")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(\" \");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&\"object\"==typeof t&&(i=\"POST\"),0<a.length&&S.ajax({url:e,type:i||\"GET\",dataType:\"html\",data:t}).done(function(e){o=arguments,a.html(r?S(\"<div>\").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,\"position\"),c=S(e),f={};\"static\"===l&&(e.style.position=\"relative\"),s=c.offset(),o=S.css(e,\"top\"),u=S.css(e,\"left\"),(\"absolute\"===l||\"fixed\"===l)&&-1<(o+u).indexOf(\"auto\")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),\"using\"in t?t.using.call(e,f):(\"number\"==typeof f.top&&(f.top+=\"px\"),\"number\"==typeof f.left&&(f.left+=\"px\"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if(\"fixed\"===S.css(r,\"position\"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&\"static\"===S.css(e,\"position\"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,\"borderTopWidth\",!0),i.left+=S.css(e,\"borderLeftWidth\",!0))}return{top:t.top-i.top-S.css(r,\"marginTop\",!0),left:t.left-i.left-S.css(r,\"marginLeft\",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&\"static\"===S.css(e,\"position\"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:\"pageXOffset\",scrollTop:\"pageYOffset\"},function(t,i){var o=\"pageYOffset\"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each([\"top\",\"left\"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+\"px\":t})}),S.each({Height:\"height\",Width:\"width\"},function(a,s){S.each({padding:\"inner\"+a,content:s,\"\":\"outer\"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||\"boolean\"!=typeof e),i=r||(!0===e||!0===t?\"margin\":\"border\");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf(\"outer\")?e[\"inner\"+a]:e.document.documentElement[\"client\"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body[\"scroll\"+a],r[\"scroll\"+a],e.body[\"offset\"+a],r[\"offset\"+a],r[\"client\"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each([\"ajaxStart\",\"ajaxStop\",\"ajaxComplete\",\"ajaxError\",\"ajaxSuccess\",\"ajaxSend\"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,\"**\"):this.off(t,e||\"**\",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each(\"blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu\".split(\" \"),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if(\"string\"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return(\"number\"===t||\"string\"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?\"\":(e+\"\").replace(Gt,\"\")},\"function\"==typeof define&&define.amd&&define(\"jquery\",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},\"undefined\"==typeof e&&(C.jQuery=C.$=S),S});\n"
  },
  {
    "path": "bdsim/bdedit/docs/_static/js/badge_only.js",
    "content": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=4)}({4:function(e,t,r){}});"
  },
  {
    "path": "bdsim/bdedit/docs/_static/js/theme.js",
    "content": "!function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(n,\"__esModule\",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&\"object\"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:n}),2&e&&\"string\"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,\"a\",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p=\"\",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e=\"undefined\"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on(\"hashchange\",t.reset),n&&t.win.on(\"scroll\",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on(\"resize\",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n(\"div.wy-side-scroll:first\"),this.win=n(window),n(document).on(\"click\",\"[data-toggle='wy-nav-top']\",(function(){n(\"[data-toggle='wy-nav-shift']\").toggleClass(\"shift\"),n(\"[data-toggle='rst-versions']\").toggleClass(\"shift\")})).on(\"click\",\".wy-menu-vertical .current ul li a\",(function(){var t=n(this);n(\"[data-toggle='wy-nav-shift']\").removeClass(\"shift\"),n(\"[data-toggle='rst-versions']\").toggleClass(\"shift\"),e.toggleCurrent(t),e.hashChange()})).on(\"click\",\"[data-toggle='rst-current-version']\",(function(){n(\"[data-toggle='rst-versions']\").toggleClass(\"shift-up\")})),n(\"table.docutils:not(.field-list,.footnote,.citation)\").wrap(\"<div class='wy-table-responsive'></div>\"),n(\"table.docutils.footnote\").wrap(\"<div class='wy-table-responsive footnote'></div>\"),n(\"table.docutils.citation\").wrap(\"<div class='wy-table-responsive citation'></div>\"),n(\".wy-menu-vertical ul\").not(\".simple\").siblings(\"a\").each((function(){var t=n(this);expand=n('<span class=\"toctree-expand\"></span>'),expand.on(\"click\",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||\"#\";try{var e=$(\".wy-menu-vertical\"),t=e.find('[href=\"'+n+'\"]');if(0===t.length){var i=$('.document [id=\"'+n.substring(1)+'\"]').closest(\"div.section\");0===(t=e.find('[href=\"#'+i.attr(\"id\")+'\"]')).length&&(t=e.find('[href=\"#\"]'))}t.length>0&&($(\".wy-menu-vertical .current\").removeClass(\"current\"),t.addClass(\"current\"),t.closest(\"li.toctree-l1\").addClass(\"current\"),t.closest(\"li.toctree-l1\").parent().addClass(\"current\"),t.closest(\"li.toctree-l1\").addClass(\"current\"),t.closest(\"li.toctree-l2\").addClass(\"current\"),t.closest(\"li.toctree-l3\").addClass(\"current\"),t.closest(\"li.toctree-l4\").addClass(\"current\"),t.closest(\"li.toctree-l5\").addClass(\"current\"),t[0].scrollIntoView())}catch(n){console.log(\"Error expanding nav for anchor\",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one(\"hashchange\",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest(\"li\");e.siblings(\"li.current\").removeClass(\"current\"),e.siblings().find(\"li.current\").removeClass(\"current\"),e.find(\"> ul li.current\").removeClass(\"current\"),e.toggleClass(\"current\")}},\"undefined\"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=[\"ms\",\"moz\",\"webkit\",\"o\"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+\"RequestAnimationFrame\"],window.cancelAnimationFrame=window[e[t]+\"CancelAnimationFrame\"]||window[e[t]+\"CancelRequestAnimationFrame\"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,t){var i=(new Date).getTime(),o=Math.max(0,16-(i-n)),r=window.setTimeout((function(){e(i+o)}),o);return n=i+o,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()}).call(window)},function(n,e){n.exports=jQuery},function(n,e,t){}]);"
  },
  {
    "path": "bdsim/bdedit/docs/_static/language_data.js",
    "content": "/*\n * language_data.js\n * ~~~~~~~~~~~~~~~~\n *\n * This script contains the language-specific data used by searchtools.js,\n * namely the list of stopwords, stemmer, scorer and splitter.\n *\n * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\nvar stopwords = [\"a\",\"and\",\"are\",\"as\",\"at\",\"be\",\"but\",\"by\",\"for\",\"if\",\"in\",\"into\",\"is\",\"it\",\"near\",\"no\",\"not\",\"of\",\"on\",\"or\",\"such\",\"that\",\"the\",\"their\",\"then\",\"there\",\"these\",\"they\",\"this\",\"to\",\"was\",\"will\",\"with\"];\n\n\n/* Non-minified version is copied as a separate JS file, is available */\n\n/**\n * Porter Stemmer\n */\nvar Stemmer = function() {\n\n  var step2list = {\n    ational: 'ate',\n    tional: 'tion',\n    enci: 'ence',\n    anci: 'ance',\n    izer: 'ize',\n    bli: 'ble',\n    alli: 'al',\n    entli: 'ent',\n    eli: 'e',\n    ousli: 'ous',\n    ization: 'ize',\n    ation: 'ate',\n    ator: 'ate',\n    alism: 'al',\n    iveness: 'ive',\n    fulness: 'ful',\n    ousness: 'ous',\n    aliti: 'al',\n    iviti: 'ive',\n    biliti: 'ble',\n    logi: 'log'\n  };\n\n  var step3list = {\n    icate: 'ic',\n    ative: '',\n    alize: 'al',\n    iciti: 'ic',\n    ical: 'ic',\n    ful: '',\n    ness: ''\n  };\n\n  var c = \"[^aeiou]\";          // consonant\n  var v = \"[aeiouy]\";          // vowel\n  var C = c + \"[^aeiouy]*\";    // consonant sequence\n  var V = v + \"[aeiou]*\";      // vowel sequence\n\n  var mgr0 = \"^(\" + C + \")?\" + V + C;                      // [C]VC... is m>0\n  var meq1 = \"^(\" + C + \")?\" + V + C + \"(\" + V + \")?$\";    // [C]VC[V] is m=1\n  var mgr1 = \"^(\" + C + \")?\" + V + C + V + C;              // [C]VCVC... is m>1\n  var s_v   = \"^(\" + C + \")?\" + v;                         // vowel in stem\n\n  this.stemWord = function (w) {\n    var stem;\n    var suffix;\n    var firstch;\n    var origword = w;\n\n    if (w.length < 3)\n      return w;\n\n    var re;\n    var re2;\n    var re3;\n    var re4;\n\n    firstch = w.substr(0,1);\n    if (firstch == \"y\")\n      w = firstch.toUpperCase() + w.substr(1);\n\n    // Step 1a\n    re = /^(.+?)(ss|i)es$/;\n    re2 = /^(.+?)([^s])s$/;\n\n    if (re.test(w))\n      w = w.replace(re,\"$1$2\");\n    else if (re2.test(w))\n      w = w.replace(re2,\"$1$2\");\n\n    // Step 1b\n    re = /^(.+?)eed$/;\n    re2 = /^(.+?)(ed|ing)$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      re = new RegExp(mgr0);\n      if (re.test(fp[1])) {\n        re = /.$/;\n        w = w.replace(re,\"\");\n      }\n    }\n    else if (re2.test(w)) {\n      var fp = re2.exec(w);\n      stem = fp[1];\n      re2 = new RegExp(s_v);\n      if (re2.test(stem)) {\n        w = stem;\n        re2 = /(at|bl|iz)$/;\n        re3 = new RegExp(\"([^aeiouylsz])\\\\1$\");\n        re4 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n        if (re2.test(w))\n          w = w + \"e\";\n        else if (re3.test(w)) {\n          re = /.$/;\n          w = w.replace(re,\"\");\n        }\n        else if (re4.test(w))\n          w = w + \"e\";\n      }\n    }\n\n    // Step 1c\n    re = /^(.+?)y$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      re = new RegExp(s_v);\n      if (re.test(stem))\n        w = stem + \"i\";\n    }\n\n    // Step 2\n    re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      suffix = fp[2];\n      re = new RegExp(mgr0);\n      if (re.test(stem))\n        w = stem + step2list[suffix];\n    }\n\n    // Step 3\n    re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      suffix = fp[2];\n      re = new RegExp(mgr0);\n      if (re.test(stem))\n        w = stem + step3list[suffix];\n    }\n\n    // Step 4\n    re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;\n    re2 = /^(.+?)(s|t)(ion)$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      re = new RegExp(mgr1);\n      if (re.test(stem))\n        w = stem;\n    }\n    else if (re2.test(w)) {\n      var fp = re2.exec(w);\n      stem = fp[1] + fp[2];\n      re2 = new RegExp(mgr1);\n      if (re2.test(stem))\n        w = stem;\n    }\n\n    // Step 5\n    re = /^(.+?)e$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      re = new RegExp(mgr1);\n      re2 = new RegExp(meq1);\n      re3 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n      if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))\n        w = stem;\n    }\n    re = /ll$/;\n    re2 = new RegExp(mgr1);\n    if (re.test(w) && re2.test(w)) {\n      re = /.$/;\n      w = w.replace(re,\"\");\n    }\n\n    // and turn initial Y back to y\n    if (firstch == \"y\")\n      w = firstch.toLowerCase() + w.substr(1);\n    return w;\n  }\n}\n\n\n\n\nvar splitChars = (function() {\n    var result = {};\n    var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,\n         1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,\n         2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,\n         2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,\n         3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,\n         3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,\n         4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,\n         8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,\n         11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,\n         43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];\n    var i, j, start, end;\n    for (i = 0; i < singles.length; i++) {\n        result[singles[i]] = true;\n    }\n    var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],\n         [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],\n         [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],\n         [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],\n         [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],\n         [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],\n         [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],\n         [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],\n         [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],\n         [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],\n         [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],\n         [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],\n         [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],\n         [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],\n         [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],\n         [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],\n         [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],\n         [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],\n         [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],\n         [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],\n         [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],\n         [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],\n         [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],\n         [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],\n         [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],\n         [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],\n         [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],\n         [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],\n         [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],\n         [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],\n         [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],\n         [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],\n         [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],\n         [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],\n         [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],\n         [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],\n         [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],\n         [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],\n         [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],\n         [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],\n         [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],\n         [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],\n         [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],\n         [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],\n         [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],\n         [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],\n         [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],\n         [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],\n         [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];\n    for (i = 0; i < ranges.length; i++) {\n        start = ranges[i][0];\n        end = ranges[i][1];\n        for (j = start; j <= end; j++) {\n            result[j] = true;\n        }\n    }\n    return result;\n})();\n\nfunction splitQuery(query) {\n    var result = [];\n    var start = -1;\n    for (var i = 0; i < query.length; i++) {\n        if (splitChars[query.charCodeAt(i)]) {\n            if (start !== -1) {\n                result.push(query.slice(start, i));\n                start = -1;\n            }\n        } else if (start === -1) {\n            start = i;\n        }\n    }\n    if (start !== -1) {\n        result.push(query.slice(start));\n    }\n    return result;\n}\n\n\n"
  },
  {
    "path": "bdsim/bdedit/docs/_static/pygments.css",
    "content": "pre { line-height: 125%; }\ntd.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }\nspan.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }\ntd.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\nspan.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\n.highlight .hll { background-color: #ffffcc }\n.highlight { background: #f8f8f8; }\n.highlight .c { color: #408080; font-style: italic } /* Comment */\n.highlight .err { border: 1px solid #FF0000 } /* Error */\n.highlight .k { color: #008000; font-weight: bold } /* Keyword */\n.highlight .o { color: #666666 } /* Operator */\n.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */\n.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */\n.highlight .cp { color: #BC7A00 } /* Comment.Preproc */\n.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */\n.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */\n.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */\n.highlight .gd { color: #A00000 } /* Generic.Deleted */\n.highlight .ge { font-style: italic } /* Generic.Emph */\n.highlight .gr { color: #FF0000 } /* Generic.Error */\n.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */\n.highlight .gi { color: #00A000 } /* Generic.Inserted */\n.highlight .go { color: #888888 } /* Generic.Output */\n.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */\n.highlight .gs { font-weight: bold } /* Generic.Strong */\n.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */\n.highlight .gt { color: #0044DD } /* Generic.Traceback */\n.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */\n.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */\n.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */\n.highlight .kp { color: #008000 } /* Keyword.Pseudo */\n.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */\n.highlight .kt { color: #B00040 } /* Keyword.Type */\n.highlight .m { color: #666666 } /* Literal.Number */\n.highlight .s { color: #BA2121 } /* Literal.String */\n.highlight .na { color: #7D9029 } /* Name.Attribute */\n.highlight .nb { color: #008000 } /* Name.Builtin */\n.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */\n.highlight .no { color: #880000 } /* Name.Constant */\n.highlight .nd { color: #AA22FF } /* Name.Decorator */\n.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */\n.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */\n.highlight .nf { color: #0000FF } /* Name.Function */\n.highlight .nl { color: #A0A000 } /* Name.Label */\n.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */\n.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */\n.highlight .nv { color: #19177C } /* Name.Variable */\n.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */\n.highlight .w { color: #bbbbbb } /* Text.Whitespace */\n.highlight .mb { color: #666666 } /* Literal.Number.Bin */\n.highlight .mf { color: #666666 } /* Literal.Number.Float */\n.highlight .mh { color: #666666 } /* Literal.Number.Hex */\n.highlight .mi { color: #666666 } /* Literal.Number.Integer */\n.highlight .mo { color: #666666 } /* Literal.Number.Oct */\n.highlight .sa { color: #BA2121 } /* Literal.String.Affix */\n.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */\n.highlight .sc { color: #BA2121 } /* Literal.String.Char */\n.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */\n.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */\n.highlight .s2 { color: #BA2121 } /* Literal.String.Double */\n.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */\n.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */\n.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */\n.highlight .sx { color: #008000 } /* Literal.String.Other */\n.highlight .sr { color: #BB6688 } /* Literal.String.Regex */\n.highlight .s1 { color: #BA2121 } /* Literal.String.Single */\n.highlight .ss { color: #19177C } /* Literal.String.Symbol */\n.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */\n.highlight .fm { color: #0000FF } /* Name.Function.Magic */\n.highlight .vc { color: #19177C } /* Name.Variable.Class */\n.highlight .vg { color: #19177C } /* Name.Variable.Global */\n.highlight .vi { color: #19177C } /* Name.Variable.Instance */\n.highlight .vm { color: #19177C } /* Name.Variable.Magic */\n.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */"
  },
  {
    "path": "bdsim/bdedit/docs/_static/searchtools.js",
    "content": "/*\n * searchtools.js\n * ~~~~~~~~~~~~~~~~\n *\n * Sphinx JavaScript utilities for the full-text search.\n *\n * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\nif (!Scorer) {\n  /**\n   * Simple result scoring code.\n   */\n  var Scorer = {\n    // Implement the following function to further tweak the score for each result\n    // The function takes a result array [filename, title, anchor, descr, score]\n    // and returns the new score.\n    /*\n    score: function(result) {\n      return result[4];\n    },\n    */\n\n    // query matches the full name of an object\n    objNameMatch: 11,\n    // or matches in the last dotted part of the object name\n    objPartialMatch: 6,\n    // Additive scores depending on the priority of the object\n    objPrio: {0:  15,   // used to be importantResults\n              1:  5,   // used to be objectResults\n              2: -5},  // used to be unimportantResults\n    //  Used when the priority is not in the mapping.\n    objPrioDefault: 0,\n\n    // query found in title\n    title: 15,\n    partialTitle: 7,\n    // query found in terms\n    term: 5,\n    partialTerm: 2\n  };\n}\n\nif (!splitQuery) {\n  function splitQuery(query) {\n    return query.split(/\\s+/);\n  }\n}\n\n/**\n * Search Module\n */\nvar Search = {\n\n  _index : null,\n  _queued_query : null,\n  _pulse_status : -1,\n\n  htmlToText : function(htmlString) {\n      var virtualDocument = document.implementation.createHTMLDocument('virtual');\n      var htmlElement = $(htmlString, virtualDocument);\n      htmlElement.find('.headerlink').remove();\n      docContent = htmlElement.find('[role=main]')[0];\n      if(docContent === undefined) {\n          console.warn(\"Content block not found. Sphinx search tries to obtain it \" +\n                       \"via '[role=main]'. Could you check your theme or template.\");\n          return \"\";\n      }\n      return docContent.textContent || docContent.innerText;\n  },\n\n  init : function() {\n      var params = $.getQueryParameters();\n      if (params.q) {\n          var query = params.q[0];\n          $('input[name=\"q\"]')[0].value = query;\n          this.performSearch(query);\n      }\n  },\n\n  loadIndex : function(url) {\n    $.ajax({type: \"GET\", url: url, data: null,\n            dataType: \"script\", cache: true,\n            complete: function(jqxhr, textstatus) {\n              if (textstatus != \"success\") {\n                document.getElementById(\"searchindexloader\").src = url;\n              }\n            }});\n  },\n\n  setIndex : function(index) {\n    var q;\n    this._index = index;\n    if ((q = this._queued_query) !== null) {\n      this._queued_query = null;\n      Search.query(q);\n    }\n  },\n\n  hasIndex : function() {\n      return this._index !== null;\n  },\n\n  deferQuery : function(query) {\n      this._queued_query = query;\n  },\n\n  stopPulse : function() {\n      this._pulse_status = 0;\n  },\n\n  startPulse : function() {\n    if (this._pulse_status >= 0)\n        return;\n    function pulse() {\n      var i;\n      Search._pulse_status = (Search._pulse_status + 1) % 4;\n      var dotString = '';\n      for (i = 0; i < Search._pulse_status; i++)\n        dotString += '.';\n      Search.dots.text(dotString);\n      if (Search._pulse_status > -1)\n        window.setTimeout(pulse, 500);\n    }\n    pulse();\n  },\n\n  /**\n   * perform a search for something (or wait until index is loaded)\n   */\n  performSearch : function(query) {\n    // create the required interface elements\n    this.out = $('#search-results');\n    this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);\n    this.dots = $('<span></span>').appendTo(this.title);\n    this.status = $('<p class=\"search-summary\">&nbsp;</p>').appendTo(this.out);\n    this.output = $('<ul class=\"search\"/>').appendTo(this.out);\n\n    $('#search-progress').text(_('Preparing search...'));\n    this.startPulse();\n\n    // index already loaded, the browser was quick!\n    if (this.hasIndex())\n      this.query(query);\n    else\n      this.deferQuery(query);\n  },\n\n  /**\n   * execute search (requires search index to be loaded)\n   */\n  query : function(query) {\n    var i;\n\n    // stem the searchterms and add them to the correct list\n    var stemmer = new Stemmer();\n    var searchterms = [];\n    var excluded = [];\n    var hlterms = [];\n    var tmp = splitQuery(query);\n    var objectterms = [];\n    for (i = 0; i < tmp.length; i++) {\n      if (tmp[i] !== \"\") {\n          objectterms.push(tmp[i].toLowerCase());\n      }\n\n      if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i] === \"\") {\n        // skip this \"word\"\n        continue;\n      }\n      // stem the word\n      var word = stemmer.stemWord(tmp[i].toLowerCase());\n      // prevent stemmer from cutting word smaller than two chars\n      if(word.length < 3 && tmp[i].length >= 3) {\n        word = tmp[i];\n      }\n      var toAppend;\n      // select the correct list\n      if (word[0] == '-') {\n        toAppend = excluded;\n        word = word.substr(1);\n      }\n      else {\n        toAppend = searchterms;\n        hlterms.push(tmp[i].toLowerCase());\n      }\n      // only add if not already in the list\n      if (!$u.contains(toAppend, word))\n        toAppend.push(word);\n    }\n    var highlightstring = '?highlight=' + $.urlencode(hlterms.join(\" \"));\n\n    // console.debug('SEARCH: searching for:');\n    // console.info('required: ', searchterms);\n    // console.info('excluded: ', excluded);\n\n    // prepare search\n    var terms = this._index.terms;\n    var titleterms = this._index.titleterms;\n\n    // array of [filename, title, anchor, descr, score]\n    var results = [];\n    $('#search-progress').empty();\n\n    // lookup as object\n    for (i = 0; i < objectterms.length; i++) {\n      var others = [].concat(objectterms.slice(0, i),\n                             objectterms.slice(i+1, objectterms.length));\n      results = results.concat(this.performObjectSearch(objectterms[i], others));\n    }\n\n    // lookup as search terms in fulltext\n    results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));\n\n    // let the scorer override scores with a custom scoring function\n    if (Scorer.score) {\n      for (i = 0; i < results.length; i++)\n        results[i][4] = Scorer.score(results[i]);\n    }\n\n    // now sort the results by score (in opposite order of appearance, since the\n    // display function below uses pop() to retrieve items) and then\n    // alphabetically\n    results.sort(function(a, b) {\n      var left = a[4];\n      var right = b[4];\n      if (left > right) {\n        return 1;\n      } else if (left < right) {\n        return -1;\n      } else {\n        // same score: sort alphabetically\n        left = a[1].toLowerCase();\n        right = b[1].toLowerCase();\n        return (left > right) ? -1 : ((left < right) ? 1 : 0);\n      }\n    });\n\n    // for debugging\n    //Search.lastresults = results.slice();  // a copy\n    //console.info('search results:', Search.lastresults);\n\n    // print the results\n    var resultCount = results.length;\n    function displayNextItem() {\n      // results left, load the summary and display it\n      if (results.length) {\n        var item = results.pop();\n        var listItem = $('<li></li>');\n        var requestUrl = \"\";\n        var linkUrl = \"\";\n        if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {\n          // dirhtml builder\n          var dirname = item[0] + '/';\n          if (dirname.match(/\\/index\\/$/)) {\n            dirname = dirname.substring(0, dirname.length-6);\n          } else if (dirname == 'index/') {\n            dirname = '';\n          }\n          requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname;\n          linkUrl = requestUrl;\n\n        } else {\n          // normal html builders\n          requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;\n          linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;\n        }\n        listItem.append($('<a/>').attr('href',\n            linkUrl +\n            highlightstring + item[2]).html(item[1]));\n        if (item[3]) {\n          listItem.append($('<span> (' + item[3] + ')</span>'));\n          Search.output.append(listItem);\n          setTimeout(function() {\n            displayNextItem();\n          }, 5);\n        } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {\n          $.ajax({url: requestUrl,\n                  dataType: \"text\",\n                  complete: function(jqxhr, textstatus) {\n                    var data = jqxhr.responseText;\n                    if (data !== '' && data !== undefined) {\n                      listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));\n                    }\n                    Search.output.append(listItem);\n                    setTimeout(function() {\n                      displayNextItem();\n                    }, 5);\n                  }});\n        } else {\n          // no source available, just display title\n          Search.output.append(listItem);\n          setTimeout(function() {\n            displayNextItem();\n          }, 5);\n        }\n      }\n      // search finished, update title and status message\n      else {\n        Search.stopPulse();\n        Search.title.text(_('Search Results'));\n        if (!resultCount)\n          Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\\'ve selected enough categories.'));\n        else\n            Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));\n        Search.status.fadeIn(500);\n      }\n    }\n    displayNextItem();\n  },\n\n  /**\n   * search for object names\n   */\n  performObjectSearch : function(object, otherterms) {\n    var filenames = this._index.filenames;\n    var docnames = this._index.docnames;\n    var objects = this._index.objects;\n    var objnames = this._index.objnames;\n    var titles = this._index.titles;\n\n    var i;\n    var results = [];\n\n    for (var prefix in objects) {\n      for (var name in objects[prefix]) {\n        var fullname = (prefix ? prefix + '.' : '') + name;\n        var fullnameLower = fullname.toLowerCase()\n        if (fullnameLower.indexOf(object) > -1) {\n          var score = 0;\n          var parts = fullnameLower.split('.');\n          // check for different match types: exact matches of full name or\n          // \"last name\" (i.e. last dotted part)\n          if (fullnameLower == object || parts[parts.length - 1] == object) {\n            score += Scorer.objNameMatch;\n          // matches in last name\n          } else if (parts[parts.length - 1].indexOf(object) > -1) {\n            score += Scorer.objPartialMatch;\n          }\n          var match = objects[prefix][name];\n          var objname = objnames[match[1]][2];\n          var title = titles[match[0]];\n          // If more than one term searched for, we require other words to be\n          // found in the name/title/description\n          if (otherterms.length > 0) {\n            var haystack = (prefix + ' ' + name + ' ' +\n                            objname + ' ' + title).toLowerCase();\n            var allfound = true;\n            for (i = 0; i < otherterms.length; i++) {\n              if (haystack.indexOf(otherterms[i]) == -1) {\n                allfound = false;\n                break;\n              }\n            }\n            if (!allfound) {\n              continue;\n            }\n          }\n          var descr = objname + _(', in ') + title;\n\n          var anchor = match[3];\n          if (anchor === '')\n            anchor = fullname;\n          else if (anchor == '-')\n            anchor = objnames[match[1]][1] + '-' + fullname;\n          // add custom score for some objects according to scorer\n          if (Scorer.objPrio.hasOwnProperty(match[2])) {\n            score += Scorer.objPrio[match[2]];\n          } else {\n            score += Scorer.objPrioDefault;\n          }\n          results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);\n        }\n      }\n    }\n\n    return results;\n  },\n\n  /**\n   * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n   */\n  escapeRegExp : function(string) {\n    return string.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, '\\\\$&'); // $& means the whole matched string\n  },\n\n  /**\n   * search for full-text terms in the index\n   */\n  performTermsSearch : function(searchterms, excluded, terms, titleterms) {\n    var docnames = this._index.docnames;\n    var filenames = this._index.filenames;\n    var titles = this._index.titles;\n\n    var i, j, file;\n    var fileMap = {};\n    var scoreMap = {};\n    var results = [];\n\n    // perform the search on the required terms\n    for (i = 0; i < searchterms.length; i++) {\n      var word = searchterms[i];\n      var files = [];\n      var _o = [\n        {files: terms[word], score: Scorer.term},\n        {files: titleterms[word], score: Scorer.title}\n      ];\n      // add support for partial matches\n      if (word.length > 2) {\n        var word_regex = this.escapeRegExp(word);\n        for (var w in terms) {\n          if (w.match(word_regex) && !terms[word]) {\n            _o.push({files: terms[w], score: Scorer.partialTerm})\n          }\n        }\n        for (var w in titleterms) {\n          if (w.match(word_regex) && !titleterms[word]) {\n              _o.push({files: titleterms[w], score: Scorer.partialTitle})\n          }\n        }\n      }\n\n      // no match but word was a required one\n      if ($u.every(_o, function(o){return o.files === undefined;})) {\n        break;\n      }\n      // found search word in contents\n      $u.each(_o, function(o) {\n        var _files = o.files;\n        if (_files === undefined)\n          return\n\n        if (_files.length === undefined)\n          _files = [_files];\n        files = files.concat(_files);\n\n        // set score for the word in each file to Scorer.term\n        for (j = 0; j < _files.length; j++) {\n          file = _files[j];\n          if (!(file in scoreMap))\n            scoreMap[file] = {};\n          scoreMap[file][word] = o.score;\n        }\n      });\n\n      // create the mapping\n      for (j = 0; j < files.length; j++) {\n        file = files[j];\n        if (file in fileMap && fileMap[file].indexOf(word) === -1)\n          fileMap[file].push(word);\n        else\n          fileMap[file] = [word];\n      }\n    }\n\n    // now check if the files don't contain excluded terms\n    for (file in fileMap) {\n      var valid = true;\n\n      // check if all requirements are matched\n      var filteredTermCount = // as search terms with length < 3 are discarded: ignore\n        searchterms.filter(function(term){return term.length > 2}).length\n      if (\n        fileMap[file].length != searchterms.length &&\n        fileMap[file].length != filteredTermCount\n      ) continue;\n\n      // ensure that none of the excluded terms is in the search result\n      for (i = 0; i < excluded.length; i++) {\n        if (terms[excluded[i]] == file ||\n            titleterms[excluded[i]] == file ||\n            $u.contains(terms[excluded[i]] || [], file) ||\n            $u.contains(titleterms[excluded[i]] || [], file)) {\n          valid = false;\n          break;\n        }\n      }\n\n      // if we have still a valid result we can add it to the result list\n      if (valid) {\n        // select one (max) score for the file.\n        // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...\n        var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));\n        results.push([docnames[file], titles[file], '', null, score, filenames[file]]);\n      }\n    }\n    return results;\n  },\n\n  /**\n   * helper function to return a node containing the\n   * search summary for a given text. keywords is a list\n   * of stemmed words, hlwords is the list of normal, unstemmed\n   * words. the first one is used to find the occurrence, the\n   * latter for highlighting it.\n   */\n  makeSearchSummary : function(htmlText, keywords, hlwords) {\n    var text = Search.htmlToText(htmlText);\n    var textLower = text.toLowerCase();\n    var start = 0;\n    $.each(keywords, function() {\n      var i = textLower.indexOf(this.toLowerCase());\n      if (i > -1)\n        start = i;\n    });\n    start = Math.max(start - 120, 0);\n    var excerpt = ((start > 0) ? '...' : '') +\n      $.trim(text.substr(start, 240)) +\n      ((start + 240 - text.length) ? '...' : '');\n    var rv = $('<p class=\"context\"></p>').text(excerpt);\n    $.each(hlwords, function() {\n      rv = rv.highlightText(this, 'highlighted');\n    });\n    return rv;\n  }\n};\n\n$(document).ready(function() {\n  Search.init();\n});\n"
  },
  {
    "path": "bdsim/bdedit/docs/_static/underscore-1.13.1.js",
    "content": "(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define('underscore', factory) :\n  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {\n    var current = global._;\n    var exports = global._ = factory();\n    exports.noConflict = function () { global._ = current; return exports; };\n  }()));\n}(this, (function () {\n  //     Underscore.js 1.13.1\n  //     https://underscorejs.org\n  //     (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors\n  //     Underscore may be freely distributed under the MIT license.\n\n  // Current version.\n  var VERSION = '1.13.1';\n\n  // Establish the root object, `window` (`self`) in the browser, `global`\n  // on the server, or `this` in some virtual machines. We use `self`\n  // instead of `window` for `WebWorker` support.\n  var root = typeof self == 'object' && self.self === self && self ||\n            typeof global == 'object' && global.global === global && global ||\n            Function('return this')() ||\n            {};\n\n  // Save bytes in the minified (but not gzipped) version:\n  var ArrayProto = Array.prototype, ObjProto = Object.prototype;\n  var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\n\n  // Create quick reference variables for speed access to core prototypes.\n  var push = ArrayProto.push,\n      slice = ArrayProto.slice,\n      toString = ObjProto.toString,\n      hasOwnProperty = ObjProto.hasOwnProperty;\n\n  // Modern feature detection.\n  var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',\n      supportsDataView = typeof DataView !== 'undefined';\n\n  // All **ECMAScript 5+** native function implementations that we hope to use\n  // are declared here.\n  var nativeIsArray = Array.isArray,\n      nativeKeys = Object.keys,\n      nativeCreate = Object.create,\n      nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;\n\n  // Create references to these builtin functions because we override them.\n  var _isNaN = isNaN,\n      _isFinite = isFinite;\n\n  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n  var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\n  var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n    'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n  // The largest integer that can be represented exactly.\n  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n\n  // Some functions take a variable number of arguments, or a few expected\n  // arguments at the beginning and then a variable number of values to operate\n  // on. This helper accumulates all remaining arguments past the function’s\n  // argument length (or an explicit `startIndex`), into an array that becomes\n  // the last argument. Similar to ES6’s \"rest parameter\".\n  function restArguments(func, startIndex) {\n    startIndex = startIndex == null ? func.length - 1 : +startIndex;\n    return function() {\n      var length = Math.max(arguments.length - startIndex, 0),\n          rest = Array(length),\n          index = 0;\n      for (; index < length; index++) {\n        rest[index] = arguments[index + startIndex];\n      }\n      switch (startIndex) {\n        case 0: return func.call(this, rest);\n        case 1: return func.call(this, arguments[0], rest);\n        case 2: return func.call(this, arguments[0], arguments[1], rest);\n      }\n      var args = Array(startIndex + 1);\n      for (index = 0; index < startIndex; index++) {\n        args[index] = arguments[index];\n      }\n      args[startIndex] = rest;\n      return func.apply(this, args);\n    };\n  }\n\n  // Is a given variable an object?\n  function isObject(obj) {\n    var type = typeof obj;\n    return type === 'function' || type === 'object' && !!obj;\n  }\n\n  // Is a given value equal to null?\n  function isNull(obj) {\n    return obj === null;\n  }\n\n  // Is a given variable undefined?\n  function isUndefined(obj) {\n    return obj === void 0;\n  }\n\n  // Is a given value a boolean?\n  function isBoolean(obj) {\n    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n  }\n\n  // Is a given value a DOM element?\n  function isElement(obj) {\n    return !!(obj && obj.nodeType === 1);\n  }\n\n  // Internal function for creating a `toString`-based type tester.\n  function tagTester(name) {\n    var tag = '[object ' + name + ']';\n    return function(obj) {\n      return toString.call(obj) === tag;\n    };\n  }\n\n  var isString = tagTester('String');\n\n  var isNumber = tagTester('Number');\n\n  var isDate = tagTester('Date');\n\n  var isRegExp = tagTester('RegExp');\n\n  var isError = tagTester('Error');\n\n  var isSymbol = tagTester('Symbol');\n\n  var isArrayBuffer = tagTester('ArrayBuffer');\n\n  var isFunction = tagTester('Function');\n\n  // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old\n  // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).\n  var nodelist = root.document && root.document.childNodes;\n  if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {\n    isFunction = function(obj) {\n      return typeof obj == 'function' || false;\n    };\n  }\n\n  var isFunction$1 = isFunction;\n\n  var hasObjectTag = tagTester('Object');\n\n  // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.\n  // In IE 11, the most common among them, this problem also applies to\n  // `Map`, `WeakMap` and `Set`.\n  var hasStringTagBug = (\n        supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8)))\n      ),\n      isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map));\n\n  var isDataView = tagTester('DataView');\n\n  // In IE 10 - Edge 13, we need a different heuristic\n  // to determine whether an object is a `DataView`.\n  function ie10IsDataView(obj) {\n    return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer);\n  }\n\n  var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView);\n\n  // Is a given value an array?\n  // Delegates to ECMA5's native `Array.isArray`.\n  var isArray = nativeIsArray || tagTester('Array');\n\n  // Internal function to check whether `key` is an own property name of `obj`.\n  function has$1(obj, key) {\n    return obj != null && hasOwnProperty.call(obj, key);\n  }\n\n  var isArguments = tagTester('Arguments');\n\n  // Define a fallback version of the method in browsers (ahem, IE < 9), where\n  // there isn't any inspectable \"Arguments\" type.\n  (function() {\n    if (!isArguments(arguments)) {\n      isArguments = function(obj) {\n        return has$1(obj, 'callee');\n      };\n    }\n  }());\n\n  var isArguments$1 = isArguments;\n\n  // Is a given object a finite number?\n  function isFinite$1(obj) {\n    return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));\n  }\n\n  // Is the given value `NaN`?\n  function isNaN$1(obj) {\n    return isNumber(obj) && _isNaN(obj);\n  }\n\n  // Predicate-generating function. Often useful outside of Underscore.\n  function constant(value) {\n    return function() {\n      return value;\n    };\n  }\n\n  // Common internal logic for `isArrayLike` and `isBufferLike`.\n  function createSizePropertyCheck(getSizeProperty) {\n    return function(collection) {\n      var sizeProperty = getSizeProperty(collection);\n      return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n    }\n  }\n\n  // Internal helper to generate a function to obtain property `key` from `obj`.\n  function shallowProperty(key) {\n    return function(obj) {\n      return obj == null ? void 0 : obj[key];\n    };\n  }\n\n  // Internal helper to obtain the `byteLength` property of an object.\n  var getByteLength = shallowProperty('byteLength');\n\n  // Internal helper to determine whether we should spend extensive checks against\n  // `ArrayBuffer` et al.\n  var isBufferLike = createSizePropertyCheck(getByteLength);\n\n  // Is a given value a typed array?\n  var typedArrayPattern = /\\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\\]/;\n  function isTypedArray(obj) {\n    // `ArrayBuffer.isView` is the most future-proof, so use it when available.\n    // Otherwise, fall back on the above regular expression.\n    return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) :\n                  isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));\n  }\n\n  var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false);\n\n  // Internal helper to obtain the `length` property of an object.\n  var getLength = shallowProperty('length');\n\n  // Internal helper to create a simple lookup structure.\n  // `collectNonEnumProps` used to depend on `_.contains`, but this led to\n  // circular imports. `emulatedSet` is a one-off solution that only works for\n  // arrays of strings.\n  function emulatedSet(keys) {\n    var hash = {};\n    for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n    return {\n      contains: function(key) { return hash[key]; },\n      push: function(key) {\n        hash[key] = true;\n        return keys.push(key);\n      }\n    };\n  }\n\n  // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't\n  // be iterated by `for key in ...` and thus missed. Extends `keys` in place if\n  // needed.\n  function collectNonEnumProps(obj, keys) {\n    keys = emulatedSet(keys);\n    var nonEnumIdx = nonEnumerableProps.length;\n    var constructor = obj.constructor;\n    var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;\n\n    // Constructor is a special case.\n    var prop = 'constructor';\n    if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n    while (nonEnumIdx--) {\n      prop = nonEnumerableProps[nonEnumIdx];\n      if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n        keys.push(prop);\n      }\n    }\n  }\n\n  // Retrieve the names of an object's own properties.\n  // Delegates to **ECMAScript 5**'s native `Object.keys`.\n  function keys(obj) {\n    if (!isObject(obj)) return [];\n    if (nativeKeys) return nativeKeys(obj);\n    var keys = [];\n    for (var key in obj) if (has$1(obj, key)) keys.push(key);\n    // Ahem, IE < 9.\n    if (hasEnumBug) collectNonEnumProps(obj, keys);\n    return keys;\n  }\n\n  // Is a given array, string, or object empty?\n  // An \"empty\" object has no enumerable own-properties.\n  function isEmpty(obj) {\n    if (obj == null) return true;\n    // Skip the more expensive `toString`-based type checks if `obj` has no\n    // `.length`.\n    var length = getLength(obj);\n    if (typeof length == 'number' && (\n      isArray(obj) || isString(obj) || isArguments$1(obj)\n    )) return length === 0;\n    return getLength(keys(obj)) === 0;\n  }\n\n  // Returns whether an object has a given set of `key:value` pairs.\n  function isMatch(object, attrs) {\n    var _keys = keys(attrs), length = _keys.length;\n    if (object == null) return !length;\n    var obj = Object(object);\n    for (var i = 0; i < length; i++) {\n      var key = _keys[i];\n      if (attrs[key] !== obj[key] || !(key in obj)) return false;\n    }\n    return true;\n  }\n\n  // If Underscore is called as a function, it returns a wrapped object that can\n  // be used OO-style. This wrapper holds altered versions of all functions added\n  // through `_.mixin`. Wrapped objects may be chained.\n  function _$1(obj) {\n    if (obj instanceof _$1) return obj;\n    if (!(this instanceof _$1)) return new _$1(obj);\n    this._wrapped = obj;\n  }\n\n  _$1.VERSION = VERSION;\n\n  // Extracts the result from a wrapped and chained object.\n  _$1.prototype.value = function() {\n    return this._wrapped;\n  };\n\n  // Provide unwrapping proxies for some methods used in engine operations\n  // such as arithmetic and JSON stringification.\n  _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value;\n\n  _$1.prototype.toString = function() {\n    return String(this._wrapped);\n  };\n\n  // Internal function to wrap or shallow-copy an ArrayBuffer,\n  // typed array or DataView to a new view, reusing the buffer.\n  function toBufferView(bufferSource) {\n    return new Uint8Array(\n      bufferSource.buffer || bufferSource,\n      bufferSource.byteOffset || 0,\n      getByteLength(bufferSource)\n    );\n  }\n\n  // We use this string twice, so give it a name for minification.\n  var tagDataView = '[object DataView]';\n\n  // Internal recursive comparison function for `_.isEqual`.\n  function eq(a, b, aStack, bStack) {\n    // Identical objects are equal. `0 === -0`, but they aren't identical.\n    // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).\n    if (a === b) return a !== 0 || 1 / a === 1 / b;\n    // `null` or `undefined` only equal to itself (strict comparison).\n    if (a == null || b == null) return false;\n    // `NaN`s are equivalent, but non-reflexive.\n    if (a !== a) return b !== b;\n    // Exhaust primitive checks\n    var type = typeof a;\n    if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\n    return deepEq(a, b, aStack, bStack);\n  }\n\n  // Internal recursive comparison function for `_.isEqual`.\n  function deepEq(a, b, aStack, bStack) {\n    // Unwrap any wrapped objects.\n    if (a instanceof _$1) a = a._wrapped;\n    if (b instanceof _$1) b = b._wrapped;\n    // Compare `[[Class]]` names.\n    var className = toString.call(a);\n    if (className !== toString.call(b)) return false;\n    // Work around a bug in IE 10 - Edge 13.\n    if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {\n      if (!isDataView$1(b)) return false;\n      className = tagDataView;\n    }\n    switch (className) {\n      // These types are compared by value.\n      case '[object RegExp]':\n        // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n      case '[object String]':\n        // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n        // equivalent to `new String(\"5\")`.\n        return '' + a === '' + b;\n      case '[object Number]':\n        // `NaN`s are equivalent, but non-reflexive.\n        // Object(NaN) is equivalent to NaN.\n        if (+a !== +a) return +b !== +b;\n        // An `egal` comparison is performed for other numeric values.\n        return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n      case '[object Date]':\n      case '[object Boolean]':\n        // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n        // millisecond representations. Note that invalid dates with millisecond representations\n        // of `NaN` are not equivalent.\n        return +a === +b;\n      case '[object Symbol]':\n        return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n      case '[object ArrayBuffer]':\n      case tagDataView:\n        // Coerce to typed array so we can fall through.\n        return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n    }\n\n    var areArrays = className === '[object Array]';\n    if (!areArrays && isTypedArray$1(a)) {\n        var byteLength = getByteLength(a);\n        if (byteLength !== getByteLength(b)) return false;\n        if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n        areArrays = true;\n    }\n    if (!areArrays) {\n      if (typeof a != 'object' || typeof b != 'object') return false;\n\n      // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n      // from different frames are.\n      var aCtor = a.constructor, bCtor = b.constructor;\n      if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&\n                               isFunction$1(bCtor) && bCtor instanceof bCtor)\n                          && ('constructor' in a && 'constructor' in b)) {\n        return false;\n      }\n    }\n    // Assume equality for cyclic structures. The algorithm for detecting cyclic\n    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n    // Initializing stack of traversed objects.\n    // It's done here since we only need them for objects and arrays comparison.\n    aStack = aStack || [];\n    bStack = bStack || [];\n    var length = aStack.length;\n    while (length--) {\n      // Linear search. Performance is inversely proportional to the number of\n      // unique nested structures.\n      if (aStack[length] === a) return bStack[length] === b;\n    }\n\n    // Add the first object to the stack of traversed objects.\n    aStack.push(a);\n    bStack.push(b);\n\n    // Recursively compare objects and arrays.\n    if (areArrays) {\n      // Compare array lengths to determine if a deep comparison is necessary.\n      length = a.length;\n      if (length !== b.length) return false;\n      // Deep compare the contents, ignoring non-numeric properties.\n      while (length--) {\n        if (!eq(a[length], b[length], aStack, bStack)) return false;\n      }\n    } else {\n      // Deep compare objects.\n      var _keys = keys(a), key;\n      length = _keys.length;\n      // Ensure that both objects contain the same number of properties before comparing deep equality.\n      if (keys(b).length !== length) return false;\n      while (length--) {\n        // Deep compare each member\n        key = _keys[length];\n        if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n      }\n    }\n    // Remove the first object from the stack of traversed objects.\n    aStack.pop();\n    bStack.pop();\n    return true;\n  }\n\n  // Perform a deep comparison to check if two objects are equal.\n  function isEqual(a, b) {\n    return eq(a, b);\n  }\n\n  // Retrieve all the enumerable property names of an object.\n  function allKeys(obj) {\n    if (!isObject(obj)) return [];\n    var keys = [];\n    for (var key in obj) keys.push(key);\n    // Ahem, IE < 9.\n    if (hasEnumBug) collectNonEnumProps(obj, keys);\n    return keys;\n  }\n\n  // Since the regular `Object.prototype.toString` type tests don't work for\n  // some types in IE 11, we use a fingerprinting heuristic instead, based\n  // on the methods. It's not great, but it's the best we got.\n  // The fingerprint method lists are defined below.\n  function ie11fingerprint(methods) {\n    var length = getLength(methods);\n    return function(obj) {\n      if (obj == null) return false;\n      // `Map`, `WeakMap` and `Set` have no enumerable keys.\n      var keys = allKeys(obj);\n      if (getLength(keys)) return false;\n      for (var i = 0; i < length; i++) {\n        if (!isFunction$1(obj[methods[i]])) return false;\n      }\n      // If we are testing against `WeakMap`, we need to ensure that\n      // `obj` doesn't have a `forEach` method in order to distinguish\n      // it from a regular `Map`.\n      return methods !== weakMapMethods || !isFunction$1(obj[forEachName]);\n    };\n  }\n\n  // In the interest of compact minification, we write\n  // each string in the fingerprints only once.\n  var forEachName = 'forEach',\n      hasName = 'has',\n      commonInit = ['clear', 'delete'],\n      mapTail = ['get', hasName, 'set'];\n\n  // `Map`, `WeakMap` and `Set` each have slightly different\n  // combinations of the above sublists.\n  var mapMethods = commonInit.concat(forEachName, mapTail),\n      weakMapMethods = commonInit.concat(mapTail),\n      setMethods = ['add'].concat(commonInit, forEachName, hasName);\n\n  var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');\n\n  var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap');\n\n  var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');\n\n  var isWeakSet = tagTester('WeakSet');\n\n  // Retrieve the values of an object's properties.\n  function values(obj) {\n    var _keys = keys(obj);\n    var length = _keys.length;\n    var values = Array(length);\n    for (var i = 0; i < length; i++) {\n      values[i] = obj[_keys[i]];\n    }\n    return values;\n  }\n\n  // Convert an object into a list of `[key, value]` pairs.\n  // The opposite of `_.object` with one argument.\n  function pairs(obj) {\n    var _keys = keys(obj);\n    var length = _keys.length;\n    var pairs = Array(length);\n    for (var i = 0; i < length; i++) {\n      pairs[i] = [_keys[i], obj[_keys[i]]];\n    }\n    return pairs;\n  }\n\n  // Invert the keys and values of an object. The values must be serializable.\n  function invert(obj) {\n    var result = {};\n    var _keys = keys(obj);\n    for (var i = 0, length = _keys.length; i < length; i++) {\n      result[obj[_keys[i]]] = _keys[i];\n    }\n    return result;\n  }\n\n  // Return a sorted list of the function names available on the object.\n  function functions(obj) {\n    var names = [];\n    for (var key in obj) {\n      if (isFunction$1(obj[key])) names.push(key);\n    }\n    return names.sort();\n  }\n\n  // An internal function for creating assigner functions.\n  function createAssigner(keysFunc, defaults) {\n    return function(obj) {\n      var length = arguments.length;\n      if (defaults) obj = Object(obj);\n      if (length < 2 || obj == null) return obj;\n      for (var index = 1; index < length; index++) {\n        var source = arguments[index],\n            keys = keysFunc(source),\n            l = keys.length;\n        for (var i = 0; i < l; i++) {\n          var key = keys[i];\n          if (!defaults || obj[key] === void 0) obj[key] = source[key];\n        }\n      }\n      return obj;\n    };\n  }\n\n  // Extend a given object with all the properties in passed-in object(s).\n  var extend = createAssigner(allKeys);\n\n  // Assigns a given object with all the own properties in the passed-in\n  // object(s).\n  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n  var extendOwn = createAssigner(keys);\n\n  // Fill in a given object with default properties.\n  var defaults = createAssigner(allKeys, true);\n\n  // Create a naked function reference for surrogate-prototype-swapping.\n  function ctor() {\n    return function(){};\n  }\n\n  // An internal function for creating a new object that inherits from another.\n  function baseCreate(prototype) {\n    if (!isObject(prototype)) return {};\n    if (nativeCreate) return nativeCreate(prototype);\n    var Ctor = ctor();\n    Ctor.prototype = prototype;\n    var result = new Ctor;\n    Ctor.prototype = null;\n    return result;\n  }\n\n  // Creates an object that inherits from the given prototype object.\n  // If additional properties are provided then they will be added to the\n  // created object.\n  function create(prototype, props) {\n    var result = baseCreate(prototype);\n    if (props) extendOwn(result, props);\n    return result;\n  }\n\n  // Create a (shallow-cloned) duplicate of an object.\n  function clone(obj) {\n    if (!isObject(obj)) return obj;\n    return isArray(obj) ? obj.slice() : extend({}, obj);\n  }\n\n  // Invokes `interceptor` with the `obj` and then returns `obj`.\n  // The primary purpose of this method is to \"tap into\" a method chain, in\n  // order to perform operations on intermediate results within the chain.\n  function tap(obj, interceptor) {\n    interceptor(obj);\n    return obj;\n  }\n\n  // Normalize a (deep) property `path` to array.\n  // Like `_.iteratee`, this function can be customized.\n  function toPath$1(path) {\n    return isArray(path) ? path : [path];\n  }\n  _$1.toPath = toPath$1;\n\n  // Internal wrapper for `_.toPath` to enable minification.\n  // Similar to `cb` for `_.iteratee`.\n  function toPath(path) {\n    return _$1.toPath(path);\n  }\n\n  // Internal function to obtain a nested property in `obj` along `path`.\n  function deepGet(obj, path) {\n    var length = path.length;\n    for (var i = 0; i < length; i++) {\n      if (obj == null) return void 0;\n      obj = obj[path[i]];\n    }\n    return length ? obj : void 0;\n  }\n\n  // Get the value of the (deep) property on `path` from `object`.\n  // If any property in `path` does not exist or if the value is\n  // `undefined`, return `defaultValue` instead.\n  // The `path` is normalized through `_.toPath`.\n  function get(object, path, defaultValue) {\n    var value = deepGet(object, toPath(path));\n    return isUndefined(value) ? defaultValue : value;\n  }\n\n  // Shortcut function for checking if an object has a given property directly on\n  // itself (in other words, not on a prototype). Unlike the internal `has`\n  // function, this public version can also traverse nested properties.\n  function has(obj, path) {\n    path = toPath(path);\n    var length = path.length;\n    for (var i = 0; i < length; i++) {\n      var key = path[i];\n      if (!has$1(obj, key)) return false;\n      obj = obj[key];\n    }\n    return !!length;\n  }\n\n  // Keep the identity function around for default iteratees.\n  function identity(value) {\n    return value;\n  }\n\n  // Returns a predicate for checking whether an object has a given set of\n  // `key:value` pairs.\n  function matcher(attrs) {\n    attrs = extendOwn({}, attrs);\n    return function(obj) {\n      return isMatch(obj, attrs);\n    };\n  }\n\n  // Creates a function that, when passed an object, will traverse that object’s\n  // properties down the given `path`, specified as an array of keys or indices.\n  function property(path) {\n    path = toPath(path);\n    return function(obj) {\n      return deepGet(obj, path);\n    };\n  }\n\n  // Internal function that returns an efficient (for current engines) version\n  // of the passed-in callback, to be repeatedly applied in other Underscore\n  // functions.\n  function optimizeCb(func, context, argCount) {\n    if (context === void 0) return func;\n    switch (argCount == null ? 3 : argCount) {\n      case 1: return function(value) {\n        return func.call(context, value);\n      };\n      // The 2-argument case is omitted because we’re not using it.\n      case 3: return function(value, index, collection) {\n        return func.call(context, value, index, collection);\n      };\n      case 4: return function(accumulator, value, index, collection) {\n        return func.call(context, accumulator, value, index, collection);\n      };\n    }\n    return function() {\n      return func.apply(context, arguments);\n    };\n  }\n\n  // An internal function to generate callbacks that can be applied to each\n  // element in a collection, returning the desired result — either `_.identity`,\n  // an arbitrary callback, a property matcher, or a property accessor.\n  function baseIteratee(value, context, argCount) {\n    if (value == null) return identity;\n    if (isFunction$1(value)) return optimizeCb(value, context, argCount);\n    if (isObject(value) && !isArray(value)) return matcher(value);\n    return property(value);\n  }\n\n  // External wrapper for our callback generator. Users may customize\n  // `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n  // This abstraction hides the internal-only `argCount` argument.\n  function iteratee(value, context) {\n    return baseIteratee(value, context, Infinity);\n  }\n  _$1.iteratee = iteratee;\n\n  // The function we call internally to generate a callback. It invokes\n  // `_.iteratee` if overridden, otherwise `baseIteratee`.\n  function cb(value, context, argCount) {\n    if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context);\n    return baseIteratee(value, context, argCount);\n  }\n\n  // Returns the results of applying the `iteratee` to each element of `obj`.\n  // In contrast to `_.map` it returns an object.\n  function mapObject(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    var _keys = keys(obj),\n        length = _keys.length,\n        results = {};\n    for (var index = 0; index < length; index++) {\n      var currentKey = _keys[index];\n      results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n    }\n    return results;\n  }\n\n  // Predicate-generating function. Often useful outside of Underscore.\n  function noop(){}\n\n  // Generates a function for a given object that returns a given property.\n  function propertyOf(obj) {\n    if (obj == null) return noop;\n    return function(path) {\n      return get(obj, path);\n    };\n  }\n\n  // Run a function **n** times.\n  function times(n, iteratee, context) {\n    var accum = Array(Math.max(0, n));\n    iteratee = optimizeCb(iteratee, context, 1);\n    for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n    return accum;\n  }\n\n  // Return a random integer between `min` and `max` (inclusive).\n  function random(min, max) {\n    if (max == null) {\n      max = min;\n      min = 0;\n    }\n    return min + Math.floor(Math.random() * (max - min + 1));\n  }\n\n  // A (possibly faster) way to get the current timestamp as an integer.\n  var now = Date.now || function() {\n    return new Date().getTime();\n  };\n\n  // Internal helper to generate functions for escaping and unescaping strings\n  // to/from HTML interpolation.\n  function createEscaper(map) {\n    var escaper = function(match) {\n      return map[match];\n    };\n    // Regexes for identifying a key that needs to be escaped.\n    var source = '(?:' + keys(map).join('|') + ')';\n    var testRegexp = RegExp(source);\n    var replaceRegexp = RegExp(source, 'g');\n    return function(string) {\n      string = string == null ? '' : '' + string;\n      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n    };\n  }\n\n  // Internal list of HTML entities for escaping.\n  var escapeMap = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    \"'\": '&#x27;',\n    '`': '&#x60;'\n  };\n\n  // Function for escaping strings to HTML interpolation.\n  var _escape = createEscaper(escapeMap);\n\n  // Internal list of HTML entities for unescaping.\n  var unescapeMap = invert(escapeMap);\n\n  // Function for unescaping strings from HTML interpolation.\n  var _unescape = createEscaper(unescapeMap);\n\n  // By default, Underscore uses ERB-style template delimiters. Change the\n  // following template settings to use alternative delimiters.\n  var templateSettings = _$1.templateSettings = {\n    evaluate: /<%([\\s\\S]+?)%>/g,\n    interpolate: /<%=([\\s\\S]+?)%>/g,\n    escape: /<%-([\\s\\S]+?)%>/g\n  };\n\n  // When customizing `_.templateSettings`, if you don't want to define an\n  // interpolation, evaluation or escaping regex, we need one that is\n  // guaranteed not to match.\n  var noMatch = /(.)^/;\n\n  // Certain characters need to be escaped so that they can be put into a\n  // string literal.\n  var escapes = {\n    \"'\": \"'\",\n    '\\\\': '\\\\',\n    '\\r': 'r',\n    '\\n': 'n',\n    '\\u2028': 'u2028',\n    '\\u2029': 'u2029'\n  };\n\n  var escapeRegExp = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n  function escapeChar(match) {\n    return '\\\\' + escapes[match];\n  }\n\n  // In order to prevent third-party code injection through\n  // `_.templateSettings.variable`, we test it against the following regular\n  // expression. It is intentionally a bit more liberal than just matching valid\n  // identifiers, but still prevents possible loopholes through defaults or\n  // destructuring assignment.\n  var bareIdentifier = /^\\s*(\\w|\\$)+\\s*$/;\n\n  // JavaScript micro-templating, similar to John Resig's implementation.\n  // Underscore templating handles arbitrary delimiters, preserves whitespace,\n  // and correctly escapes quotes within interpolated code.\n  // NB: `oldSettings` only exists for backwards compatibility.\n  function template(text, settings, oldSettings) {\n    if (!settings && oldSettings) settings = oldSettings;\n    settings = defaults({}, settings, _$1.templateSettings);\n\n    // Combine delimiters into one regular expression via alternation.\n    var matcher = RegExp([\n      (settings.escape || noMatch).source,\n      (settings.interpolate || noMatch).source,\n      (settings.evaluate || noMatch).source\n    ].join('|') + '|$', 'g');\n\n    // Compile the template source, escaping string literals appropriately.\n    var index = 0;\n    var source = \"__p+='\";\n    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n      source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n      index = offset + match.length;\n\n      if (escape) {\n        source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n      } else if (interpolate) {\n        source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n      } else if (evaluate) {\n        source += \"';\\n\" + evaluate + \"\\n__p+='\";\n      }\n\n      // Adobe VMs need the match returned to produce the correct offset.\n      return match;\n    });\n    source += \"';\\n\";\n\n    var argument = settings.variable;\n    if (argument) {\n      // Insure against third-party code injection. (CVE-2021-23358)\n      if (!bareIdentifier.test(argument)) throw new Error(\n        'variable is not a bare identifier: ' + argument\n      );\n    } else {\n      // If a variable is not specified, place data values in local scope.\n      source = 'with(obj||{}){\\n' + source + '}\\n';\n      argument = 'obj';\n    }\n\n    source = \"var __t,__p='',__j=Array.prototype.join,\" +\n      \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n      source + 'return __p;\\n';\n\n    var render;\n    try {\n      render = new Function(argument, '_', source);\n    } catch (e) {\n      e.source = source;\n      throw e;\n    }\n\n    var template = function(data) {\n      return render.call(this, data, _$1);\n    };\n\n    // Provide the compiled source as a convenience for precompilation.\n    template.source = 'function(' + argument + '){\\n' + source + '}';\n\n    return template;\n  }\n\n  // Traverses the children of `obj` along `path`. If a child is a function, it\n  // is invoked with its parent as context. Returns the value of the final\n  // child, or `fallback` if any child is undefined.\n  function result(obj, path, fallback) {\n    path = toPath(path);\n    var length = path.length;\n    if (!length) {\n      return isFunction$1(fallback) ? fallback.call(obj) : fallback;\n    }\n    for (var i = 0; i < length; i++) {\n      var prop = obj == null ? void 0 : obj[path[i]];\n      if (prop === void 0) {\n        prop = fallback;\n        i = length; // Ensure we don't continue iterating.\n      }\n      obj = isFunction$1(prop) ? prop.call(obj) : prop;\n    }\n    return obj;\n  }\n\n  // Generate a unique integer id (unique within the entire client session).\n  // Useful for temporary DOM ids.\n  var idCounter = 0;\n  function uniqueId(prefix) {\n    var id = ++idCounter + '';\n    return prefix ? prefix + id : id;\n  }\n\n  // Start chaining a wrapped Underscore object.\n  function chain(obj) {\n    var instance = _$1(obj);\n    instance._chain = true;\n    return instance;\n  }\n\n  // Internal function to execute `sourceFunc` bound to `context` with optional\n  // `args`. Determines whether to execute a function as a constructor or as a\n  // normal function.\n  function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n    var self = baseCreate(sourceFunc.prototype);\n    var result = sourceFunc.apply(self, args);\n    if (isObject(result)) return result;\n    return self;\n  }\n\n  // Partially apply a function by creating a version that has had some of its\n  // arguments pre-filled, without changing its dynamic `this` context. `_` acts\n  // as a placeholder by default, allowing any combination of arguments to be\n  // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.\n  var partial = restArguments(function(func, boundArgs) {\n    var placeholder = partial.placeholder;\n    var bound = function() {\n      var position = 0, length = boundArgs.length;\n      var args = Array(length);\n      for (var i = 0; i < length; i++) {\n        args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n      }\n      while (position < arguments.length) args.push(arguments[position++]);\n      return executeBound(func, bound, this, this, args);\n    };\n    return bound;\n  });\n\n  partial.placeholder = _$1;\n\n  // Create a function bound to a given object (assigning `this`, and arguments,\n  // optionally).\n  var bind = restArguments(function(func, context, args) {\n    if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function');\n    var bound = restArguments(function(callArgs) {\n      return executeBound(func, bound, context, this, args.concat(callArgs));\n    });\n    return bound;\n  });\n\n  // Internal helper for collection methods to determine whether a collection\n  // should be iterated as an array or as an object.\n  // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n  // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n  var isArrayLike = createSizePropertyCheck(getLength);\n\n  // Internal implementation of a recursive `flatten` function.\n  function flatten$1(input, depth, strict, output) {\n    output = output || [];\n    if (!depth && depth !== 0) {\n      depth = Infinity;\n    } else if (depth <= 0) {\n      return output.concat(input);\n    }\n    var idx = output.length;\n    for (var i = 0, length = getLength(input); i < length; i++) {\n      var value = input[i];\n      if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {\n        // Flatten current level of array or arguments object.\n        if (depth > 1) {\n          flatten$1(value, depth - 1, strict, output);\n          idx = output.length;\n        } else {\n          var j = 0, len = value.length;\n          while (j < len) output[idx++] = value[j++];\n        }\n      } else if (!strict) {\n        output[idx++] = value;\n      }\n    }\n    return output;\n  }\n\n  // Bind a number of an object's methods to that object. Remaining arguments\n  // are the method names to be bound. Useful for ensuring that all callbacks\n  // defined on an object belong to it.\n  var bindAll = restArguments(function(obj, keys) {\n    keys = flatten$1(keys, false, false);\n    var index = keys.length;\n    if (index < 1) throw new Error('bindAll must be passed function names');\n    while (index--) {\n      var key = keys[index];\n      obj[key] = bind(obj[key], obj);\n    }\n    return obj;\n  });\n\n  // Memoize an expensive function by storing its results.\n  function memoize(func, hasher) {\n    var memoize = function(key) {\n      var cache = memoize.cache;\n      var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n      if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);\n      return cache[address];\n    };\n    memoize.cache = {};\n    return memoize;\n  }\n\n  // Delays a function for the given number of milliseconds, and then calls\n  // it with the arguments supplied.\n  var delay = restArguments(function(func, wait, args) {\n    return setTimeout(function() {\n      return func.apply(null, args);\n    }, wait);\n  });\n\n  // Defers a function, scheduling it to run after the current call stack has\n  // cleared.\n  var defer = partial(delay, _$1, 1);\n\n  // Returns a function, that, when invoked, will only be triggered at most once\n  // during a given window of time. Normally, the throttled function will run\n  // as much as it can, without ever going more than once per `wait` duration;\n  // but if you'd like to disable the execution on the leading edge, pass\n  // `{leading: false}`. To disable execution on the trailing edge, ditto.\n  function throttle(func, wait, options) {\n    var timeout, context, args, result;\n    var previous = 0;\n    if (!options) options = {};\n\n    var later = function() {\n      previous = options.leading === false ? 0 : now();\n      timeout = null;\n      result = func.apply(context, args);\n      if (!timeout) context = args = null;\n    };\n\n    var throttled = function() {\n      var _now = now();\n      if (!previous && options.leading === false) previous = _now;\n      var remaining = wait - (_now - previous);\n      context = this;\n      args = arguments;\n      if (remaining <= 0 || remaining > wait) {\n        if (timeout) {\n          clearTimeout(timeout);\n          timeout = null;\n        }\n        previous = _now;\n        result = func.apply(context, args);\n        if (!timeout) context = args = null;\n      } else if (!timeout && options.trailing !== false) {\n        timeout = setTimeout(later, remaining);\n      }\n      return result;\n    };\n\n    throttled.cancel = function() {\n      clearTimeout(timeout);\n      previous = 0;\n      timeout = context = args = null;\n    };\n\n    return throttled;\n  }\n\n  // When a sequence of calls of the returned function ends, the argument\n  // function is triggered. The end of a sequence is defined by the `wait`\n  // parameter. If `immediate` is passed, the argument function will be\n  // triggered at the beginning of the sequence instead of at the end.\n  function debounce(func, wait, immediate) {\n    var timeout, previous, args, result, context;\n\n    var later = function() {\n      var passed = now() - previous;\n      if (wait > passed) {\n        timeout = setTimeout(later, wait - passed);\n      } else {\n        timeout = null;\n        if (!immediate) result = func.apply(context, args);\n        // This check is needed because `func` can recursively invoke `debounced`.\n        if (!timeout) args = context = null;\n      }\n    };\n\n    var debounced = restArguments(function(_args) {\n      context = this;\n      args = _args;\n      previous = now();\n      if (!timeout) {\n        timeout = setTimeout(later, wait);\n        if (immediate) result = func.apply(context, args);\n      }\n      return result;\n    });\n\n    debounced.cancel = function() {\n      clearTimeout(timeout);\n      timeout = args = context = null;\n    };\n\n    return debounced;\n  }\n\n  // Returns the first function passed as an argument to the second,\n  // allowing you to adjust arguments, run code before and after, and\n  // conditionally execute the original function.\n  function wrap(func, wrapper) {\n    return partial(wrapper, func);\n  }\n\n  // Returns a negated version of the passed-in predicate.\n  function negate(predicate) {\n    return function() {\n      return !predicate.apply(this, arguments);\n    };\n  }\n\n  // Returns a function that is the composition of a list of functions, each\n  // consuming the return value of the function that follows.\n  function compose() {\n    var args = arguments;\n    var start = args.length - 1;\n    return function() {\n      var i = start;\n      var result = args[start].apply(this, arguments);\n      while (i--) result = args[i].call(this, result);\n      return result;\n    };\n  }\n\n  // Returns a function that will only be executed on and after the Nth call.\n  function after(times, func) {\n    return function() {\n      if (--times < 1) {\n        return func.apply(this, arguments);\n      }\n    };\n  }\n\n  // Returns a function that will only be executed up to (but not including) the\n  // Nth call.\n  function before(times, func) {\n    var memo;\n    return function() {\n      if (--times > 0) {\n        memo = func.apply(this, arguments);\n      }\n      if (times <= 1) func = null;\n      return memo;\n    };\n  }\n\n  // Returns a function that will be executed at most one time, no matter how\n  // often you call it. Useful for lazy initialization.\n  var once = partial(before, 2);\n\n  // Returns the first key on an object that passes a truth test.\n  function findKey(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var _keys = keys(obj), key;\n    for (var i = 0, length = _keys.length; i < length; i++) {\n      key = _keys[i];\n      if (predicate(obj[key], key, obj)) return key;\n    }\n  }\n\n  // Internal function to generate `_.findIndex` and `_.findLastIndex`.\n  function createPredicateIndexFinder(dir) {\n    return function(array, predicate, context) {\n      predicate = cb(predicate, context);\n      var length = getLength(array);\n      var index = dir > 0 ? 0 : length - 1;\n      for (; index >= 0 && index < length; index += dir) {\n        if (predicate(array[index], index, array)) return index;\n      }\n      return -1;\n    };\n  }\n\n  // Returns the first index on an array-like that passes a truth test.\n  var findIndex = createPredicateIndexFinder(1);\n\n  // Returns the last index on an array-like that passes a truth test.\n  var findLastIndex = createPredicateIndexFinder(-1);\n\n  // Use a comparator function to figure out the smallest index at which\n  // an object should be inserted so as to maintain order. Uses binary search.\n  function sortedIndex(array, obj, iteratee, context) {\n    iteratee = cb(iteratee, context, 1);\n    var value = iteratee(obj);\n    var low = 0, high = getLength(array);\n    while (low < high) {\n      var mid = Math.floor((low + high) / 2);\n      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n    }\n    return low;\n  }\n\n  // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.\n  function createIndexFinder(dir, predicateFind, sortedIndex) {\n    return function(array, item, idx) {\n      var i = 0, length = getLength(array);\n      if (typeof idx == 'number') {\n        if (dir > 0) {\n          i = idx >= 0 ? idx : Math.max(idx + length, i);\n        } else {\n          length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n        }\n      } else if (sortedIndex && idx && length) {\n        idx = sortedIndex(array, item);\n        return array[idx] === item ? idx : -1;\n      }\n      if (item !== item) {\n        idx = predicateFind(slice.call(array, i, length), isNaN$1);\n        return idx >= 0 ? idx + i : -1;\n      }\n      for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n        if (array[idx] === item) return idx;\n      }\n      return -1;\n    };\n  }\n\n  // Return the position of the first occurrence of an item in an array,\n  // or -1 if the item is not included in the array.\n  // If the array is large and already in sort order, pass `true`\n  // for **isSorted** to use binary search.\n  var indexOf = createIndexFinder(1, findIndex, sortedIndex);\n\n  // Return the position of the last occurrence of an item in an array,\n  // or -1 if the item is not included in the array.\n  var lastIndexOf = createIndexFinder(-1, findLastIndex);\n\n  // Return the first value which passes a truth test.\n  function find(obj, predicate, context) {\n    var keyFinder = isArrayLike(obj) ? findIndex : findKey;\n    var key = keyFinder(obj, predicate, context);\n    if (key !== void 0 && key !== -1) return obj[key];\n  }\n\n  // Convenience version of a common use case of `_.find`: getting the first\n  // object containing specific `key:value` pairs.\n  function findWhere(obj, attrs) {\n    return find(obj, matcher(attrs));\n  }\n\n  // The cornerstone for collection functions, an `each`\n  // implementation, aka `forEach`.\n  // Handles raw objects in addition to array-likes. Treats all\n  // sparse array-likes as if they were dense.\n  function each(obj, iteratee, context) {\n    iteratee = optimizeCb(iteratee, context);\n    var i, length;\n    if (isArrayLike(obj)) {\n      for (i = 0, length = obj.length; i < length; i++) {\n        iteratee(obj[i], i, obj);\n      }\n    } else {\n      var _keys = keys(obj);\n      for (i = 0, length = _keys.length; i < length; i++) {\n        iteratee(obj[_keys[i]], _keys[i], obj);\n      }\n    }\n    return obj;\n  }\n\n  // Return the results of applying the iteratee to each element.\n  function map(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    var _keys = !isArrayLike(obj) && keys(obj),\n        length = (_keys || obj).length,\n        results = Array(length);\n    for (var index = 0; index < length; index++) {\n      var currentKey = _keys ? _keys[index] : index;\n      results[index] = iteratee(obj[currentKey], currentKey, obj);\n    }\n    return results;\n  }\n\n  // Internal helper to create a reducing function, iterating left or right.\n  function createReduce(dir) {\n    // Wrap code that reassigns argument variables in a separate function than\n    // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n    var reducer = function(obj, iteratee, memo, initial) {\n      var _keys = !isArrayLike(obj) && keys(obj),\n          length = (_keys || obj).length,\n          index = dir > 0 ? 0 : length - 1;\n      if (!initial) {\n        memo = obj[_keys ? _keys[index] : index];\n        index += dir;\n      }\n      for (; index >= 0 && index < length; index += dir) {\n        var currentKey = _keys ? _keys[index] : index;\n        memo = iteratee(memo, obj[currentKey], currentKey, obj);\n      }\n      return memo;\n    };\n\n    return function(obj, iteratee, memo, context) {\n      var initial = arguments.length >= 3;\n      return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n    };\n  }\n\n  // **Reduce** builds up a single result from a list of values, aka `inject`,\n  // or `foldl`.\n  var reduce = createReduce(1);\n\n  // The right-associative version of reduce, also known as `foldr`.\n  var reduceRight = createReduce(-1);\n\n  // Return all the elements that pass a truth test.\n  function filter(obj, predicate, context) {\n    var results = [];\n    predicate = cb(predicate, context);\n    each(obj, function(value, index, list) {\n      if (predicate(value, index, list)) results.push(value);\n    });\n    return results;\n  }\n\n  // Return all the elements for which a truth test fails.\n  function reject(obj, predicate, context) {\n    return filter(obj, negate(cb(predicate)), context);\n  }\n\n  // Determine whether all of the elements pass a truth test.\n  function every(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var _keys = !isArrayLike(obj) && keys(obj),\n        length = (_keys || obj).length;\n    for (var index = 0; index < length; index++) {\n      var currentKey = _keys ? _keys[index] : index;\n      if (!predicate(obj[currentKey], currentKey, obj)) return false;\n    }\n    return true;\n  }\n\n  // Determine if at least one element in the object passes a truth test.\n  function some(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var _keys = !isArrayLike(obj) && keys(obj),\n        length = (_keys || obj).length;\n    for (var index = 0; index < length; index++) {\n      var currentKey = _keys ? _keys[index] : index;\n      if (predicate(obj[currentKey], currentKey, obj)) return true;\n    }\n    return false;\n  }\n\n  // Determine if the array or object contains a given item (using `===`).\n  function contains(obj, item, fromIndex, guard) {\n    if (!isArrayLike(obj)) obj = values(obj);\n    if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n    return indexOf(obj, item, fromIndex) >= 0;\n  }\n\n  // Invoke a method (with arguments) on every item in a collection.\n  var invoke = restArguments(function(obj, path, args) {\n    var contextPath, func;\n    if (isFunction$1(path)) {\n      func = path;\n    } else {\n      path = toPath(path);\n      contextPath = path.slice(0, -1);\n      path = path[path.length - 1];\n    }\n    return map(obj, function(context) {\n      var method = func;\n      if (!method) {\n        if (contextPath && contextPath.length) {\n          context = deepGet(context, contextPath);\n        }\n        if (context == null) return void 0;\n        method = context[path];\n      }\n      return method == null ? method : method.apply(context, args);\n    });\n  });\n\n  // Convenience version of a common use case of `_.map`: fetching a property.\n  function pluck(obj, key) {\n    return map(obj, property(key));\n  }\n\n  // Convenience version of a common use case of `_.filter`: selecting only\n  // objects containing specific `key:value` pairs.\n  function where(obj, attrs) {\n    return filter(obj, matcher(attrs));\n  }\n\n  // Return the maximum element (or element-based computation).\n  function max(obj, iteratee, context) {\n    var result = -Infinity, lastComputed = -Infinity,\n        value, computed;\n    if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n      obj = isArrayLike(obj) ? obj : values(obj);\n      for (var i = 0, length = obj.length; i < length; i++) {\n        value = obj[i];\n        if (value != null && value > result) {\n          result = value;\n        }\n      }\n    } else {\n      iteratee = cb(iteratee, context);\n      each(obj, function(v, index, list) {\n        computed = iteratee(v, index, list);\n        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n          result = v;\n          lastComputed = computed;\n        }\n      });\n    }\n    return result;\n  }\n\n  // Return the minimum element (or element-based computation).\n  function min(obj, iteratee, context) {\n    var result = Infinity, lastComputed = Infinity,\n        value, computed;\n    if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n      obj = isArrayLike(obj) ? obj : values(obj);\n      for (var i = 0, length = obj.length; i < length; i++) {\n        value = obj[i];\n        if (value != null && value < result) {\n          result = value;\n        }\n      }\n    } else {\n      iteratee = cb(iteratee, context);\n      each(obj, function(v, index, list) {\n        computed = iteratee(v, index, list);\n        if (computed < lastComputed || computed === Infinity && result === Infinity) {\n          result = v;\n          lastComputed = computed;\n        }\n      });\n    }\n    return result;\n  }\n\n  // Sample **n** random values from a collection using the modern version of the\n  // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n  // If **n** is not specified, returns a single random element.\n  // The internal `guard` argument allows it to work with `_.map`.\n  function sample(obj, n, guard) {\n    if (n == null || guard) {\n      if (!isArrayLike(obj)) obj = values(obj);\n      return obj[random(obj.length - 1)];\n    }\n    var sample = isArrayLike(obj) ? clone(obj) : values(obj);\n    var length = getLength(sample);\n    n = Math.max(Math.min(n, length), 0);\n    var last = length - 1;\n    for (var index = 0; index < n; index++) {\n      var rand = random(index, last);\n      var temp = sample[index];\n      sample[index] = sample[rand];\n      sample[rand] = temp;\n    }\n    return sample.slice(0, n);\n  }\n\n  // Shuffle a collection.\n  function shuffle(obj) {\n    return sample(obj, Infinity);\n  }\n\n  // Sort the object's values by a criterion produced by an iteratee.\n  function sortBy(obj, iteratee, context) {\n    var index = 0;\n    iteratee = cb(iteratee, context);\n    return pluck(map(obj, function(value, key, list) {\n      return {\n        value: value,\n        index: index++,\n        criteria: iteratee(value, key, list)\n      };\n    }).sort(function(left, right) {\n      var a = left.criteria;\n      var b = right.criteria;\n      if (a !== b) {\n        if (a > b || a === void 0) return 1;\n        if (a < b || b === void 0) return -1;\n      }\n      return left.index - right.index;\n    }), 'value');\n  }\n\n  // An internal function used for aggregate \"group by\" operations.\n  function group(behavior, partition) {\n    return function(obj, iteratee, context) {\n      var result = partition ? [[], []] : {};\n      iteratee = cb(iteratee, context);\n      each(obj, function(value, index) {\n        var key = iteratee(value, index, obj);\n        behavior(result, value, key);\n      });\n      return result;\n    };\n  }\n\n  // Groups the object's values by a criterion. Pass either a string attribute\n  // to group by, or a function that returns the criterion.\n  var groupBy = group(function(result, value, key) {\n    if (has$1(result, key)) result[key].push(value); else result[key] = [value];\n  });\n\n  // Indexes the object's values by a criterion, similar to `_.groupBy`, but for\n  // when you know that your index values will be unique.\n  var indexBy = group(function(result, value, key) {\n    result[key] = value;\n  });\n\n  // Counts instances of an object that group by a certain criterion. Pass\n  // either a string attribute to count by, or a function that returns the\n  // criterion.\n  var countBy = group(function(result, value, key) {\n    if (has$1(result, key)) result[key]++; else result[key] = 1;\n  });\n\n  // Split a collection into two arrays: one whose elements all pass the given\n  // truth test, and one whose elements all do not pass the truth test.\n  var partition = group(function(result, value, pass) {\n    result[pass ? 0 : 1].push(value);\n  }, true);\n\n  // Safely create a real, live array from anything iterable.\n  var reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\n  function toArray(obj) {\n    if (!obj) return [];\n    if (isArray(obj)) return slice.call(obj);\n    if (isString(obj)) {\n      // Keep surrogate pair characters together.\n      return obj.match(reStrSymbol);\n    }\n    if (isArrayLike(obj)) return map(obj, identity);\n    return values(obj);\n  }\n\n  // Return the number of elements in a collection.\n  function size(obj) {\n    if (obj == null) return 0;\n    return isArrayLike(obj) ? obj.length : keys(obj).length;\n  }\n\n  // Internal `_.pick` helper function to determine whether `key` is an enumerable\n  // property name of `obj`.\n  function keyInObj(value, key, obj) {\n    return key in obj;\n  }\n\n  // Return a copy of the object only containing the allowed properties.\n  var pick = restArguments(function(obj, keys) {\n    var result = {}, iteratee = keys[0];\n    if (obj == null) return result;\n    if (isFunction$1(iteratee)) {\n      if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);\n      keys = allKeys(obj);\n    } else {\n      iteratee = keyInObj;\n      keys = flatten$1(keys, false, false);\n      obj = Object(obj);\n    }\n    for (var i = 0, length = keys.length; i < length; i++) {\n      var key = keys[i];\n      var value = obj[key];\n      if (iteratee(value, key, obj)) result[key] = value;\n    }\n    return result;\n  });\n\n  // Return a copy of the object without the disallowed properties.\n  var omit = restArguments(function(obj, keys) {\n    var iteratee = keys[0], context;\n    if (isFunction$1(iteratee)) {\n      iteratee = negate(iteratee);\n      if (keys.length > 1) context = keys[1];\n    } else {\n      keys = map(flatten$1(keys, false, false), String);\n      iteratee = function(value, key) {\n        return !contains(keys, key);\n      };\n    }\n    return pick(obj, iteratee, context);\n  });\n\n  // Returns everything but the last entry of the array. Especially useful on\n  // the arguments object. Passing **n** will return all the values in\n  // the array, excluding the last N.\n  function initial(array, n, guard) {\n    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n  }\n\n  // Get the first element of an array. Passing **n** will return the first N\n  // values in the array. The **guard** check allows it to work with `_.map`.\n  function first(array, n, guard) {\n    if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n    if (n == null || guard) return array[0];\n    return initial(array, array.length - n);\n  }\n\n  // Returns everything but the first entry of the `array`. Especially useful on\n  // the `arguments` object. Passing an **n** will return the rest N values in the\n  // `array`.\n  function rest(array, n, guard) {\n    return slice.call(array, n == null || guard ? 1 : n);\n  }\n\n  // Get the last element of an array. Passing **n** will return the last N\n  // values in the array.\n  function last(array, n, guard) {\n    if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n    if (n == null || guard) return array[array.length - 1];\n    return rest(array, Math.max(0, array.length - n));\n  }\n\n  // Trim out all falsy values from an array.\n  function compact(array) {\n    return filter(array, Boolean);\n  }\n\n  // Flatten out an array, either recursively (by default), or up to `depth`.\n  // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.\n  function flatten(array, depth) {\n    return flatten$1(array, depth, false);\n  }\n\n  // Take the difference between one array and a number of other arrays.\n  // Only the elements present in just the first array will remain.\n  var difference = restArguments(function(array, rest) {\n    rest = flatten$1(rest, true, true);\n    return filter(array, function(value){\n      return !contains(rest, value);\n    });\n  });\n\n  // Return a version of the array that does not contain the specified value(s).\n  var without = restArguments(function(array, otherArrays) {\n    return difference(array, otherArrays);\n  });\n\n  // Produce a duplicate-free version of the array. If the array has already\n  // been sorted, you have the option of using a faster algorithm.\n  // The faster algorithm will not work with an iteratee if the iteratee\n  // is not a one-to-one function, so providing an iteratee will disable\n  // the faster algorithm.\n  function uniq(array, isSorted, iteratee, context) {\n    if (!isBoolean(isSorted)) {\n      context = iteratee;\n      iteratee = isSorted;\n      isSorted = false;\n    }\n    if (iteratee != null) iteratee = cb(iteratee, context);\n    var result = [];\n    var seen = [];\n    for (var i = 0, length = getLength(array); i < length; i++) {\n      var value = array[i],\n          computed = iteratee ? iteratee(value, i, array) : value;\n      if (isSorted && !iteratee) {\n        if (!i || seen !== computed) result.push(value);\n        seen = computed;\n      } else if (iteratee) {\n        if (!contains(seen, computed)) {\n          seen.push(computed);\n          result.push(value);\n        }\n      } else if (!contains(result, value)) {\n        result.push(value);\n      }\n    }\n    return result;\n  }\n\n  // Produce an array that contains the union: each distinct element from all of\n  // the passed-in arrays.\n  var union = restArguments(function(arrays) {\n    return uniq(flatten$1(arrays, true, true));\n  });\n\n  // Produce an array that contains every item shared between all the\n  // passed-in arrays.\n  function intersection(array) {\n    var result = [];\n    var argsLength = arguments.length;\n    for (var i = 0, length = getLength(array); i < length; i++) {\n      var item = array[i];\n      if (contains(result, item)) continue;\n      var j;\n      for (j = 1; j < argsLength; j++) {\n        if (!contains(arguments[j], item)) break;\n      }\n      if (j === argsLength) result.push(item);\n    }\n    return result;\n  }\n\n  // Complement of zip. Unzip accepts an array of arrays and groups\n  // each array's elements on shared indices.\n  function unzip(array) {\n    var length = array && max(array, getLength).length || 0;\n    var result = Array(length);\n\n    for (var index = 0; index < length; index++) {\n      result[index] = pluck(array, index);\n    }\n    return result;\n  }\n\n  // Zip together multiple lists into a single array -- elements that share\n  // an index go together.\n  var zip = restArguments(unzip);\n\n  // Converts lists into objects. Pass either a single array of `[key, value]`\n  // pairs, or two parallel arrays of the same length -- one of keys, and one of\n  // the corresponding values. Passing by pairs is the reverse of `_.pairs`.\n  function object(list, values) {\n    var result = {};\n    for (var i = 0, length = getLength(list); i < length; i++) {\n      if (values) {\n        result[list[i]] = values[i];\n      } else {\n        result[list[i][0]] = list[i][1];\n      }\n    }\n    return result;\n  }\n\n  // Generate an integer Array containing an arithmetic progression. A port of\n  // the native Python `range()` function. See\n  // [the Python documentation](https://docs.python.org/library/functions.html#range).\n  function range(start, stop, step) {\n    if (stop == null) {\n      stop = start || 0;\n      start = 0;\n    }\n    if (!step) {\n      step = stop < start ? -1 : 1;\n    }\n\n    var length = Math.max(Math.ceil((stop - start) / step), 0);\n    var range = Array(length);\n\n    for (var idx = 0; idx < length; idx++, start += step) {\n      range[idx] = start;\n    }\n\n    return range;\n  }\n\n  // Chunk a single array into multiple arrays, each containing `count` or fewer\n  // items.\n  function chunk(array, count) {\n    if (count == null || count < 1) return [];\n    var result = [];\n    var i = 0, length = array.length;\n    while (i < length) {\n      result.push(slice.call(array, i, i += count));\n    }\n    return result;\n  }\n\n  // Helper function to continue chaining intermediate results.\n  function chainResult(instance, obj) {\n    return instance._chain ? _$1(obj).chain() : obj;\n  }\n\n  // Add your own custom functions to the Underscore object.\n  function mixin(obj) {\n    each(functions(obj), function(name) {\n      var func = _$1[name] = obj[name];\n      _$1.prototype[name] = function() {\n        var args = [this._wrapped];\n        push.apply(args, arguments);\n        return chainResult(this, func.apply(_$1, args));\n      };\n    });\n    return _$1;\n  }\n\n  // Add all mutator `Array` functions to the wrapper.\n  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n    var method = ArrayProto[name];\n    _$1.prototype[name] = function() {\n      var obj = this._wrapped;\n      if (obj != null) {\n        method.apply(obj, arguments);\n        if ((name === 'shift' || name === 'splice') && obj.length === 0) {\n          delete obj[0];\n        }\n      }\n      return chainResult(this, obj);\n    };\n  });\n\n  // Add all accessor `Array` functions to the wrapper.\n  each(['concat', 'join', 'slice'], function(name) {\n    var method = ArrayProto[name];\n    _$1.prototype[name] = function() {\n      var obj = this._wrapped;\n      if (obj != null) obj = method.apply(obj, arguments);\n      return chainResult(this, obj);\n    };\n  });\n\n  // Named Exports\n\n  var allExports = {\n    __proto__: null,\n    VERSION: VERSION,\n    restArguments: restArguments,\n    isObject: isObject,\n    isNull: isNull,\n    isUndefined: isUndefined,\n    isBoolean: isBoolean,\n    isElement: isElement,\n    isString: isString,\n    isNumber: isNumber,\n    isDate: isDate,\n    isRegExp: isRegExp,\n    isError: isError,\n    isSymbol: isSymbol,\n    isArrayBuffer: isArrayBuffer,\n    isDataView: isDataView$1,\n    isArray: isArray,\n    isFunction: isFunction$1,\n    isArguments: isArguments$1,\n    isFinite: isFinite$1,\n    isNaN: isNaN$1,\n    isTypedArray: isTypedArray$1,\n    isEmpty: isEmpty,\n    isMatch: isMatch,\n    isEqual: isEqual,\n    isMap: isMap,\n    isWeakMap: isWeakMap,\n    isSet: isSet,\n    isWeakSet: isWeakSet,\n    keys: keys,\n    allKeys: allKeys,\n    values: values,\n    pairs: pairs,\n    invert: invert,\n    functions: functions,\n    methods: functions,\n    extend: extend,\n    extendOwn: extendOwn,\n    assign: extendOwn,\n    defaults: defaults,\n    create: create,\n    clone: clone,\n    tap: tap,\n    get: get,\n    has: has,\n    mapObject: mapObject,\n    identity: identity,\n    constant: constant,\n    noop: noop,\n    toPath: toPath$1,\n    property: property,\n    propertyOf: propertyOf,\n    matcher: matcher,\n    matches: matcher,\n    times: times,\n    random: random,\n    now: now,\n    escape: _escape,\n    unescape: _unescape,\n    templateSettings: templateSettings,\n    template: template,\n    result: result,\n    uniqueId: uniqueId,\n    chain: chain,\n    iteratee: iteratee,\n    partial: partial,\n    bind: bind,\n    bindAll: bindAll,\n    memoize: memoize,\n    delay: delay,\n    defer: defer,\n    throttle: throttle,\n    debounce: debounce,\n    wrap: wrap,\n    negate: negate,\n    compose: compose,\n    after: after,\n    before: before,\n    once: once,\n    findKey: findKey,\n    findIndex: findIndex,\n    findLastIndex: findLastIndex,\n    sortedIndex: sortedIndex,\n    indexOf: indexOf,\n    lastIndexOf: lastIndexOf,\n    find: find,\n    detect: find,\n    findWhere: findWhere,\n    each: each,\n    forEach: each,\n    map: map,\n    collect: map,\n    reduce: reduce,\n    foldl: reduce,\n    inject: reduce,\n    reduceRight: reduceRight,\n    foldr: reduceRight,\n    filter: filter,\n    select: filter,\n    reject: reject,\n    every: every,\n    all: every,\n    some: some,\n    any: some,\n    contains: contains,\n    includes: contains,\n    include: contains,\n    invoke: invoke,\n    pluck: pluck,\n    where: where,\n    max: max,\n    min: min,\n    shuffle: shuffle,\n    sample: sample,\n    sortBy: sortBy,\n    groupBy: groupBy,\n    indexBy: indexBy,\n    countBy: countBy,\n    partition: partition,\n    toArray: toArray,\n    size: size,\n    pick: pick,\n    omit: omit,\n    first: first,\n    head: first,\n    take: first,\n    initial: initial,\n    last: last,\n    rest: rest,\n    tail: rest,\n    drop: rest,\n    compact: compact,\n    flatten: flatten,\n    without: without,\n    uniq: uniq,\n    unique: uniq,\n    union: union,\n    intersection: intersection,\n    difference: difference,\n    unzip: unzip,\n    transpose: unzip,\n    zip: zip,\n    object: object,\n    range: range,\n    chunk: chunk,\n    mixin: mixin,\n    'default': _$1\n  };\n\n  // Default Export\n\n  // Add all of the Underscore functions to the wrapper object.\n  var _ = mixin(allExports);\n  // Legacy Node.js API.\n  _._ = _;\n\n  return _;\n\n})));\n//# sourceMappingURL=underscore-umd.js.map\n"
  },
  {
    "path": "bdsim/bdedit/docs/_static/underscore.js",
    "content": "!function(n,r){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=r():\"function\"==typeof define&&define.amd?define(\"underscore\",r):(n=\"undefined\"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){\n//     Underscore.js 1.13.1\n//     https://underscorejs.org\n//     (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors\n//     Underscore may be freely distributed under the MIT license.\nvar n=\"1.13.1\",r=\"object\"==typeof self&&self.self===self&&self||\"object\"==typeof global&&global.global===global&&global||Function(\"return this\")()||{},t=Array.prototype,e=Object.prototype,u=\"undefined\"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c=\"undefined\"!=typeof ArrayBuffer,l=\"undefined\"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable(\"toString\"),b=[\"valueOf\",\"isPrototypeOf\",\"toString\",\"propertyIsEnumerable\",\"hasOwnProperty\",\"toLocaleString\"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u<t;u++)e[u]=arguments[u+r];switch(r){case 0:return n.call(this,e);case 1:return n.call(this,arguments[0],e);case 2:return n.call(this,arguments[0],arguments[1],e)}var o=Array(r+1);for(u=0;u<r;u++)o[u]=arguments[u];return o[r]=e,n.apply(this,o)}}function _(n){var r=typeof n;return\"function\"===r||\"object\"===r&&!!n}function w(n){return void 0===n}function A(n){return!0===n||!1===n||\"[object Boolean]\"===a.call(n)}function x(n){var r=\"[object \"+n+\"]\";return function(n){return a.call(n)===r}}var S=x(\"String\"),O=x(\"Number\"),M=x(\"Date\"),E=x(\"RegExp\"),B=x(\"Error\"),N=x(\"Symbol\"),I=x(\"ArrayBuffer\"),T=x(\"Function\"),k=r.document&&r.document.childNodes;\"function\"!=typeof/./&&\"object\"!=typeof Int8Array&&\"function\"!=typeof k&&(T=function(n){return\"function\"==typeof n||!1});var D=T,R=x(\"Object\"),F=l&&R(new DataView(new ArrayBuffer(8))),V=\"undefined\"!=typeof Map&&R(new Map),P=x(\"DataView\");var q=F?function(n){return null!=n&&D(n.getInt8)&&I(n.buffer)}:P,U=s||x(\"Array\");function W(n,r){return null!=n&&f.call(n,r)}var z=x(\"Arguments\");!function(){z(arguments)||(z=function(n){return W(n,\"callee\")})}();var L=z;function $(n){return O(n)&&y(n)}function C(n){return function(){return n}}function K(n){return function(r){var t=n(r);return\"number\"==typeof t&&t>=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J(\"byteLength\"),H=K(G),Q=/\\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J(\"length\");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e<t;++e)r[n[e]]=!0;return{contains:function(n){return r[n]},push:function(t){return r[t]=!0,n.push(t)}}}(r);var t=b.length,u=n.constructor,o=D(u)&&u.prototype||e,i=\"constructor\";for(W(n,i)&&!r.contains(i)&&r.push(i);t--;)(i=b[t])in n&&n[i]!==o[i]&&!r.contains(i)&&r.push(i)}function nn(n){if(!_(n))return[];if(p)return p(n);var r=[];for(var t in n)W(n,t)&&r.push(t);return g&&Z(n,r),r}function rn(n,r){var t=nn(r),e=t.length;if(null==n)return!e;for(var u=Object(n),o=0;o<e;o++){var i=t[o];if(r[i]!==u[i]||!(i in u))return!1}return!0}function tn(n){return n instanceof tn?n:this instanceof tn?void(this._wrapped=n):new tn(n)}function en(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,G(n))}tn.VERSION=n,tn.prototype.value=function(){return this._wrapped},tn.prototype.valueOf=tn.prototype.toJSON=tn.prototype.value,tn.prototype.toString=function(){return String(this._wrapped)};var un=\"[object DataView]\";function on(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(null==n||null==r)return!1;if(n!=n)return r!=r;var o=typeof n;return(\"function\"===o||\"object\"===o||\"object\"==typeof r)&&function n(r,t,e,o){r instanceof tn&&(r=r._wrapped);t instanceof tn&&(t=t._wrapped);var i=a.call(r);if(i!==a.call(t))return!1;if(F&&\"[object Object]\"==i&&q(r)){if(!q(t))return!1;i=un}switch(i){case\"[object RegExp]\":case\"[object String]\":return\"\"+r==\"\"+t;case\"[object Number]\":return+r!=+r?+t!=+t:0==+r?1/+r==1/t:+r==+t;case\"[object Date]\":case\"[object Boolean]\":return+r==+t;case\"[object Symbol]\":return u.valueOf.call(r)===u.valueOf.call(t);case\"[object ArrayBuffer]\":case un:return n(en(r),en(t),e,o)}var f=\"[object Array]\"===i;if(!f&&X(r)){if(G(r)!==G(t))return!1;if(r.buffer===t.buffer&&r.byteOffset===t.byteOffset)return!0;f=!0}if(!f){if(\"object\"!=typeof r||\"object\"!=typeof t)return!1;var c=r.constructor,l=t.constructor;if(c!==l&&!(D(c)&&c instanceof c&&D(l)&&l instanceof l)&&\"constructor\"in r&&\"constructor\"in t)return!1}o=o||[];var s=(e=e||[]).length;for(;s--;)if(e[s]===r)return o[s]===t;if(e.push(r),o.push(t),f){if((s=r.length)!==t.length)return!1;for(;s--;)if(!on(r[s],t[s],e,o))return!1}else{var p,v=nn(r);if(s=v.length,nn(t).length!==s)return!1;for(;s--;)if(p=v[s],!W(t,p)||!on(r[p],t[p],e,o))return!1}return e.pop(),o.pop(),!0}(n,r,t,e)}function an(n){if(!_(n))return[];var r=[];for(var t in n)r.push(t);return g&&Z(n,r),r}function fn(n){var r=Y(n);return function(t){if(null==t)return!1;var e=an(t);if(Y(e))return!1;for(var u=0;u<r;u++)if(!D(t[n[u]]))return!1;return n!==hn||!D(t[cn])}}var cn=\"forEach\",ln=\"has\",sn=[\"clear\",\"delete\"],pn=[\"get\",ln,\"set\"],vn=sn.concat(cn,pn),hn=sn.concat(pn),yn=[\"add\"].concat(sn,cn,ln),dn=V?fn(vn):x(\"Map\"),gn=V?fn(hn):x(\"WeakMap\"),bn=V?fn(yn):x(\"Set\"),mn=x(\"WeakSet\");function jn(n){for(var r=nn(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=n[r[u]];return e}function _n(n){for(var r={},t=nn(n),e=0,u=t.length;e<u;e++)r[n[t[e]]]=t[e];return r}function wn(n){var r=[];for(var t in n)D(n[t])&&r.push(t);return r.sort()}function An(n,r){return function(t){var e=arguments.length;if(r&&(t=Object(t)),e<2||null==t)return t;for(var u=1;u<e;u++)for(var o=arguments[u],i=n(o),a=i.length,f=0;f<a;f++){var c=i[f];r&&void 0!==t[c]||(t[c]=o[c])}return t}}var xn=An(an),Sn=An(nn),On=An(an,!0);function Mn(n){if(!_(n))return{};if(v)return v(n);var r=function(){};r.prototype=n;var t=new r;return r.prototype=null,t}function En(n){return _(n)?U(n)?n.slice():xn({},n):n}function Bn(n){return U(n)?n:[n]}function Nn(n){return tn.toPath(n)}function In(n,r){for(var t=r.length,e=0;e<t;e++){if(null==n)return;n=n[r[e]]}return t?n:void 0}function Tn(n,r,t){var e=In(n,Nn(r));return w(e)?t:e}function kn(n){return n}function Dn(n){return n=Sn({},n),function(r){return rn(r,n)}}function Rn(n){return n=Nn(n),function(r){return In(r,n)}}function Fn(n,r,t){if(void 0===r)return n;switch(null==t?3:t){case 1:return function(t){return n.call(r,t)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return function(){return n.apply(r,arguments)}}function Vn(n,r,t){return null==n?kn:D(n)?Fn(n,r,t):_(n)&&!U(n)?Dn(n):Rn(n)}function Pn(n,r){return Vn(n,r,1/0)}function qn(n,r,t){return tn.iteratee!==Pn?tn.iteratee(n,r):Vn(n,r,t)}function Un(){}function Wn(n,r){return null==r&&(r=n,n=0),n+Math.floor(Math.random()*(r-n+1))}tn.toPath=Bn,tn.iteratee=Pn;var zn=Date.now||function(){return(new Date).getTime()};function Ln(n){var r=function(r){return n[r]},t=\"(?:\"+nn(n).join(\"|\")+\")\",e=RegExp(t),u=RegExp(t,\"g\");return function(n){return n=null==n?\"\":\"\"+n,e.test(n)?n.replace(u,r):n}}var $n={\"&\":\"&amp;\",\"<\":\"&lt;\",\">\":\"&gt;\",'\"':\"&quot;\",\"'\":\"&#x27;\",\"`\":\"&#x60;\"},Cn=Ln($n),Kn=Ln(_n($n)),Jn=tn.templateSettings={evaluate:/<%([\\s\\S]+?)%>/g,interpolate:/<%=([\\s\\S]+?)%>/g,escape:/<%-([\\s\\S]+?)%>/g},Gn=/(.)^/,Hn={\"'\":\"'\",\"\\\\\":\"\\\\\",\"\\r\":\"r\",\"\\n\":\"n\",\"\\u2028\":\"u2028\",\"\\u2029\":\"u2029\"},Qn=/\\\\|'|\\r|\\n|\\u2028|\\u2029/g;function Xn(n){return\"\\\\\"+Hn[n]}var Yn=/^\\s*(\\w|\\$)+\\s*$/;var Zn=0;function nr(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var rr=j((function(n,r){var t=rr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a<o;a++)i[a]=r[a]===t?arguments[u++]:r[a];for(;u<arguments.length;)i.push(arguments[u++]);return nr(n,e,this,this,i)};return e}));rr.placeholder=tn;var tr=j((function(n,r,t){if(!D(n))throw new TypeError(\"Bind must be called on a function\");var e=j((function(u){return nr(n,e,r,this,t.concat(u))}));return e})),er=K(Y);function ur(n,r,t,e){if(e=e||[],r||0===r){if(r<=0)return e.concat(n)}else r=1/0;for(var u=e.length,o=0,i=Y(n);o<i;o++){var a=n[o];if(er(a)&&(U(a)||L(a)))if(r>1)ur(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f<c;)e[u++]=a[f++];else t||(e[u++]=a)}return e}var or=j((function(n,r){var t=(r=ur(r,!1,!1)).length;if(t<1)throw new Error(\"bindAll must be passed function names\");for(;t--;){var e=r[t];n[e]=tr(n[e],n)}return n}));var ir=j((function(n,r,t){return setTimeout((function(){return n.apply(null,t)}),r)})),ar=rr(ir,tn,1);function fr(n){return function(){return!n.apply(this,arguments)}}function cr(n,r){var t;return function(){return--n>0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var lr=rr(cr,2);function sr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o<i;o++)if(r(n[e=u[o]],e,n))return e}function pr(n){return function(r,t,e){t=qn(t,e);for(var u=Y(r),o=n>0?0:u-1;o>=0&&o<u;o+=n)if(t(r[o],o,r))return o;return-1}}var vr=pr(1),hr=pr(-1);function yr(n,r,t,e){for(var u=(t=qn(t,e,1))(r),o=0,i=Y(n);o<i;){var a=Math.floor((o+i)/2);t(n[a])<u?o=a+1:i=a}return o}function dr(n,r,t){return function(e,u,o){var a=0,f=Y(e);if(\"number\"==typeof o)n>0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o<f;o+=n)if(e[o]===u)return o;return-1}}var gr=dr(1,vr,yr),br=dr(-1,hr);function mr(n,r,t){var e=(er(n)?vr:sr)(n,r,t);if(void 0!==e&&-1!==e)return n[e]}function jr(n,r,t){var e,u;if(r=Fn(r,t),er(n))for(e=0,u=n.length;e<u;e++)r(n[e],e,n);else{var o=nn(n);for(e=0,u=o.length;e<u;e++)r(n[o[e]],o[e],n)}return n}function _r(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=Array(u),i=0;i<u;i++){var a=e?e[i]:i;o[i]=r(n[a],a,n)}return o}function wr(n){var r=function(r,t,e,u){var o=!er(r)&&nn(r),i=(o||r).length,a=n>0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a<i;a+=n){var f=o?o[a]:a;e=t(e,r[f],f,r)}return e};return function(n,t,e,u){var o=arguments.length>=3;return r(n,Fn(t,u,4),e,o)}}var Ar=wr(1),xr=wr(-1);function Sr(n,r,t){var e=[];return r=qn(r,t),jr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Or(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(!r(n[i],i,n))return!1}return!0}function Mr(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(r(n[i],i,n))return!0}return!1}function Er(n,r,t,e){return er(n)||(n=jn(n)),(\"number\"!=typeof t||e)&&(t=0),gr(n,r,t)>=0}var Br=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Nn(r),e=r.slice(0,-1),r=r[r.length-1]),_r(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=In(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Nr(n,r){return _r(n,Rn(r))}function Ir(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||\"number\"==typeof r&&\"object\"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;a<f;a++)null!=(e=n[a])&&e>o&&(o=e);else r=qn(r,t),jr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}function Tr(n,r,t){if(null==r||t)return er(n)||(n=jn(n)),n[Wn(n.length-1)];var e=er(n)?En(n):jn(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i<r;i++){var a=Wn(i,o),f=e[i];e[i]=e[a],e[a]=f}return e.slice(0,r)}function kr(n,r){return function(t,e,u){var o=r?[[],[]]:{};return e=qn(e,u),jr(t,(function(r,u){var i=e(r,u,t);n(o,r,i)})),o}}var Dr=kr((function(n,r,t){W(n,t)?n[t].push(r):n[t]=[r]})),Rr=kr((function(n,r,t){n[t]=r})),Fr=kr((function(n,r,t){W(n,t)?n[t]++:n[t]=1})),Vr=kr((function(n,r,t){n[t?0:1].push(r)}),!0),Pr=/[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;function qr(n,r,t){return r in t}var Ur=j((function(n,r){var t={},e=r[0];if(null==n)return t;D(e)?(r.length>1&&(e=Fn(e,r[1])),r=an(n)):(e=qr,r=ur(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u<o;u++){var i=r[u],a=n[i];e(a,i,n)&&(t[i]=a)}return t})),Wr=j((function(n,r){var t,e=r[0];return D(e)?(e=fr(e),r.length>1&&(t=r[1])):(r=_r(ur(r,!1,!1),String),e=function(n,t){return!Er(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=ur(r,!0,!0),Sr(n,(function(n){return!Er(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u=[],o=[],i=0,a=Y(n);i<a;i++){var f=n[i],c=t?t(f,i,n):f;r&&!t?(i&&o===c||u.push(f),o=c):t?Er(o,c)||(o.push(c),u.push(f)):Er(u,f)||u.push(f)}return u}var Gr=j((function(n){return Jr(ur(n,!0,!0))}));function Hr(n){for(var r=n&&Ir(n,Y).length||0,t=Array(r),e=0;e<r;e++)t[e]=Nr(n,e);return t}var Qr=j(Hr);function Xr(n,r){return n._chain?tn(r).chain():r}function Yr(n){return jr(wn(n),(function(r){var t=tn[r]=n[r];tn.prototype[r]=function(){var n=[this._wrapped];return o.apply(n,arguments),Xr(this,t.apply(tn,n))}})),tn}jr([\"pop\",\"push\",\"reverse\",\"shift\",\"sort\",\"splice\",\"unshift\"],(function(n){var r=t[n];tn.prototype[n]=function(){var t=this._wrapped;return null!=t&&(r.apply(t,arguments),\"shift\"!==n&&\"splice\"!==n||0!==t.length||delete t[0]),Xr(this,t)}})),jr([\"concat\",\"join\",\"slice\"],(function(n){var r=t[n];tn.prototype[n]=function(){var n=this._wrapped;return null!=n&&(n=r.apply(n,arguments)),Xr(this,n)}}));var Zr=Yr({__proto__:null,VERSION:n,restArguments:j,isObject:_,isNull:function(n){return null===n},isUndefined:w,isBoolean:A,isElement:function(n){return!(!n||1!==n.nodeType)},isString:S,isNumber:O,isDate:M,isRegExp:E,isError:B,isSymbol:N,isArrayBuffer:I,isDataView:q,isArray:U,isFunction:D,isArguments:L,isFinite:function(n){return!N(n)&&d(n)&&!isNaN(parseFloat(n))},isNaN:$,isTypedArray:X,isEmpty:function(n){if(null==n)return!0;var r=Y(n);return\"number\"==typeof r&&(U(n)||S(n)||L(n))?0===r:0===Y(nn(n))},isMatch:rn,isEqual:function(n,r){return on(n,r)},isMap:dn,isWeakMap:gn,isSet:bn,isWeakSet:mn,keys:nn,allKeys:an,values:jn,pairs:function(n){for(var r=nn(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=[r[u],n[r[u]]];return e},invert:_n,functions:wn,methods:wn,extend:xn,extendOwn:Sn,assign:Sn,defaults:On,create:function(n,r){var t=Mn(n);return r&&Sn(t,r),t},clone:En,tap:function(n,r){return r(n),n},get:Tn,has:function(n,r){for(var t=(r=Nn(r)).length,e=0;e<t;e++){var u=r[e];if(!W(n,u))return!1;n=n[u]}return!!t},mapObject:function(n,r,t){r=qn(r,t);for(var e=nn(n),u=e.length,o={},i=0;i<u;i++){var a=e[i];o[a]=r(n[a],a,n)}return o},identity:kn,constant:C,noop:Un,toPath:Bn,property:Rn,propertyOf:function(n){return null==n?Un:function(r){return Tn(n,r)}},matcher:Dn,matches:Dn,times:function(n,r,t){var e=Array(Math.max(0,n));r=Fn(r,t,1);for(var u=0;u<n;u++)e[u]=r(u);return e},random:Wn,now:zn,escape:Cn,unescape:Kn,templateSettings:Jn,template:function(n,r,t){!r&&t&&(r=t),r=On({},r,tn.templateSettings);var e=RegExp([(r.escape||Gn).source,(r.interpolate||Gn).source,(r.evaluate||Gn).source].join(\"|\")+\"|$\",\"g\"),u=0,o=\"__p+='\";n.replace(e,(function(r,t,e,i,a){return o+=n.slice(u,a).replace(Qn,Xn),u=a+r.length,t?o+=\"'+\\n((__t=(\"+t+\"))==null?'':_.escape(__t))+\\n'\":e?o+=\"'+\\n((__t=(\"+e+\"))==null?'':__t)+\\n'\":i&&(o+=\"';\\n\"+i+\"\\n__p+='\"),r})),o+=\"';\\n\";var i,a=r.variable;if(a){if(!Yn.test(a))throw new Error(\"variable is not a bare identifier: \"+a)}else o=\"with(obj||{}){\\n\"+o+\"}\\n\",a=\"obj\";o=\"var __t,__p='',__j=Array.prototype.join,\"+\"print=function(){__p+=__j.call(arguments,'');};\\n\"+o+\"return __p;\\n\";try{i=new Function(a,\"_\",o)}catch(n){throw n.source=o,n}var f=function(n){return i.call(this,n,tn)};return f.source=\"function(\"+a+\"){\\n\"+o+\"}\",f},result:function(n,r,t){var e=(r=Nn(r)).length;if(!e)return D(t)?t.call(n):t;for(var u=0;u<e;u++){var o=null==n?void 0:n[r[u]];void 0===o&&(o=t,u=e),n=D(o)?o.call(n):o}return n},uniqueId:function(n){var r=++Zn+\"\";return n?n+r:r},chain:function(n){var r=tn(n);return r._chain=!0,r},iteratee:Pn,partial:rr,bind:tr,bindAll:or,memoize:function(n,r){var t=function(e){var u=t.cache,o=\"\"+(r?r.apply(this,arguments):e);return W(u,o)||(u[o]=n.apply(this,arguments)),u[o]};return t.cache={},t},delay:ir,defer:ar,throttle:function(n,r,t){var e,u,o,i,a=0;t||(t={});var f=function(){a=!1===t.leading?0:zn(),e=null,i=n.apply(u,o),e||(u=o=null)},c=function(){var c=zn();a||!1!==t.leading||(a=c);var l=r-(c-a);return u=this,o=arguments,l<=0||l>r?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=zn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=zn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return rr(r,n)},negate:fr,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:cr,once:lr,findKey:sr,findIndex:vr,findLastIndex:hr,sortedIndex:yr,indexOf:gr,lastIndexOf:br,find:mr,detect:mr,findWhere:function(n,r){return mr(n,Dn(r))},each:jr,forEach:jr,map:_r,collect:_r,reduce:Ar,foldl:Ar,inject:Ar,reduceRight:xr,foldr:xr,filter:Sr,select:Sr,reject:function(n,r,t){return Sr(n,fr(qn(r)),t)},every:Or,all:Or,some:Mr,any:Mr,contains:Er,includes:Er,include:Er,invoke:Br,pluck:Nr,where:function(n,r){return Sr(n,Dn(r))},max:Ir,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||\"number\"==typeof r&&\"object\"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;a<f;a++)null!=(e=n[a])&&e<o&&(o=e);else r=qn(r,t),jr(n,(function(n,t,e){((u=r(n,t,e))<i||u===1/0&&o===1/0)&&(o=n,i=u)}));return o},shuffle:function(n){return Tr(n,1/0)},sample:Tr,sortBy:function(n,r,t){var e=0;return r=qn(r,t),Nr(_r(n,(function(n,t,u){return{value:n,index:e++,criteria:r(n,t,u)}})).sort((function(n,r){var t=n.criteria,e=r.criteria;if(t!==e){if(t>e||void 0===t)return 1;if(t<e||void 0===e)return-1}return n.index-r.index})),\"value\")},groupBy:Dr,indexBy:Rr,countBy:Fr,partition:Vr,toArray:function(n){return n?U(n)?i.call(n):S(n)?n.match(Pr):er(n)?_r(n,kn):jn(n):[]},size:function(n){return null==n?0:er(n)?n.length:nn(n).length},pick:Ur,omit:Wr,first:Lr,head:Lr,take:Lr,initial:zr,last:function(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[n.length-1]:$r(n,Math.max(0,n.length-r))},rest:$r,tail:$r,drop:$r,compact:function(n){return Sr(n,Boolean)},flatten:function(n,r){return ur(n,r,!1)},without:Kr,uniq:Jr,unique:Jr,union:Gr,intersection:function(n){for(var r=[],t=arguments.length,e=0,u=Y(n);e<u;e++){var o=n[e];if(!Er(r,o)){var i;for(i=1;i<t&&Er(arguments[i],o);i++);i===t&&r.push(o)}}return r},difference:Cr,unzip:Hr,transpose:Hr,zip:Qr,object:function(n,r){for(var t={},e=0,u=Y(n);e<u;e++)r?t[n[e]]=r[e]:t[n[e][0]]=n[e][1];return t},range:function(n,r,t){null==r&&(r=n||0,n=0),t||(t=r<n?-1:1);for(var e=Math.max(Math.ceil((r-n)/t),0),u=Array(e),o=0;o<e;o++,n+=t)u[o]=n;return u},chunk:function(n,r){if(null==r||r<1)return[];for(var t=[],e=0,u=n.length;e<u;)t.push(i.call(n,e,e+=r));return t},mixin:Yr,default:tn});return Zr._=Zr,Zr}));"
  },
  {
    "path": "bdsim/bdedit/docs/bdedit.html",
    "content": "\n\n<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  \n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  \n  <title>bdedit package &mdash; BdEdit  documentation</title>\n  \n\n  \n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n\n  \n  \n\n  \n  \n\n  \n\n  \n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  \n    \n      <script type=\"text/javascript\" id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script data-url_root=\"./\" id=\"documentation_options\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n    \n    <script type=\"text/javascript\" src=\"_static/js/theme.js\"></script>\n\n    \n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n    <link rel=\"prev\" title=\"bdedit\" href=\"modules.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\">\n\n   \n  <div class=\"wy-grid-for-nav\">\n    \n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n          \n\n          \n            <a href=\"index.html\" class=\"icon icon-home\"> BdEdit\n          \n\n          \n          </a>\n\n          \n            \n            \n          \n\n          \n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n\n          \n        </div>\n\n        \n        <div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"main navigation\">\n          \n            \n            \n              \n            \n            \n              <p class=\"caption\"><span class=\"caption-text\">Contents:</span></p>\n<ul class=\"current\">\n<li class=\"toctree-l1 current\"><a class=\"reference internal\" href=\"modules.html\">bdedit</a><ul class=\"current\">\n<li class=\"toctree-l2 current\"><a class=\"current reference internal\" href=\"#\">bdedit package</a><ul>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#submodules\">Submodules</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.Icons\">bdedit.Icons module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.block\">bdedit.block module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.block_graphics_block\">bdedit.block_graphics_block module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.block_graphics_socket\">bdedit.block_graphics_socket module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.block_graphics_wire\">bdedit.block_graphics_wire module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.block_param_window\">bdedit.block_param_window module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.block_socket\">bdedit.block_socket module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.block_socket_block\">bdedit.block_socket_block module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.block_wire\">bdedit.block_wire module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.interface\">bdedit.interface module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.interface_graphics_scene\">bdedit.interface_graphics_scene module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.interface_graphics_view\">bdedit.interface_graphics_view module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.interface_scene\">bdedit.interface_scene module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit.interface_serialize\">bdedit.interface_serialize module</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#module-bdedit\">Module contents</a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n\n            \n          \n        </div>\n        \n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\">\n\n      \n      <nav class=\"wy-nav-top\" aria-label=\"top navigation\">\n        \n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">BdEdit</a>\n        \n      </nav>\n\n\n      <div class=\"wy-nav-content\">\n        \n        <div class=\"rst-content\">\n        \n          \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<div role=\"navigation\" aria-label=\"breadcrumbs navigation\">\n\n  <ul class=\"wy-breadcrumbs\">\n    \n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n        \n          <li><a href=\"modules.html\">bdedit</a> &raquo;</li>\n        \n      <li>bdedit package</li>\n    \n    \n      <li class=\"wy-breadcrumbs-aside\">\n        \n          \n            <a href=\"_sources/bdedit.rst.txt\" rel=\"nofollow\"> View page source</a>\n          \n        \n      </li>\n    \n  </ul>\n\n  \n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n            \n  <div class=\"section\" id=\"bdedit-package\">\n<h1>bdedit package<a class=\"headerlink\" href=\"#bdedit-package\" title=\"Permalink to this headline\">¶</a></h1>\n<div class=\"section\" id=\"submodules\">\n<h2>Submodules<a class=\"headerlink\" href=\"#submodules\" title=\"Permalink to this headline\">¶</a></h2>\n</div>\n<div class=\"section\" id=\"module-bdedit.Icons\">\n<span id=\"bdedit-icons-module\"></span><h2>bdedit.Icons module<a class=\"headerlink\" href=\"#module-bdedit.Icons\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py function\">\n<dt class=\"sig sig-object py\" id=\"bdedit.Icons.qCleanupResources\">\n<span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.Icons.</span></span><span class=\"sig-name descname\"><span class=\"pre\">qCleanupResources</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.Icons.qCleanupResources\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py function\">\n<dt class=\"sig sig-object py\" id=\"bdedit.Icons.qInitResources\">\n<span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.Icons.</span></span><span class=\"sig-name descname\"><span class=\"pre\">qInitResources</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.Icons.qInitResources\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.block\">\n<span id=\"bdedit-block-module\"></span><h2>bdedit.block module<a class=\"headerlink\" href=\"#module-bdedit.block\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">Block</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.interface_serialize.Serializable\" title=\"bdedit.interface_serialize.Serializable\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.interface_serialize.Serializable</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">Serializable</span></code> Class from BdEdit, and\ndefines how a block is represented, and has all the necessary methods\nfor creating, manipulating and interacting with a block.</p>\n<p>This class includes information about the blocks’:</p>\n<ul class=\"simple\">\n<li><p>name;</p></li>\n<li><p>type;</p></li>\n<li><p>appearance;</p></li>\n<li><p>on-screen positioning;</p></li>\n<li><p>parameters, and their values;</p></li>\n<li><p>number of inputs and outputs.</p></li>\n</ul>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> Class.\nIt maps the following internal parameters of the block, initializing\nthem to their defaults values. These are overwritten when an instance of\nthe grandchild block is created. The parameters are defined as:</p>\n<ul class=\"simple\">\n<li><p>title: the name of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.\nThis defaults to the name of the name of the grandchild class, and\nis incremented if an instance with the same default name already exists.</p></li>\n<li><p>type: the type of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.\nThis defaults to the type of the grandchild class, and is determined\nthrough calling blockname(self.__class__) when a grandchild class is created.</p></li>\n<li><p>icon: the icon for this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.\nThis is a locally referenced string filepath, defined within the grandchild class.</p></li>\n<li><p>inputs: a list of containing input <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> relating to this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.\nThe number of input sockets is restricted to 0 or n based on the inputsNum\nvariable defined within the child class.</p></li>\n<li><p>outputs: a list of containing output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> relating to this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.\nThe number of output sockets is restricted to 0 or n based on the outputsNum\nvariable defined within the child class.</p></li>\n<li><p>parameters: a list of editable parameters relating to this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.\nThis defaults to the list defined within the grandchild class, but follows\nthe following structure of being a list of lists, where each ‘lists’ is a list\ndefining the parameter as below:</p>\n<ul>\n<li><p>parameters = [“name”, type, value, [restrictions]]\ne.g. parameters = [[“Gain”, float, gain, []], [“Premul”, bool, premul, []]]</p></li>\n<li><p>name: is the name of the variable as a string</p></li>\n<li><p>type: is the required type the variable should be (e.g. int, str, float)</p></li>\n<li><p>value: is the default value the variable is set to should one not be provided</p></li>\n<li><p>restrictions: is a list (can be list of lists) containing further restrictions\napplied to the parameter. These restrictions follow the following structure, of\nbeing a list with a string as the first list element, followed by a list of\nconditions being applied to the parameter as the second list element:</p>\n<ul>\n<li><p>restriction = [“restriction name”, [condition(s)]]</p></li>\n<li><p>restriction name: can be only one of the following “keywords”, “range”, “type”\nor “signs”.</p></li>\n<li><p>condition(s): differ based on the restriction name used, and will be of the\nfollowing format:</p>\n<ul>\n<li><p>for keywords: a list of string words the parameter must exactly match to,\ne.g. [“keywords”, [“sine”, “square”, “triangle”]]</p></li>\n<li><p>for range: a list containing a min and max allowable value for this parameter,\ne.g. [“range”, [0, 1000]] or [“range”, [-math.inf, math.inf]]</p></li>\n<li><p>for type: a list containing alternative types, with the last value repeating\nthe initial type required for this parameter,\ne.g. [“type”, [type(None), tuple]] (initial type = tuple) or [“type”, [type(None), bool]] (initial type = bool)</p></li>\n<li><p>for signs: a list containing each allowable character this parameter can match,\ne.g. [“signs”, [“*”, “/”]] or [“signs”, [“+”, “-“]]\ncurrently this is used for drawing signs along certain input sockets, so only these characters are supported,</p></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – a scene (or canvas) in which the Block is stored and\nshown (or painted into). Provided by the <code class=\"docutils literal notranslate\"><span class=\"pre\">Interface</span></code>.</p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – layout information of where all <code class=\"docutils literal notranslate\"><span class=\"pre\">Widgets</span></code> are located\nin the bdedit window. Provided by the <code class=\"docutils literal notranslate\"><span class=\"pre\">Interface</span></code>.</p></li>\n<li><p><strong>name</strong> (<em>str</em><em>, </em><em>optional</em>) – set to grandchild class’s default name “__class__.__name__ Block” when it is created</p></li>\n<li><p><strong>pos</strong> (<em>tuple of 2-ints</em><em>, </em><em>optional</em>) – (x,y) coordinates of the block’s positioning within the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, defaults to (0,0)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.closeParamWindow\">\n<span class=\"sig-name descname\"><span class=\"pre\">closeParamWindow</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.closeParamWindow\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method closes the <code class=\"docutils literal notranslate\"><span class=\"pre\">ParamWindow</span></code> of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.deserialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">deserialize</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">data</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">hashmap</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">{}</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.deserialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to reconstruct a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> when loading a saved JSON\nfile containing all relevant information to recreate the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> with all\nits items.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>data</strong> (<em>OrderedDict</em><em>, </em><em>required</em>) – a Dictionary of essential information for reconstructing a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>hashmap</strong> (<em>Dict</em><em>, </em><em>required</em>) – a Dictionary for directly mapping the essential block parameters\nto this instance of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, without having to individually map each parameter</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>True when completed successfully</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Boolean</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.getSocketPosition\">\n<span class=\"sig-name descname\"><span class=\"pre\">getSocketPosition</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">index</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">position</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.getSocketPosition\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to determine the coordinates of where a given <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code>\nshould be positioned on the sides of the this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. The returned\ncoordinates are in reference to the coordinates of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>index</strong> (<em>int</em><em>, </em><em>required</em>) – the index of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> in the list of sockets for this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>position</strong> – the (LEFT(1) or RIGHT(3)) side of the block this socket</p></li>\n</ul>\n</dd>\n</dl>\n<p>should be displayed on.\n:type position: enumerate, required\n:return: the [x,y] coordinates at which to place this <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> instance.\n:rtype: list of int, int</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.makeInputSockets\">\n<span class=\"sig-name descname\"><span class=\"pre\">makeInputSockets</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">inputs</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">position</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">socketType</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">1</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.makeInputSockets\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to create a number of input <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> for this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>inputs</strong> (<em>int</em><em>, </em><em>required</em>) – number of input sockets to create</p></li>\n<li><p><strong>position</strong> – an enum representing the position of where to place</p></li>\n</ul>\n</dd>\n</dl>\n<p>the <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> on the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> currently only supports LEFT (1), or RIGHT (3).\n:type position: enumerate, required\n:param socketType: an enum representing the type of <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> to create.\nThis is used for the graphics of the socket, but was also intended to be used\nto reduce two methods for creating input and output sockets, to a single method.\n:type socketType: enumerate, optional, defaults to INPUT(1)</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.makeOutputSockets\">\n<span class=\"sig-name descname\"><span class=\"pre\">makeOutputSockets</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">outputs</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">position</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">socketType</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">2</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.makeOutputSockets\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to create a number of outputs <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> for this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>outputs</strong> (<em>int</em><em>, </em><em>required</em>) – number of output sockets to create</p></li>\n<li><p><strong>position</strong> – an enum representing the position of where to place</p></li>\n</ul>\n</dd>\n</dl>\n<p>the <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> on the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> currently only supports LEFT (1), or RIGHT (3).\n:type position: enumerate, required\n:param socketType: an enum representing the type of <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> to create.\nThis is used for the graphics of the socket, but was also intended to be used\nto reduce two methods for creating input and output sockets, to a single method.\n:type socketType: enumerate, optional, defaults to OUTPUT(2)</p>\n</dd></dl>\n\n<dl class=\"py property\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.pos\">\n<em class=\"property\"><span class=\"pre\">property</span> </em><span class=\"sig-name descname\"><span class=\"pre\">pos</span></span><a class=\"headerlink\" href=\"#bdedit.block.Block.pos\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to access the positional coordinates of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nin terms of where it is displayed within the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code></p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>the (x,y) coordinates of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>tuple (int, int)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.remove\">\n<span class=\"sig-name descname\"><span class=\"pre\">remove</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.remove\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to remove:</p>\n<ul class=\"simple\">\n<li><p>the selected <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> instance;</p></li>\n<li><p>any sockets associated with this Block;</p></li>\n<li><p>any wires that were connected to this Blocks’ sockets; and</p></li>\n<li><p>the parameter window associated with this Block (if one existed).</p></li>\n</ul>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.removeSockets\">\n<span class=\"sig-name descname\"><span class=\"pre\">removeSockets</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">type</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.removeSockets\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method removes all sockets of given type, associated with this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>type</strong> – the type of <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> to remove (“Input” for input type,</p>\n</dd>\n</dl>\n<p>“Output” for output type)\n:type type: str, required</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.serialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">serialize</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.serialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to create an ordered dictionary of all of this Blocks’\nparameters - necessary for the reconstruction of this Block - as key-value\npairs. This dictionary is later used for writing into a JSON file.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>an <code class=\"docutils literal notranslate\"><span class=\"pre\">OrderedDict</span></code> of [keys, values] pairs of all essential <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nparameters.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p><code class=\"docutils literal notranslate\"><span class=\"pre\">OrderedDict</span></code> ([keys, values]*)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.setDefaultTitle\">\n<span class=\"sig-name descname\"><span class=\"pre\">setDefaultTitle</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">increment</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.setDefaultTitle\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to give a block a generic name, and if that name\nalready exists, to increment it by 1.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>name</strong> (<em>str</em><em>, </em><em>required</em>) – the generic name to be given to this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>increment</strong> – the number to display next to the generic name, to make</p></li>\n</ul>\n</dd>\n</dl>\n<p>it unique. Defaults to None if this is the first instance of this block type.\n:type increment: int, optional</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.setFocusOfBlocks\">\n<span class=\"sig-name descname\"><span class=\"pre\">setFocusOfBlocks</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.setFocusOfBlocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sends all <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> instances within the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> to back\nand then sends the currently selected <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> instance to front.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.setPos\">\n<span class=\"sig-name descname\"><span class=\"pre\">setPos</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">x</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">y</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.setPos\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to set the positional coordinates of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nin terms of where it is displayed within the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code></p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>x</strong> (<em>int</em><em>, </em><em>required</em>) – the x coordinate of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>y</strong> (<em>int</em><em>, </em><em>required</em>) – the y coordinate of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.setTitle\">\n<span class=\"sig-name descname\"><span class=\"pre\">setTitle</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.setTitle\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to determine if a this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> can be named with the\nprovided name. It applies logic to check if the given name of type <cite>str</cite>,\nand if no other <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> instance already has the given name. If either of\nthese conditions are not met, the user will be notified to provide a\ndifferent name.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>name</strong> – given name to be set for this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, defaults to None if</p>\n</dd>\n</dl>\n<p>not provided\n:type name: str, optional\n:return: - nothing (if name successfully set);</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>[duplicate error message, given name] (if duplicate found);</p></li>\n<li><p>invalid type error message (if name is not of type <cite>str</cite>).</p></li>\n</ul>\n</div></blockquote>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><ul class=\"simple\">\n<li><p>nothing (if name successfully set);</p></li>\n<li><p>list of [str, str] (if duplicate found);</p></li>\n<li><p>str (if name is not of type <cite>str</cite>).</p></li>\n</ul>\n</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.toggleParamWindow\">\n<span class=\"sig-name descname\"><span class=\"pre\">toggleParamWindow</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.toggleParamWindow\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method toggles the visibility of the <code class=\"docutils literal notranslate\"><span class=\"pre\">ParamWindow</span></code> of this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.tuple_decoder\">\n<em class=\"property\"><span class=\"pre\">static</span> </em><span class=\"sig-name descname\"><span class=\"pre\">tuple_decoder</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">obj</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.tuple_decoder\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called when deserializing a JSON file to generate a saved\ncopy of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> with all the Blocks, Sockets and Wires. It’s purpose\nis for decoding an encoded representation for a tuple (encoded with the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">TupleEncoder</span></code> Class) when the JSON file was written. This decoder/encoder\ncombination is required as JSON does not support saving under type tuple,\nand instead saves that information as a type list.</p>\n<p>This code has been adapted from: <a class=\"reference external\" href=\"https://stackoverflow.com/a/15721641\">https://stackoverflow.com/a/15721641</a></p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>obj</strong> (<em>Union</em><em> [</em><em>int</em><em>, </em><em>slice</em><em>]</em><em>, </em><em>required</em>) – the string object being decoded</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the string object wrapped as a tuple (if decoded to have a __tuple__ key)</p>\n</dd>\n</dl>\n<p>the string object (otherwise)\n:rtype: - tuple (if decoded to have a __tuple__ key);\n- any (otherwise)</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.updateConnectedEdges\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateConnectedEdges</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.updateConnectedEdges\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method calls for any and all <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> instances that are connected to\na <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> instance, to update where it is drawn TO and FROM.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.updateSocketPositions\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateSocketPositions</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.updateSocketPositions\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method updates flips the position (LEFT or RIGHT) of where the\ninput and output sockets needs to be placed within this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.\nAfter the positions of all the Blocks’ sockets are updated,\nthe updateConnectedEdges method is called to update the locations for\nwhere the wires connect to.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.Block.updateSocketSigns\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateSocketSigns</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.Block.updateSocketSigns\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>As some Blocks - namely the <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM</span></code> Blocks - have additional logic for\ndrawing signs (+,-,*,/) alongside the input sockets, this method updates\nthese signs of the socket, if the block type is a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM</span></code> Block</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.DiscreteBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">DiscreteBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Discrete</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.DiscreteBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">DiscreteBlock</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and parameters of its\nparent class and controls the number of input or output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> any\nsubclass (referred to as a grandchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) that inherits it has.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.DiscreteBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Discrete</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.DiscreteBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">DiscreteBlock</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> – overwritten to the name of grandchild class’s block name,</p></li>\n</ul>\n</dd>\n</dl>\n<p>defaults to “Unnamed Discrete Block”\n:type name: str, optional\n:param pos: inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\n:type pos: tuple of 2-ints, optional</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.DiscreteBlock.numInputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numInputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.DiscreteBlock.numInputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of input sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.DiscreteBlock.numOutputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numOutputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.DiscreteBlock.numOutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of output sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.FunctionBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">FunctionBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Function</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.FunctionBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">FunctionBlock</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and parameters of its\nparent class and controls the number of input or output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> any\nsubclass (referred to as a grandchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) that inherits it has.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.FunctionBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Function</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.FunctionBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">FunctionBlock</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> – overwritten to the name of grandchild class’s block name,</p></li>\n</ul>\n</dd>\n</dl>\n<p>defaults to “Unnamed Function Block”\n:type name: str, optional\n:param pos: inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\n:type pos: tuple of 2-ints, optional</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.FunctionBlock.numInputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numInputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.FunctionBlock.numInputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of input sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.FunctionBlock.numOutputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numOutputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.FunctionBlock.numOutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of output sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.INPORTBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">INPORTBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">INPORT</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.INPORTBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">INPORTBlock</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and parameters of its\nparent class and controls the number of input or output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> any\nsubclass (referred to as a grandchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) that inherits it has.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.INPORTBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">INPORT</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.INPORTBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">INPORTBlock</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> (<em>str</em><em>, </em><em>optional</em>) – overwritten to the name of grandchild class’s block name,\ndefaults to “Unnamed INPORT Block”</p></li>\n<li><p><strong>pos</strong> (<em>tuple of 2-ints</em><em>, </em><em>optional</em>) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.INPORTBlock.numInputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numInputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.INPORTBlock.numInputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of input sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.INPORTBlock.numOutputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numOutputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.INPORTBlock.numOutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of output sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.OUTPORTBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">OUTPORTBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">OUTPORT</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.OUTPORTBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">OUTPORTBlock</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and parameters of its\nparent class and controls the number of input or output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> any\nsubclass (referred to as a grandchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) that inherits it has.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.OUTPORTBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">OUTPORT</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.OUTPORTBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">OUTPORTBlock</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> – overwritten to the name of grandchild class’s block name,</p></li>\n</ul>\n</dd>\n</dl>\n<p>defaults to “Unnamed OUTPORT Block”\n:type name: str, optional\n:param pos: inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\n:type pos: tuple of 2-ints, optional</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.OUTPORTBlock.numInputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numInputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.OUTPORTBlock.numInputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of input sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.OUTPORTBlock.numOutputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numOutputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.OUTPORTBlock.numOutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of output sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SUBSYSTEMBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">SUBSYSTEMBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">SUBSYSTEM</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SUBSYSTEMBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">SUBSYSTEMBlock</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and parameters of its\nparent class and controls the number of input or output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> any\nsubclass (referred to as a grandchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) that inherits it has.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SUBSYSTEMBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">SUBSYSTEM</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SUBSYSTEMBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">SUBSYSTEMBlock</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> – overwritten to the name of grandchild class’s block name,</p></li>\n</ul>\n</dd>\n</dl>\n<p>defaults to “Unnamed SUBSYSTEM Block”\n:type name: str, optional\n:param pos: inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\n:type pos: tuple of 2-ints, optional</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SUBSYSTEMBlock.numInputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numInputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SUBSYSTEMBlock.numInputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of input sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SUBSYSTEMBlock.numOutputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numOutputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SUBSYSTEMBlock.numOutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of output sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SinkBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">SinkBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Sink</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SinkBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">SinkBlock</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and parameters of its\nparent class and controls the number of input or output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> any\nsubclass (referred to as a grandchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) that inherits it has.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SinkBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Sink</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SinkBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">SinkBlock</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> – overwritten to the name of grandchild class’s block name,</p></li>\n</ul>\n</dd>\n</dl>\n<p>defaults to “Unnamed Sink Block”\n:type name: str, optional\n:param pos: inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\n:type pos: tuple of 2-ints, optional</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SinkBlock.numInputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numInputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SinkBlock.numInputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of input sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SinkBlock.numOutputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numOutputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SinkBlock.numOutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of output sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SourceBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">SourceBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Source</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SourceBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">SourceBlock</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and parameters of its\nparent class and controls the number of input or output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> any\nsubclass (referred to as a grandchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) that inherits it has.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SourceBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Source</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SourceBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">SourceBlock</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> – overwritten to the name of grandchild class’s block name,</p></li>\n</ul>\n</dd>\n</dl>\n<p>defaults to “Unnamed Source Block”\n:type name: str, optional\n:param pos: inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\n:type pos: tuple of 2-ints, optional</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SourceBlock.numInputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numInputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SourceBlock.numInputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of input sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.SourceBlock.numOutputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numOutputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.SourceBlock.numOutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of output sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.TransferBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">TransferBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Transfer</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.TransferBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">TransferBlock</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and parameters of its\nparent class and controls the number of input or output <code class=\"docutils literal notranslate\"><span class=\"pre\">Sockets</span></code> any\nsubclass (referred to as a grandchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) that inherits it has.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.TransferBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Transfer</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.TransferBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">TransferBlock</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> – overwritten to the name of grandchild class’s block name,</p></li>\n</ul>\n</dd>\n</dl>\n<p>defaults to “Unnamed Transfer Block”\n:type name: str, optional\n:param pos: inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\n:type pos: tuple of 2-ints, optional</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.TransferBlock.numInputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numInputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.TransferBlock.numInputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of input sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.TransferBlock.numOutputs\">\n<span class=\"sig-name descname\"><span class=\"pre\">numOutputs</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.TransferBlock.numOutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the number of output sockets this Block has.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>number of input sockets associated with this Block.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.TupleEncoder\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">TupleEncoder</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\"><span class=\"pre\">*</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">skipkeys</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">False</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">ensure_ascii</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">True</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">check_circular</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">True</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">allow_nan</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">True</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">sort_keys</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">False</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">indent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">separators</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">default</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.TupleEncoder\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">json.encoder.JSONEncoder</span></code></p>\n<p>This Class inherits JSONEncoder from the json library, and is used to encode\nuser-editable parameters associated with a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> which need to be stored\nas a type tuple. This code is necessary as JSON does not support storing\ndata as tuples. After the encoder has been used to serialize (save) the\nBlock parameter data, when the Block is deserialized (loaded), this encoded\nrepresentation of a tuple will be decoded and stored as a tuple.</p>\n<p>This code is adapted from: <a class=\"reference external\" href=\"https://stackoverflow.com/a/15721641\">https://stackoverflow.com/a/15721641</a></p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.TupleEncoder.encode\">\n<span class=\"sig-name descname\"><span class=\"pre\">encode</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">item</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.TupleEncoder.encode\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method determines whether a given user-editable block parameter\nis of type tuple, and converts it to a dictionary with a “__tuple__”\nkey with value <cite>True</cite> (signifying this parameter should be represented\nas a tuple), and an “item’s” key with value <cite>item</cite> (this being the\nvalue of the user-editable parameter).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>item</strong> (<em>any</em>) – the user-editable parameter’s value</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p><ul class=\"simple\">\n<li><p>a Dictionary defined as above (if item is tuple);</p></li>\n<li><p>the item (otherwise)</p></li>\n</ul>\n</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><ul class=\"simple\">\n<li><p>Dict (if item is tuple);</p></li>\n<li><p>any (otherwise)</p></li>\n</ul>\n</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py function\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.block\">\n<span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">block</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">cls</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.block\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called whenever a grandchild class of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> is called,\nadding it to a list of usable blocks.</p>\n<p>This code has been adapted from: <a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/blob/bdedit/bdsim/components.py\">https://github.com/petercorke/bdsim/blob/bdedit/bdsim/components.py</a></p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>cls</strong> (<em>Class</em><em>, </em><em>required</em>) – the class of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> Class’s grandchild block Class.</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py function\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block.blockname\">\n<span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">blockname</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">cls</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block.blockname\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method strips any underscores from a grandchild Class of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nClass, and capitalizes the Class.__name__ to be used as the the Class’s name.</p>\n<p>This code has been adapted from: <a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/blob/bdedit/bdsim/bdsim.py\">https://github.com/petercorke/bdsim/blob/bdedit/bdsim/bdsim.py</a></p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>cls</strong> (<em>Class</em><em>, </em><em>required</em>) – the class of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> Class’s grandchild block Class.</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a reformatted string of the block’s class name</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>str</p>\n</dd>\n</dl>\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.block_graphics_block\">\n<span id=\"bdedit-block-graphics-block-module\"></span><h2>bdedit.block_graphics_block module<a class=\"headerlink\" href=\"#module-bdedit.block_graphics_block\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_graphics_block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">block</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">PyQt5.QtWidgets.QGraphicsItem</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">QGraphicsItem</span></code> Class from PyQt5.\nThis class is responsible for graphically drawing Blocks within the GraphicsScene.\nUsing the provided Block dimensions, it specifies the Blocks’ shape and colour.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">block</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code> Class.\nIt inherits the dimensions of its Block, and defines its shape and colour.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>block</strong> (<a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><em>Block</em></a><em>, </em><em>required</em>) – the Block this GraphicsBlock instance relates to</p></li>\n<li><p><strong>parent</strong> (<em>NoneType</em><em>, </em><em>optional</em><em>, </em><em>defaults to None</em>) – the parent widget this class instance belongs to (None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.boundingRect\">\n<span class=\"sig-name descname\"><span class=\"pre\">boundingRect</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.boundingRect\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code>\nwhich returns the area within which the GraphicsBlock can be interacted with.\nWhen a mouse click event is detected within this area, this will trigger logic\nthat relates to a Block (that being, selecting/deselecting, moving, deleting,\nflipping or opening a parameter window).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>a rectangle within which the Block can be interacted with</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>QRectF</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.checkBlockHeight\">\n<span class=\"sig-name descname\"><span class=\"pre\">checkBlockHeight</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.checkBlockHeight\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method checks if the current height of the Block is enough to fit all\nthe Sockets that are to be drawn, while following the set socket spacing.\nIt also handles the resizing of the Block (if there isn’t enough space for\nall the sockets), ensuring the sockets are evenly spaced while following\nthe set socket spacing.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.checkMode\">\n<span class=\"sig-name descname\"><span class=\"pre\">checkMode</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.checkMode\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method checks the mode of the GraphicsScene’s background (Light, Dark)\nand updates the colour mode of the pens and brushes used to paint this Block.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.getTitle\">\n<span class=\"sig-name descname\"><span class=\"pre\">getTitle</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.getTitle\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the current title of this Block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>Block title</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>str</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.initTitle\">\n<span class=\"sig-name descname\"><span class=\"pre\">initTitle</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.initTitle\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes a QGraphicsTextItem which will graphically represent\nthe title (name) of this Block.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.initUI\">\n<span class=\"sig-name descname\"><span class=\"pre\">initUI</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.initUI\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets flags to allow for this Block to be movable and selectable.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.mouseMoveEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">mouseMoveEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.mouseMoveEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code> to detect, and assign logic to mouse movement.</p>\n<p>Currently, the following logic is applied to the Block on mouse movement:</p>\n<ul class=\"simple\">\n<li><p>a detected mouse move event on this GraphicsBlock will enforce grid-snapping\non the selected GraphicsBlock (making it move only in increments of the same\nsize as the smaller grid squares of the background).</p></li>\n<li><p>the selected GraphicsBlock will be prevented from moving outside the maximum\nzoomed out border of the work area (the GraphicsScene).</p></li>\n<li><p>the connection points of any wires connected to the selected block AND any\nother block it is connected to, will be updated, as the block is moved around.</p></li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseMoveEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a mouse movement event</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.mousePressEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">mousePressEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.mousePressEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code> to detect, and assign logic to a right mouse press event.</p>\n<p>Currently a detected mouse press event on the GraphicsBlock will select\nor deselect it.</p>\n<ul class=\"simple\">\n<li><p>If selected, the GraphicsBlock will be sent to front and will appear on\ntop of other blocks.</p></li>\n<li><p>Additionally, if the right mouse button is pressed and a GraphicsBlock\nis selected, a parameter window will be toggled for this Block.</p></li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMousePressEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a mouse press event (Left, Middle or Right)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.paint\">\n<span class=\"sig-name descname\"><span class=\"pre\">paint</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">painter</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">style</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">widget</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.paint\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code>.\nThis method is automatically called by the GraphicsView Class whenever even\na slight user-interaction is detected within the Scene.</p>\n<p>Before drawing, the dimensions of the Block are checked, to ensure they can\nhold all the necessary Sockets. Then the following are drawn in order:</p>\n<ul class=\"simple\">\n<li><p>the title of the block</p></li>\n<li><p>the fill of the block (a rounded rectangle)</p></li>\n<li><p>the outline of the block (a rounded rectangle)</p></li>\n<li><p>the icon of the block (if one exists)</p></li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>painter</strong> (<em>QPainter</em><em>, </em><em>automatically recognized and overwritten from this method</em>) – a painter (paint brush) that paints and fills the shape of this GraphicsBlock</p></li>\n<li><p><strong>style</strong> (<em>QStyleOptionGraphicsItem</em><em>, </em><em>automatically recognized from this method</em>) – style of the painter (isn’t used but must be defined)</p></li>\n<li><p><strong>widget</strong> (<em>NoneType</em><em>, </em><em>optional</em><em>, </em><em>defaults to None</em>) – the widget this class is being painted on (None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.setTitle\">\n<span class=\"sig-name descname\"><span class=\"pre\">setTitle</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.setTitle\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method updates this Blocks’ graphical title to the stored title of the Block.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.titleLength\">\n<span class=\"sig-name descname\"><span class=\"pre\">titleLength</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.titleLength\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method calculates and returns the length of this Blocks’ title in pixels.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>the pixel length of this Blocks’ title</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsBlock.updateMode\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateMode</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">value</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsBlock.updateMode\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method updates the mode of the Block to the provided value (should only\never be “Light”, “Dark” or “Off”).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>value</strong> (<em>str</em><em>, </em><em>required</em>) – current mode of the GraphicsScene’s background (“Light”, “Dark”, “Off”)</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsSocketBlock\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_graphics_block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsSocketBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">block</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsSocketBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">PyQt5.QtWidgets.QGraphicsItem</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocketBlock</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">QGraphicsItem</span></code> Class from PyQt5.\nThis class is responsible for graphically drawing Connector Blocks within the\nGraphicsScene.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsSocketBlock.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">block</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsSocketBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocketBlock</span></code> Class\n(otherwise known as the Graphics Class of the Connector Block).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>block</strong> (<em>Connector Block</em>) – the Connector Block this GraphicsSocketBlock instance relates to</p></li>\n<li><p><strong>parent</strong> (<em>NoneType</em><em>, </em><em>optional</em><em>, </em><em>defaults to None</em>) – the parent widget this class instance belongs to (None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsSocketBlock.boundingRect\">\n<span class=\"sig-name descname\"><span class=\"pre\">boundingRect</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsSocketBlock.boundingRect\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocketBlock</span></code>\nwhich returns the area within which the GraphicsSocketBlock can be interacted with.\nWhen a mouse click event is detected within this area, this will trigger logic\nthat relates to a Block (that being, selecting/deselecting, moving, deleting,\nflipping or opening a parameter window. Or if its Sockets are clicked on,\nthis will trigger a wire to be created or ended).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>a rectangle within which the Block can be interacted with</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>QRectF</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsSocketBlock.initUI\">\n<span class=\"sig-name descname\"><span class=\"pre\">initUI</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsSocketBlock.initUI\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets flags to allow for this Connector Block to be movable and selectable.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsSocketBlock.mouseMoveEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">mouseMoveEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsSocketBlock.mouseMoveEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocketBlock</span></code> to detect, and assign logic to mouse movement.</p>\n<p>Currently, the following logic is applied to the Connector Block on mouse movement:</p>\n<ul class=\"simple\">\n<li><p>a detected mouse move event on this GraphicsSocketBlock will enforce\ngrid-snapping on the selected GraphicsSocketBlock (making it move only\nin increments of the same size as the smaller grid squares of the background).</p></li>\n<li><p>the selected GraphicsSocketBlock will be prevented from moving outside the\nmaximum zoomed out border of the work area (the GraphicsScene).</p></li>\n<li><p>the connection points of any wires connected to the selected Connector Block AND any\nother block it is connected to, will be updated, as the block is moved around.</p></li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseMoveEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a mouse movement event</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsSocketBlock.mousePressEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">mousePressEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsSocketBlock.mousePressEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocketBlock</span></code> to detect, and assign logic to a right mouse press event.</p>\n<p>Currently a detected mouse press event on the GraphicsSocketBlock will\nselect or deselect it.</p>\n<p>Additionally if selected, the GraphicsBlock will be sent to front and will\nappear on top of other blocks.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMousePressEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a mouse press event (Left, Middle or Right)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_block.GraphicsSocketBlock.paint\">\n<span class=\"sig-name descname\"><span class=\"pre\">paint</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">painter</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">style</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">widget</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_block.GraphicsSocketBlock.paint\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocketBlock</span></code> (otherwise referred to as the Graphics Class of\nthe Connector Block. This method is automatically called by the GraphicsView\nClass whenever even a slight user-interaction is detected within the Scene.</p>\n<p>When the Connector Block is selected, this method will draw an orange\noutline around the Connector Block, within which it can be interacted with.</p>\n<p>:param painter:a painter (paint brush) that paints and fills the shape of this GraphicsSocketBlock\n:type painter: QPainter, automatically recognized and overwritten from this method\n:param style: style of the painter (isn’t used but must be defined)\n:type style: QStyleOptionGraphicsItem, automatically recognized from this method\n:param widget: the widget this class is being painted on (None)\n:type widget: NoneType, optional, defaults to None</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.block_graphics_socket\">\n<span id=\"bdedit-block-graphics-socket-module\"></span><h2>bdedit.block_graphics_socket module<a class=\"headerlink\" href=\"#module-bdedit.block_graphics_socket\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_graphics_socket.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsSocket</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">socket</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">PyQt5.QtWidgets.QGraphicsItem</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocket</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">QGraphicsItem</span></code> Class from PyQt5.\nThis class is responsible for graphically drawing Sockets on Blocks. It\nspecifies the shape, colour, style and dimensions of the Socket and also\nimplements the logic for drawing signs alongside the input sockets of <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD</span></code>\nand <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM`</span></code> Blocks.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">socket</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocket</span></code> Class. It\ndefines the shapes and sizes for a given input or output Socket. Depending\non the socket_type, stored within the provided Socket, the shape and colour\nof the given Socket is decided.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>socket</strong> (<a class=\"reference internal\" href=\"#bdedit.block_socket.Socket\" title=\"bdedit.block_socket.Socket\"><em>Socket</em></a>) – the Socket this GraphicsSocket instance relates to</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket.boundingRect\">\n<span class=\"sig-name descname\"><span class=\"pre\">boundingRect</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket.boundingRect\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocket</span></code>\nwhich returns the area within which the GraphicsSocket can be interacted with.\nWhen a mouse click event is detected within this area, this will trigger logic\nthat relates to a Socket (that being, the generating or completion of a Wire).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>a rectangle within which the Socket can be interacted with</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>QRectF</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket.getSignPath\">\n<span class=\"sig-name descname\"><span class=\"pre\">getSignPath</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">sign</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">multi</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket.getSignPath\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method determines and returns what method should be called to paint\nthe sign (+,-,*,/) next to an input socket (for PROD and SUM blocks only).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>sign</strong> (<em>str</em><em>, </em><em>required</em>) – the sign associated with the current Socket (can be ‘+’,’-‘,’*’, or ‘/’)</p></li>\n<li><p><strong>multi</strong> (<em>int</em><em>, </em><em>required</em><em>, </em><em>1</em><em> or </em><em>-1</em>) – internal variable (1 when default orientation, -1 when flipped)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the relevant painter path method for drawing the desired sign</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>QPainterPath</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket.paint\">\n<span class=\"sig-name descname\"><span class=\"pre\">paint</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">painter</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">style</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">widget</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket.paint\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocket</span></code>.\nThis method is automatically called by the GraphicsView Class whenever even\na slight user-interaction is detected within the Scene.</p>\n<p>It dictates how both input and output Sockets are painted on their relating Block.\nThe position at which to draw the Socket is determined internally by the Socket\nclass, so when the GraphicsSocket class paints the Socket, it is painted with\nrespects to the point where the Socket should be.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>painter</strong> (<em>QPainter</em><em>, </em><em>automatically recognized and overwritten from this method</em>) – a painter (paint brush) that paints and fills the shape of this GraphicsSocket</p></li>\n<li><p><strong>style</strong> (<em>QStyleOptionGraphicsItem</em><em>, </em><em>automatically recognized from this method</em>) – style of the painter (isn’t used but must be defined)</p></li>\n<li><p><strong>widget</strong> (<em>NoneType</em><em>, </em><em>optional</em><em>, </em><em>Defaults to None</em>) – the widget this class is being painted on (None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket.paintDivide\">\n<span class=\"sig-name descname\"><span class=\"pre\">paintDivide</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">multi</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket.paintDivide\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates a painter path for drawing a divide sign character next\nto an input socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>multi</strong> (<em>int</em><em>, </em><em>required</em><em>, </em><em>1</em><em> or </em><em>-1</em>) – internal variable (1 when default orientation, -1 when flipped)</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the painter path to draw this sign</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>QPainterPath</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket.paintMinus\">\n<span class=\"sig-name descname\"><span class=\"pre\">paintMinus</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">multi</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket.paintMinus\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates a painter path for drawing the ‘-‘ character next\nto an input socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>multi</strong> (<em>int</em><em>, </em><em>required</em><em>, </em><em>1</em><em> or </em><em>-1</em>) – internal variable (1 when default orientation, -1 when flipped)</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the painter path to draw this sign</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>QPainterPath</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket.paintMultiply\">\n<span class=\"sig-name descname\"><span class=\"pre\">paintMultiply</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">multi</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket.paintMultiply\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates a painter path for drawing the ‘x’ character next\nto an input socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>multi</strong> (<em>int</em><em>, </em><em>required</em><em>, </em><em>1</em><em> or </em><em>-1</em>) – internal variable (1 when default orientation, -1 when flipped)</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the painter path to draw this sign</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>QPainterPath</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_socket.GraphicsSocket.paintPlus\">\n<span class=\"sig-name descname\"><span class=\"pre\">paintPlus</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">multi</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_socket.GraphicsSocket.paintPlus\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates a painter path for drawing the ‘+’ character next\nto an input socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>multi</strong> (<em>int</em><em>, </em><em>required</em><em>, </em><em>1</em><em> or </em><em>-1</em>) – internal variable (1 when default orientation, -1 when flipped)</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the painter path to draw this sign</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>QPainterPath</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.block_graphics_wire\">\n<span id=\"bdedit-block-graphics-wire-module\"></span><h2>bdedit.block_graphics_wire module<a class=\"headerlink\" href=\"#module-bdedit.block_graphics_wire\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_graphics_wire.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsWire</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">PyQt5.QtWidgets.QGraphicsPathItem</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWire</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">QGraphicsPathItem</span></code> Class from PyQt5.\nThis class is responsible for graphically drawing Wires between Sockets.</p>\n<p>This class takes a Wire as an input and then looks for the coordinates of the\nstart and end socket defined within it. Then based on these coordinates,\nconnects them with a Wire of the selected type. It is also used to redraw\nthe wires when they are moved around, and if a wire is selected it will\nredraw the wire thicker and in a different colour.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWire</span></code> Class. It\ninitially specifies the starting and ending sockets as being None, sets\nthe Wire to always be drawn underneath other items within the GraphicsScene,\nand defines the colors with which the wire can be drawn.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>wire</strong> (<a class=\"reference internal\" href=\"#bdedit.block_wire.Wire\" title=\"bdedit.block_wire.Wire\"><em>Wire</em></a>) – the Wire Class instance this GraphicsWire relates to</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.paint\">\n<span class=\"sig-name descname\"><span class=\"pre\">paint</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">painter</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">style</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">widget</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.paint\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsItem, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWire</span></code>.\nThis method is automatically called by the GraphicsView Class whenever even\na slight user-interaction is detected within the Scene.</p>\n<p>It sets up the painter object and draws the line based on the path that\nwill be set by the specific implementation of GraphicsWire that is\ncalling paint. Then the painter will select the way the wire will be\ndrawn depending on whether or not the wire is selected.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>painter</strong> (<em>QPainter</em><em>, </em><em>automatically recognized and overwritten from this method</em>) – a painter that paints the path (line) of this GraphicsWire</p></li>\n<li><p><strong>style</strong> (<em>QStyleOptionGraphicsItem</em><em>, </em><em>automatically recognized from this method</em>) – style of the painter (isn’t used but must be defined)</p></li>\n<li><p><strong>widget</strong> (<em>NoneType</em><em>, </em><em>optional</em><em>, </em><em>Defaults to None</em>) – the widget this class is being painted on (None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.setDestination\">\n<span class=\"sig-name descname\"><span class=\"pre\">setDestination</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">x</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">y</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.setDestination\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets the point of where the Wire will end. This is\nbased on the position of the end Socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>x</strong> (<em>int</em><em>, </em><em>required</em>) – x coordinate of the end Socket</p></li>\n<li><p><strong>y</strong> (<em>int</em><em>, </em><em>required</em>) – y coordinate of the end Socket</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.setDestinationOrientation\">\n<span class=\"sig-name descname\"><span class=\"pre\">setDestinationOrientation</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">orientation</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.setDestinationOrientation\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets the orientation (position) of the destination (end)\nSocket - in terms of where it is drawn on the block (LEFT/RIGHT) - to\nthe provided orientation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>orientation</strong> (<em>enumerate</em><em>, </em><em>required</em>) – where on the Block the end Socket is drawn (LEFT(1) or RIGHT(2))</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.setSource\">\n<span class=\"sig-name descname\"><span class=\"pre\">setSource</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">x</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">y</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.setSource\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets the point from where the Wire will start. This is\nbased on the position of the start Socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>x</strong> (<em>int</em><em>, </em><em>required</em>) – x coordinate of the start Socket</p></li>\n<li><p><strong>y</strong> (<em>int</em><em>, </em><em>required</em>) – y coordinate of the start Socket</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.setSourceOrientation\">\n<span class=\"sig-name descname\"><span class=\"pre\">setSourceOrientation</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">orientation</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.setSourceOrientation\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets the orientation (position) of the source (start)\nSocket - in terms of where it is drawn on the block (LEFT/RIGHT) - to\nthe provided orientation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>orientation</strong> (<em>enumerate</em><em>, </em><em>required</em>) – where on the Block the start Socket is drawn (LEFT(1) or RIGHT(2))</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.updateLineSegments\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateLineSegments</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.updateLineSegments\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method uses the coordinates of the points this wire goes through, to\ndetermine the coordinates that make up the horizontal and vertical line\nsegments of this wire (this logic is only applicable to GraphicsWireStep).</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.updatePath\">\n<span class=\"sig-name descname\"><span class=\"pre\">updatePath</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.updatePath\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is inherited and overwritten (currently) by the GraphicsWireDirect,\nGraphicsWireBezier or GraphicsWireStep classes, which dictate the pathing\nlogic of the wire between the start and end socket.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWire.updateWireCoordinates\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateWireCoordinates</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">new_coordinates</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWire.updateWireCoordinates\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method checks if the list of coordinate points this wire passes through,\nhas changed and needs to be updated. This method reduces the computational\nresources required to otherwise re-write the list of coordinate points for\nthis wire, every time a user-interaction is detected within the GraphicsView.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>new_coordinates</strong> (<em>list</em>) – proposed coordinate points for this Wire</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWireBezier\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_graphics_wire.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsWireBezier</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWireBezier\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block_graphics_wire.GraphicsWire\" title=\"bdedit.block_graphics_wire.GraphicsWire\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block_graphics_wire.GraphicsWire</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWireBezier</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWire</span></code> Class from BdEdit.\nThis class is responsible for providing a bezier painter path that the\nGraphicsWire class should follow when drawing the Wire. This wire type option\nlooks good in the first direction it is drawn (e.g. left-to-right) but will not\nwrap logically when blocks are flipped or moved past each other (e.g. such that\nthe wire would now be right-to-left).</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWireBezier.updatePath\">\n<span class=\"sig-name descname\"><span class=\"pre\">updatePath</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWireBezier.updatePath\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates a painter path that connects two points (start/end sockets)\nwith a bezier line. This line is drawn as a cubic (think sine wave).</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWireDirect\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_graphics_wire.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsWireDirect</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWireDirect\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block_graphics_wire.GraphicsWire\" title=\"bdedit.block_graphics_wire.GraphicsWire\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block_graphics_wire.GraphicsWire</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWireDirect</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWire</span></code> Class from BdEdit.\nThis class is responsible for providing a straight painter path that the\nGraphicsWire class should follow when drawing the Wire. This wire type will draw\na straight line between two Sockets. It will take the shortest distance between\nthese two points, and will go through other Blocks to do so.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWireDirect.updatePath\">\n<span class=\"sig-name descname\"><span class=\"pre\">updatePath</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWireDirect.updatePath\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates a painter path that connects two points (start/end sockets)\nwith a straight line.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWireStep\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_graphics_wire.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsWireStep</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWireStep\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block_graphics_wire.GraphicsWire\" title=\"bdedit.block_graphics_wire.GraphicsWire\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block_graphics_wire.GraphicsWire</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWireStep</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWire</span></code> Class from BdEdit.\nThis class is responsible for providing a stepped painter path that the\nGraphicsWire class should follow when drawing the Wire. This is the default wire\nstyle used within BdEdit, and has the most supporting logic built around it.</p>\n<p>This wire option draws a straight line between two sockets when the two blocks\nside by side at equal heights, are connected with a wire in the middle.</p>\n<p>Otherwise if the two blocks are at varying heights, a stepped line will be drawn\nfrom the starting socket, with 90 degree bends at each point the wire must turn\nto reach the end socket.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_graphics_wire.GraphicsWireStep.updatePath\">\n<span class=\"sig-name descname\"><span class=\"pre\">updatePath</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_graphics_wire.GraphicsWireStep.updatePath\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates a painter path that connects two points (start/end sockets)\nwith a stepped line. This path is returned as a straight line if two blocks\nat equal heights, are connected with a wire on the inside of each of the blocks.\nOtherwise the path is returned as a stepped line with 90 degree bends at each\npoint the wire must turn.</p>\n<p>The logic for when this wire should turn is calculated internally. Please refer\nto the technical document accompanying the BdEdit code for visual explanations\nfor how this logic is determined.</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.block_param_window\">\n<span id=\"bdedit-block-param-window-module\"></span><h2>bdedit.block_param_window module<a class=\"headerlink\" href=\"#module-bdedit.block_param_window\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_param_window.ParamWindow\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_param_window.</span></span><span class=\"sig-name descname\"><span class=\"pre\">ParamWindow</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">block</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_param_window.ParamWindow\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">PyQt5.QtWidgets.QWidget</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">ParamWindow</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">QWidget</span></code> Class from PyQt5.\nThe ParamWindow Class controls:</p>\n<ul class=\"simple\">\n<li><p>how the parameter window appears visually,</p></li>\n<li><p>where it is located within the BdEdit application window,</p></li>\n<li><p>the displayed parameters from the Block the parameter window is related to,</p></li>\n<li><p>sanity checking on user-edits to the Block parameters,</p></li>\n<li><p>pop-up user feedback for successful or unsuccessful Block parameter edits.</p></li>\n</ul>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_param_window.ParamWindow.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">block</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_param_window.ParamWindow.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">ParamWindow</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>block</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>) – the Block this ParamWindow instance relates to</p></li>\n<li><p><strong>parent</strong> (<em>None</em><em>, </em><em>optional</em>) – the parent widget this ParamWindow belongs to (should be None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_param_window.ParamWindow.buildParamWindow\">\n<span class=\"sig-name descname\"><span class=\"pre\">buildParamWindow</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_param_window.ParamWindow.buildParamWindow\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method handles the building of the ParamWindow instance. These instances\nwill always look exactly the same in terms of the information they contain,\nhowever the Block parameters and the block type will vary depending on the Block\nthis ParamWindow relates to.</p>\n<p>The ParamWindow is built by adding items into the QWidget that represents this\nparameter window. For each item added into the QWidget, a label is displayed on\nthe left-hand-side, and either the non-editable value (label) is displayed on the\nright-hand-side, or an editable line is displayed and populated with the respective\nparameters’ current value.</p>\n<p>The ParamWindow is populated by, first, adding a non-editable line displaying the\nselected Blocks’ type. Next, the Blocks’ current title is added with an editable\nline. Following this, each Block parameter looped through and added with an editable\nline in which the current value of the Block parameter is populated. Changing this\nvalue will prompt the sanity checking of the value entered, which is handled by\nthe updateBlockParameters() method.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_param_window.ParamWindow.closeQMessageBox\">\n<span class=\"sig-name descname\"><span class=\"pre\">closeQMessageBox</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_param_window.ParamWindow.closeQMessageBox\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method closes a pop-up user-feedback message if one already exists\nwithin the parameter window. This prevents multiple messages from being\ndisplayed at the same time, and ensure the message the user sees, is the\nmost relevant one.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_param_window.ParamWindow.displayPopUpMessage\">\n<span class=\"sig-name descname\"><span class=\"pre\">displayPopUpMessage</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">title</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">text</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">messageType</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_param_window.ParamWindow.displayPopUpMessage\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method displays a pop-up user-feedback message within the parameter window,\nnotifying them of either a successful or unsuccessful update to the Blocks’\nparameters. This method will also trigger the message to auto-close, after 1.5\nseconds for a successful update, and after 5 seconds for an unsuccessful update.\nIf at any point the user updates the Block parameters before this time is elapsed,\nthe current (old) message will be removed and replaced by the most relevant message.\nAn unsuccessful update attempt will also issue an error sound when the message is\nopened.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>title</strong> (<em>str</em>) – the title of the message box displayed</p></li>\n<li><p><strong>text</strong> (<em>str</em>) – the text that fills the body of the displayed message box</p></li>\n<li><p><strong>messageType</strong> (<em>str</em>) – variable that calls what type of message to display (“Success”, “Error”)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_param_window.ParamWindow.getSafeValue\">\n<em class=\"property\"><span class=\"pre\">static</span> </em><span class=\"sig-name descname\"><span class=\"pre\">getSafeValue</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">inputValue</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">requiredType</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">requiredOptions</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_param_window.ParamWindow.getSafeValue\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method takes an input value (which is the value a parameter is being checked\nif it can be updated to), and checks whether it matches an allowable type that\nhas been defined for that parameter within the grandchild Block Class. If the\ninput value doesn’t match the required type, an invalid type str will be returned.\nIf the input value does match the required type, it is further checked, whether\nit matches any further restrictions placed onto that parameter from within the\ngrandchild Block Class. If the value doesn’t meet the criteria of the restrictions,\na bad input str will be returned. If the input does match the criteria of the\nrestriction, it will be converted to the type it must be in and returned.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>inputValue</strong> (<em>str</em>) – the value which the parameter would be updated to</p></li>\n<li><p><strong>requiredType</strong> (<em>type</em><em>, </em><em>determined by the grandchild Block Class</em>) – the value type which is required for this parameter</p></li>\n<li><p><strong>requiredOptions</strong> (<em>list</em>) – a list of restrictions placed onto this parameter</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p><ul class=\"simple\">\n<li><p>str (if incompatible type or restriction criteria not met),</p></li>\n<li><p>requiredType (if compatible type and restrictions are met)</p></li>\n</ul>\n</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>type, determined by the grandchild Block Class</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_param_window.ParamWindow.initUI\">\n<span class=\"sig-name descname\"><span class=\"pre\">initUI</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_param_window.ParamWindow.initUI\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method adds a ‘Parameter Window’ label to the ParamWindow, sets the\nalignment of items within the parameter window, sets the background to\nauto fill, and finally, sets the layout manager of the ParamWindow.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_param_window.ParamWindow.updateBlockParameters\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateBlockParameters</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_param_window.ParamWindow.updateBlockParameters\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method calls for each of the parameters within the parameter window to be\nsanity checked by the getSafeValue() method, which determines whether or not\na provided value is compatible with the parameter type (defined in the Block\nClass) and is safe to override the current value. If that check is returned\nto be safe, this method will handle the updating of the Block parameters, as\nwell as triggering a successful update attempt message.</p>\n<p>If the check is returned as not safe, meaning the given value is not compatible,\nan unsuccessful update attempt error message will be prompted, notifying the\nuser of the incompatible parameter value they have set, and either what the\ncompatible types or values are. This logic also applies when a user changes the\nblocks’ title to one that already exists, which will cause a duplicate error\nmessage to display.</p>\n<p>Some parameters values directly affect the GraphicsBlock of the Block they relate\nto. For example, blocks that can have multiple input or output sockets, will\nhave a parameter that controls how many of these sockets the block has. And once\nedited, this method will trigger an appropriate number of sockets to be created\nor deleted. This parameter can also affect the GraphicsBlock when too many sockets\nare created, requiring the block to be resized. The triggering of this resizing\nwill also be issued from within this method.</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.block_socket\">\n<span id=\"bdedit-block-socket-module\"></span><h2>bdedit.block_socket module<a class=\"headerlink\" href=\"#module-bdedit.block_socket\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_socket.</span></span><span class=\"sig-name descname\"><span class=\"pre\">Socket</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">node</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">index</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">0</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">position</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">1</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">socket_type</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">1</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">multi_wire</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">True</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.interface_serialize.Serializable\" title=\"bdedit.interface_serialize.Serializable\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.interface_serialize.Serializable</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">Serializable</span></code> Class from BdEdit, and\ndefines how a socket is represented, and has all the necessary methods\nfor creating, manipulating and interacting with a socket. This class allows\nfor Wires to be connected to Blocks, while also controlling where on the\nBlock the Sockets are drawn, and how they appear.</p>\n<p>This class includes information about the sockets’:</p>\n<ul class=\"simple\">\n<li><p>type;</p></li>\n<li><p>index;</p></li>\n<li><p>position;</p></li>\n<li><p>appearance;</p></li>\n<li><p>parent Block; and</p></li>\n<li><p>connected wire(s).</p></li>\n</ul>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">node</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">index</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">0</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">position</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">1</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">socket_type</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">1</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">multi_wire</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">True</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>node</strong> (<a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><em>Block</em></a><em>, </em><em>required</em>) – the associated Block this Socket relates to</p></li>\n<li><p><strong>index</strong> (<em>int</em><em>, </em><em>optional</em><em>, </em><em>defaults to 0</em>) – the height (along the side of the Block) this Socket should be drawn at</p></li>\n<li><p><strong>position</strong> (<em>enumerate</em><em>, </em><em>optional</em><em>, </em><em>defaults to LEFT</em><em>(</em><em>1</em><em>)</em>) – the side ( LEFT(1) or RIGHT(3) ) this Socket should be drawn on</p></li>\n<li><p><strong>socket_type</strong> (<em>enumerate</em><em>, </em><em>optional</em><em>, </em><em>defaults to INPUT</em><em>(</em><em>1</em><em>)</em>) – this Socket’s type (INPUT(1) or OUTPUT(2))</p></li>\n<li><p><strong>multi_wire</strong> (<em>bool</em><em>, </em><em>optional</em><em>, </em><em>defaults to True</em>) – boolean of whether this Socket has multiple wires</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.deserialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">deserialize</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">data</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">hashmap</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">{}</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.deserialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to reconstruct a <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> when loading a saved JSON\nfile containing all relevant information to recreate the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> with all\nits items.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>data</strong> (<em>OrderedDict</em><em>, </em><em>required</em>) – a Dictionary of essential information for reconstructing a <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code></p></li>\n<li><p><strong>hashmap</strong> (<em>Dict</em><em>, </em><em>required</em>) – a Dictionary for directly mapping the essential socket variables\nto this instance of <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code>, without having to individually map each variable</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>True when completed successfully</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Boolean</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.getSocketPosition\">\n<span class=\"sig-name descname\"><span class=\"pre\">getSocketPosition</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.getSocketPosition\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method retrieves and returns the [x,y] coordinates for where the\ncurrent Socket should be drawn.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>the [x,y] coordinates at which to place this Socket.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>list of int, int</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.hasEdge\">\n<span class=\"sig-name descname\"><span class=\"pre\">hasEdge</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.hasEdge\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns True if the current Socket has Wires connected to it,\nand False if no Wires are connected to it.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p><ul class=\"simple\">\n<li><p>True (If wires are connected to this Socket)</p></li>\n<li><p>False (If no wires are connected to this Socket)</p></li>\n</ul>\n</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>bool</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.isInputSocket\">\n<span class=\"sig-name descname\"><span class=\"pre\">isInputSocket</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.isInputSocket\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns True if the current Socket is an input socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p><ul class=\"simple\">\n<li><p>True (If current Socket is an input Socket)</p></li>\n<li><p>False (If current Socket is not an input Socket)</p></li>\n</ul>\n</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>bool</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.isOutputSocket\">\n<span class=\"sig-name descname\"><span class=\"pre\">isOutputSocket</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.isOutputSocket\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns True if the current Socket is an output socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p><ul class=\"simple\">\n<li><p>True (If current Socket is an output Socket)</p></li>\n<li><p>False (If current Socket is not an output Socket)</p></li>\n</ul>\n</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>bool</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.removeAllWires\">\n<span class=\"sig-name descname\"><span class=\"pre\">removeAllWires</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.removeAllWires\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method removes all Wires connected to this Socket.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.removeSockets\">\n<span class=\"sig-name descname\"><span class=\"pre\">removeSockets</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">type</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.removeSockets\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method removes all of the input or output Sockets, relating to this\nBlock, as specified by the type.</p>\n<p>This method removes all sockets of given type, associated with this <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>type</strong> (<em>str</em><em>, </em><em>required</em>) – the type of Socket to remove (“Input” or “Output”)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.removeWire\">\n<span class=\"sig-name descname\"><span class=\"pre\">removeWire</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.removeWire\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method removes the given Wire from the list of Wires connected to this\nSocket, if it is connected to this Socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>wire</strong> (<a class=\"reference internal\" href=\"#bdedit.block_wire.Wire\" title=\"bdedit.block_wire.Wire\"><em>Wire</em></a><em>, </em><em>required</em>) – the wire to be removed</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.serialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">serialize</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.serialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to create an ordered dictionary of all of this Sockets’\nparameters - necessary for the reconstruction of this Socket - as key-value\npairs. This dictionary is later used for writing into a JSON file.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>an <code class=\"docutils literal notranslate\"><span class=\"pre\">OrderedDict</span></code> of [keys, values] pairs of all essential <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code>\nparameters.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p><code class=\"docutils literal notranslate\"><span class=\"pre\">OrderedDict</span></code> ([keys, values]*)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket.Socket.setConnectedEdge\">\n<span class=\"sig-name descname\"><span class=\"pre\">setConnectedEdge</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket.Socket.setConnectedEdge\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method adds the given wire to the list of Wires that are connected to\nthis Socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>wire</strong> (<a class=\"reference internal\" href=\"#bdedit.block_wire.Wire\" title=\"bdedit.block_wire.Wire\"><em>Wire</em></a><em>, </em><em>required</em>) – the wire connecting to this Socket</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.block_socket_block\">\n<span id=\"bdedit-block-socket-block-module\"></span><h2>bdedit.block_socket_block module<a class=\"headerlink\" href=\"#module-bdedit.block_socket_block\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket_block.Connector\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_socket_block.</span></span><span class=\"sig-name descname\"><span class=\"pre\">Connector</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Connector</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket_block.Connector\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.block.Block\" title=\"bdedit.block.Block\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.block.Block</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">Connector</span></code> Class is a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, and referred to as a\nchild class of <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>. It inherits all the methods and variables of its\nparent class to behave as a Block. It allows for wires to be more neatly\nredirected, acting as a node through which the wires can be moved around\nmore freely within the work area.</p>\n<p>The idea of this Connector block was for it to be a single socket which\nallows a wire to be redirected through it, however currently it works by\nmimicking a Block that only has 1 input and 1 output socket. The same socket\nlogic that applies to a Block, also applies to the Connector Block.</p>\n<p>That being:</p>\n<ul class=\"simple\">\n<li><p>an input: can only have 1 Wire connecting into it</p></li>\n<li><p>an output: can have n Wires connecting into it</p></li>\n</ul>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_socket_block.Connector.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">'Unnamed</span> <span class=\"pre\">Connector</span> <span class=\"pre\">Block'</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">pos</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">(0,</span> <span class=\"pre\">0)</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_socket_block.Connector.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Connector</span></code> Block Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>window</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">QGridLayout</span></code>, required) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p><strong>name</strong> (<em>str</em><em>, </em><em>optional</em>) – defaults to “Unnamed Connector Block”</p></li>\n<li><p><strong>pos</strong> (<em>tuple of 2-ints</em><em>, </em><em>optional</em>) – inherited through <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.block_wire\">\n<span id=\"bdedit-block-wire-module\"></span><h2>bdedit.block_wire module<a class=\"headerlink\" href=\"#module-bdedit.block_wire\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.block_wire.</span></span><span class=\"sig-name descname\"><span class=\"pre\">Wire</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">start_socket</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">end_socket</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire_type</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">3</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.interface_serialize.Serializable\" title=\"bdedit.interface_serialize.Serializable\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.interface_serialize.Serializable</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">Serializable</span></code> Class from BdEdit, and\ndefines how a wire is represented, and has all the necessary methods\nfor creating, manipulating and interacting with a wire. This class connects\nstart and end sockets to a created wire. The style of wire being drawn is\nalso controlled by this Class:</p>\n<ul class=\"simple\">\n<li><p>a straight wire will have type DIRECT(1),</p></li>\n<li><p>a curved or wave-like wire will have type BEZIER(2),</p></li>\n<li><p>a stepped wire will have type STEP(3)</p></li>\n</ul>\n<p>This class includes information about the wires’:</p>\n<ul class=\"simple\">\n<li><p>style;</p></li>\n<li><p>end_socket;</p></li>\n<li><p>start_socket;</p></li>\n<li><p>point-to-point coordinates;</p></li>\n<li><p>horizontal and vertical line segments;</p></li>\n<li><p>intersection points with other wires (has been disabled).</p></li>\n</ul>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">start_socket</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">end_socket</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire_type</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">3</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, required) – a scene (or canvas) in which the Wire is stored and shown (or painted into). Provided by the <code class=\"docutils literal notranslate\"><span class=\"pre\">Interface</span></code>.</p></li>\n<li><p><strong>start_socket</strong> (<a class=\"reference internal\" href=\"#bdedit.block_socket.Socket\" title=\"bdedit.block_socket.Socket\"><em>Socket</em></a><em>, </em><em>optional</em><em>, </em><em>defaults to None</em><em> (</em><em>automatically set</em><em>)</em>) – the start Socket of this Wire</p></li>\n<li><p><strong>end_socket</strong> (<a class=\"reference internal\" href=\"#bdedit.block_socket.Socket\" title=\"bdedit.block_socket.Socket\"><em>Socket</em></a><em>, </em><em>optional</em><em>, </em><em>defaults to None</em><em> (</em><em>automatically set</em><em>)</em>) – the end Socket of this Wire</p></li>\n<li><p><strong>wire_type</strong> (<em>enumerate</em><em>, </em><em>optional</em><em>, </em><em>defaults to STEP</em><em>(</em><em>3</em><em>) </em><em>(</em><em>automatically set</em><em>)</em>) – the wire style of this Wire (DIRECT(1), BEZIER(2), STEP(3))</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.checkIntersections\">\n<span class=\"sig-name descname\"><span class=\"pre\">checkIntersections</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.checkIntersections\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method checks all active wires in the scene for intersections with other\nwires. This method will be called any time a mouse movement is detected in\nthe GraphicsView class, which will cause the GraphicsScene to draw points\nat these intersections to separate the wires.</p>\n<p>To reduce computation for finding these intersection points, only vertical\nline segments of wires are checked for intersections. This is because an\nintersection point can only occur when a horizontal line segment of one wire\nmeets a vertical line segment of another wire, and every single wire has a\nhorizontal segment (as sockets are drawn on the LEFT or RIGHT sides of a Block).</p>\n<p>When this method is called, the current intersection points are deleted, as\nall wires are checked against in this method, and as such, any new (or previous)\nintersection points will be appended into a list of intersection points that\nis stored within the GraphicsScene Class.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.deserialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">deserialize</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">data</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">hashmap</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">{}</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.deserialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to reconstruct a <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> when loading a saved JSON\nfile containing all relevant information to recreate the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> with all\nits items.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>data</strong> (<em>OrderedDict</em><em>, </em><em>required</em>) – a Dictionary of essential information for reconstructing a <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code></p></li>\n<li><p><strong>hashmap</strong> (<em>Dict</em><em>, </em><em>required</em>) – a Dictionary for directly mapping the essential wire variables\nto this instance of <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code>, without having to individually map each variable</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>True when completed successfully</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Boolean</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py property\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.end_socket\">\n<em class=\"property\"><span class=\"pre\">property</span> </em><span class=\"sig-name descname\"><span class=\"pre\">end_socket</span></span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.end_socket\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is a decorate that gets the end socket of this Wire.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>the end Socket of this Wire</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p><a class=\"reference internal\" href=\"#bdedit.block_socket.Socket\" title=\"bdedit.block_socket.Socket\">Socket</a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.remove\">\n<span class=\"sig-name descname\"><span class=\"pre\">remove</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.remove\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method will remove the selected Wire from the Scene, un-assign\nthe Sockets that related to it, and remove the Wire from these Sockets.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.remove_from_sockets\">\n<span class=\"sig-name descname\"><span class=\"pre\">remove_from_sockets</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.remove_from_sockets\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method will un-assign the start and end sockets of this Wire.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.serialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">serialize</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.serialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to create an ordered dictionary of all of this Wires’\nparameters - necessary for the reconstruction of this Wire - as key-value\npairs. This dictionary is later used for writing into a JSON file.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>an <code class=\"docutils literal notranslate\"><span class=\"pre\">OrderedDict</span></code> of [keys, values] pairs of all essential <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code>\nparameters.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>OrderedDict, ([keys, values]*)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py property\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.start_socket\">\n<em class=\"property\"><span class=\"pre\">property</span> </em><span class=\"sig-name descname\"><span class=\"pre\">start_socket</span></span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.start_socket\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is a decorate that gets the start socket of this Wire.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>the start Socket of this Wire</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p><a class=\"reference internal\" href=\"#bdedit.block_socket.Socket\" title=\"bdedit.block_socket.Socket\">Socket</a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.updatePositions\">\n<span class=\"sig-name descname\"><span class=\"pre\">updatePositions</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.updatePositions\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method grabs the new positions of sockets on blocks as they are moved\naround within the scene, in order to determine the positions which the\nwire should connect. The redrawing of the wire to these positions will also\nbe handled within this method.</p>\n</dd></dl>\n\n<dl class=\"py property\">\n<dt class=\"sig sig-object py\" id=\"bdedit.block_wire.Wire.wire_type\">\n<em class=\"property\"><span class=\"pre\">property</span> </em><span class=\"sig-name descname\"><span class=\"pre\">wire_type</span></span><a class=\"headerlink\" href=\"#bdedit.block_wire.Wire.wire_type\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is a decorate that gets the wire type (or style) of this Wire.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>the style of this Wire (DIRECT(1), BEZIER(2), STEP(3))</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>enumerate</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.interface\">\n<span id=\"bdedit-interface-module\"></span><h2>bdedit.interface module<a class=\"headerlink\" href=\"#module-bdedit.interface\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.interface.</span></span><span class=\"sig-name descname\"><span class=\"pre\">Interface</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">resolution</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">PyQt5.QtWidgets.QWidget</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">Interface</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">QWidget</span></code> Class from PyQt5, and houses\nthe necessary methods for controlling how the application appears. It also\nconnects the other Classes to allow for Block Diagrams to be constructed.</p>\n<p>This class includes information about the:</p>\n<ul class=\"simple\">\n<li><p>toolbar, its buttons and their connections</p></li>\n<li><p>library Browser menu, its buttons and their connections</p></li>\n<li><p>scene, its appearance (Background and Foreground) and its items (Blocks, Sockets, Wires)</p></li>\n<li><p>application layout, in terms of where the toolbar, library Browser, scene and\nparameter window is displayed.</p></li>\n</ul>\n<p>Note, the toolbar, library Browser, scene and parameter window will be referred\nto as application components.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">resolution</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Interface</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>resolution</strong> (<em>PyQt5.QtCore.QRect</em><em>(</em><em>0</em><em>, </em><em>0</em><em>, </em><em>screen_width</em><em>, </em><em>screen_height</em><em>)</em><em>, </em><em>required</em>) – the desktop screen resolution of the user</p></li>\n<li><p><strong>parent</strong> (<em>None</em><em>, </em><em>optional</em>) – the parent widget this interface belongs to (should be None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.initUI\">\n<span class=\"sig-name descname\"><span class=\"pre\">initUI</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">resolution</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.initUI\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is responsible for controlling the size of the application window.\nIt is also responsible for each application component, in terms of:</p>\n<ul class=\"simple\">\n<li><p>setting its dimensions ;</p></li>\n<li><p>setting its position within the application layout;</p></li>\n<li><p>creating its relevant buttons and connecting them to desired actions;</p></li>\n<li><p>populating it with the created buttons; and</p></li>\n<li><p>spacing out these buttons within the application component itself.</p></li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>resolution</strong> (<em>PyQt5.QtCore.QRect</em><em>(</em><em>0</em><em>, </em><em>0</em><em>, </em><em>screen_width</em><em>, </em><em>screen_height</em><em>)</em><em>, </em><em>required</em>) – the desktop screen resolution of the user</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a QWidget that is displayed within the application from bdEdit.py</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>QWidget</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.loadFromFile\">\n<span class=\"sig-name descname\"><span class=\"pre\">loadFromFile</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.loadFromFile\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method opens a QFileDialog window, prompting the user to select a file\nto load from.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.on_click\">\n<span class=\"sig-name descname\"><span class=\"pre\">on_click</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.on_click\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates a <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> instance from the <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> that was clicked\non, to the mouse pointer.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>scene</strong> (<a class=\"reference internal\" href=\"#bdedit.interface_scene.Scene\" title=\"bdedit.interface_scene.Scene\"><em>Scene</em></a><em>, </em><em>required</em>) – the scene within which the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> are located</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.resizeEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">resizeEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.resizeEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QWidget, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">Interface</span></code>\nto update the dimensions of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> when the application window has\nbeen resized.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QResizeEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – an interaction event that has occurred with this QWidget</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.saveAsToFile\">\n<span class=\"sig-name descname\"><span class=\"pre\">saveAsToFile</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.saveAsToFile\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method opens a QFileDialog window, prompting the user to enter a name\nunder which the current file will be saved. This file will automatically be\ngiven a .json file type.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.saveToFile\">\n<span class=\"sig-name descname\"><span class=\"pre\">saveToFile</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.saveToFile\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method calls the method from within the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> to save a copy of the\ncurrent Scene, with all its items under a file with the current filename. If\nthis is the first time a user is saving their file, they will be prompted to\nname the file and to choose where it will be saved.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.save_image\">\n<span class=\"sig-name descname\"><span class=\"pre\">save_image</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">picture_name</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.save_image\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method takes a filename and saves a snapshot of all the items within\nthe <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> into it. Currently the resolution of this image is set to\n4K resolution (3840 x 2160).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>picture_name</strong> (<em>str</em><em>, </em><em>required</em>) – the name under which the image will be saved</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.toggleCanvasItems\">\n<span class=\"sig-name descname\"><span class=\"pre\">toggleCanvasItems</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.toggleCanvasItems\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method toggles hiding/expanding all Canvas related Items.\nCurrently these include only the <code class=\"docutils literal notranslate\"><span class=\"pre\">Connector</span> <span class=\"pre\">Block</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.toggleDiscreteBlocks\">\n<span class=\"sig-name descname\"><span class=\"pre\">toggleDiscreteBlocks</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.toggleDiscreteBlocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method toggles hiding/expanding all <code class=\"docutils literal notranslate\"><span class=\"pre\">Discrete</span> <span class=\"pre\">Blocks</span></code>.\nThese depend on the Blocks defined within the auto-imported files.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.toggleFunctionBlocks\">\n<span class=\"sig-name descname\"><span class=\"pre\">toggleFunctionBlocks</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.toggleFunctionBlocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method toggles hiding/expanding all <code class=\"docutils literal notranslate\"><span class=\"pre\">Function</span> <span class=\"pre\">Blocks</span></code>.\nThese depend on the Blocks defined within the auto-imported files.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.toggleSinkBlocks\">\n<span class=\"sig-name descname\"><span class=\"pre\">toggleSinkBlocks</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.toggleSinkBlocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method toggles hiding/expanding all <code class=\"docutils literal notranslate\"><span class=\"pre\">Sink</span> <span class=\"pre\">Blocks</span></code>.\nThese depend on the Blocks defined within the auto-imported files.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.toggleSourceBlocks\">\n<span class=\"sig-name descname\"><span class=\"pre\">toggleSourceBlocks</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.toggleSourceBlocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method toggles hiding/expanding all <code class=\"docutils literal notranslate\"><span class=\"pre\">Source</span> <span class=\"pre\">Blocks</span></code>.\nThese depend on the Blocks defined within the auto-imported files.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.toggleSubSystemBlocks\">\n<span class=\"sig-name descname\"><span class=\"pre\">toggleSubSystemBlocks</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.toggleSubSystemBlocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method toggles hiding/expanding all <code class=\"docutils literal notranslate\"><span class=\"pre\">SubSystem</span> <span class=\"pre\">Blocks</span></code>.\nThese depend on the Blocks defined within the auto-imported files.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.toggleTransferBlocks\">\n<span class=\"sig-name descname\"><span class=\"pre\">toggleTransferBlocks</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.toggleTransferBlocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method toggles hiding/expanding all <code class=\"docutils literal notranslate\"><span class=\"pre\">Transfer</span> <span class=\"pre\">Blocks</span></code>.\nThese depend on the Blocks defined within the auto-imported files.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.updateColorMode\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateColorMode</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.updateColorMode\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to update the color mode with which the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>\nbackground should be displayed. The options are:</p>\n<ul class=\"simple\">\n<li><p>Light: light gray grid lines, with dark outlines for blocks</p></li>\n<li><p>Dark: dark gray grid lines, with light outlines for blocks</p></li>\n<li><p>Off: no grid lines, with dark outlines for blocks</p></li>\n</ul>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.Interface.updateSceneDimensions\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateSceneDimensions</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.Interface.updateSceneDimensions\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method updates the dimensions of the scene based on current window\nsize (will change as the application window is resized).</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py function\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface.importBlocks\">\n<span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.interface.</span></span><span class=\"sig-name descname\"><span class=\"pre\">importBlocks</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface.importBlocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called at the beginning of an <code class=\"docutils literal notranslate\"><span class=\"pre\">Interface</span></code> instance, to auto\nimport all grandchild Classes of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> class from a locally referenced\ndictionary called <cite>Block_Classes</cite>.</p>\n<p>This code is adapted from: <a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/blob/bdedit/bdsim/bdsim.py\">https://github.com/petercorke/bdsim/blob/bdedit/bdsim/bdsim.py</a></p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>a list of imported blocks</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>list</p>\n</dd>\n</dl>\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.interface_graphics_scene\">\n<span id=\"bdedit-interface-graphics-scene-module\"></span><h2>bdedit.interface_graphics_scene module<a class=\"headerlink\" href=\"#module-bdedit.interface_graphics_scene\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_scene.GraphicsScene\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.interface_graphics_scene.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsScene</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_scene.GraphicsScene\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">PyQt5.QtWidgets.QGraphicsScene</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">QGraphicsScene</span></code> Class from PyQt5,\nand controls the basic appearance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> it belongs to. The things\nit controls include its background, and foreground.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_scene.GraphicsScene.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">scene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_scene.GraphicsScene.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates an <code class=\"docutils literal notranslate\"><span class=\"pre\">QGraphicsScene</span></code> instance and associates it to this\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code> instance. The GraphicsScene dictates how all items\nwithin the Scene are visually represented.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>scene</strong> (<a class=\"reference internal\" href=\"#bdedit.interface_scene.Scene\" title=\"bdedit.interface_scene.Scene\"><em>Scene</em></a><em>, </em><em>required</em>) – the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> to which this <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code> belongs to</p></li>\n<li><p><strong>parent</strong> (<em>None</em><em>, </em><em>optional</em>) – the parent widget this GraphicsScene belongs to (should be None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_scene.GraphicsScene.checkMode\">\n<span class=\"sig-name descname\"><span class=\"pre\">checkMode</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_scene.GraphicsScene.checkMode\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method updates the colors used for painting the background of the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_scene.GraphicsScene.drawBackground\">\n<span class=\"sig-name descname\"><span class=\"pre\">drawBackground</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">painter</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">rect</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_scene.GraphicsScene.drawBackground\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsScene, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code> to draw a grid background, or a plain background,\ndepending on what grid mode is chosen. This background is drawn behind\nall other items within the GraphicsScene.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>painter</strong> (<em>QPainter</em><em>, </em><em>automatically recognized and overwritten from this method</em>) – a painter (paint brush) that paints the background of this GraphicsScene</p></li>\n<li><p><strong>rect</strong> (<em>QRect</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a rectangle that defines the dimensions of this GraphicsScene</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_scene.GraphicsScene.drawForeground\">\n<span class=\"sig-name descname\"><span class=\"pre\">drawForeground</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">painter</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">rect</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_scene.GraphicsScene.drawForeground\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsScene, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code>\nto draw additional logic for intersection points between wires. This logic is drawn\novertop of all other items within the GraphicsScene apart from Blocks. Intersection\npoints are drawn as a circle (same fill color as the background) to create a\nseparation between the wires, then redraws a vertical section of the wire overtop.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>painter</strong> (<em>QPainter</em><em>, </em><em>automatically recognized and overwritten from this method</em>) – a painter (paint brush) that paints the foreground of this GraphicsScene</p></li>\n<li><p><strong>rect</strong> (<em>QRect</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a rectangle that defines the dimensions of this GraphicsScene</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_scene.GraphicsScene.mouseMoveEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">mouseMoveEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_scene.GraphicsScene.mouseMoveEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsScene, that is overwritten by <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code>\nto update the start-end points of where the wires are drawn to, as items\nare moved around within the GraphicsScene.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a mouse movement event that has occurred with this GraphicsScene</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_scene.GraphicsScene.setGrScene\">\n<span class=\"sig-name descname\"><span class=\"pre\">setGrScene</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">width</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">height</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_scene.GraphicsScene.setGrScene\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets the dimensions of the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>width</strong> (<em>int</em><em>, </em><em>required</em>) – width of the GraphicsScene</p></li>\n<li><p><strong>height</strong> (<em>int</em><em>, </em><em>required</em>) – height of the GraphicsScene</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_scene.GraphicsScene.updateMode\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateMode</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">value</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_scene.GraphicsScene.updateMode\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method updates the background mode for the GraphicsScene, depending\non what option was chosen in the toolbar drop down menu next to grid mode.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>value</strong> (<em>str</em><em>, </em><em>required</em>) – the color mode of the background (“Light”, “Dark”, “Off”)</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.interface_graphics_view\">\n<span id=\"bdedit-interface-graphics-view-module\"></span><h2>bdedit.interface_graphics_view module<a class=\"headerlink\" href=\"#module-bdedit.interface_graphics_view\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.interface_graphics_view.</span></span><span class=\"sig-name descname\"><span class=\"pre\">GraphicsView</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">grScene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">PyQt5.QtWidgets.QGraphicsView</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">QGraphicsView</span></code> Class from PyQt5,\nand handles most of the user interactions with the <code class=\"docutils literal notranslate\"><span class=\"pre\">Interface</span></code>, through\npress/scroll/click/scroll/key events. It also contains the logic for what Wire\nshould be drawn and what Sockets it connects to. Here mouse click events\nare used to drag the wires from a start to a end socket, when click is\ndragged from a socket, the mode == MODE_WIRE_DRAG will be set to True and a\nWire will follow the mouse until a end socket is set or mode == MODE_WIRE_DRAG\nis False and the Wire will be deleted.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">grScene</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">parent</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">None</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates an <code class=\"docutils literal notranslate\"><span class=\"pre\">QGraphicsView</span></code> instance and associates it to this\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code> instance.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>grScene</strong> (<a class=\"reference internal\" href=\"#bdedit.interface_graphics_scene.GraphicsScene\" title=\"bdedit.interface_graphics_scene.GraphicsScene\"><em>GraphicsScene</em></a><em>, </em><em>required</em>) – the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code> to which this <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code> belongs to</p></li>\n<li><p><strong>parent</strong> (<em>None</em><em>, </em><em>optional</em>) – the parent widget this GraphicsView belongs to (should be None)</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.closeParamWindows\">\n<span class=\"sig-name descname\"><span class=\"pre\">closeParamWindows</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.closeParamWindows\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method will close the parameter window used for changing the\nuser-editable block variables.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.deleteSelected\">\n<span class=\"sig-name descname\"><span class=\"pre\">deleteSelected</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.deleteSelected\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method removes the selected Block or Wire from the scene.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.dist_click_release\">\n<span class=\"sig-name descname\"><span class=\"pre\">dist_click_release</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.dist_click_release\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method checks how for the cursor has moved. This is be used when the\nWire is dragged, to check that wire has been dragged away from the start\nsocket, so that when it is released on a socket we know its not the\nstart socket.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a mouse release event that has occurred with this GraphicsView</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p><ul class=\"simple\">\n<li><p>True (if mouse has been released more than an defined distance from\nthe start_socket)</p></li>\n<li><p>False (if mouse has been released too close too the start_socket)</p></li>\n</ul>\n</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>bool</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.edgeDragEnd\">\n<span class=\"sig-name descname\"><span class=\"pre\">edgeDragEnd</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">item</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.edgeDragEnd\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is used for setting the end socket of the Wire. The place\nwhere the wire has been released will be checked, and if it is a\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicSocket</span></code> and is not the start socket then a Wire is completed.</p>\n<p>Next some check will be made to see that inputs are not connected to inputs\nand outputs are not connected to outputs. Additionally, Block Sockets will\nbe checked to prevent multiple Wires from connecting to a single input socket.\nNo such restriction is placed on the output sockets. This same logic is\napplied to Connector Blocks.</p>\n<p>If these conditions are met, the wire that was dragged will be deleted, and\na new Wire will be created with the start socket from the block the wire\ndrag started at, and the end socket being from the socket of the block the\nWire was dragged to.</p>\n<p>If the above-mentioned conditions not met, the wire is simply removed.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>item</strong> – should be the socket that has been clicked on (however could</p>\n</dd>\n</dl>\n<p>be one of the following: <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocket</span></code>,\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWireStep</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">NoneType</span></code>)\n:type item: GraphicsSocket, required\n:return: False (if the the Wire has been successfully drawn between Blocks)\n:rtype: bool</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.edgeDragStart\">\n<span class=\"sig-name descname\"><span class=\"pre\">edgeDragStart</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">item</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.edgeDragStart\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method starts drawing a Wire between two Blocks. It will\nconstruct a new <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> and set the start socket to the socket that\nhas been clicked on, and the end socket to None. The end socket will\nbe set when either another socket is clicked, or the mouse button is\nreleased over another socket. If neither happen, the wire will be deleted.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>item</strong> (<a class=\"reference internal\" href=\"#bdedit.block_graphics_socket.GraphicsSocket\" title=\"bdedit.block_graphics_socket.GraphicsSocket\"><em>GraphicsSocket</em></a><em>, </em><em>required</em>) – the socket that has been clicked on</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.flipBlockSockets\">\n<span class=\"sig-name descname\"><span class=\"pre\">flipBlockSockets</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.flipBlockSockets\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method flips the selected Block so that the input and output\nSockets change sides.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.getItemAtClick\">\n<span class=\"sig-name descname\"><span class=\"pre\">getItemAtClick</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.getItemAtClick\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the object at the click location. It is used when\nchecking what item within the GraphicsView has been clicked when starting\nto drag a wire.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a mouse click event that has occurred with this GraphicsView</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the item that has been clicked on (can be <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code>,\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocket</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWireStep</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">NoneType</span></code>), required</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdedit.block_graphics_block.GraphicsBlock\" title=\"bdedit.block_graphics_block.GraphicsBlock\">GraphicsBlock</a>, <a class=\"reference internal\" href=\"#bdedit.block_graphics_socket.GraphicsSocket\" title=\"bdedit.block_graphics_socket.GraphicsSocket\">GraphicsSocket</a>, <a class=\"reference internal\" href=\"#bdedit.block_graphics_wire.GraphicsWireStep\" title=\"bdedit.block_graphics_wire.GraphicsWireStep\">GraphicsWireStep</a> or NoneType</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.initUI\">\n<span class=\"sig-name descname\"><span class=\"pre\">initUI</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.initUI\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes the GraphicsScene with additional settings\nto make things draw smoother</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.intersectionTest\">\n<span class=\"sig-name descname\"><span class=\"pre\">intersectionTest</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.intersectionTest\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initiates the checking of all Wires within the Scene for\nintersection points where they overlap.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.keyPressEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">keyPressEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.keyPressEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsView, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code> to detect, and assign actions to the following key presses.</p>\n<ul class=\"simple\">\n<li><p>DEL or BACKSPACE: removes selected item from the Scene</p></li>\n<li><p>F: flips the sockets on a Block or Connector Block</p></li>\n<li><p>CTRL + S: previously connected to saving the Scene</p></li>\n<li><p>CTRL + L: previously connected to loading a Scene file</p></li>\n</ul>\n<p>The saving and loading of a file using keys has since been disabled, as\nit used an old method for saving/loading JSON files which has since been\noverwritten in the Interface Class. However these key checks are still\nconnected if future development should take place.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QKeyPressEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – key(s) press(es) that have been detected</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.leftMouseButtonPress\">\n<span class=\"sig-name descname\"><span class=\"pre\">leftMouseButtonPress</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.leftMouseButtonPress\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method handles the logic associate with the Left mouse button press.\nIt will always run the getItemAtClick method to return the item that\nhas been clicked on.</p>\n<ul class=\"simple\">\n<li><p>If a GraphicsSocket is pressed on, then a draggable Wire will be started.</p></li>\n<li><p>If a GraphicWire is pressed, then the active draggable Wire will be ended\n(when the wire is draggable, clicking off at a Socket, will register the\nclicked item as a GraphicsWire).</p></li>\n</ul>\n<p>Alternatively, the following logic is applied for selecting items.</p>\n<ul class=\"simple\">\n<li><p>If an empty space within the GraphicsView is pressed, a draggable net\nwill appear, within which all items will be selected.</p></li>\n<li><p>If left clicking while holding the SHIFT or CTRL key, this will incrementally\nselect an item from within the GraphicsView. The items that are selectable\nare <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWire</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocketBlock</span></code> (which is\nthe Connector Block).</p></li>\n</ul>\n<p>Otherwise nothing is done with the left mouse press.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMousePressEvent</em><em>, </em><em>required</em>) – a Left mouse button press</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>None to exit the method</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>NoneType</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.leftMouseButtonRelease\">\n<span class=\"sig-name descname\"><span class=\"pre\">leftMouseButtonRelease</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.leftMouseButtonRelease\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method handles the logic associate with the Left mouse button release.\nIt will always run the getItemAtClick method to return the item that\nthe mouse has been released from.</p>\n<ul class=\"simple\">\n<li><p>If a Wire was the item being dragged, it will check how far the Wire has\nmoved, then an attempt to complete the Wire onto a Socket will be made.\nIf no Socket is found, the Wire will be ended.</p></li>\n</ul>\n<p>Alternatively, the following logic is applied for selecting items.</p>\n<ul class=\"simple\">\n<li><p>If an empty space within the GraphicsView is released, if a draggable net\nwas active, all items within that net will be selected.</p></li>\n<li><p>If left clicking while holding the SHIFT or CTRL key, this will incrementally\nselect an item from within the GraphicsView. The items that are selectable\nare <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsWire</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsSocketBlock</span></code> (which is\nthe Connector Block).</p></li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseReleaseEvent</em><em>, </em><em>required</em>) – a Left mouse button release</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>None to exit the method</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>NoneType</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.middleMouseButtonPress\">\n<span class=\"sig-name descname\"><span class=\"pre\">middleMouseButtonPress</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.middleMouseButtonPress\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method handles the logic associate with the Middle mouse button press\n(perhaps more intuitively understood as pressing the scroll wheel).\nWhen the scroll wheel is pressed, the mouse cursor will appear as a hand\nthat pinches the GraphicsView, allowing the canvas to be dragged around.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMousePressEvent</em><em>, </em><em>required</em>) – the detected middle mouse press event</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.middleMouseButtonRelease\">\n<span class=\"sig-name descname\"><span class=\"pre\">middleMouseButtonRelease</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.middleMouseButtonRelease\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method handles the logic associate with the Middle mouse button release\n(perhaps more intuitively understood as releasing the scroll wheel).\nWhen the scroll wheel is releasing, the mouse cursor will change back from\nappearing as a hand to the default mouse cursor (pointer arrow on Windows).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseReleaseEvent</em><em>, </em><em>required</em>) – the detected middle mouse release event</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.mouseMoveEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">mouseMoveEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.mouseMoveEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsView, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code> to assign logic to detected mouse movement.</p>\n<ul class=\"simple\">\n<li><p>If the wire is in dragging mode, the position the wire is drawn to\nwill be updated to the mouse cursor as it is moved around.</p></li>\n<li><p>Additionally, the code to check for intersection amongst wires will\nbe run, and subsequently, if any are found, they will be automatically\nmarked within the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code> Class.</p></li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseMoveEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – the detected mouse movement event</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.mousePressEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">mousePressEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.mousePressEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsView, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code> to detect, and direct the Left, Middle and Right mouse\nbutton presses to methods that handle their associated logic.</p>\n<p>Additionally, when the Left mouse button is pressed anywhere in the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code>, any currently <code class=\"docutils literal notranslate\"><span class=\"pre\">ParamWindow</span></code> that relates to an active\n<code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> within the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> will be closed.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMousePressEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – a mouse press event (Left, Middle or Right)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.mouseReleaseEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">mouseReleaseEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.mouseReleaseEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsView, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code> to detect, and direct the Left, Middle and Right mouse\nbutton releases to methods that handle their associated logic.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMouseReleaseEvent</em><em>, </em><em>required</em>) – a mouse release event (Left, Middle or Right)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.rightMouseButtonPress\">\n<span class=\"sig-name descname\"><span class=\"pre\">rightMouseButtonPress</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.rightMouseButtonPress\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method handles the logic associate with the Right mouse button press.\nCurrently no logic is linked to a right mouse press.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMousePressEvent</em><em>, </em><em>required</em>) – the detected right mouse press event</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the mouse press event is returned</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>QMousePressEvent</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.rightMouseButtonRelease\">\n<span class=\"sig-name descname\"><span class=\"pre\">rightMouseButtonRelease</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.rightMouseButtonRelease\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method handles the logic associate with the Right mouse button release.\nCurrently no logic is linked to a right mouse release.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QMousePressEvent</em><em>, </em><em>required</em>) – the detected right mouse release event</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>the mouse release event is returned</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>QMouseReleaseEvent</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_graphics_view.GraphicsView.wheelEvent\">\n<span class=\"sig-name descname\"><span class=\"pre\">wheelEvent</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">event</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_graphics_view.GraphicsView.wheelEvent\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This is an inbuilt method of QGraphicsView, that is overwritten by\n<code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsView</span></code> to assign logic to detected scroll wheel movement.</p>\n<ul class=\"simple\">\n<li><p>As the scroll wheel is moved up, this will make the zoom in on the work\narea of the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code>.</p></li>\n<li><p>As the scroll wheel is moved down, this will make the zoom out of the work\narea of the <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code>.</p></li>\n</ul>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>event</strong> (<em>QWheelEvent</em><em>, </em><em>automatically recognized by the inbuilt function</em>) – the detected scroll wheel movement</p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.interface_scene\">\n<span id=\"bdedit-interface-scene-module\"></span><h2>bdedit.interface_scene module<a class=\"headerlink\" href=\"#module-bdedit.interface_scene\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.interface_scene.</span></span><span class=\"sig-name descname\"><span class=\"pre\">Scene</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">resolution</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdedit.interface_serialize.Serializable\" title=\"bdedit.interface_serialize.Serializable\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdedit.interface_serialize.Serializable</span></code></a></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> Class extends the <code class=\"docutils literal notranslate\"><span class=\"pre\">Serializable</span></code> Class from BdEdit, and holds\nthe information of all the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> instances that are within it.\nIt also handles the storage of intersection points of the wires.</p>\n<p>This class includes information about the:</p>\n<ul class=\"simple\">\n<li><p>blocks, a list containing all <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> instances</p></li>\n<li><p>wires, a list containing all <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> instances</p></li>\n<li><p>intersection points, a list containing all intersection points between Wires</p></li>\n</ul>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">resolution</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">window</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method initializes an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> Class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>resolution</strong> (<em>PyQt5.QtCore.QRect</em><em>(</em><em>0</em><em>, </em><em>0</em><em>, </em><em>screen_width</em><em>, </em><em>screen_height</em><em>)</em><em>, </em><em>required</em>) – the desktop screen resolution of the user</p></li>\n<li><p><strong>window</strong> (<em>QGridLayout</em><em>, </em><em>required</em>) – the application’s layer manager</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.addBlock\">\n<span class=\"sig-name descname\"><span class=\"pre\">addBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">block</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.addBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method adds a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> to the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene's</span></code> list of blocks.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.addWire\">\n<span class=\"sig-name descname\"><span class=\"pre\">addWire</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.addWire\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method adds a <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> to the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene's</span></code> list of wires.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.checkForDuplicates\">\n<span class=\"sig-name descname\"><span class=\"pre\">checkForDuplicates</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.checkForDuplicates\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method checks if the given name would be a duplicate of an existing\nblock name.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>name</strong> (<em>str</em><em>, </em><em>required</em>) – the desired name for a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p><ul class=\"simple\">\n<li><p>False (if given name is not a duplicate)</p></li>\n<li><p>True (if given name is a duplicate)</p></li>\n</ul>\n</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>bool</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.clear\">\n<span class=\"sig-name descname\"><span class=\"pre\">clear</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.clear\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method removes all blocks from the list of blocks within the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>.\nThis will subsequently remove any and all wires between these blocks.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.deserialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">deserialize</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">data</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">hashmap</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">{}</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.deserialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to reconstruct a <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> and all its items when\nloading a saved JSON.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>data</strong> (<em>OrderedDict</em><em>, </em><em>required</em>) – a Dictionary of essential information for reconstructing a <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code></p></li>\n<li><p><strong>hashmap</strong> (<em>Dict</em><em>, </em><em>required</em>) – a Dictionary for directly mapping the essential scene variables\nto this instance of <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, without having to individually map each variable</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>True when completed successfully</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>bool</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.displayMessage\">\n<span class=\"sig-name descname\"><span class=\"pre\">displayMessage</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.displayMessage\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method displays a ‘File saved successfully!’ pop-up message, providing\nthe user with feedback that their was saved. This pop-up message will\ndisappear on its own after 1 second.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.getSceneHeight\">\n<span class=\"sig-name descname\"><span class=\"pre\">getSceneHeight</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.getSceneHeight\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the current height of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.getSceneWidth\">\n<span class=\"sig-name descname\"><span class=\"pre\">getSceneWidth</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.getSceneWidth\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method returns the current width of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.initUI\">\n<span class=\"sig-name descname\"><span class=\"pre\">initUI</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.initUI\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method creates an <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsScene</span></code> instance and associates it to this\n<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> instance. The GraphicsScene dictates how all items within the Scene\nare visually represented.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.loadFromFile\">\n<span class=\"sig-name descname\"><span class=\"pre\">loadFromFile</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">filename</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.loadFromFile\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method loads the contents of a saved JSON file with the given filename\ninto an instance of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>.</p>\n<p>This method will call upon the self.deserialize() method which will\nsubsequently call the self.deserialize() method within each item that should\nbe reconstructed for the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> (these being the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code>\nand <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code>).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>filename</strong> (<em>str</em>) – name of the file to load from</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.removeBlock\">\n<span class=\"sig-name descname\"><span class=\"pre\">removeBlock</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">block</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.removeBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method removes a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> to the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene's</span></code> list of blocks.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.removeWire\">\n<span class=\"sig-name descname\"><span class=\"pre\">removeWire</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">wire</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.removeWire\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method removes a <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> to the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene's</span></code> list of wires.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.saveToFile\">\n<span class=\"sig-name descname\"><span class=\"pre\">saveToFile</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">filename</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.saveToFile\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method saves the contents of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> instance into a JSON file\nunder the given filename.\nThis method will call upon the self.serialize() method which will\nsubsequently call the self.serialize() method within each item displayed\nin the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> (these being the <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code>).</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>filename</strong> (<em>str</em><em>, </em><em>required</em>) – name of the file to save into</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.serialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">serialize</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.serialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is called to create an ordered dictionary of all of this Scenes’\nparameters - necessary for the reconstruction of this Scene - as key-value\npairs. This dictionary is later used for writing into a JSON file.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>an <code class=\"docutils literal notranslate\"><span class=\"pre\">OrderedDict</span></code> of [keys, values] pairs of all essential <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>\nparameters.</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p><code class=\"docutils literal notranslate\"><span class=\"pre\">OrderedDict</span></code> ([keys, values]*)</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.setSceneHeight\">\n<span class=\"sig-name descname\"><span class=\"pre\">setSceneHeight</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">height</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.setSceneHeight\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets the current height of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, to the given height.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.setSceneWidth\">\n<span class=\"sig-name descname\"><span class=\"pre\">setSceneWidth</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">width</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.setSceneWidth\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets the current width of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, to the given width.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_scene.Scene.updateSceneDimensions\">\n<span class=\"sig-name descname\"><span class=\"pre\">updateSceneDimensions</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_scene.Scene.updateSceneDimensions\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method sets the dimensions of the <code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code> to the currently set\nscene_width and scene_height.</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit.interface_serialize\">\n<span id=\"bdedit-interface-serialize-module\"></span><h2>bdedit.interface_serialize module<a class=\"headerlink\" href=\"#module-bdedit.interface_serialize\" title=\"Permalink to this headline\">¶</a></h2>\n<dl class=\"py class\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_serialize.Serializable\">\n<em class=\"property\"><span class=\"pre\">class</span> </em><span class=\"sig-prename descclassname\"><span class=\"pre\">bdedit.interface_serialize.</span></span><span class=\"sig-name descname\"><span class=\"pre\">Serializable</span></span><a class=\"headerlink\" href=\"#bdedit.interface_serialize.Serializable\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">Serializable</span></code> class provides three essential methods for: ensuring uniqueness\namongst necessary data (1), saving (2) and loading (3) of this data that is needed\nfor the reconstruction of a Block Diagram.</p>\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_serialize.Serializable.__init__\">\n<span class=\"sig-name descname\"><span class=\"pre\">__init__</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_serialize.Serializable.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method extracts the unique identification number of the class instance\nthat calls this method, and stores it as a variable within that class instance.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_serialize.Serializable.deserialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">deserialize</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">data</span></span></em>, <em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">hashmap</span></span><span class=\"o\"><span class=\"pre\">=</span></span><span class=\"default_value\"><span class=\"pre\">{}</span></span></em><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_serialize.Serializable.deserialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is inherited and overwritten by all classes that have graphical\ncomponents related to them (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code>).\nThis allows those classes to un-package (load) the data stored within the\nsaved JSON file in order to reconstruct the respective class instance.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>data</strong> (<em>OrderedDict</em><em>, </em><em>required</em>) – a Dictionary of essential data for reconstructing a Block Diagram</p></li>\n<li><p><strong>hashmap</strong> – a Dictionary for of the same data, but used for simpler mapping</p></li>\n</ul>\n</dd>\n</dl>\n<p>of variables to class instances\n:type hashmap: Dict, required</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt class=\"sig sig-object py\" id=\"bdedit.interface_serialize.Serializable.serialize\">\n<span class=\"sig-name descname\"><span class=\"pre\">serialize</span></span><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"headerlink\" href=\"#bdedit.interface_serialize.Serializable.serialize\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>This method is inherited and overwritten by all classes that have graphical\ncomponents related to them (<code class=\"docutils literal notranslate\"><span class=\"pre\">Scene</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Socket</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Wire</span></code>).\nThis allows those classes to package (save) essential variables necessary\nfor the later reconstruction of those class instances, into a JSON file.</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdedit\">\n<span id=\"module-contents\"></span><h2>Module contents<a class=\"headerlink\" href=\"#module-bdedit\" title=\"Permalink to this headline\">¶</a></h2>\n</div>\n</div>\n\n\n           </div>\n           \n          </div>\n          <footer>\n    <div class=\"rst-footer-buttons\" role=\"navigation\" aria-label=\"footer navigation\">\n        <a href=\"modules.html\" class=\"btn btn-neutral float-left\" title=\"bdedit\" accesskey=\"p\" rel=\"prev\"><span class=\"fa fa-arrow-circle-left\" aria-hidden=\"true\"></span> Previous</a>\n    </div>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>\n        &#169; Copyright 2021, Daniel Petkov.\n\n    </p>\n  </div>\n    \n    \n    \n    Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    \n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    \n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>. \n\n</footer>\n        </div>\n      </div>\n\n    </section>\n\n  </div>\n  \n\n  <script type=\"text/javascript\">\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n\n  \n  \n    \n   \n\n</body>\n</html>"
  },
  {
    "path": "bdsim/bdedit/docs/genindex.html",
    "content": "\n\n<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  \n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  \n  <title>Index &mdash; BdEdit  documentation</title>\n  \n\n  \n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n\n  \n  \n\n  \n  \n\n  \n\n  \n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  \n    \n      <script type=\"text/javascript\" id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script data-url_root=\"./\" id=\"documentation_options\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n    \n    <script type=\"text/javascript\" src=\"_static/js/theme.js\"></script>\n\n    \n    <link rel=\"index\" title=\"Index\" href=\"#\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\">\n\n   \n  <div class=\"wy-grid-for-nav\">\n    \n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n          \n\n          \n            <a href=\"index.html\" class=\"icon icon-home\"> BdEdit\n          \n\n          \n          </a>\n\n          \n            \n            \n          \n\n          \n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n\n          \n        </div>\n\n        \n        <div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"main navigation\">\n          \n            \n            \n              \n            \n            \n              <p class=\"caption\"><span class=\"caption-text\">Contents:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"modules.html\">bdedit</a></li>\n</ul>\n\n            \n          \n        </div>\n        \n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\">\n\n      \n      <nav class=\"wy-nav-top\" aria-label=\"top navigation\">\n        \n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">BdEdit</a>\n        \n      </nav>\n\n\n      <div class=\"wy-nav-content\">\n        \n        <div class=\"rst-content\">\n        \n          \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<div role=\"navigation\" aria-label=\"breadcrumbs navigation\">\n\n  <ul class=\"wy-breadcrumbs\">\n    \n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n        \n      <li>Index</li>\n    \n    \n      <li class=\"wy-breadcrumbs-aside\">\n        \n          \n        \n      </li>\n    \n  </ul>\n\n  \n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n            \n\n<h1 id=\"index\">Index</h1>\n\n<div class=\"genindex-jumpbox\">\n <a href=\"#_\"><strong>_</strong></a>\n | <a href=\"#A\"><strong>A</strong></a>\n | <a href=\"#B\"><strong>B</strong></a>\n | <a href=\"#C\"><strong>C</strong></a>\n | <a href=\"#D\"><strong>D</strong></a>\n | <a href=\"#E\"><strong>E</strong></a>\n | <a href=\"#F\"><strong>F</strong></a>\n | <a href=\"#G\"><strong>G</strong></a>\n | <a href=\"#H\"><strong>H</strong></a>\n | <a href=\"#I\"><strong>I</strong></a>\n | <a href=\"#K\"><strong>K</strong></a>\n | <a href=\"#L\"><strong>L</strong></a>\n | <a href=\"#M\"><strong>M</strong></a>\n | <a href=\"#N\"><strong>N</strong></a>\n | <a href=\"#O\"><strong>O</strong></a>\n | <a href=\"#P\"><strong>P</strong></a>\n | <a href=\"#Q\"><strong>Q</strong></a>\n | <a href=\"#R\"><strong>R</strong></a>\n | <a href=\"#S\"><strong>S</strong></a>\n | <a href=\"#T\"><strong>T</strong></a>\n | <a href=\"#U\"><strong>U</strong></a>\n | <a href=\"#W\"><strong>W</strong></a>\n \n</div>\n<h2 id=\"_\">_</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.Block.__init__\">__init__() (bdedit.block.Block method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block.DiscreteBlock.__init__\">(bdedit.block.DiscreteBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.FunctionBlock.__init__\">(bdedit.block.FunctionBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.INPORTBlock.__init__\">(bdedit.block.INPORTBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.OUTPORTBlock.__init__\">(bdedit.block.OUTPORTBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SinkBlock.__init__\">(bdedit.block.SinkBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SourceBlock.__init__\">(bdedit.block.SourceBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SUBSYSTEMBlock.__init__\">(bdedit.block.SUBSYSTEMBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.TransferBlock.__init__\">(bdedit.block.TransferBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.__init__\">(bdedit.block_graphics_block.GraphicsBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsSocketBlock.__init__\">(bdedit.block_graphics_block.GraphicsSocketBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket.__init__\">(bdedit.block_graphics_socket.GraphicsSocket method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.__init__\">(bdedit.block_graphics_wire.GraphicsWire method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_param_window.ParamWindow.__init__\">(bdedit.block_param_window.ParamWindow method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_socket.Socket.__init__\">(bdedit.block_socket.Socket method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_socket_block.Connector.__init__\">(bdedit.block_socket_block.Connector method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_wire.Wire.__init__\">(bdedit.block_wire.Wire method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface.Interface.__init__\">(bdedit.interface.Interface method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_graphics_scene.GraphicsScene.__init__\">(bdedit.interface_graphics_scene.GraphicsScene method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.__init__\">(bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.__init__\">(bdedit.interface_scene.Scene method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_serialize.Serializable.__init__\">(bdedit.interface_serialize.Serializable method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"A\">A</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.addBlock\">addBlock() (bdedit.interface_scene.Scene method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.addWire\">addWire() (bdedit.interface_scene.Scene method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"B\">B</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li>\n    bdedit\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.block\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.block\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.block_graphics_block\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.block_graphics_block\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.block_graphics_socket\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.block_graphics_socket\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.block_graphics_wire\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.block_graphics_wire\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.block_param_window\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.block_param_window\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.block_socket\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.block_socket\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.block_socket_block\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.block_socket_block\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.block_wire\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.block_wire\">module</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li>\n    bdedit.Icons\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.Icons\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.interface\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.interface\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.interface_graphics_scene\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.interface_graphics_scene\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.interface_graphics_view\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.interface_graphics_view\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.interface_scene\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.interface_scene\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdedit.interface_serialize\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit.interface_serialize\">module</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block.Block\">Block (class in bdedit.block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.block\">block() (in module bdedit.block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.blockname\">blockname() (in module bdedit.block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.boundingRect\">boundingRect() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsSocketBlock.boundingRect\">(bdedit.block_graphics_block.GraphicsSocketBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket.boundingRect\">(bdedit.block_graphics_socket.GraphicsSocket method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block_param_window.ParamWindow.buildParamWindow\">buildParamWindow() (bdedit.block_param_window.ParamWindow method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"C\">C</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.checkBlockHeight\">checkBlockHeight() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.checkForDuplicates\">checkForDuplicates() (bdedit.interface_scene.Scene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_wire.Wire.checkIntersections\">checkIntersections() (bdedit.block_wire.Wire method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.checkMode\">checkMode() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.interface_graphics_scene.GraphicsScene.checkMode\">(bdedit.interface_graphics_scene.GraphicsScene method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.clear\">clear() (bdedit.interface_scene.Scene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.closeParamWindow\">closeParamWindow() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.closeParamWindows\">closeParamWindows() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_param_window.ParamWindow.closeQMessageBox\">closeQMessageBox() (bdedit.block_param_window.ParamWindow method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_socket_block.Connector\">Connector (class in bdedit.block_socket_block)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"D\">D</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.deleteSelected\">deleteSelected() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.deserialize\">deserialize() (bdedit.block.Block method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_socket.Socket.deserialize\">(bdedit.block_socket.Socket method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_wire.Wire.deserialize\">(bdedit.block_wire.Wire method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.deserialize\">(bdedit.interface_scene.Scene method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_serialize.Serializable.deserialize\">(bdedit.interface_serialize.Serializable method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.DiscreteBlock\">DiscreteBlock (class in bdedit.block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.displayMessage\">displayMessage() (bdedit.interface_scene.Scene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_param_window.ParamWindow.displayPopUpMessage\">displayPopUpMessage() (bdedit.block_param_window.ParamWindow method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.dist_click_release\">dist_click_release() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_scene.GraphicsScene.drawBackground\">drawBackground() (bdedit.interface_graphics_scene.GraphicsScene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_scene.GraphicsScene.drawForeground\">drawForeground() (bdedit.interface_graphics_scene.GraphicsScene method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"E\">E</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.edgeDragEnd\">edgeDragEnd() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.edgeDragStart\">edgeDragStart() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.TupleEncoder.encode\">encode() (bdedit.block.TupleEncoder method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_wire.Wire.end_socket\">end_socket (bdedit.block_wire.Wire property)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"F\">F</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.flipBlockSockets\">flipBlockSockets() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.FunctionBlock\">FunctionBlock (class in bdedit.block)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"G\">G</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.getItemAtClick\">getItemAtClick() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_param_window.ParamWindow.getSafeValue\">getSafeValue() (bdedit.block_param_window.ParamWindow static method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.getSceneHeight\">getSceneHeight() (bdedit.interface_scene.Scene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.getSceneWidth\">getSceneWidth() (bdedit.interface_scene.Scene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket.getSignPath\">getSignPath() (bdedit.block_graphics_socket.GraphicsSocket method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.getSocketPosition\">getSocketPosition() (bdedit.block.Block method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_socket.Socket.getSocketPosition\">(bdedit.block_socket.Socket method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.getTitle\">getTitle() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock\">GraphicsBlock (class in bdedit.block_graphics_block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_scene.GraphicsScene\">GraphicsScene (class in bdedit.interface_graphics_scene)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket\">GraphicsSocket (class in bdedit.block_graphics_socket)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsSocketBlock\">GraphicsSocketBlock (class in bdedit.block_graphics_block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView\">GraphicsView (class in bdedit.interface_graphics_view)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire\">GraphicsWire (class in bdedit.block_graphics_wire)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWireBezier\">GraphicsWireBezier (class in bdedit.block_graphics_wire)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWireDirect\">GraphicsWireDirect (class in bdedit.block_graphics_wire)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWireStep\">GraphicsWireStep (class in bdedit.block_graphics_wire)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"H\">H</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_socket.Socket.hasEdge\">hasEdge() (bdedit.block_socket.Socket method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"I\">I</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface.importBlocks\">importBlocks() (in module bdedit.interface)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.initTitle\">initTitle() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.initUI\">initUI() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsSocketBlock.initUI\">(bdedit.block_graphics_block.GraphicsSocketBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_param_window.ParamWindow.initUI\">(bdedit.block_param_window.ParamWindow method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface.Interface.initUI\">(bdedit.interface.Interface method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.initUI\">(bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.initUI\">(bdedit.interface_scene.Scene method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.INPORTBlock\">INPORTBlock (class in bdedit.block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface\">Interface (class in bdedit.interface)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.intersectionTest\">intersectionTest() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_socket.Socket.isInputSocket\">isInputSocket() (bdedit.block_socket.Socket method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_socket.Socket.isOutputSocket\">isOutputSocket() (bdedit.block_socket.Socket method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"K\">K</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.keyPressEvent\">keyPressEvent() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"L\">L</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.leftMouseButtonPress\">leftMouseButtonPress() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.leftMouseButtonRelease\">leftMouseButtonRelease() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.loadFromFile\">loadFromFile() (bdedit.interface.Interface method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.loadFromFile\">(bdedit.interface_scene.Scene method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"M\">M</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.Block.makeInputSockets\">makeInputSockets() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.makeOutputSockets\">makeOutputSockets() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.middleMouseButtonPress\">middleMouseButtonPress() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.middleMouseButtonRelease\">middleMouseButtonRelease() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li>\n    module\n\n      <ul>\n        <li><a href=\"bdedit.html#module-bdedit\">bdedit</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.block\">bdedit.block</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.block_graphics_block\">bdedit.block_graphics_block</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.block_graphics_socket\">bdedit.block_graphics_socket</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.block_graphics_wire\">bdedit.block_graphics_wire</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.block_param_window\">bdedit.block_param_window</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.block_socket\">bdedit.block_socket</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.block_socket_block\">bdedit.block_socket_block</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.block_wire\">bdedit.block_wire</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.Icons\">bdedit.Icons</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.interface\">bdedit.interface</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.interface_graphics_scene\">bdedit.interface_graphics_scene</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.interface_graphics_view\">bdedit.interface_graphics_view</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.interface_scene\">bdedit.interface_scene</a>\n</li>\n        <li><a href=\"bdedit.html#module-bdedit.interface_serialize\">bdedit.interface_serialize</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.mouseMoveEvent\">mouseMoveEvent() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsSocketBlock.mouseMoveEvent\">(bdedit.block_graphics_block.GraphicsSocketBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_graphics_scene.GraphicsScene.mouseMoveEvent\">(bdedit.interface_graphics_scene.GraphicsScene method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.mouseMoveEvent\">(bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.mousePressEvent\">mousePressEvent() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsSocketBlock.mousePressEvent\">(bdedit.block_graphics_block.GraphicsSocketBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.mousePressEvent\">(bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.mouseReleaseEvent\">mouseReleaseEvent() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"N\">N</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.DiscreteBlock.numInputs\">numInputs() (bdedit.block.DiscreteBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block.FunctionBlock.numInputs\">(bdedit.block.FunctionBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.INPORTBlock.numInputs\">(bdedit.block.INPORTBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.OUTPORTBlock.numInputs\">(bdedit.block.OUTPORTBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SinkBlock.numInputs\">(bdedit.block.SinkBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SourceBlock.numInputs\">(bdedit.block.SourceBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SUBSYSTEMBlock.numInputs\">(bdedit.block.SUBSYSTEMBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.TransferBlock.numInputs\">(bdedit.block.TransferBlock method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.DiscreteBlock.numOutputs\">numOutputs() (bdedit.block.DiscreteBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block.FunctionBlock.numOutputs\">(bdedit.block.FunctionBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.INPORTBlock.numOutputs\">(bdedit.block.INPORTBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.OUTPORTBlock.numOutputs\">(bdedit.block.OUTPORTBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SinkBlock.numOutputs\">(bdedit.block.SinkBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SourceBlock.numOutputs\">(bdedit.block.SourceBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.SUBSYSTEMBlock.numOutputs\">(bdedit.block.SUBSYSTEMBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block.TransferBlock.numOutputs\">(bdedit.block.TransferBlock method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"O\">O</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.on_click\">on_click() (bdedit.interface.Interface method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.OUTPORTBlock\">OUTPORTBlock (class in bdedit.block)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"P\">P</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.paint\">paint() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsSocketBlock.paint\">(bdedit.block_graphics_block.GraphicsSocketBlock method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket.paint\">(bdedit.block_graphics_socket.GraphicsSocket method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.paint\">(bdedit.block_graphics_wire.GraphicsWire method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket.paintDivide\">paintDivide() (bdedit.block_graphics_socket.GraphicsSocket method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket.paintMinus\">paintMinus() (bdedit.block_graphics_socket.GraphicsSocket method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket.paintMultiply\">paintMultiply() (bdedit.block_graphics_socket.GraphicsSocket method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_socket.GraphicsSocket.paintPlus\">paintPlus() (bdedit.block_graphics_socket.GraphicsSocket method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_param_window.ParamWindow\">ParamWindow (class in bdedit.block_param_window)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.pos\">pos (bdedit.block.Block property)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"Q\">Q</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.Icons.qCleanupResources\">qCleanupResources() (in module bdedit.Icons)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.Icons.qInitResources\">qInitResources() (in module bdedit.Icons)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"R\">R</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block.Block.remove\">remove() (bdedit.block.Block method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_wire.Wire.remove\">(bdedit.block_wire.Wire method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block_wire.Wire.remove_from_sockets\">remove_from_sockets() (bdedit.block_wire.Wire method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_socket.Socket.removeAllWires\">removeAllWires() (bdedit.block_socket.Socket method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.removeBlock\">removeBlock() (bdedit.interface_scene.Scene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.removeSockets\">removeSockets() (bdedit.block.Block method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_socket.Socket.removeSockets\">(bdedit.block_socket.Socket method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_socket.Socket.removeWire\">removeWire() (bdedit.block_socket.Socket method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.removeWire\">(bdedit.interface_scene.Scene method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.resizeEvent\">resizeEvent() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.rightMouseButtonPress\">rightMouseButtonPress() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.rightMouseButtonRelease\">rightMouseButtonRelease() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"S\">S</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.save_image\">save_image() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.saveAsToFile\">saveAsToFile() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.saveToFile\">saveToFile() (bdedit.interface.Interface method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.saveToFile\">(bdedit.interface_scene.Scene method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene\">Scene (class in bdedit.interface_scene)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_serialize.Serializable\">Serializable (class in bdedit.interface_serialize)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.serialize\">serialize() (bdedit.block.Block method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_socket.Socket.serialize\">(bdedit.block_socket.Socket method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_wire.Wire.serialize\">(bdedit.block_wire.Wire method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.serialize\">(bdedit.interface_scene.Scene method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.interface_serialize.Serializable.serialize\">(bdedit.interface_serialize.Serializable method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block_socket.Socket.setConnectedEdge\">setConnectedEdge() (bdedit.block_socket.Socket method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.setDefaultTitle\">setDefaultTitle() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.setDestination\">setDestination() (bdedit.block_graphics_wire.GraphicsWire method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.setDestinationOrientation\">setDestinationOrientation() (bdedit.block_graphics_wire.GraphicsWire method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.setFocusOfBlocks\">setFocusOfBlocks() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_scene.GraphicsScene.setGrScene\">setGrScene() (bdedit.interface_graphics_scene.GraphicsScene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.setPos\">setPos() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.setSceneHeight\">setSceneHeight() (bdedit.interface_scene.Scene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.setSceneWidth\">setSceneWidth() (bdedit.interface_scene.Scene method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.setSource\">setSource() (bdedit.block_graphics_wire.GraphicsWire method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.setSourceOrientation\">setSourceOrientation() (bdedit.block_graphics_wire.GraphicsWire method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.setTitle\">setTitle() (bdedit.block.Block method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.setTitle\">(bdedit.block_graphics_block.GraphicsBlock method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block.SinkBlock\">SinkBlock (class in bdedit.block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_socket.Socket\">Socket (class in bdedit.block_socket)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.SourceBlock\">SourceBlock (class in bdedit.block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_wire.Wire.start_socket\">start_socket (bdedit.block_wire.Wire property)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.SUBSYSTEMBlock\">SUBSYSTEMBlock (class in bdedit.block)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"T\">T</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.titleLength\">titleLength() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.toggleCanvasItems\">toggleCanvasItems() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.toggleDiscreteBlocks\">toggleDiscreteBlocks() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.toggleFunctionBlocks\">toggleFunctionBlocks() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.toggleParamWindow\">toggleParamWindow() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.toggleSinkBlocks\">toggleSinkBlocks() (bdedit.interface.Interface method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.toggleSourceBlocks\">toggleSourceBlocks() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.toggleSubSystemBlocks\">toggleSubSystemBlocks() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.toggleTransferBlocks\">toggleTransferBlocks() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.TransferBlock\">TransferBlock (class in bdedit.block)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.tuple_decoder\">tuple_decoder() (bdedit.block.Block static method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.TupleEncoder\">TupleEncoder (class in bdedit.block)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"U\">U</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_param_window.ParamWindow.updateBlockParameters\">updateBlockParameters() (bdedit.block_param_window.ParamWindow method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.updateColorMode\">updateColorMode() (bdedit.interface.Interface method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.updateConnectedEdges\">updateConnectedEdges() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.updateLineSegments\">updateLineSegments() (bdedit.block_graphics_wire.GraphicsWire method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_block.GraphicsBlock.updateMode\">updateMode() (bdedit.block_graphics_block.GraphicsBlock method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.interface_graphics_scene.GraphicsScene.updateMode\">(bdedit.interface_graphics_scene.GraphicsScene method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.updatePath\">updatePath() (bdedit.block_graphics_wire.GraphicsWire method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWireBezier.updatePath\">(bdedit.block_graphics_wire.GraphicsWireBezier method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWireDirect.updatePath\">(bdedit.block_graphics_wire.GraphicsWireDirect method)</a>\n</li>\n        <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWireStep.updatePath\">(bdedit.block_graphics_wire.GraphicsWireStep method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_wire.Wire.updatePositions\">updatePositions() (bdedit.block_wire.Wire method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.interface.Interface.updateSceneDimensions\">updateSceneDimensions() (bdedit.interface.Interface method)</a>\n\n      <ul>\n        <li><a href=\"bdedit.html#bdedit.interface_scene.Scene.updateSceneDimensions\">(bdedit.interface_scene.Scene method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.updateSocketPositions\">updateSocketPositions() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block.Block.updateSocketSigns\">updateSocketSigns() (bdedit.block.Block method)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_graphics_wire.GraphicsWire.updateWireCoordinates\">updateWireCoordinates() (bdedit.block_graphics_wire.GraphicsWire method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"W\">W</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.interface_graphics_view.GraphicsView.wheelEvent\">wheelEvent() (bdedit.interface_graphics_view.GraphicsView method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdedit.html#bdedit.block_wire.Wire\">Wire (class in bdedit.block_wire)</a>\n</li>\n      <li><a href=\"bdedit.html#bdedit.block_wire.Wire.wire_type\">wire_type (bdedit.block_wire.Wire property)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n\n\n           </div>\n           \n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>\n        &#169; Copyright 2021, Daniel Petkov.\n\n    </p>\n  </div>\n    \n    \n    \n    Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    \n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    \n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>. \n\n</footer>\n        </div>\n      </div>\n\n    </section>\n\n  </div>\n  \n\n  <script type=\"text/javascript\">\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n\n  \n  \n    \n   \n\n</body>\n</html>"
  },
  {
    "path": "bdsim/bdedit/docs/index.html",
    "content": "\n\n<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  \n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  \n  <title>Welcome to BdEdit’s documentation! &mdash; BdEdit  documentation</title>\n  \n\n  \n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n\n  \n  \n\n  \n  \n\n  \n\n  \n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  \n    \n      <script type=\"text/javascript\" id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script data-url_root=\"./\" id=\"documentation_options\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n    \n    <script type=\"text/javascript\" src=\"_static/js/theme.js\"></script>\n\n    \n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n    <link rel=\"next\" title=\"bdedit\" href=\"modules.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\">\n\n   \n  <div class=\"wy-grid-for-nav\">\n    \n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n          \n\n          \n            <a href=\"#\" class=\"icon icon-home\"> BdEdit\n          \n\n          \n          </a>\n\n          \n            \n            \n          \n\n          \n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n\n          \n        </div>\n\n        \n        <div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"main navigation\">\n          \n            \n            \n              \n            \n            \n              <p class=\"caption\"><span class=\"caption-text\">Contents:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"modules.html\">bdedit</a></li>\n</ul>\n\n            \n          \n        </div>\n        \n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\">\n\n      \n      <nav class=\"wy-nav-top\" aria-label=\"top navigation\">\n        \n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"#\">BdEdit</a>\n        \n      </nav>\n\n\n      <div class=\"wy-nav-content\">\n        \n        <div class=\"rst-content\">\n        \n          \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<div role=\"navigation\" aria-label=\"breadcrumbs navigation\">\n\n  <ul class=\"wy-breadcrumbs\">\n    \n      <li><a href=\"#\" class=\"icon icon-home\"></a> &raquo;</li>\n        \n      <li>Welcome to BdEdit’s documentation!</li>\n    \n    \n      <li class=\"wy-breadcrumbs-aside\">\n        \n          \n            <a href=\"_sources/index.rst.txt\" rel=\"nofollow\"> View page source</a>\n          \n        \n      </li>\n    \n  </ul>\n\n  \n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n            \n  <div class=\"section\" id=\"welcome-to-bdedit-s-documentation\">\n<h1>Welcome to BdEdit’s documentation!<a class=\"headerlink\" href=\"#welcome-to-bdedit-s-documentation\" title=\"Permalink to this headline\">¶</a></h1>\n<div class=\"toctree-wrapper compound\">\n<p class=\"caption\"><span class=\"caption-text\">Contents:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"modules.html\">bdedit</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html\">bdedit package</a></li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n<div class=\"section\" id=\"indices-and-tables\">\n<h1>Indices and tables<a class=\"headerlink\" href=\"#indices-and-tables\" title=\"Permalink to this headline\">¶</a></h1>\n<ul class=\"simple\">\n<li><p><a class=\"reference internal\" href=\"genindex.html\"><span class=\"std std-ref\">Index</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"py-modindex.html\"><span class=\"std std-ref\">Module Index</span></a></p></li>\n<li><p><a class=\"reference internal\" href=\"search.html\"><span class=\"std std-ref\">Search Page</span></a></p></li>\n</ul>\n</div>\n\n\n           </div>\n           \n          </div>\n          <footer>\n    <div class=\"rst-footer-buttons\" role=\"navigation\" aria-label=\"footer navigation\">\n        <a href=\"modules.html\" class=\"btn btn-neutral float-right\" title=\"bdedit\" accesskey=\"n\" rel=\"next\">Next <span class=\"fa fa-arrow-circle-right\" aria-hidden=\"true\"></span></a>\n    </div>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>\n        &#169; Copyright 2021, Daniel Petkov.\n\n    </p>\n  </div>\n    \n    \n    \n    Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    \n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    \n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>. \n\n</footer>\n        </div>\n      </div>\n\n    </section>\n\n  </div>\n  \n\n  <script type=\"text/javascript\">\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n\n  \n  \n    \n   \n\n</body>\n</html>"
  },
  {
    "path": "bdsim/bdedit/docs/modules.html",
    "content": "\n\n<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  \n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  \n  <title>bdedit &mdash; BdEdit  documentation</title>\n  \n\n  \n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n\n  \n  \n\n  \n  \n\n  \n\n  \n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  \n    \n      <script type=\"text/javascript\" id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script data-url_root=\"./\" id=\"documentation_options\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n    \n    <script type=\"text/javascript\" src=\"_static/js/theme.js\"></script>\n\n    \n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n    <link rel=\"next\" title=\"bdedit package\" href=\"bdedit.html\" />\n    <link rel=\"prev\" title=\"Welcome to BdEdit’s documentation!\" href=\"index.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\">\n\n   \n  <div class=\"wy-grid-for-nav\">\n    \n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n          \n\n          \n            <a href=\"index.html\" class=\"icon icon-home\"> BdEdit\n          \n\n          \n          </a>\n\n          \n            \n            \n          \n\n          \n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n\n          \n        </div>\n\n        \n        <div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"main navigation\">\n          \n            \n            \n              \n            \n            \n              <p class=\"caption\"><span class=\"caption-text\">Contents:</span></p>\n<ul class=\"current\">\n<li class=\"toctree-l1 current\"><a class=\"current reference internal\" href=\"#\">bdedit</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html\">bdedit package</a></li>\n</ul>\n</li>\n</ul>\n\n            \n          \n        </div>\n        \n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\">\n\n      \n      <nav class=\"wy-nav-top\" aria-label=\"top navigation\">\n        \n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">BdEdit</a>\n        \n      </nav>\n\n\n      <div class=\"wy-nav-content\">\n        \n        <div class=\"rst-content\">\n        \n          \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<div role=\"navigation\" aria-label=\"breadcrumbs navigation\">\n\n  <ul class=\"wy-breadcrumbs\">\n    \n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n        \n      <li>bdedit</li>\n    \n    \n      <li class=\"wy-breadcrumbs-aside\">\n        \n          \n            <a href=\"_sources/modules.rst.txt\" rel=\"nofollow\"> View page source</a>\n          \n        \n      </li>\n    \n  </ul>\n\n  \n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n            \n  <div class=\"section\" id=\"bdedit\">\n<h1>bdedit<a class=\"headerlink\" href=\"#bdedit\" title=\"Permalink to this headline\">¶</a></h1>\n<div class=\"toctree-wrapper compound\">\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdedit.html\">bdedit package</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#submodules\">Submodules</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.Icons\">bdedit.Icons module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.block\">bdedit.block module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.block_graphics_block\">bdedit.block_graphics_block module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.block_graphics_socket\">bdedit.block_graphics_socket module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.block_graphics_wire\">bdedit.block_graphics_wire module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.block_param_window\">bdedit.block_param_window module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.block_socket\">bdedit.block_socket module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.block_socket_block\">bdedit.block_socket_block module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.block_wire\">bdedit.block_wire module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.interface\">bdedit.interface module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.interface_graphics_scene\">bdedit.interface_graphics_scene module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.interface_graphics_view\">bdedit.interface_graphics_view module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.interface_scene\">bdedit.interface_scene module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit.interface_serialize\">bdedit.interface_serialize module</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdedit.html#module-bdedit\">Module contents</a></li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n\n\n           </div>\n           \n          </div>\n          <footer>\n    <div class=\"rst-footer-buttons\" role=\"navigation\" aria-label=\"footer navigation\">\n        <a href=\"bdedit.html\" class=\"btn btn-neutral float-right\" title=\"bdedit package\" accesskey=\"n\" rel=\"next\">Next <span class=\"fa fa-arrow-circle-right\" aria-hidden=\"true\"></span></a>\n        <a href=\"index.html\" class=\"btn btn-neutral float-left\" title=\"Welcome to BdEdit’s documentation!\" accesskey=\"p\" rel=\"prev\"><span class=\"fa fa-arrow-circle-left\" aria-hidden=\"true\"></span> Previous</a>\n    </div>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>\n        &#169; Copyright 2021, Daniel Petkov.\n\n    </p>\n  </div>\n    \n    \n    \n    Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    \n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    \n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>. \n\n</footer>\n        </div>\n      </div>\n\n    </section>\n\n  </div>\n  \n\n  <script type=\"text/javascript\">\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n\n  \n  \n    \n   \n\n</body>\n</html>"
  },
  {
    "path": "bdsim/bdedit/docs/py-modindex.html",
    "content": "\n\n<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  \n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  \n  <title>Python Module Index &mdash; BdEdit  documentation</title>\n  \n\n  \n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n\n  \n  \n\n  \n  \n\n  \n\n  \n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  \n    \n      <script type=\"text/javascript\" id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script data-url_root=\"./\" id=\"documentation_options\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n    \n    <script type=\"text/javascript\" src=\"_static/js/theme.js\"></script>\n\n    \n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n \n\n\n</head>\n\n<body class=\"wy-body-for-nav\">\n\n   \n  <div class=\"wy-grid-for-nav\">\n    \n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n          \n\n          \n            <a href=\"index.html\" class=\"icon icon-home\"> BdEdit\n          \n\n          \n          </a>\n\n          \n            \n            \n          \n\n          \n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n\n          \n        </div>\n\n        \n        <div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"main navigation\">\n          \n            \n            \n              \n            \n            \n              <p class=\"caption\"><span class=\"caption-text\">Contents:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"modules.html\">bdedit</a></li>\n</ul>\n\n            \n          \n        </div>\n        \n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\">\n\n      \n      <nav class=\"wy-nav-top\" aria-label=\"top navigation\">\n        \n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">BdEdit</a>\n        \n      </nav>\n\n\n      <div class=\"wy-nav-content\">\n        \n        <div class=\"rst-content\">\n        \n          \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<div role=\"navigation\" aria-label=\"breadcrumbs navigation\">\n\n  <ul class=\"wy-breadcrumbs\">\n    \n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n        \n      <li>Python Module Index</li>\n    \n    \n      <li class=\"wy-breadcrumbs-aside\">\n        \n      </li>\n    \n  </ul>\n\n  \n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n            \n\n   <h1>Python Module Index</h1>\n\n   <div class=\"modindex-jumpbox\">\n   <a href=\"#cap-b\"><strong>b</strong></a>\n   </div>\n\n   <table class=\"indextable modindextable\">\n     <tr class=\"pcap\"><td></td><td>&#160;</td><td></td></tr>\n     <tr class=\"cap\" id=\"cap-b\"><td></td><td>\n       <strong>b</strong></td><td></td></tr>\n     <tr>\n       <td><img src=\"_static/minus.png\" class=\"toggler\"\n              id=\"toggle-1\" style=\"display: none\" alt=\"-\" /></td>\n       <td>\n       <a href=\"bdedit.html#module-bdedit\"><code class=\"xref\">bdedit</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.block\"><code class=\"xref\">bdedit.block</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.block_graphics_block\"><code class=\"xref\">bdedit.block_graphics_block</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.block_graphics_socket\"><code class=\"xref\">bdedit.block_graphics_socket</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.block_graphics_wire\"><code class=\"xref\">bdedit.block_graphics_wire</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.block_param_window\"><code class=\"xref\">bdedit.block_param_window</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.block_socket\"><code class=\"xref\">bdedit.block_socket</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.block_socket_block\"><code class=\"xref\">bdedit.block_socket_block</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.block_wire\"><code class=\"xref\">bdedit.block_wire</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.Icons\"><code class=\"xref\">bdedit.Icons</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.interface\"><code class=\"xref\">bdedit.interface</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.interface_graphics_scene\"><code class=\"xref\">bdedit.interface_graphics_scene</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.interface_graphics_view\"><code class=\"xref\">bdedit.interface_graphics_view</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.interface_scene\"><code class=\"xref\">bdedit.interface_scene</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdedit.html#module-bdedit.interface_serialize\"><code class=\"xref\">bdedit.interface_serialize</code></a></td><td>\n       <em></em></td></tr>\n   </table>\n\n\n           </div>\n           \n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>\n        &#169; Copyright 2021, Daniel Petkov.\n\n    </p>\n  </div>\n    \n    \n    \n    Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    \n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    \n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>. \n\n</footer>\n        </div>\n      </div>\n\n    </section>\n\n  </div>\n  \n\n  <script type=\"text/javascript\">\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n\n  \n  \n    \n   \n\n</body>\n</html>"
  },
  {
    "path": "bdsim/bdedit/docs/search.html",
    "content": "\n\n<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  \n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  \n  <title>Search &mdash; BdEdit  documentation</title>\n  \n\n  \n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n\n  \n  \n\n  \n  \n\n  \n\n  \n    \n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  \n    \n      <script type=\"text/javascript\" id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script data-url_root=\"./\" id=\"documentation_options\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n    \n    <script type=\"text/javascript\" src=\"_static/js/theme.js\"></script>\n\n    \n    <script type=\"text/javascript\" src=\"_static/searchtools.js\"></script>\n    <script type=\"text/javascript\" src=\"_static/language_data.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"#\" /> \n</head>\n\n<body class=\"wy-body-for-nav\">\n\n   \n  <div class=\"wy-grid-for-nav\">\n    \n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n          \n\n          \n            <a href=\"index.html\" class=\"icon icon-home\"> BdEdit\n          \n\n          \n          </a>\n\n          \n            \n            \n          \n\n          \n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"#\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n\n          \n        </div>\n\n        \n        <div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"main navigation\">\n          \n            \n            \n              \n            \n            \n              <p class=\"caption\"><span class=\"caption-text\">Contents:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"modules.html\">bdedit</a></li>\n</ul>\n\n            \n          \n        </div>\n        \n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\">\n\n      \n      <nav class=\"wy-nav-top\" aria-label=\"top navigation\">\n        \n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">BdEdit</a>\n        \n      </nav>\n\n\n      <div class=\"wy-nav-content\">\n        \n        <div class=\"rst-content\">\n        \n          \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<div role=\"navigation\" aria-label=\"breadcrumbs navigation\">\n\n  <ul class=\"wy-breadcrumbs\">\n    \n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n        \n      <li>Search</li>\n    \n    \n      <li class=\"wy-breadcrumbs-aside\">\n        \n      </li>\n    \n  </ul>\n\n  \n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n            \n  <noscript>\n  <div id=\"fallback\" class=\"admonition warning\">\n    <p class=\"last\">\n      Please activate JavaScript to enable the search functionality.\n    </p>\n  </div>\n  </noscript>\n\n  \n  <div id=\"search-results\">\n  \n  </div>\n\n           </div>\n           \n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>\n        &#169; Copyright 2021, Daniel Petkov.\n\n    </p>\n  </div>\n    \n    \n    \n    Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    \n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    \n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>. \n\n</footer>\n        </div>\n      </div>\n\n    </section>\n\n  </div>\n  \n\n  <script type=\"text/javascript\">\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n\n  \n  \n    \n  \n  <script type=\"text/javascript\">\n    jQuery(function() { Search.loadIndex(\"searchindex.js\"); });\n  </script>\n  \n  <script type=\"text/javascript\" id=\"searchindexloader\"></script>\n   \n\n\n</body>\n</html>"
  },
  {
    "path": "bdsim/bdedit/docs/searchindex.js",
    "content": "Search.setIndex({docnames:[\"bdedit\",\"block_docs/block_discrete_blocks\",\"block_docs/block_function_blocks\",\"block_docs/block_hierarchy_blocks\",\"block_docs/block_sink_blocks\",\"block_docs/block_source_blocks\",\"block_docs/block_transfer_blocks\",\"block_docs/modules\",\"index\",\"modules\"],envversion:{\"sphinx.domains.c\":2,\"sphinx.domains.changeset\":1,\"sphinx.domains.citation\":1,\"sphinx.domains.cpp\":3,\"sphinx.domains.index\":1,\"sphinx.domains.javascript\":2,\"sphinx.domains.math\":2,\"sphinx.domains.python\":3,\"sphinx.domains.rst\":2,\"sphinx.domains.std\":2,sphinx:56},filenames:[\"bdedit.rst\",\"block_docs\\\\block_discrete_blocks.rst\",\"block_docs\\\\block_function_blocks.rst\",\"block_docs\\\\block_hierarchy_blocks.rst\",\"block_docs\\\\block_sink_blocks.rst\",\"block_docs\\\\block_source_blocks.rst\",\"block_docs\\\\block_transfer_blocks.rst\",\"block_docs\\\\modules.rst\",\"index.rst\",\"modules.rst\"],objects:{\"\":{bdedit:[0,0,0,\"-\"]},\"bdedit.Icons\":{qCleanupResources:[0,1,1,\"\"],qInitResources:[0,1,1,\"\"]},\"bdedit.block\":{Block:[0,2,1,\"\"],DiscreteBlock:[0,2,1,\"\"],FunctionBlock:[0,2,1,\"\"],INPORTBlock:[0,2,1,\"\"],OUTPORTBlock:[0,2,1,\"\"],SUBSYSTEMBlock:[0,2,1,\"\"],SinkBlock:[0,2,1,\"\"],SourceBlock:[0,2,1,\"\"],TransferBlock:[0,2,1,\"\"],TupleEncoder:[0,2,1,\"\"],block:[0,1,1,\"\"],blockname:[0,1,1,\"\"]},\"bdedit.block.Block\":{__init__:[0,3,1,\"\"],closeParamWindow:[0,3,1,\"\"],deserialize:[0,3,1,\"\"],getSocketPosition:[0,3,1,\"\"],makeInputSockets:[0,3,1,\"\"],makeOutputSockets:[0,3,1,\"\"],pos:[0,4,1,\"\"],remove:[0,3,1,\"\"],removeSockets:[0,3,1,\"\"],serialize:[0,3,1,\"\"],setDefaultTitle:[0,3,1,\"\"],setFocusOfBlocks:[0,3,1,\"\"],setPos:[0,3,1,\"\"],setTitle:[0,3,1,\"\"],toggleParamWindow:[0,3,1,\"\"],tuple_decoder:[0,3,1,\"\"],updateConnectedEdges:[0,3,1,\"\"],updateSocketPositions:[0,3,1,\"\"],updateSocketSigns:[0,3,1,\"\"]},\"bdedit.block.DiscreteBlock\":{__init__:[0,3,1,\"\"],numInputs:[0,3,1,\"\"],numOutputs:[0,3,1,\"\"]},\"bdedit.block.FunctionBlock\":{__init__:[0,3,1,\"\"],numInputs:[0,3,1,\"\"],numOutputs:[0,3,1,\"\"]},\"bdedit.block.INPORTBlock\":{__init__:[0,3,1,\"\"],numInputs:[0,3,1,\"\"],numOutputs:[0,3,1,\"\"]},\"bdedit.block.OUTPORTBlock\":{__init__:[0,3,1,\"\"],numInputs:[0,3,1,\"\"],numOutputs:[0,3,1,\"\"]},\"bdedit.block.SUBSYSTEMBlock\":{__init__:[0,3,1,\"\"],numInputs:[0,3,1,\"\"],numOutputs:[0,3,1,\"\"]},\"bdedit.block.SinkBlock\":{__init__:[0,3,1,\"\"],numInputs:[0,3,1,\"\"],numOutputs:[0,3,1,\"\"]},\"bdedit.block.SourceBlock\":{__init__:[0,3,1,\"\"],numInputs:[0,3,1,\"\"],numOutputs:[0,3,1,\"\"]},\"bdedit.block.TransferBlock\":{__init__:[0,3,1,\"\"],numInputs:[0,3,1,\"\"],numOutputs:[0,3,1,\"\"]},\"bdedit.block.TupleEncoder\":{encode:[0,3,1,\"\"]},\"bdedit.block_graphics_block\":{GraphicsBlock:[0,2,1,\"\"],GraphicsSocketBlock:[0,2,1,\"\"]},\"bdedit.block_graphics_block.GraphicsBlock\":{__init__:[0,3,1,\"\"],boundingRect:[0,3,1,\"\"],checkBlockHeight:[0,3,1,\"\"],checkMode:[0,3,1,\"\"],getTitle:[0,3,1,\"\"],initTitle:[0,3,1,\"\"],initUI:[0,3,1,\"\"],mouseMoveEvent:[0,3,1,\"\"],mousePressEvent:[0,3,1,\"\"],paint:[0,3,1,\"\"],setTitle:[0,3,1,\"\"],titleLength:[0,3,1,\"\"],updateMode:[0,3,1,\"\"]},\"bdedit.block_graphics_block.GraphicsSocketBlock\":{__init__:[0,3,1,\"\"],boundingRect:[0,3,1,\"\"],initUI:[0,3,1,\"\"],mouseMoveEvent:[0,3,1,\"\"],mousePressEvent:[0,3,1,\"\"],paint:[0,3,1,\"\"]},\"bdedit.block_graphics_socket\":{GraphicsSocket:[0,2,1,\"\"]},\"bdedit.block_graphics_socket.GraphicsSocket\":{__init__:[0,3,1,\"\"],boundingRect:[0,3,1,\"\"],getSignPath:[0,3,1,\"\"],paint:[0,3,1,\"\"],paintDivide:[0,3,1,\"\"],paintMinus:[0,3,1,\"\"],paintMultiply:[0,3,1,\"\"],paintPlus:[0,3,1,\"\"]},\"bdedit.block_graphics_wire\":{GraphicsWire:[0,2,1,\"\"],GraphicsWireBezier:[0,2,1,\"\"],GraphicsWireDirect:[0,2,1,\"\"],GraphicsWireStep:[0,2,1,\"\"]},\"bdedit.block_graphics_wire.GraphicsWire\":{__init__:[0,3,1,\"\"],paint:[0,3,1,\"\"],setDestination:[0,3,1,\"\"],setDestinationOrientation:[0,3,1,\"\"],setSource:[0,3,1,\"\"],setSourceOrientation:[0,3,1,\"\"],updateLineSegments:[0,3,1,\"\"],updatePath:[0,3,1,\"\"],updateWireCoordinates:[0,3,1,\"\"]},\"bdedit.block_graphics_wire.GraphicsWireBezier\":{updatePath:[0,3,1,\"\"]},\"bdedit.block_graphics_wire.GraphicsWireDirect\":{updatePath:[0,3,1,\"\"]},\"bdedit.block_graphics_wire.GraphicsWireStep\":{updatePath:[0,3,1,\"\"]},\"bdedit.block_param_window\":{ParamWindow:[0,2,1,\"\"]},\"bdedit.block_param_window.ParamWindow\":{__init__:[0,3,1,\"\"],buildParamWindow:[0,3,1,\"\"],closeQMessageBox:[0,3,1,\"\"],displayPopUpMessage:[0,3,1,\"\"],getSafeValue:[0,3,1,\"\"],initUI:[0,3,1,\"\"],updateBlockParameters:[0,3,1,\"\"]},\"bdedit.block_socket\":{Socket:[0,2,1,\"\"]},\"bdedit.block_socket.Socket\":{__init__:[0,3,1,\"\"],deserialize:[0,3,1,\"\"],getSocketPosition:[0,3,1,\"\"],hasEdge:[0,3,1,\"\"],isInputSocket:[0,3,1,\"\"],isOutputSocket:[0,3,1,\"\"],removeAllWires:[0,3,1,\"\"],removeSockets:[0,3,1,\"\"],removeWire:[0,3,1,\"\"],serialize:[0,3,1,\"\"],setConnectedEdge:[0,3,1,\"\"]},\"bdedit.block_socket_block\":{Connector:[0,2,1,\"\"]},\"bdedit.block_socket_block.Connector\":{__init__:[0,3,1,\"\"]},\"bdedit.block_wire\":{Wire:[0,2,1,\"\"]},\"bdedit.block_wire.Wire\":{__init__:[0,3,1,\"\"],checkIntersections:[0,3,1,\"\"],deserialize:[0,3,1,\"\"],end_socket:[0,4,1,\"\"],remove:[0,3,1,\"\"],remove_from_sockets:[0,3,1,\"\"],serialize:[0,3,1,\"\"],start_socket:[0,4,1,\"\"],updatePositions:[0,3,1,\"\"],wire_type:[0,4,1,\"\"]},\"bdedit.interface\":{Interface:[0,2,1,\"\"],importBlocks:[0,1,1,\"\"]},\"bdedit.interface.Interface\":{__init__:[0,3,1,\"\"],initUI:[0,3,1,\"\"],loadFromFile:[0,3,1,\"\"],on_click:[0,3,1,\"\"],resizeEvent:[0,3,1,\"\"],saveAsToFile:[0,3,1,\"\"],saveToFile:[0,3,1,\"\"],save_image:[0,3,1,\"\"],toggleCanvasItems:[0,3,1,\"\"],toggleDiscreteBlocks:[0,3,1,\"\"],toggleFunctionBlocks:[0,3,1,\"\"],toggleSinkBlocks:[0,3,1,\"\"],toggleSourceBlocks:[0,3,1,\"\"],toggleSubSystemBlocks:[0,3,1,\"\"],toggleTransferBlocks:[0,3,1,\"\"],updateColorMode:[0,3,1,\"\"],updateSceneDimensions:[0,3,1,\"\"]},\"bdedit.interface_graphics_scene\":{GraphicsScene:[0,2,1,\"\"]},\"bdedit.interface_graphics_scene.GraphicsScene\":{__init__:[0,3,1,\"\"],checkMode:[0,3,1,\"\"],drawBackground:[0,3,1,\"\"],drawForeground:[0,3,1,\"\"],mouseMoveEvent:[0,3,1,\"\"],setGrScene:[0,3,1,\"\"],updateMode:[0,3,1,\"\"]},\"bdedit.interface_graphics_view\":{GraphicsView:[0,2,1,\"\"]},\"bdedit.interface_graphics_view.GraphicsView\":{__init__:[0,3,1,\"\"],closeParamWindows:[0,3,1,\"\"],deleteSelected:[0,3,1,\"\"],dist_click_release:[0,3,1,\"\"],edgeDragEnd:[0,3,1,\"\"],edgeDragStart:[0,3,1,\"\"],flipBlockSockets:[0,3,1,\"\"],getItemAtClick:[0,3,1,\"\"],initUI:[0,3,1,\"\"],intersectionTest:[0,3,1,\"\"],keyPressEvent:[0,3,1,\"\"],leftMouseButtonPress:[0,3,1,\"\"],leftMouseButtonRelease:[0,3,1,\"\"],middleMouseButtonPress:[0,3,1,\"\"],middleMouseButtonRelease:[0,3,1,\"\"],mouseMoveEvent:[0,3,1,\"\"],mousePressEvent:[0,3,1,\"\"],mouseReleaseEvent:[0,3,1,\"\"],rightMouseButtonPress:[0,3,1,\"\"],rightMouseButtonRelease:[0,3,1,\"\"],wheelEvent:[0,3,1,\"\"]},\"bdedit.interface_scene\":{Scene:[0,2,1,\"\"]},\"bdedit.interface_scene.Scene\":{__init__:[0,3,1,\"\"],addBlock:[0,3,1,\"\"],addWire:[0,3,1,\"\"],checkForDuplicates:[0,3,1,\"\"],clear:[0,3,1,\"\"],deserialize:[0,3,1,\"\"],displayMessage:[0,3,1,\"\"],getSceneHeight:[0,3,1,\"\"],getSceneWidth:[0,3,1,\"\"],initUI:[0,3,1,\"\"],loadFromFile:[0,3,1,\"\"],removeBlock:[0,3,1,\"\"],removeWire:[0,3,1,\"\"],saveToFile:[0,3,1,\"\"],serialize:[0,3,1,\"\"],setSceneHeight:[0,3,1,\"\"],setSceneWidth:[0,3,1,\"\"],updateSceneDimensions:[0,3,1,\"\"]},\"bdedit.interface_serialize\":{Serializable:[0,2,1,\"\"]},\"bdedit.interface_serialize.Serializable\":{__init__:[0,3,1,\"\"],deserialize:[0,3,1,\"\"],serialize:[0,3,1,\"\"]},bdedit:{\"interface\":[0,0,0,\"-\"],Icons:[0,0,0,\"-\"],block:[0,0,0,\"-\"],block_graphics_block:[0,0,0,\"-\"],block_graphics_socket:[0,0,0,\"-\"],block_graphics_wire:[0,0,0,\"-\"],block_param_window:[0,0,0,\"-\"],block_socket:[0,0,0,\"-\"],block_socket_block:[0,0,0,\"-\"],block_wire:[0,0,0,\"-\"],interface_graphics_scene:[0,0,0,\"-\"],interface_graphics_view:[0,0,0,\"-\"],interface_scene:[0,0,0,\"-\"],interface_serialize:[0,0,0,\"-\"]}},objnames:{\"0\":[\"py\",\"module\",\"Python module\"],\"1\":[\"py\",\"function\",\"Python function\"],\"2\":[\"py\",\"class\",\"Python class\"],\"3\":[\"py\",\"method\",\"Python method\"],\"4\":[\"py\",\"property\",\"Python property\"]},objtypes:{\"0\":\"py:module\",\"1\":\"py:function\",\"2\":\"py:class\",\"3\":\"py:method\",\"4\":\"py:property\"},terms:{\"0\":0,\"1\":0,\"1000\":0,\"15721641\":0,\"2\":0,\"2160\":0,\"3\":0,\"3840\":0,\"4k\":0,\"5\":0,\"90\":0,\"boolean\":0,\"class\":0,\"default\":0,\"do\":0,\"enum\":0,\"final\":0,\"float\":0,\"function\":0,\"import\":0,\"int\":0,\"new\":0,\"return\":0,\"static\":0,\"true\":0,\"while\":0,AND:0,And:0,As:0,For:0,If:0,It:0,No:0,Or:0,TO:0,That:0,The:0,Then:0,These:0,To:0,__class__:0,__init__:0,__name__:0,__tuple__:0,about:0,abov:0,access:0,accompani:0,act:0,action:0,activ:0,ad:0,adapt:0,add:0,addblock:0,addit:0,addition:0,addwir:0,affect:0,after:0,against:0,align:0,all:0,allow:0,allow_nan:0,along:0,alongsid:0,alreadi:0,also:0,altern:0,alwai:0,amongst:0,an:0,ani:0,anoth:0,anywher:0,apart:0,appear:0,append:0,appli:0,applic:0,appropri:0,ar:0,area:0,around:0,arrow:0,assign:0,associ:0,attempt:0,auto:0,automat:0,awai:0,back:0,background:0,backspac:0,bad:0,base:0,basic:0,bdsim:0,becaus:0,been:0,befor:0,begin:0,behav:0,behind:0,being:0,belong:0,below:0,bend:0,between:0,bezier:0,blob:0,block:9,block_class:0,block_discrete_block:7,block_function_block:7,block_graphics_block:9,block_graphics_socket:9,block_graphics_wir:9,block_hierarchy_block:7,block_param_window:9,block_sink_block:7,block_socket:9,block_socket_block:9,block_source_block:7,block_transfer_block:7,block_wir:9,blocknam:0,bodi:0,bool:0,border:0,both:0,boundingrect:0,box:0,browser:0,brush:0,build:0,buildparamwindow:0,built:0,button:0,calcul:0,call:0,can:0,canva:0,capit:0,caus:0,certain:0,chang:0,charact:0,check:0,check_circular:0,checkblockheight:0,checkfordupl:0,checkintersect:0,checkmod:0,child:0,choos:0,chosen:0,circl:0,cl:0,clear:0,click:0,close:0,closeparamwindow:0,closeqmessagebox:0,code:0,color:0,colour:0,com:0,combin:0,compat:0,complet:0,compon:0,comput:0,condit:0,connect:0,connector:0,construct:0,contain:0,content:9,control:0,convert:0,coordin:0,copi:0,could:0,creat:0,criteria:0,ctrl:0,cubic:0,current:0,cursor:0,curv:0,dark:0,data:0,decid:0,decod:0,decor:0,defin:0,degre:0,del:0,delet:0,deleteselect:0,depend:0,deselect:0,deseri:0,desir:0,desktop:0,destin:0,detect:0,determin:0,develop:0,diagram:0,dict:0,dictat:0,dictionari:0,differ:0,dimens:0,direct:0,directli:0,disabl:0,disappear:0,discret:0,discreteblock:0,displai:0,displaymessag:0,displaypopupmessag:0,dist_click_releas:0,distanc:0,divid:0,document:0,doe:0,doesn:0,done:0,down:0,drag:0,draggabl:0,draw:0,drawbackground:0,drawforeground:0,drawn:0,drop:0,duplic:0,e:0,each:0,edgedragend:0,edgedragstart:0,edit:0,either:0,elaps:0,element:0,empti:0,encod:0,end:0,end_socket:0,enforc:0,enough:0,ensur:0,ensure_ascii:0,enter:0,enumer:0,equal:0,error:0,es:0,essenti:0,even:0,evenli:0,event:0,ever:0,everi:0,exactli:0,exampl:0,exist:0,exit:0,expand:0,explan:0,extend:0,extract:0,f:0,fals:0,far:0,feedback:0,file:0,filenam:0,filepath:0,fill:0,find:0,first:0,fit:0,flag:0,flip:0,flipblocksocket:0,follow:0,foreground:0,format:0,found:0,freeli:0,from:0,front:0,functionblock:0,further:0,futur:0,g:0,gain:0,gener:0,get:0,getitematclick:0,getsafevalu:0,getsceneheight:0,getscenewidth:0,getsignpath:0,getsocketposit:0,gettitl:0,github:0,give:0,given:0,go:0,goe:0,good:0,grab:0,grai:0,grandchild:0,graphic:0,graphicsblock:0,graphicsocket:0,graphicsscen:0,graphicssocket:0,graphicssocketblock:0,graphicsview:0,graphicswir:0,graphicswirebezi:0,graphicswiredirect:0,graphicswirestep:0,graphicwir:0,grid:0,grscene:0,ha:0,hand:0,handl:0,happen:0,hasedg:0,hashmap:0,have:0,height:0,here:0,hide:0,hold:0,horizont:0,hous:0,how:0,howev:0,http:0,icon:9,idea:0,identif:0,imag:0,implement:0,importblock:0,inbuilt:0,includ:0,incompat:0,increment:0,indent:0,index:[0,8],individu:0,inf:0,inform:0,inherit:0,initi:0,inittitl:0,initui:0,inport:0,inportblock:0,input:0,inputsnum:0,inputvalu:0,insid:0,instanc:0,instead:0,intend:0,interact:0,interfac:9,interface_graphics_scen:9,interface_graphics_view:9,interface_scen:9,interface_seri:9,intern:0,intersect:0,intersectiontest:0,intuit:0,invalid:0,isinputsocket:0,isn:0,isoutputsocket:0,issu:0,item:0,its:0,itself:0,json:0,jsonencod:0,kei:0,keypressev:0,keyword:0,know:0,known:0,l:0,label:0,last:0,later:0,layer:0,layout:0,left:0,leftmousebuttonpress:0,leftmousebuttonreleas:0,length:0,librari:0,light:0,like:0,line:0,link:0,list:0,load:0,loadfromfil:0,local:0,locat:0,logic:0,look:0,loop:0,made:0,make:0,makeinputsocket:0,makeoutputsocket:0,manag:0,mani:0,manipul:0,map:0,mark:0,match:0,math:0,max:0,maximum:0,mean:0,meet:0,mention:0,menu:0,messag:0,messagetyp:0,met:0,method:0,middl:0,middlemousebuttonpress:0,middlemousebuttonreleas:0,mimick:0,min:0,mode:0,mode_wire_drag:0,modul:[7,8,9],more:0,most:0,mous:0,mousemoveev:0,mousepressev:0,mousereleaseev:0,movabl:0,move:0,movement:0,multi:0,multi_wir:0,multipl:0,must:0,n:0,name:0,neatli:0,necessari:0,need:0,neither:0,net:0,new_coordin:0,next:0,node:0,non:0,none:0,nonetyp:0,note:0,noth:0,notifi:0,now:0,number:0,numinput:0,numoutput:0,obj:0,object:0,occur:0,off:0,old:0,on_click:0,onc:0,one:0,onli:0,onto:0,open:0,option:0,orang:0,order:0,ordereddict:0,orient:0,other:0,otherwis:0,out:0,outlin:0,outport:0,outportblock:0,output:0,outputsnum:0,outsid:0,over:0,overlap:0,overrid:0,overtop:0,overwritten:0,own:0,packag:[8,9],page:8,paint:0,paintdivid:0,painter:0,paintminu:0,paintmultipli:0,paintplu:0,pair:0,param:0,paramet:0,paramwindow:0,parent:0,pass:0,past:0,path:0,pen:0,perhap:0,petercork:0,picture_nam:0,pinch:0,pixel:0,place:0,plain:0,pleas:0,po:0,point:0,pointer:0,pop:0,popul:0,posit:0,premul:0,press:0,prevent:0,previou:0,previous:0,prod:0,prompt:0,properti:0,propos:0,provid:0,purpos:0,py:0,pyqt5:0,qcleanupresourc:0,qfiledialog:0,qgraphicsitem:0,qgraphicspathitem:0,qgraphicsscen:0,qgraphicstextitem:0,qgraphicsview:0,qgridlayout:0,qinitresourc:0,qkeypressev:0,qmouseev:0,qmousemoveev:0,qmousepressev:0,qmousereleaseev:0,qpainter:0,qpainterpath:0,qrect:0,qrectf:0,qresizeev:0,qstyleoptiongraphicsitem:0,qtcore:0,qtwidget:0,qwheelev:0,qwidget:0,rang:0,re:0,reach:0,recogn:0,reconstruct:0,recreat:0,rect:0,rectangl:0,redirect:0,redraw:0,reduc:0,refer:0,referenc:0,reformat:0,regist:0,relat:0,releas:0,relev:0,remov:0,remove_from_socket:0,removeallwir:0,removeblock:0,removesocket:0,removewir:0,repeat:0,replac:0,repres:0,represent:0,requir:0,requiredopt:0,requiredtyp:0,resiz:0,resizeev:0,resolut:0,resourc:0,respect:0,respons:0,restrict:0,retriev:0,right:0,rightmousebuttonpress:0,rightmousebuttonreleas:0,round:0,rtype:0,run:0,s:0,safe:0,same:0,saniti:0,save:0,save_imag:0,saveastofil:0,savetofil:0,scene:0,scene_height:0,scene_width:0,screen:0,screen_height:0,screen_width:0,scroll:0,search:8,second:0,section:0,see:0,segment:0,select:0,self:0,send:0,sent:0,separ:0,serial:0,serializ:0,set:0,setconnectededg:0,setdefaulttitl:0,setdestin:0,setdestinationorient:0,setfocusofblock:0,setgrscen:0,setpo:0,setsceneheight:0,setscenewidth:0,setsourc:0,setsourceorient:0,settitl:0,shape:0,shift:0,shortest:0,should:0,shown:0,side:0,sign:0,signifi:0,simpler:0,simpli:0,sinc:0,sine:0,singl:0,sink:0,sinkblock:0,size:0,skipkei:0,slice:0,slight:0,smaller:0,smoother:0,snap:0,snapshot:0,so:0,socket:0,socket_typ:0,sockettyp:0,some:0,sort_kei:0,sound:0,sourc:0,sourceblock:0,space:0,specif:0,specifi:0,squar:0,stackoverflow:0,start:0,start_socket:0,step:0,still:0,storag:0,store:0,str:0,straight:0,string:0,strip:0,structur:0,style:0,subclass:0,submodul:9,subsequ:0,subsystem:0,subsystemblock:0,success:0,successfulli:0,sum:0,support:0,t:0,take:0,technic:0,term:0,text:0,than:0,thei:0,them:0,thi:0,thicker:0,thing:0,think:0,those:0,three:0,through:0,time:0,titl:0,titlelength:0,toggl:0,togglecanvasitem:0,togglediscreteblock:0,togglefunctionblock:0,toggleparamwindow:0,togglesinkblock:0,togglesourceblock:0,togglesubsystemblock:0,toggletransferblock:0,too:0,toolbar:0,top:0,transfer:0,transferblock:0,triangl:0,trigger:0,tupl:0,tuple_decod:0,tupleencod:0,turn:0,two:0,type:0,un:0,under:0,underneath:0,underscor:0,understood:0,union:0,uniqu:0,unnam:0,unsuccess:0,until:0,up:0,updat:0,updateblockparamet:0,updatecolormod:0,updateconnectededg:0,updatelineseg:0,updatemod:0,updatepath:0,updateposit:0,updatescenedimens:0,updatesocketposit:0,updatesocketsign:0,updatewirecoordin:0,upon:0,us:0,usabl:0,user:0,valu:0,vari:0,variabl:0,vertic:0,visibl:0,visual:0,wa:0,wai:0,wave:0,we:0,well:0,were:0,what:0,wheel:0,wheelev:0,when:0,whenev:0,where:0,whether:0,which:0,widget:0,width:0,window:0,wire:0,wire_typ:0,within:0,without:0,word:0,work:0,would:0,wrap:0,write:0,written:0,x:0,y:0,zoom:0},titles:[\"bdedit package\",\"block_discrete_blocks module\",\"block_function_blocks module\",\"block_hierarchy_blocks module\",\"block_sink_blocks module\",\"block_source_blocks module\",\"block_transfer_blocks module\",\"Block_Classes\",\"Welcome to BdEdit\\u2019s documentation!\",\"bdedit\"],titleterms:{bdedit:[0,8,9],block:0,block_class:7,block_discrete_block:1,block_function_block:2,block_graphics_block:0,block_graphics_socket:0,block_graphics_wir:0,block_hierarchy_block:3,block_param_window:0,block_sink_block:4,block_socket:0,block_socket_block:0,block_source_block:5,block_transfer_block:6,block_wir:0,content:[0,8],document:8,icon:0,indic:8,interfac:0,interface_graphics_scen:0,interface_graphics_view:0,interface_scen:0,interface_seri:0,modul:[0,1,2,3,4,5,6],packag:0,s:8,submodul:0,tabl:8,welcom:8}})"
  },
  {
    "path": "bdsim/bdedit/docstring.md",
    "content": "\n# Parameter types and defaults\n\nThe docstrings of bdsim blocks are parsed to determine the types and default values of all parameters.\nThis means that they need to conform to some simple guidelines.\n\n`bdedit` parses the docstrings of all discovered blocks at startup time, and  will complain at runtime if it cannot parse a docstring.\n\nInput values are checked when the `Update parameters` button is clicked, and type or value violations are notified by a popup.\n\n## Default values\n\n\nFor assigning the default value for a parameter, expected format in param definition\n\n```\n:param myparam: ..., defaults to X\n```\n\n* Text up until `defaults to` is ignored, the rest is either a value that can be evaluated or a string\n* If the value cannot be parsed it defaults to `None` \n\n### List\n\n* If the value that follows `defaults to` is in the form of a list, there must be no spaces between values in the list, e.g. [0,0,0]\n\nFor example:\n\n```\n\tfrequency, defaults to 1\n\tthe constant, defaults to None\n\tinterpolation method, defaults to 'linear'\n\tdenominator coefficients, defaults to [1,1]\n\taxis labels (xlabel, ylabel), defaults to [\"X\",\"Y\"]\n\tInitial phase of signal in the range [0,1], defaults to 0\n\tduty cycle for square wave in range [0,1], defaults to 0.5\n\textra keyword arguments passed to the function, defaults to {}\n\tpass in a reference to a dictionary instance, defaults to False\n\textra positional arguments passed to the function, defaults to []\n\tsigns associated with input ports, accepted characters: + or -, defaults to '++'\n```\n\n### One of a set\n\nFor parameters where input can be one of certain keywords, expected format in param definition:\n\n```\n:param myparam: ... one of: 'option1', 'option2' [default], 'option3'\n```\n\n* Text up until `one of:` is ignored\n* After `one of:` every option is expected to be given as as string using **single quotes**\n* Options are separated by commas\n* The default value has `[default]` after the option string, but before the comma\n* There should be no more text after last option\n\t\nFor example:\n\n```\n\ttype of waveform to generate, one of: 'sine', 'square' [default], 'triangle'\n\tfrequency unit, one of: 'rad/s', 'Hz' [default]\n```\n\n### Range limit\n\nFor parameters where input must be within a range, expected format in param definition:\n\n```\n:param myparam: ... range [min, max]\n```\n\n* Text up to `range` is ignored\n* The string after `range` bdedit is evaluated and the result is a list instance of length of 2 which is taken as the range, else an error message.\n\t\nFor example:\n\n```\n\tduty cycle for square wave in range [0,1], defaults to 0.5\n\tInitial phase of signal in the range [0,1], defaults to 0\n```\n### Character subset\n\nFor parameters where input is a string that comprises a subset of characters:\n\n```\n:param myparam: \t... accepted characters: X or Y or Z\n```\n\n* Text up to `accepted characters:` is ignored\n* Text after after `accepted characters:` is assumed to be a white-space separated list and the\n even elements are taken.  The odd elements are the keyword `or`.\n* Values must be **not alphanumeric**, else ignored. \n* \tbdedit knows it has reached the end of the character options when there is no longer an `or` after a given value\n\n\t\nFor example:\n\n```\n\tsigns associated with input ports, accepted characters: + or -, defaults to '++'\n\toperations associated with input ports, accepted characters: * or /, defaults to '**'\n```\n\n\n## Parameter types\n\nIf for whatever reason a parameter type is not detected, bdedit will assign `str` as the default type. \n\n\n### Array like\n\n\nIf the keyword `array_like` is used in the type definition of a parameter.\n\n#### No size restriction\n```\n:type myparam: ... or array_like, ...\n:type myparam: ...\tarray_like ..., ...\n:type myparam: ...\tarray_like, ...\n```\n\n* bdedit uses regex to search for `array_like[^(]` (not size restricted) \n\nFor example:\n\n```\n\tfloat or array_like, optional\n\tarray_like, shape (N,) optional\n\tarray_like, optional\n\tarray_like\n```\n\n#### With size restriction\n\n```\n:type myparam: ...\tor array_like(N), ...\n:type myparam: ...\tarray_like(N) ..., ...\n:type myparam: ...\tarray_like(N), ...\n```\n\n* bdedit uses regex to search for `array_like([0-9]+)` (size restricted)\n* if a match, or multiple matches for `array_like` are found, each will be checked for size restrictions\n\t\t\n???? \n* if size restrictions are found: \tparameter restricted to types: list or dict\n* else if no size restrictions are found: parameter restricted to types: list, dict, int or float\n\nFor example:\n\n```\n\tstr or array_like(2) or array_like(4)\n\tstr or array_like(2), optional\n\tstr or array_like(2)\n\tarray_like(2)\n```\t\n\t\n\n\n\n### sequence or string\n\n* If keyword `string` (instead of `str`) is found, the parameter will be granted types: \t\tlist and str \n* If keyword `sequence`  found, the parameter will be granted types:\t\tlist\n\nFor example:\n\n```\n\tcallable or sequence of callables, optional\n\tsequence of strings\n\tbool or sequence\n\tsequence of time, value pairs\n```\n\n### Python native types\n\nIf any of the keywords `str`, `int`, `float`, `list`, `dict` are used are used in type definition of a parameter, bdedit will simply try to evaluate the given parameter value and test the resulting\ntype.\n\nIf keywords `callable`, `any` are used in type definition of a parameter, bdedit will consider the parameter of type `str`. \n\nThe keyword `tuple` will be considered to be type `list` (JSON cannot distinguish `tuple` and `list`) \n\n\n"
  },
  {
    "path": "bdsim/bdedit/floating_label.py",
    "content": "# Library imports\nimport json\nimport copy\nfrom collections import OrderedDict\n\n# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n# BdEdit imports\nfrom bdsim.bdedit.interface_serialize import Serializable\nfrom bdsim.bdedit.floating_label_graphics import GraphicsLabel\n\n\nDEBUG = False\n\n\nclass Floating_Label(Serializable):\n    def __init__(self, scene, window, mainwindow, label_text=\"text\", pos=(0, 0)):\n        super().__init__()\n        self.scene = scene\n        self.window = window\n        self.interfaceManager = mainwindow\n        self.label_text = label_text\n        self.position = pos\n\n        self.width = 0\n        self.height = 0\n\n        self.content = ContentWidget(self)\n        self.grContent = GraphicsLabel(self)\n\n        self.scene.addLabel(self)\n        self.scene.grScene.addItem(self.grContent)\n\n        self.scene.has_been_modified = True\n\n    def setPos(self, x, y):\n        self.grContent.setPos(x, y)\n\n    def setFocusOfFloatingText(self):\n        \"\"\"\n        This method sends all ``FloatingLabel`` instances within the ``Scene`` to back\n        and then sends the currently selected ``FloatingLabel`` instance to front.\n        \"\"\"\n\n        # Iterates through each floating label within the relevant list stored in\n        # the Scene Class and sets the graphical component of each label to a zValue of -4.\n        for floatinglabel in self.scene.floating_labels:\n            floatinglabel.grContent.setZValue(-4)\n\n        # Then sets the graphical component of the currently selected label to a\n        # zValue of -3, which makes it display above all other labels on screen.\n        self.grContent.setZValue(-3)\n\n    # Todo - update comments to match floating label, not block\n    def remove(self):\n\n        # For each socket associated with this block, remove the connected wires\n        if DEBUG:\n            print(\"> Removing Floating Label\", self)\n\n        # Remove the graphical representation of this block from the scene\n        # This will also remove the associated graphical representation of the\n        # blocks' sockets.\n        if DEBUG:\n            print(\" - removing grContent\")\n        self.scene.grScene.removeItem(self.grContent)\n        self.grContent = None\n\n        # Finally, call the removeBlock method from within the Scene, which\n        # removes this block from the list of blocks stored in the Scene.\n        if DEBUG:\n            print(\" - removing Floating Label from the scene\")\n        self.scene.removeLabel(self)\n        if DEBUG:\n            print(\" - everything was done.\")\n\n    # -----------------------------------------------------------------------------\n    def serialize(self):\n        font_info = self.content.text_edit.toHtml()\n        fill_color = self.content.backgroundColor.getRgb()\n\n        return OrderedDict(\n            [\n                (\"id\", self.id),\n                (\"text\", self.label_text),\n                (\"pos_x\", self.grContent.scenePos().x()),\n                (\"pos_y\", self.grContent.scenePos().y()),\n                (\"width\", self.width),\n                (\"height\", self.height),\n                (\"fill_color\", fill_color),\n                (\"styling\", font_info),\n            ]\n        )\n\n    # -----------------------------------------------------------------------------\n    def deserialize(self, data, hashmap={}):\n        # The id of this floating label is set to whatever was stored as its id in the JSON file.\n        self.id = data[\"id\"]\n        self.label_text = data[\"text\"]\n        self.width = data[\"width\"]\n        self.height = data[\"height\"]\n\n        # The position of the Floating Labels within the Scene, are set accordingly.\n        self.setPos(data[\"pos_x\"], data[\"pos_y\"])\n\n        self.content.text_edit.document().setHtml(data[\"styling\"])\n\n        try:\n            if data[\"fill_color\"]:\n                # If fill color exists in json, convert rgba to QColor\n                color = QColor(\n                    data[\"fill_color\"][0],\n                    data[\"fill_color\"][1],\n                    data[\"fill_color\"][2],\n                    data[\"fill_color\"][3],\n                )\n\n                # Grab copy of text edit's color palette, to change its background\n                palette = self.content.text_edit.viewport().palette()\n\n                # Update the copy of background color\n                self.content.backgroundColor = color\n                palette.setColor(\n                    self.content.text_edit.viewport().backgroundRole(), color\n                )\n                self.content.text_edit.viewport().setPalette(palette)\n\n                # Update the text highlighting color\n                color_for_highlighting = copy.copy(self.content.backgroundColor)\n                color_for_highlighting.setAlpha(0)\n                self.content.setTextHighlighting(color_for_highlighting)\n\n                # Update color of rounded border drawn around text edit\n                self.grContent.outline_brush = QBrush(self.content.backgroundColor)\n        except KeyError:\n            # Fill color is a new feature, so some models might not have fill color saved in the json\n            # if this is the case, draw the labels with the default white color\n            pass\n\n        self.content.updateShape()\n\n        return True\n\n\nclass ContentWidget(QWidget):\n    def __init__(self, label):\n        super().__init__()\n\n        self.floating_label = label\n        self.text_edit = QTextEdit(self)\n\n        self.defaultFont = \"Arial\"\n        self.defaultFontSize = 14\n        self.defaultWeight = QFont.Normal\n        self.defaultItalics = False\n        self.defaultUnderline = False\n        # self.defaultColor = QColor(\"#000000\")\n        self.defaultColor = QColor(\"#0000ff\")\n        self.defaultAlignment = Qt.AlignLeft\n        self.defaultBackgroundColor = QColor(255, 255, 255)\n\n        self.currentFontSize = copy.copy(self.defaultFontSize)\n        self.backgroundColor = copy.copy(self.defaultBackgroundColor)\n\n        self.padding = 8\n\n        self.setup()\n        self.updateShape()\n\n        self.wasEdited = False\n\n        self.initUI()\n\n    def setup(self):\n        self.text_edit.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n        self.text_edit.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)\n        self.text_edit.setFrameStyle(QFrame.NoFrame)\n        self.text_edit.setTextInteractionFlags(Qt.NoTextInteraction)\n        self.text_edit.setAutoFillBackground(True)\n\n        self.setDefaultFormatting()\n\n        self.text_edit.setPlainText(self.floating_label.label_text)\n        self.text_edit.textChanged.connect(self.updateText)\n\n    def initUI(self):\n        self.layout = QVBoxLayout()\n        self.layout.setContentsMargins(0, 0, 0, 0)\n        self.layout.setAlignment(Qt.AlignmentFlag.AlignTop)\n        self.setLayout(self.layout)\n        self.layout.addWidget(self.text_edit)\n\n    def setTextHighlighting(self, highlight):\n        p = self.text_edit.palette()\n        p.setColor(QPalette.Highlight, highlight)\n        self.text_edit.setPalette(p)\n\n    def updateText(self):\n        if self.text_edit.document().isModified():\n            current_text = self.text_edit.toPlainText()\n            # If changes have been made to the labels current text, update it internally\n            if current_text != self.floating_label.label_text:\n                self.floating_label.label_text = current_text\n                self.updateShape()\n                self.wasEdited = True\n\n    def updateShape(self):\n        # Find the space occupied by text within the floating label\n        font = self.text_edit.currentFont()\n        fontmetrics = QFontMetrics(font)\n        textSize = fontmetrics.size(0, self.text_edit.toPlainText())\n\n        w = textSize.width() + self.padding\n        h = textSize.height() + self.padding\n\n        # Resize the interactable area where the text is displayed\n        self.text_edit.setMinimumSize(w, h)\n        self.text_edit.setMaximumSize(w, h)\n        self.text_edit.resize(w, h)\n\n        # Resize max width of widget container for the text area\n        self.setMaximumSize(w, h)\n\n        # Update the dimensions of the floating label widget, so that the outline around it could be properly drawn\n        self.floating_label.width = w\n        self.floating_label.height = h\n\n    def setDefaultFormatting(self):\n        self.text_edit.setFont(QFont(self.defaultFont, self.defaultFontSize))\n        self.text_edit.setFontPointSize(self.defaultFontSize)\n        self.text_edit.setFontWeight(self.defaultWeight)\n        self.text_edit.setFontItalic(self.defaultItalics)\n        self.text_edit.setFontUnderline(self.defaultUnderline)\n        self.text_edit.setAlignment(self.defaultAlignment)\n        self.text_edit.setTextColor(self.defaultColor)\n"
  },
  {
    "path": "bdsim/bdedit/floating_label_graphics.py",
    "content": "import copy\n\n# PyQt5 imports\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtGui import *\n\n\nclass GraphicsLabel(QGraphicsItem):\n    def __init__(self, label, parent=None):\n        super().__init__(parent)\n        self.floating_label = label\n        self.content = self.floating_label.content\n\n        # Label related outline settings\n        self.edge_size = 6.0\n        self._selected_line_thickness = (\n            5.0  # Thickness of the label outline on selection\n        )\n        self._pen_selected = QPen(\n            QColorConstants.Svg.orange, self._selected_line_thickness\n        )\n        self.outline_brush = QBrush(QColorConstants.Svg.white)\n\n        self.initUI()\n        self.wasMoved = False\n        self.lastPos = self.pos()\n\n    def initUI(self):\n        self.setFlag(QGraphicsItem.ItemIsSelectable)\n        self.setFlag(QGraphicsItem.ItemIsMovable)\n        self.setAcceptHoverEvents(True)\n\n        self.grText = QGraphicsProxyWidget(self)\n        self.content.setGeometry(\n            0, 0, self.floating_label.width, self.floating_label.height\n        )\n        self.grText.setWidget(self.content)\n        self.setZValue(-3)\n\n    def boundingRect(self):\n        return QRectF(\n            -self.edge_size,\n            -self.edge_size,\n            2 * self.edge_size + self.floating_label.width,\n            2 * self.edge_size + self.floating_label.height,\n        ).normalized()\n\n    def paint(self, painter, style, widget=None):\n        # Draw the outline of the box and fill in the background whitespace\n        path = QPainterPath()\n        path.addRoundedRect(self.boundingRect(), self.edge_size, self.edge_size)\n        painter.setPen(Qt.NoPen if not self.isSelected() else self._pen_selected)\n        painter.setBrush(QColor(\"#F0F0F0\"))\n        painter.drawPath(path.simplified())\n        painter.setBrush(self.outline_brush)\n        painter.drawPath(path.simplified())\n\n    def setLabelUnfocus(self):\n        self.floating_label.setFocusOfFloatingText()\n        color_for_highlighting = copy.copy(self.floating_label.content.backgroundColor)\n        color_for_highlighting.setAlpha(0)\n        self.floating_label.content.setTextHighlighting(color_for_highlighting)\n        self.floating_label.content.text_edit.setTextInteractionFlags(\n            Qt.NoTextInteraction\n        )\n\n        # If floating label has been edited, update the variable within the model, to then update the\n        # title of the model, to indicate that there is unsaved progress\n        if self.content.wasEdited:\n            self.content.wasEdited = False\n            self.floating_label.scene.has_been_modified = True\n            self.floating_label.scene.history.storeHistory(\"Floating label edited\")\n\n    def setLabelFocus(self):\n        self.floating_label.content.setTextHighlighting(QColor(225, 225, 225, 127))\n        self.floating_label.content.text_edit.setTextInteractionFlags(\n            Qt.TextEditorInteraction\n        )\n\n    def setLabelSizeBox(self):\n        self.floating_label.interfaceManager.updateToolbarValues()\n\n    def hoverEnterEvent(self, event):\n        \"\"\"\n        When a ``FloatingLabel`` is hovered over with the cursor, this method will display\n        a tooltip with a description of how to change its color.\n        :param event: mouse hover detected over floating label\n        :type event: QGraphicsSceneHoverEvent\n        \"\"\"\n\n        self.setToolTip(\"Right click to change background color.\")\n\n    def mousePressEvent(self, event):\n        def updateColor(chosen_color):\n            if chosen_color.isValid():\n                # Grab copy of text edit's color palette, to change its background\n                palette = self.floating_label.content.text_edit.viewport().palette()\n\n                # Update the copy of background color\n                self.floating_label.content.backgroundColor = chosen_color\n                palette.setColor(\n                    self.floating_label.content.text_edit.viewport().backgroundRole(),\n                    chosen_color,\n                )\n                self.floating_label.content.text_edit.viewport().setPalette(palette)\n\n                # Update the text highlighting color\n                color_for_highlighting = copy.copy(\n                    self.floating_label.content.backgroundColor\n                )\n                color_for_highlighting.setAlpha(0)\n                self.floating_label.content.setTextHighlighting(color_for_highlighting)\n\n                # Update color of rounded border drawn around text edit\n                self.outline_brush = QBrush(self.floating_label.content.backgroundColor)\n\n                self.floating_label.scene.has_been_modified = True\n                self.floating_label.scene.history.storeHistory(\n                    \"Grouping box color changed\"\n                )\n\n        super().mousePressEvent(event)\n        self.setLabelUnfocus()\n        self.setLabelSizeBox()\n\n        # If the right mouse button is pressed, bring up a QColorDialog\n        if event.button() == Qt.RightButton:\n            # Make a backup of the original background color in case user cancels color selection\n            # current_palette = self.floating_label.content.text_edit.viewport().palette()\n            current_color = copy.copy(self.floating_label.content.backgroundColor)\n\n            # Open a color dialog window, and when the chosen color changes, call func updateColor\n            # to update the background color of the floating label\n            colorDialog = QColorDialog()\n            colorDialog.setOption(QColorDialog.ShowAlphaChannel, on=True)\n            colorDialog.currentColorChanged.connect(\n                lambda checked: updateColor(colorDialog.currentColor())\n            )\n\n            # If user selects okay, this finalizes the color selection\n            if colorDialog.exec_() == QDialog.Accepted:\n                updateColor(colorDialog.selectedColor())\n            # Otherwise, if they exit out of the color picker, the original color will be reverted to.\n            else:\n                updateColor(current_color)\n\n    def mouseDoubleClickEvent(self, event):\n        super().mouseDoubleClickEvent(event)\n        self.setLabelFocus()\n\n    def mouseReleaseEvent(self, event):\n        super().mouseReleaseEvent(event)\n\n        # If floating label has been moved, update the variable within the model, to then update the\n        # title of the model, to indicate that there is unsaved progress\n        if self.wasMoved:\n            self.wasMoved = False\n            self.floating_label.scene.has_been_modified = True\n            self.floating_label.scene.history.storeHistory(\"Floating label moved\")\n"
  },
  {
    "path": "bdsim/bdedit/grouping_box.py",
    "content": "# Library imports\nimport json\nimport copy\nfrom collections import OrderedDict\n\n# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n# BdEdit imports\nfrom bdsim.bdedit.interface_serialize import Serializable\nfrom bdsim.bdedit.grouping_box_graphics import GraphicsGBox\n\n\nDEBUG = False\n\n\nclass Grouping_Box(Serializable):\n    def __init__(\n        self,\n        scene,\n        window,\n        width=500,\n        height=300,\n        bg_color=(146, 187, 255),\n        pos=(-200, -100),\n    ):\n        super().__init__()\n        self.scene = scene\n        self.window = window\n        self.position = pos\n\n        self.width = width\n        self.height = height\n        self.background_color = QColor(bg_color[0], bg_color[1], bg_color[2], 127)\n        self.border_color = QColor(0, 0, 0, 255)\n\n        self.grGBox = GraphicsGBox(self, 0, 0, self.width, self.height)\n        self.grGBox.setPos(self.position[0], self.position[1])\n\n        self.scene.addGBox(self)\n        self.scene.grScene.addItem(self.grGBox)\n\n        self.scene.has_been_modified = True\n\n    def setPos(self, x, y):\n        self.grGBox.setPos(x, y)\n\n    def setFocusOfGroupingBox(self):\n        \"\"\"\n        This method sends all ``Grouping Box`` instances within the ``Scene`` to back\n        and then sends the currently selected ``Grouping Box`` instance to front.\n        \"\"\"\n\n        # Iterates through each Grouping Box within grouping_boxes list stored in \\\n        # the Scene Class and sets the graphical component of each gbox to a zValue of -11.\n        for groupBox in self.scene.grouping_boxes:\n            groupBox.grGBox.setZValue(-11)\n\n        # Then sets the graphical component of the currently selected gbox to a\n        # zValue of -10, which makes it display above all other gboxes on screen, but behind\n        # all other items drawn in the canvas.\n        self.grGBox.setZValue(-10)\n\n    # Todo - update comments to match floating label, not block\n    def remove(self):\n\n        if DEBUG:\n            print(\"> Removing Grouping Box\", self)\n\n        # Remove the graphical representation of this grouping box from the scene.\n        if DEBUG:\n            print(\" - removing grGBox\")\n        self.scene.grScene.removeItem(self.grGBox)\n        self.grGBox = None\n\n        # Finally, call the removeGBox method from within the Scene, which\n        # removes this GBox from the list of grouping boxes stored in the Scene.\n        if DEBUG:\n            print(\" - removing Grouping Box from the scene\")\n        self.scene.removeGBox(self)\n        if DEBUG:\n            print(\" - everything was done.\")\n\n    # -----------------------------------------------------------------------------\n    def serialize(self):\n        actual_pos = self.grGBox.mapToScene(self.grGBox.rect())\n        return OrderedDict(\n            [\n                (\"id\", self.id),\n                (\"pos_x\", actual_pos.boundingRect().x()),\n                (\"pos_y\", actual_pos.boundingRect().y()),\n                (\"width\", self.grGBox.rect().width()),\n                (\"height\", self.grGBox.rect().height()),\n                (\"color\", self.grGBox.bg_color.getRgb()[0:3]),\n            ]\n        )\n\n    # -----------------------------------------------------------------------------\n    def deserialize(self, data, hashmap={}):\n        # The id of this Grouping Box is set to whatever was stored as its id in the JSON file.\n        self.id = data[\"id\"]\n\n        return True\n        pass\n"
  },
  {
    "path": "bdsim/bdedit/grouping_box_graphics.py",
    "content": "# PyQt5 imports\nimport copy\n\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n\n# Majority of this code has been adapted with heavy inspiration from: https://stackoverflow.com/a/34442054\n\n\nclass GraphicsGBox(QGraphicsRectItem):\n\n    handleTopLeft = 1\n    handleTopMiddle = 2\n    handleTopRight = 3\n    handleMiddleLeft = 4\n    handleMiddleRight = 5\n    handleBottomLeft = 6\n    handleBottomMiddle = 7\n    handleBottomRight = 8\n\n    handleSize = +8.0\n    handleSpace = -4.0\n\n    handleCursors = {\n        handleTopLeft: Qt.SizeFDiagCursor,\n        handleTopMiddle: Qt.SizeVerCursor,\n        handleTopRight: Qt.SizeBDiagCursor,\n        handleMiddleLeft: Qt.SizeHorCursor,\n        handleMiddleRight: Qt.SizeHorCursor,\n        handleBottomLeft: Qt.SizeBDiagCursor,\n        handleBottomMiddle: Qt.SizeVerCursor,\n        handleBottomRight: Qt.SizeFDiagCursor,\n    }\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, gbox, *args):\n\n        super().__init__(*args)\n        # Handles dictionary and variables to manage cursors\n        self.handles = {}\n        self.handleSelected = None\n        self.mousePressPos = None\n        self.mousePressRect = None\n\n        # Inherit properties from parent grouping box\n        self.grouping_box = gbox\n        self.width = self.grouping_box.width\n        self.height = self.grouping_box.height\n\n        # Pen thickness and block-related spacings are defined\n        self._line_thickness = 3.0  # Thickness of the block outline by default\n        self._selected_line_thickness = (\n            5.0  # Thickness of the block outline on selection\n        )\n\n        # Colours for pens are defined\n        self._pen_selected = QPen(\n            QColorConstants.Svg.orange, self._selected_line_thickness, Qt.SolidLine\n        )\n        self.bg_color = self.grouping_box.background_color\n        self.br_color = self.grouping_box.border_color\n\n        # Internal variable for catching fatal errors, and allowing user to save work before crashing\n        self.FATAL_ERROR = False\n\n        # Method called to further initialize necessary block settings\n        self.initUI()\n        self.wasMoved = False\n        self.lastPos = self.pos()\n\n    # -----------------------------------------------------------------------------\n    def initUI(self):\n        \"\"\"\n        This method sets flags to allow for this Block to be movable and selectable.\n        \"\"\"\n        self.setFlag(QGraphicsItem.ItemIsSelectable)\n        self.setFlag(QGraphicsItem.ItemIsMovable)\n        self.setFlag(QGraphicsItem.ItemSendsGeometryChanges)\n        self.setFlag(QGraphicsItem.ItemIsFocusable)\n        self.setAcceptHoverEvents(True)\n        self.updateHandlesPos()\n        self.setZValue(-11)\n\n    def handleAt(self, point):\n        \"\"\"\n        Returns the resize handle below the given point.\n        \"\"\"\n        for (\n            k,\n            v,\n        ) in self.handles.items():\n            if v.contains(point):\n                return k\n        return None\n\n    def hoverMoveEvent(self, moveEvent):\n        \"\"\"\n        Executed when the mouse moves over the shape (NOT PRESSED).\n        \"\"\"\n        if self.isSelected():\n            handle = self.handleAt(moveEvent.pos())\n            cursor = Qt.ArrowCursor if handle is None else self.handleCursors[handle]\n            self.setCursor(cursor)\n        super().hoverMoveEvent(moveEvent)\n\n    def hoverLeaveEvent(self, moveEvent):\n        \"\"\"\n        Executed when the mouse leaves the shape (NOT PRESSED).\n        \"\"\"\n        self.setCursor(Qt.ArrowCursor)\n        super().hoverLeaveEvent(moveEvent)\n\n    def mousePressEvent(self, mouseEvent):\n        \"\"\"\n        Executed when the mouse is pressed on the item.\n        \"\"\"\n\n        def updateColor(chosen_color):\n            if chosen_color.isValid():\n                # Set alpha value of chosen color, to half transparency\n                chosen_color.setAlpha(127)\n\n                self.bg_color = chosen_color\n                self.grouping_box.scene.has_been_modified = True\n                self.grouping_box.scene.history.storeHistory(\n                    \"Grouping box color changed\"\n                )\n\n        # Selected grouping box will be brought into focus, by sending others 1 layer back\n        self.grouping_box.setFocusOfGroupingBox()\n\n        # If a grouping box edge/corner is selected to increase its size, handle the logic for this\n        self.handleSelected = self.handleAt(mouseEvent.pos())\n        if self.handleSelected:\n            self.mousePressPos = mouseEvent.pos()\n            self.mousePressRect = self.boundingRect()\n\n        # If the right mouse button is pressed, bring up a QColorDialog\n        if mouseEvent.button() == Qt.RightButton:\n            # Make a backup of the original background color incase user cancel's color selection\n            current_bg_color = copy.copy(self.bg_color)\n\n            # Open a color dialog window, and when the chosen color changes, call func updateColor\n            # to update the background color of the grouping box\n            colorDialog = QColorDialog()\n            colorDialog.currentColorChanged.connect(\n                lambda checked: updateColor(colorDialog.currentColor())\n            )\n\n            # If user selects okay, this finalizes the color selection\n            if colorDialog.exec_() == QDialog.Accepted:\n                updateColor(colorDialog.selectedColor())\n            # Otherwise, if they exit out of the color picker, the original color will be reverted to.\n            else:\n                updateColor(current_bg_color)\n\n        super().mousePressEvent(mouseEvent)\n\n    def mouseMoveEvent(self, mouseEvent):\n        \"\"\"\n        Executed when the mouse is being moved over the item while being pressed.\n        \"\"\"\n        if self.handleSelected is not None:\n            self.interactiveResize(mouseEvent.pos())\n            self.wasMoved = True\n        else:\n            super().mouseMoveEvent(mouseEvent)\n\n    def mouseReleaseEvent(self, mouseEvent):\n        \"\"\"\n        Executed when the mouse is released from the item.\n        \"\"\"\n        super().mouseReleaseEvent(mouseEvent)\n        self.handleSelected = None\n        self.mousePressPos = None\n        self.mousePressRect = None\n        self.update()\n\n        # If grouping box has been moved, update the variable within the model, to then update the\n        # title of the model, to indicate that there is unsaved progress\n        if self.wasMoved:\n            self.wasMoved = False\n            self.grouping_box.scene.has_been_modified = True\n            self.grouping_box.scene.history.storeHistory(\n                \"Grouping box moved or resized\"\n            )\n\n    def boundingRect(self):\n        \"\"\"\n        Returns the bounding rect of the shape (including the resize handles).\n        \"\"\"\n        o = self.handleSize + self.handleSpace\n        return self.rect().adjusted(-o, -o, o, o)\n\n    def updateHandlesPos(self):\n        \"\"\"\n        Update current resize handles according to the shape size and position.\n        \"\"\"\n        s = self.handleSize\n        b = self.boundingRect()\n        self.handles[self.handleTopLeft] = QRectF(b.left(), b.top(), s, s)\n        self.handles[self.handleTopMiddle] = QRectF(\n            b.center().x() - s / 2, b.top(), s, s\n        )\n        self.handles[self.handleTopRight] = QRectF(b.right() - s, b.top(), s, s)\n        self.handles[self.handleMiddleLeft] = QRectF(\n            b.left(), b.center().y() - s / 2, s, s\n        )\n        self.handles[self.handleMiddleRight] = QRectF(\n            b.right() - s, b.center().y() - s / 2, s, s\n        )\n        self.handles[self.handleBottomLeft] = QRectF(b.left(), b.bottom() - s, s, s)\n        self.handles[self.handleBottomMiddle] = QRectF(\n            b.center().x() - s / 2, b.bottom() - s, s, s\n        )\n        self.handles[self.handleBottomRight] = QRectF(\n            b.right() - s, b.bottom() - s, s, s\n        )\n\n    def interactiveResize(self, mousePos):\n        \"\"\"\n        Perform shape interactive resize.\n        \"\"\"\n        offset = self.handleSize + self.handleSpace\n        boundingRect = self.boundingRect()\n        rect = self.rect()\n        diff = QPointF(0, 0)\n\n        # Quantize resizing of grouping box\n        spacing = 20\n\n        x_diff = mousePos.x() - self.mousePressPos.x()\n        y_diff = mousePos.y() - self.mousePressPos.y()\n\n        x = round(x_diff / spacing) * spacing\n        y = round(y_diff / spacing) * spacing\n\n        self.prepareGeometryChange()\n\n        if self.handleSelected == self.handleTopLeft:\n\n            fromX = self.mousePressRect.left()\n            fromY = self.mousePressRect.top()\n            toX = fromX + x\n            toY = fromY + y\n            diff.setX(toX - fromX)\n            diff.setY(toY - fromY)\n            boundingRect.setLeft(toX)\n            boundingRect.setTop(toY)\n            rect.setLeft(boundingRect.left() + offset)\n            rect.setTop(boundingRect.top() + offset)\n\n        elif self.handleSelected == self.handleTopMiddle:\n\n            fromY = self.mousePressRect.top()\n            toY = fromY + y\n            diff.setY(toY - fromY)\n            boundingRect.setTop(toY)\n            rect.setTop(boundingRect.top() + offset)\n\n        elif self.handleSelected == self.handleTopRight:\n\n            fromX = self.mousePressRect.right()\n            fromY = self.mousePressRect.top()\n            toX = fromX + x\n            toY = fromY + y\n            diff.setX(toX - fromX)\n            diff.setY(toY - fromY)\n            boundingRect.setRight(toX)\n            boundingRect.setTop(toY)\n            rect.setRight(boundingRect.right() - offset)\n            rect.setTop(boundingRect.top() + offset)\n\n        elif self.handleSelected == self.handleMiddleLeft:\n\n            fromX = self.mousePressRect.left()\n            toX = fromX + x\n            diff.setX(toX - fromX)\n            boundingRect.setLeft(toX)\n            rect.setLeft(boundingRect.left() + offset)\n\n        elif self.handleSelected == self.handleMiddleRight:\n            fromX = self.mousePressRect.right()\n            toX = fromX + x\n            diff.setX(toX - fromX)\n            boundingRect.setRight(toX)\n            rect.setRight(boundingRect.right() - offset)\n\n        elif self.handleSelected == self.handleBottomLeft:\n\n            fromX = self.mousePressRect.left()\n            fromY = self.mousePressRect.bottom()\n            toX = fromX + x\n            toY = fromY + y\n            diff.setX(toX - fromX)\n            diff.setY(toY - fromY)\n            boundingRect.setLeft(toX)\n            boundingRect.setBottom(toY)\n            rect.setLeft(boundingRect.left() + offset)\n            rect.setBottom(boundingRect.bottom() - offset)\n\n        elif self.handleSelected == self.handleBottomMiddle:\n\n            fromY = self.mousePressRect.bottom()\n            toY = fromY + y\n            diff.setY(toY - fromY)\n            boundingRect.setBottom(toY)\n            rect.setBottom(boundingRect.bottom() - offset)\n\n        elif self.handleSelected == self.handleBottomRight:\n\n            fromX = self.mousePressRect.right()\n            fromY = self.mousePressRect.bottom()\n            toX = fromX + x\n            toY = fromY + y\n            diff.setX(toX - fromX)\n            diff.setY(toY - fromY)\n            boundingRect.setRight(toX)\n            boundingRect.setBottom(toY)\n            rect.setRight(boundingRect.right() - offset)\n            rect.setBottom(boundingRect.bottom() - offset)\n\n        # Finally, check if rectangle has been dragged inside out\n        if rect.width() < spacing:\n            if self.handleSelected in [\n                self.handleTopLeft,\n                self.handleMiddleLeft,\n                self.handleBottomLeft,\n            ]:\n                rect.setLeft(rect.right() - spacing)\n            else:\n                rect.setRight(rect.left() + spacing)\n        if rect.height() < spacing:\n            if self.handleSelected in [\n                self.handleTopLeft,\n                self.handleTopMiddle,\n                self.handleTopRight,\n            ]:\n                rect.setTop(rect.bottom() - spacing)\n            else:\n                rect.setBottom(rect.top() + spacing)\n\n        self.setRect(rect)\n        self.updateHandlesPos()\n\n    def hoverEnterEvent(self, event):\n        \"\"\"\n        When a ``GraphicsGBox`` is hovered over with the cursor, this method will display\n        a tooltip with a description of how to change its color.\n        :param event: mouse hover detected over grouping box\n        :type event: QGraphicsSceneHoverEvent\n        \"\"\"\n\n        self.setToolTip(\"Right click to change background color.\")\n\n    def shape(self):\n        \"\"\"\n        Returns the shape of this item as a QPainterPath in local coordinates.\n        \"\"\"\n        path = QPainterPath()\n        path.addRect(self.rect())\n        if self.isSelected():\n            for shape in self.handles.values():\n                path.addEllipse(shape)\n        return path\n\n    def paint(self, painter, option, widget=None):\n        \"\"\"\n        Paint the node in the graphic view.\n        \"\"\"\n        painter.setBrush(QBrush(self.bg_color))\n        painter.setPen(\n            QPen(self.br_color, 1.0, Qt.SolidLine)\n            if not self.isSelected()\n            else self._pen_selected\n        )  # black default outline, thicker orange when selected\n        painter.drawRect(self.rect())\n\n        if self.isSelected():\n            painter.setRenderHint(QPainter.Antialiasing)\n            # painter.setBrush(QBrush(QColor(\"#FFFFA637\")))\n            painter.setBrush(QBrush(QColorConstants.Svg.orange))\n            painter.setPen(\n                QPen(\n                    QColorConstants.Svg.black,\n                    1.0,\n                    Qt.SolidLine,\n                    Qt.RoundCap,\n                    Qt.RoundJoin,\n                )\n            )\n            for handle, rect in self.handles.items():\n                painter.drawEllipse(rect)\n"
  },
  {
    "path": "bdsim/bdedit/interface.py",
    "content": "# Library imports\nimport os\nimport fnmatch\n\n# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n# BdEdit imports\nfrom bdsim.bdedit.block import *\nfrom bdsim.bdedit.Icons import *\nfrom bdsim.bdedit.grouping_box import *\nfrom bdsim.bdedit.block_wire import Wire\nfrom bdsim.bdedit.block_importer import *\nfrom bdsim.bdedit.floating_label import *\nfrom bdsim.bdedit.block_main_block import *\nfrom bdsim.bdedit.interface_scene import Scene\nfrom bdsim.bdedit.block_connector_block import *\nfrom bdsim.bdedit.interface_graphics_view import GraphicsView\n\n# =============================================================================\n#\n#   Defining and setting global variables and methods\n#\n# =============================================================================\n# Variable for enabling/disabling debug comments\nDEBUG = False\n\n# =============================================================================\n#\n#   Defining the Interface Class, which houses all the application appearance\n#   logic, and connects all other classes together.\n#\n# =============================================================================\nclass Interface(QWidget):\n    \"\"\"\n    The ``Interface`` Class extends the ``QWidget`` Class from PyQt5, and houses\n    the necessary methods for controlling how the application appears. It also\n    connects the other Classes to allow for Block Diagrams to be constructed.\n\n    This class includes information about the:\n\n    - toolbar, its buttons and their connections\n    - library Browser menu, its buttons and their connections\n    - scene, its appearance (Background and Foreground) and its items (Blocks, Sockets, Wires)\n    - application layout, in terms of where the toolbar, library Browser, scene and\n      parameter window is displayed.\n\n    Note, the toolbar, library Browser, scene and parameter window will be referred\n    to as application components.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, resolution, debug=False, parent=None):\n        \"\"\"\n        This method initializes an instance of the ``Interface``.\n\n        :param resolution: the desktop screen resolution of the user\n        :type resolution: PyQt5.QtCore.QRect(0, 0, screen_width, screen_height), required\n        :param parent: the parent widget this interface belongs to (should be None)\n        :type parent: None, optional\n        \"\"\"\n        super().__init__(parent)\n\n        # The toolbar and library browser widgets are initialized\n        # self.toolBar = QWidget()\n        self.libraryBrowser = QWidget()\n\n        # LibraryBrowserBox is wrapped by LibraryBrowser, as this allows the items within\n        # the libraryBrowser to be scrollable\n        self.libraryBrowserBox = QGroupBox()\n\n        # # Set file extension for screenshots. PDF (default) PNG if specified from command line args\n        # self.screenshot_extension_format = 'pdf'\n\n        # The Scene interface is called to be initialized\n        self.initUI(resolution, debug, parent)\n\n    # -----------------------------------------------------------------------------\n    def initUI(self, resolution, debug, main_window):\n        \"\"\"\n        This method is responsible for controlling the size of the application window.\n        It is also responsible for each application component, in terms of:\n\n        - setting its dimensions ;\n        - setting its position within the application layout;\n        - creating its relevant buttons and connecting them to desired actions;\n        - populating it with the created buttons; and\n        - spacing out these buttons within the application component itself.\n\n        :param resolution: the desktop screen resolution of the user\n        :type resolution: PyQt5.QtCore.QRect(0, 0, screen_width, screen_height), required\n        :return: a QWidget that is displayed within the application from bdEdit.py\n        :rtype: QWidget\n        \"\"\"\n\n        # _______________________________ Initial Setup _______________________________\n        # Sets interface's (application window's) resolution. Several options available:\n        # self.setGeometry(100, 100, resolution.width() - 200, resolution.height() - 200)  # Interface will be same size as desktop screen, minus 100 pixels from all sides\n        # self.setGeometry(resolution.width() / 4, resolution.height() / 4, resolution.width() / 2, resolution.height() / 2)  # Interface will be half the size of the desktop screen, and centered in the screen\n        # self.setGeometry(100, 100, resolution.width() / 2, resolution.height() / 2)  # Interface will be half the size of the desktop screen, and displayed 100 pixels down and right from top left corner of the screen\n        main_window.setGeometry(\n            100, 100, int(resolution.width() / 2), int(resolution.height() / 2)\n        )  # Interface will be half the size of the desktop screen, and displayed 100 pixels down and right from top left corner of the screen\n\n        # Layout manager is defined and set for the application layout. This will handle\n        # the positioning of each application component.\n        self.layout = QGridLayout()  # Contains all the widgets\n        self.layout.setContentsMargins(0, 0, 0, 0)  # Removes the border\n        self.setLayout(self.layout)\n\n        # Different screen resolutions result in varying sizes of the library browser\n        # and parameter window panels. To compensate for this, the preferred dimensions\n        # of these panels as seen on the screen while being developed (2560 resolution\n        # width) have been scaled to other screen sizes.\n        self.layout.scale = int(2560 / resolution.width())\n\n        # An instance of the Scene class is created, providing it the resolution of the\n        # desktop screen and the application layout manager.\n        self.scene = Scene(resolution, self.layout, main_window)\n\n        # Since the Scene itself is only a class and doesn't have a 'visual' representation,\n        # it will create a 'grScene' variable, that will be responsible for handling everything\n        # graphical related. This 'grScene' is fed into an instance of a GraphicsView, which\n        # handles visual updates to the 'grScene' (e.g. updating the Scene when Blocks are\n        # deleted, or when wires are moved around)\n        self.canvasView = GraphicsView(self.scene.grScene, main_window, self)\n\n        # Import all the blocks that bdedit can see, and sort the list in alphabetical order\n        self.blockLibrary = import_blocks(self.scene, self.layout)\n        self.sortBlockLibrary()\n\n        # if debug:\n        # print(\"\\nfrom self.blockLibrary\")\n        # for group in self.blockLibrary:\n        #     for block_cls in group[1]:\n        #         for variables in block_cls[1].__dict__.items():\n        #             if variables[0] in [\"parameters\"]:\n        #                 print(\"('\" + variables[0] + \"',\")\n        #                 for param in variables[1]:\n        #                     print(\"     \", param)\n        #             else:\n        #                 print(variables)\n        #         print()\n        #\n        # print(\"\\n----------------------------------\\n\")\n\n        # ___________________________ Library Browser Setup ___________________________\n        # The library browser will be displayed along the left-hand side of the interface,\n        # items should be displayed vertically within it, hence the vertical layout manager.\n        self.libraryBrowser.layout = QVBoxLayout(self.libraryBrowser)\n\n        # Adding icon for the tool above the library browser\n        self.tool_logo = QLabel()\n        self.tool_logo.setPixmap(\n            QPixmap(\":/Icons_Reference/Icons/bdsim_logo2.png\").scaledToWidth(\n                230 * self.layout.scale\n            )\n        )\n        # self.tool_logo.setPixmap(QPixmap(\":/Icons_Reference/Icons/bdsim_logo2.png\").scaledToHeight(40 * self.layout.scale))\n        self.libraryBrowser.layout.addWidget(self.tool_logo)\n        self.libraryBrowser.layout.setAlignment(\n            self.tool_logo, Qt.AlignmentFlag.AlignHCenter\n        )\n\n        # The follow label is added to the library browser, naming it\n        # self.libraryBrowser.layout.addWidget(QLabel('<font size=8><b>Library Browser</font>'))\n\n        # The library browser box makes the items inside of it scrollable, so all the relevant\n        # buttons will be added into this widget. This widget will also have a vertical layout\n        # manager. Then this widget will be wrapped by the library browser (will go inside it),\n        # in order to position where it is displayed in the application window.\n        self.libraryBrowserBox.layout = QVBoxLayout()\n\n        # Remove whitespace between buttons within the library browser panel\n        self.libraryBrowserBox.layout.setSpacing(2)\n\n        # Make a button for canvas items. These items are like the auto-imported blocks,\n        # but are created from definitions in bdedit, rather than from external libraries\n        self.canvasItems_button = QPushButton(\" + Canvas Items\")\n        self.canvasItems_button.setStyleSheet(\"QPushButton { text-align: left }\")\n        self.canvasItems_button.clicked.connect(self.toggleCanvasItems)\n        self.canvas_items_hidden = True\n\n        # A list is created to hold all the buttons that will create Blocks within the Scene\n        self.list_of_scrollbar_buttons = []\n\n        # This set of blocks are definited internally within bdedit. Currently they include:\n        # the connector block, the main block, and the text item. As they are definied by\n        # bdedit, rather than having their definitions come from an external library, the\n        # buttons for these items must also be manually created within bdedit.\n        self.libraryBrowserBox.layout.addWidget(self.canvasItems_button)\n        self.connector_block_button = QPushButton(\"Connector Block\")\n        self.main_block_button = QPushButton(\"Main Block\")\n        self.text_item_button = QPushButton(\"Text Item\")\n        self.grouping_box_button = QPushButton(\"Grouping Box\")\n\n        self.connector_block_button.setVisible(False)\n        self.main_block_button.setVisible(False)\n        self.text_item_button.setVisible(False)\n        self.grouping_box_button.setVisible(False)\n\n        # These buttons are then connected to creating their respective instances within the Scene\n        self.connector_block_button.clicked.connect(\n            lambda checked: Connector(self.scene, self.layout, \"Connector Block\")\n        )\n        self.main_block_button.clicked.connect(\n            lambda checked: Main(self.scene, self.layout)\n        )\n        self.text_item_button.clicked.connect(\n            lambda checked: Floating_Label(self.scene, self.layout, main_window)\n        )\n        self.grouping_box_button.clicked.connect(\n            lambda checked: Grouping_Box(self.scene, self.layout)\n        )\n\n        # Set up secondary connection to these buttons, to update scene history when they are added to the scene\n        self.connector_block_button.clicked.connect(\n            lambda checked, desc=\"Added connector block to scene\": self.scene.history.storeHistory(\n                desc\n            )\n        )\n        self.main_block_button.clicked.connect(\n            lambda checked, desc=\"Added main block to scene\": self.scene.history.storeHistory(\n                desc\n            )\n        )\n        self.text_item_button.clicked.connect(\n            lambda checked, desc=\"Added text label to scene\": self.scene.history.storeHistory(\n                desc\n            )\n        )\n        self.grouping_box_button.clicked.connect(\n            lambda checked, desc=\"Added grouping box to scene\": self.scene.history.storeHistory(\n                desc\n            )\n        )\n\n        # Adding the buttons to the library browser's layout manager\n        self.libraryBrowserBox.layout.addWidget(self.text_item_button)\n        self.libraryBrowserBox.layout.addWidget(self.main_block_button)\n        self.libraryBrowserBox.layout.addWidget(self.grouping_box_button)\n        self.libraryBrowserBox.layout.addWidget(self.connector_block_button)\n\n        # This for loop goes through each block type (sink, source, function) that was auto\n        # imported (and stored into self.blockLibrary at the Interface's initialization).\n        for sub_class_group in self.blockLibrary:\n\n            group_of_buttons = []\n\n            # Grab each group that blocks belong to, and create a library panel button for those groups\n            cleaned_class_group = (\n                sub_class_group[0][:-1]\n                if sub_class_group[0].endswith(\"s\")\n                else sub_class_group[0]\n            )\n            group_button = QPushButton(\n                \" + \" + cleaned_class_group.capitalize() + \" Blocks\"\n            )\n\n            # Buttons' text alignment is set to be left-aligned\n            group_button.setStyleSheet(\"QPushButton { text-align: left }\")\n\n            # The following variables control the '+,-' sign displayed alongside each\n            # hide-able/expandable list section within the library browser. If below it is\n            # defined as True, the button will be '+' when hidden and '-' when expanded. Setting to\n            # False will reverse this logic. Setting it to False, WILL NOT make the list\n            # sections display in expanded mode by default. This is controlled further down with setVisible.\n            group_button.is_hidden = True\n            group_button.clicked.connect(self.toggle_sub_buttons)\n            group_of_buttons.append((group_button, cleaned_class_group.capitalize()))\n\n            self.libraryBrowserBox.layout.addWidget(group_button)\n\n            list_of_sub_buttons = []\n\n            # Go through each class block in the 2nd element of the group of blocks, and create buttons to spawn each\n            # of those blocks into bdedit\n            for class_block in sub_class_group[1]:\n\n                # Make a button with the name of the block type\n                button = QPushButton(class_block[0])\n                # Set the button to be invisible by default (for the list's to be hidden)\n                button.setVisible(False)\n                # Connect button to calling a new instance of the block type class\n                button.clicked.connect(\n                    lambda checked, blockClass=class_block[1]: blockClass()\n                )\n                button.clicked.connect(\n                    lambda checked, desc=\"Added imported block to scene\": self.scene.history.storeHistory(\n                        desc\n                    )\n                )\n                # Add button to list of scrollbar buttons for reference of what buttons should be\n                # affected when expanding/hiding the list sections\n                list_of_sub_buttons.append((button, class_block[1]))\n                # self.list_of_scrollbar_buttons.append((button, class_block[1]))\n                # Add the button to the library browser box layout (the scrollable widget)\n                self.libraryBrowserBox.layout.addWidget(button)\n\n            group_of_buttons.append(list_of_sub_buttons)\n            self.list_of_scrollbar_buttons.append(group_of_buttons)\n\n        # All the button items are set to align to the top of the libraryBrowserBox\n        self.libraryBrowserBox.layout.addStretch()\n        self.libraryBrowserBox.layout.setAlignment(Qt.AlignTop)\n        self.libraryBrowserBox.setLayout(self.libraryBrowserBox.layout)\n\n        # A scroll area is defined and applied to the libraryBrowserBox. Its dimensions\n        # are set to allow for resizing, however the minimum height of the scroll area\n        # is set to 300 pixels.\n        self.scroll = QScrollArea()\n        self.scroll.setWidget(self.libraryBrowserBox)\n        self.scroll.setWidgetResizable(True)\n        self.scroll.setMinimumHeight(300)\n\n        # The width of the libraryBrowser widget is set to 250 pixels, and it the scroll\n        # area is added to the libraryBrowser widget and set to align to the top of this widget.\n        self.libraryBrowser.setFixedWidth(250 * self.layout.scale)\n        self.libraryBrowser.layout.addWidget(self.scroll)\n        self.libraryBrowser.layout.setAlignment(Qt.AlignTop)\n        self.libraryBrowser.setLayout(self.libraryBrowser.layout)\n\n        # _________ Application components added to application layout manager ___________\n        # Refer to technical documentation for visualising how these components are\n        # organised within the grid layout.\n        # Each component is added to the grid layout,\n        # * at an initial cell position within that grid, denoted by the first two ints\n        # ** (which represent the y, then x coordinate of the cell),\n        # * then is stretched by a number of cells, denoted by the last two ints\n        # ** (which represent how many cells to stretch vertically, then how many cells to stretch horizontally)\n\n        # For example, the canvas view is added to cell in the 0th row, and 1st column,\n        # then stretched vertically by 10 row (to row 11),\n        # and stretched horizontally by 9 columns (to column 10)\n        self.layout.addWidget(self.libraryBrowser, 0, 0, 10, 1)\n        self.layout.addWidget(self.canvasView, 0, 1, 10, 9)\n\n    # -----------------------------------------------------------------------------\n    @pyqtSlot()\n    def on_click(self, scene):\n        \"\"\"\n        This method creates a ``Wire`` instance from the ``Socket`` that was clicked\n        on, to the mouse pointer.\n\n        :param scene: the scene within which the ``Block`` and ``Socket`` are located\n        :type scene: Scene, required\n        \"\"\"\n\n        # The start block (which has the start socket) and the end block (which has\n        # the end socket) are grabbed.\n        startBlock, endBlock, startSocket, endSocket = self.get_Input()\n        # And a wire is made between those two points. When the wire is being dragged\n        # from a Socket to another socket, the endSocket (and endBlock) are considered\n        # as the location of the mouse pointer.\n        Wire(\n            scene,\n            scene.blocks[startBlock].outputs[startSocket],\n            scene.blocks[endBlock].inputs[endSocket],\n            wire_type=3,\n        )\n\n    # Todo - add doc comment for this\n    # -----------------------------------------------------------------------------\n    def sortBlockLibrary(self):\n        for sub_list in self.blockLibrary:\n            # Sort the blocks within each sublist (functions, sources, sinks, etc) in alphabetical order\n            sub_list[1].sort(key=lambda x: x[0])\n\n        # Then sort the groups in alphabetical order too\n        self.blockLibrary.sort(key=lambda x: x[0])\n\n    # -----------------------------------------------------------------------------\n    def clickBox(self, state):\n        \"\"\"\n        This method is called when the toolbar checkbox for toggling the visiblity\n        of the connector blocks is triggered. It toggles between the connector\n        blocks being displayed and hidden.\n        :param state: the state of the checkbox (clicked, unclicked)\n        :type state: int\n        \"\"\"\n\n        if state == QtCore.Qt.Checked:\n            # Set variable for hiding connector blocks to True\n            self.scene.hide_connector_blocks = True\n        else:\n            # Set variable for hiding connector blocks to False\n            self.scene.hide_connector_blocks = False\n\n    # Todo - add main block into here\n    # -----------------------------------------------------------------------------\n    def toggleCanvasItems(self):\n        \"\"\"\n        This method toggles hiding/expanding all Canvas related Items.\n        Currently these include only the ``Connector Block``.\n        \"\"\"\n\n        # If the list section button is set to be hidden, the associated sign\n        # will be displayed as '-', otherwise it will be displayed as '+' if expanded\n        if self.canvas_items_hidden:\n            self.canvasItems_button.setText(\" -  Canvas Items\")\n        else:\n            self.canvasItems_button.setText(\" + Canvas Items\")\n\n        # When toggling, the variable that represents the current hidden/expanded\n        # state of the list section, is flipped to the opposite boolean value of itself\n        # If True -> False, If False -> True\n        self.canvas_items_hidden = not self.canvas_items_hidden\n        # And the associated buttons are set to being visible/invisible depending\n        # on that variable.\n        self.connector_block_button.setVisible(\n            not self.connector_block_button.isVisible()\n        )\n        self.main_block_button.setVisible(not self.main_block_button.isVisible())\n        self.text_item_button.setVisible(not self.text_item_button.isVisible())\n        self.grouping_box_button.setVisible(not self.grouping_box_button.isVisible())\n\n    # Todo - update doc string comments\n    # -----------------------------------------------------------------------------\n    def toggle_sub_buttons(self):\n        # Go through list of buttons in the scroll bar\n        for group in self.list_of_scrollbar_buttons:\n            # Find the button group button that was pressed (functions, sink, source, etc)\n            # group looks like - [[QPushButton_for_functions, \"functions\"], [all relevant buttons]]\n            group_button = group[0][0]\n            if group_button == self.sender():\n                # If the list section button is set to be hidden, the associated sign\n                # will be displayed as '-', otherwise it will be displayed as '+' if expanded\n                if group_button.is_hidden:\n                    group_button.setText(group_button.text().replace(\"+\", \"- \"))\n                else:\n                    group_button.setText(group_button.text().replace(\"- \", \"+\"))\n\n                # When toggling, the variable that represents the current hidden/expanded\n                # state of the list section, is flipped to the opposite boolean value of itself\n                # If True -> False, If False -> True\n                group_button.is_hidden = not group_button.is_hidden\n\n                # Go through all relevant buttons and hide/show them\n                # group[1] looks like - [[QPushButton_for_block1, \"block1\"],[QPushButton_for_block2, \"block2\"], ...]\n                for button_tuple in group[1]:\n                    button_tuple[0].setVisible(not button_tuple[0].isVisible())\n\n        # Code for debugging\n        # for group in self.list_of_scrollbar_buttons:\n        #     print(\"group:\", group[0][1], \"\\t\", group[0][0])\n        #     for item in group[1]:\n        #         print(\"\\titem:\", item[1], \"\\t\", item[0])\n        #     print(\"___________________________\")\n\n    # Todo, update documentation of this function\n    # -----------------------------------------------------------------------------\n    def grab_screenshot_dimensions(self):\n        def find_boundaries(L, T, R, B, left, top, right, btm):\n            if L < left:\n                left = L\n            if T < top:\n                top = T\n            if R > right:\n                right = R\n            if B > btm:\n                btm = B\n            return [left, top, right, btm]\n\n        # Define initial dimensions of screenshot (if no blocks in scene)\n        top, btm, left, right = 0, 0, 0, 0\n        spacer = 50  # half a typical block's width\n\n        # Go through each block in scene, to find the top/bottom/left/right-most blocks\n        for block in self.scene.blocks:\n            b_left = block.grBlock.pos().x()\n            b_top = block.grBlock.pos().y()\n            b_right = b_left + block.width\n            b_btm = b_top + block.height\n\n            [left, top, right, btm] = find_boundaries(\n                b_left, b_top, b_right, b_btm, left, top, right, btm\n            )\n\n            # if b_left < left: left = b_left\n            # if b_top < top: top = b_top\n            # if b_right > right: right = b_right\n            # if b_btm > btm: btm = b_btm\n\n        # Then go through each floating text item, grouping box, and wire segments\n        for floating_text in self.scene.floating_labels:\n            f_left = floating_text.grContent.pos().x()\n            f_top = floating_text.grContent.pos().y()\n            f_rect = floating_text.grContent.boundingRect()\n            f_right = f_left + f_rect.width()\n            f_btm = f_top + f_rect.height()\n\n            [left, top, right, btm] = find_boundaries(\n                f_left, f_top, f_right, f_btm, left, top, right, btm\n            )\n            # print(\"floating label - rect, left, top, right, btm:\", [f_rect, f_left, f_top, f_right, f_btm])\n\n        for gbox in self.scene.grouping_boxes:\n            g_left = gbox.grGBox.pos().x()\n            g_top = gbox.grGBox.pos().y()\n            g_rect = gbox.grGBox.boundingRect()\n            g_right = g_left + g_rect.width()\n            g_btm = g_top + g_rect.height()\n\n            [left, top, right, btm] = find_boundaries(\n                g_left, g_top, g_right, g_btm, left, top, right, btm\n            )\n\n            # print(\"grouping box - rect, left, top, right, btm:\", [g_rect, g_left, g_top, g_right, g_btm])\n\n        for wire in self.scene.wires:\n            w_rect = wire.grWire.boundingRect()\n            w_left = w_rect.left()\n            w_top = w_rect.top()\n            w_right = w_left + w_rect.width()\n            w_btm = w_top + w_rect.height()\n\n            [left, top, right, btm] = find_boundaries(\n                w_left, w_top, w_right, w_btm, left, top, right, btm\n            )\n\n            # print(\"wire - rect, left, top, right, btm:\", [w_rect, w_left, w_top, w_right, w_btm])\n\n        if DEBUG:\n            print(\n                \"Left most:\",\n                left,\n                \" | Top most:\",\n                top,\n                \" | Right most:\",\n                right,\n                \" | Bottom most:\",\n                btm,\n            )\n\n        # Return the rect (x,y, width, height) that all these blocks occupy\n        width = (right + spacer) - (left - spacer)\n        height = (btm + spacer) - (top - spacer)\n        return [left - spacer, top - spacer, width, height]\n\n    # -----------------------------------------------------------------------------\n    def save_image(self, picture_path, picture_name=None, picture_format=None):\n        \"\"\"\n        This method takes a filename and saves a snapshot of all the items within\n        the ``Scene`` into it. Currently the resolution of this image is set to\n        4K resolution (3840 x 2160).\n\n        :param picture_path: path where the given model is saved, and where the image will be saved\n        :type picture_path: path, required\n        :param picture_name: name of screenshot, same as model name if not given\n        :type picture_name: str, optional\n        \"\"\"\n\n        print(\"Rendering image\")\n\n        # Creates an image, of defined resolution quality\n        ratio = 3\n        output_image = QImage(\n            int(self.scene.scene_width * ratio),\n            int(self.scene.scene_height * ratio),\n            QImage.Format_RGBA64,\n        )\n\n        # Then a painter is initialized to that image\n        painter = QPainter(output_image)\n        painter.setRenderHint(QPainter.Antialiasing, True)\n\n        # The canvas is rendered by the above-defined painter (into the image)\n        self.scene.grScene.render(painter)\n        painter.end()\n\n        # Grab the dimensions of the space all blocks within the screen occupy\n        [x, y, width, height] = self.grab_screenshot_dimensions()\n\n        # ensure number of bytes in row (width*3) is a multiple of 4\n        width += (width * 3) % 4\n        # Scale the dimensions from above, to the image\n        rect = QRect(\n            int(output_image.width() / 2 + (x * ratio)),\n            int(output_image.height() / 2 + (y * ratio)),\n            int(width * ratio),\n            int(height * ratio),\n        )\n\n        # Crop the image to area of interest\n        output_image = output_image.copy(rect)\n        # by default this is in QImage.Format_RGBA64 = 26 format, convert\n        # 8-bit RGB pixels\n        #  see https://doc.qt.io/qt-5/qimage.html\n        output_image = output_image.convertToFormat(QImage.Format_RGB888)\n\n        save_path = self.getScreenshotName(picture_path, picture_name, picture_format)\n\n        # use PIL to do the PDF printing\n        from PIL import Image\n\n        bytes = output_image.bits().asstring(output_image.sizeInBytes())\n        img_PIL = Image.frombuffer(\n            \"RGB\",\n            (output_image.width(), output_image.height()),\n            bytes,\n            \"raw\",\n            \"RGB\",\n            0,\n            1,\n        )\n        img_PIL.save(save_path)\n        # # And the image is saved under the given file name, as a PDF\n        print(\"Screenshot saved --> \", save_path)\n\n    # -----------------------------------------------------------------------------\n    def getScreenshotName(self, picture_path, picture_name, picture_format=None):\n        \"\"\" \"\"\"\n\n        # If picture_name is None, save screenshot under same name as model file.\n        # Extract directory of model file and save screenshot in same place, suffixed with .pdf by default\n        # If picture_format is given, this overrides the default file type. This can only happen if user selects file type when exporting image from menubar\n        if picture_name is None:\n            name_to_save = (\n                os.path.join(\n                    os.path.splitext(os.path.basename(picture_path))[0] + \".pdf\"\n                )\n                if picture_format is None\n                else os.path.join(\n                    os.path.splitext(os.path.basename(picture_path))[0]\n                    + \".\"\n                    + picture_format\n                )\n            )\n        # If picture name is given, use this name when saving screenshot\n        else:\n            name_to_save = (\n                os.path.join(picture_name)\n                if picture_format is None\n                else os.path.join(picture_name + \".\" + picture_format)\n            )\n\n        # Find all other images in the current directory (files ending with .png)\n        # as bdedit only saves images with .png extensions\n        # HACK\n        images_in_dir = []\n        dir_list = os.listdir(os.path.dirname(picture_path))\n        for img in fnmatch.filter(dir_list, \"*.pdf\"), fnmatch.filter(dir_list, \"*.png\"):\n            images_in_dir.append(img)\n\n        # Check if saving current model under the model name would create a duplicate\n        no_duplicates = True\n        for image in images_in_dir:\n            if name_to_save == image:\n                no_duplicates = False\n                break\n        # HACK\n        # no_duplicates = True\n\n        # If no duplicates are found, save screenshot under current model name\n        if no_duplicates:\n            return os.path.join(os.path.dirname(picture_path), name_to_save)\n        else:\n            print(\n                \"Handle not yet implemented. Saving screenshot would override existing screenshot with same name.\"\n            )\n\n    # def getScreenshotName(self, picture_path, increment=None):\n    #     \"\"\"\n    #     This function takes a path of where the current model is saved, and searches\n    #     if there are any screenshots in this path with the same name as the model.\n    #     If a duplicate name is detected, the given picture_name is incremented\n    #     with a -N, where N is a unique integer.\n    #\n    #     :param picture_path: path of model to extract name from\n    #     :type picture_path: path, required\n    #     :param increment: integer which makes filename unique. Incremented internally.\n    #     :type increment: int, optional\n    #     \"\"\"\n    #\n    #     # Given the filepath where to save the picture, find the basename of the screenshot\n    #     if increment is None:\n    #         name_to_save = os.path.join(os.path.splitext(os.path.basename(picture_path))[0] + \".pdf\")\n    #     else:\n    #         name_to_save = os.path.join(os.path.splitext(os.path.basename(picture_path))[0] + \"-\" + str(increment)) + \".pdf\"\n    #         increment += 1\n    #\n    #     # Find all other images in the current directory (files ending with .png)\n    #     # as bdedit only saves images with .png extensions\n    #     # HACK\n    #     images_in_dir = []\n    #     print('Picture path:', picture_path)\n    #     dir_list = os.listdir(os.path.dirname(picture_path))\n    #     for img in fnmatch.filter(dir_list, \"*.pdf\"):\n    #         images_in_dir.append(img)\n    #\n    #     # Check if saving current model under the model name would create a duplicate\n    #     no_duplicates = True\n    #     for image in images_in_dir:\n    #         if name_to_save == image:\n    #             no_duplicates = False\n    #             break\n    #     #HACK\n    #     # no_duplicates = True\n    #\n    #     # If no duplicates are found, save screenshot under current model name\n    #     if no_duplicates:\n    #         return os.path.join(os.path.dirname(picture_path), name_to_save)\n    #     else:\n    #         if increment is None: return self.getScreenshotName(picture_path, 1)\n    #         else: return self.getScreenshotName(picture_path, increment)\n\n    # -----------------------------------------------------------------------------\n    def updateSceneDimensions(self):\n        \"\"\"\n        This method updates the dimensions of the scene based on current window\n        size (will change as the application window is resized).\n        \"\"\"\n        # The largest size the scene can be is:\n        # the difference between the max zoom out level (zoomRange[max_zoom_out, max_zoom_in]) and default zoom\n        # multiplied by the zoom out factor\n        multiplier = (\n            abs(self.canvasView.zoomRange[0] - self.canvasView._default_zoom_level)\n            * 0.8\n        )\n\n        # Only update if canvas dimensions have changed from what they were previously set to\n        if (\n            self.width() * multiplier != self.scene.getSceneWidth() * multiplier\n            or self.height() * multiplier != self.scene.getSceneHeight() * multiplier\n        ):\n            self.scene.setSceneWidth((self.width()) * multiplier)\n            self.scene.setSceneHeight((self.height()) * multiplier)\n            self.scene.updateSceneDimensions()\n\n    # -----------------------------------------------------------------------------\n    # Update the canvas's dimension if its size has changed (if window has been resized)\n    def resizeEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QWidget, that is overwritten by ``Interface``\n        to update the dimensions of the ``Scene`` when the application window has\n        been resized.\n\n        :param event: an interaction event that has occurred with this QWidget\n        :type event: QResizeEvent, automatically recognized by the inbuilt function\n        \"\"\"\n        self.updateSceneDimensions()\n"
  },
  {
    "path": "bdsim/bdedit/interface_graphics_scene.py",
    "content": "# Library imports\nimport math\n\n# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\nfrom PyQt5.QtSvg import *\n\n# BdEdit imports\nfrom bdsim.bdedit.Icons import *\n\n\n# =============================================================================\n#\n#   Defining the GraphicsScene Class, which mainly controls the background and\n#   foreground of the canvas within the Scene.\n#\n# =============================================================================\nclass GraphicsScene(QGraphicsScene):\n    \"\"\"\n    The ``GraphicsScene`` Class extends the ``QGraphicsScene`` Class from PyQt5,\n    and controls the basic appearance of the ``Scene`` it belongs to. The things\n    it controls include its background, and foreground.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, scene, parent=None):\n        \"\"\"\n        This method creates an ``QGraphicsScene`` instance and associates it to this\n        ``GraphicsScene`` instance. The GraphicsScene dictates how all items\n        within the Scene are visually represented.\n\n        :param scene: the ``Scene`` to which this ``GraphicsScene`` belongs to\n        :type scene: Scene, required\n        :param parent: the parent widget this GraphicsScene belongs to (should be None)\n        :type parent: None, optional\n        \"\"\"\n        super().__init__(parent)\n\n        # The Scene this GraphicsScene belongs to, is assigned to an internal variable\n        self.scene = scene\n\n        # Grid settings are defined for the spacing of the smaller grid squares (20 px)\n        # and how many smaller grid squares fit into a larger grid square (5)\n        self.gridSize = 20\n        self.gridSquares = 5\n\n        # Set the default background mode of the Scene\n        self.mode = False\n        # Set the wire overlaps to not being detected by default\n        self.enable_intersections = True\n        self.mousePressed = False\n\n        # Set the default background color for when no grid lines are drawn\n        # Currently set to same color as the background for Light mode\n        # self._default_background_color = QColor(\"#E0E0E0\")\n        # Alternatively could be set to a plain white background\n        self._default_background_color = QColor(\"#FFFFFF\")\n\n        # Set the image used for separating wires at points of overlap\n        self.overlap_image_renderer = QSvgRenderer(\n            \":/Icons_Reference/Icons/overlap.svg\"\n        )\n\n    # -----------------------------------------------------------------------------\n    def setGrScene(self, width, height):\n        \"\"\"\n        This method sets the dimensions of the ``GraphicsScene``.\n\n        :param width: width of the GraphicsScene\n        :type width: int, required\n        :param height: height of the GraphicsScene\n        :type height: int, required\n        \"\"\"\n\n        # Set this way so that the (0,0) coordinate would be in the center\n        # of the scene.\n        self.setSceneRect(-width // 2, -height // 2, width, height)\n\n    # -----------------------------------------------------------------------------\n    def updateBackgroundMode(self, bgcolor, grid):\n        \"\"\"Set the background color and grid status for the GraphicsScene.\n\n        :param bgcolor: the background color\n        :type bgcolor: str, required\n        :param grid: grid drawn\n        :type grid: bool, required\n        \"\"\"\n\n        # Set the mode of the background and update the GraphicsScene\n        self.bgcolor = bgcolor\n        self.grid = grid\n        self.update()\n\n    # -----------------------------------------------------------------------------\n    def checkMode(self):\n        \"\"\"\n        This method updates the colors used for painting the background of the ``GraphicsScene``.\n        \"\"\"\n        if self.bgcolor == \"white\":\n            self._color_background = QColorConstants.Svg.white\n        elif self.bgcolor == \"grey\":\n            self._color_background = QColor(\"#E0E0E0\")  # Light gray\n        else:\n            raise ValueError(f\"bad color {self.bgcolor}\")\n\n        if self.grid is True:\n            # set color of major and minor grid lines\n            self._color_light = QColorConstants.Svg.lightgray\n            self._color_dark = QColorConstants.Svg.silver\n        elif self.grid is False:\n            # no grid, major and minor grid lines are background color\n            self._color_light = self._color_background\n            self._color_dark = self._color_background\n\n        # if self.mode == False:\n        #     self._color_background = QColor(\"#E0E0E0\")          # Light gray\n        #     self._color_light = QColorConstants.Svg.lightgray\n        #     self._color_dark = QColorConstants.Svg.silver\n        # elif self.mode == True:\n        #     self._color_background = self._default_background_color     # Light gray\n\n        # Set the line thickness of the smaller, then larger grid squares\n        self._pen_light = QPen(self._color_light)\n        self._pen_light.setWidth(1)\n        self._pen_dark = QPen(self._color_dark)\n        self._pen_dark.setWidth(2)\n        # Set the background fill color\n        self.setBackgroundBrush(self._color_background)\n\n    def mousePressEvent(self, event):\n        # If the mouse is pressed, an internal variable is set to True\n        super().mousePressEvent(event)\n        self.mousePressed = True\n\n    def mouseReleaseEvent(self, event):\n        # If mouse is released, the internal variable is set to False\n        super().mouseReleaseEvent(event)\n        self.mousePressed = False\n\n    # -----------------------------------------------------------------------------\n    def mouseMoveEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QGraphicsScene, that is overwritten by ``GraphicsScene``.\n        It handles the movement related logic for items selected within the ``GraphicsScene``.\n\n        Currently, generic movement logic is applied to instances of the following classes:\n        blocks, floating labels, and grouping boxes\n\n        This genermic movement logic consists of the following being applied on mouse movement:\n\n        - a detected mouse move event on selected item will enforce grid-snapping (making it\n          move only in increments matching the size of the smaller grid squares in the background).\n\n        - the selected item will be prevented from moving outside the maximum zoomed out border\n          of the work area (the GraphicsScene).\n\n        - additioanlly only applies if the selected item is a block:\n          * the locations of its sockets, and that of other connected blocks,\n            are updated as the block moves around.\n          * Additionally, block movements can be relevant to wire routing when they are\n            in custom routing mode, so this logic is checked as blocks are moved.\n          * Finally, moving a block will affect where wires may overlap,\n            so this logic is updated as the blocks are moved.\n\n        - additionally only applies if the selected item is a floating text label:\n          * floating labels have the ability of being moved closer to wires and blocks,\n            so their grid-snapping is enforced to 5 pixels instead of the typical 20 pixels\n            like for all other items.\n\n        - finally, if an item's position within the ``GraphicsScene`` has visually been updated,\n          an internal will reflect that the item has moved, to then indicate unsaved changes and\n          record a new snapshop of the scene's history.\n\n        :param event: a mouse movement event that has occurred with this GraphicsScene\n        :type event: QMouseEvent, automatically recognized by the inbuilt function\n        \"\"\"\n\n        def borderRestriction(item, padding):\n            if hasattr(item, \"block\"):\n                item_width = item.width\n                item_height = item.height\n                item_title = item.title_height\n            elif hasattr(item, \"floating_label\"):\n                item_width = item.floating_label.width\n                item_height = item.floating_label.height\n                item_title = 0\n            elif hasattr(item, \"grouping_box\"):\n                item_width = item.grouping_box.width\n                item_height = item.grouping_box.height\n                item_title = 0\n\n            # left\n            if item.pos().x() < item.scene().sceneRect().x() + padding:\n                item.setPos(item.scene().sceneRect().x() + padding, item.pos().y())\n\n            # top\n            if item.pos().y() < item.scene().sceneRect().y() + padding:\n                item.setPos(item.pos().x(), item.scene().sceneRect().y() + padding)\n\n            # right\n            if item.pos().x() > (\n                item.scene().sceneRect().x()\n                + item.scene().sceneRect().width()\n                - item_width\n                - padding\n            ):\n                item.setPos(\n                    item.scene().sceneRect().x()\n                    + item.scene().sceneRect().width()\n                    - item_width\n                    - padding,\n                    item.pos().y(),\n                )\n\n            # bottom\n            if item.pos().y() > (\n                item.scene().sceneRect().y()\n                + item.scene().sceneRect().height()\n                - item_height\n                - item_title\n                - padding\n            ):\n                item.setPos(\n                    item.pos().x(),\n                    item.scene().sceneRect().y()\n                    + item.scene().sceneRect().height()\n                    - item_height\n                    - item_title\n                    - padding,\n                )\n\n        super().mouseMoveEvent(event)\n\n        if self.mousePressed:\n\n            # For all moveable items which are selected, update their mouseMove related methods\n            for item in self.selectedItems():\n\n                # Padding of 20 pixelsis used for how close the item can come up to the border of the scene\n                padding = 20\n\n                # The x,y position of the mouse cursor is grabbed, and is restricted to update\n                # every 20 pixels (the size of the smaller grid squares, as defined in GraphicsScene)\n                x = round(item.pos().x() / padding) * padding\n                y = round(item.pos().y() / padding) * padding\n                pos = QPointF(x, y)\n\n                # For blocks:\n                if hasattr(item, \"block\"):\n                    # The position of this GraphicsBlock is set to the restricted position of the mouse cursor\n                    item.setPos(pos)\n\n                    borderRestriction(item, padding)\n\n                    # Update the connected wires of all Blocks that are affected by this Block being moved\n                    item.block.updateConnectedEdges()\n\n                    # Since block was moved, update the wires connected to its input & output\n                    # sockets to route the wires using the inbuilt hardcoded logic\n                    item.block.updateWireRoutingLogic()\n\n                    # If there are wires within the Scene\n                    if self.scene.wires:\n                        # Call the first wire in the Scene to check the intersections\n                        # Calling the first wire will still check intersection points\n                        # of all wires, however since that code is located within the\n                        # Wire class, this is how it's accessed.\n                        self.scene.wires[0].checkIntersections()\n\n                # For floating text labels:\n                elif hasattr(item, \"floating_label\"):\n                    padding = 5\n                    x = round(item.pos().x() / padding) * padding\n                    y = round(item.pos().y() / padding) * padding\n                    pos = QPointF(x, y)\n\n                    # The position of this GraphicsFloatingLabel is set to the restricted position of the mouse cursor\n                    item.setPos(pos)\n                    borderRestriction(item, padding)\n\n                # For grouping boxes:\n                elif hasattr(item, \"grouping_box\"):\n                    # The position of this GraphicsGroupingBox is set to the restricted position of the mouse cursor\n                    item.setPos(pos)\n                    borderRestriction(item, padding)\n\n                # If selected item is of any block type, floating text label or grouping box, and\n                if (\n                    hasattr(item, \"block\")\n                    or hasattr(item, \"floating_label\")\n                    or hasattr(item, \"grouping_box\")\n                ):\n                    # If the above rounding has rounded to a new value, and the block has actually \"moved\" in the scene, updated variable to reflect that\n                    if pos != item.lastPos:\n                        item.lastPos = item.pos()\n                        item.wasMoved = True\n\n    # -----------------------------------------------------------------------------\n    def drawForeground(self, painter, rect):\n        \"\"\"\n        This is an inbuilt method of QGraphicsScene, that is overwritten by ``GraphicsScene``\n        to draw additional logic for intersection points between wires. This logic is drawn\n        overtop of all other items within the GraphicsScene apart from Blocks. Intersection\n        points are drawn as a circle (same fill color as the background) to create a\n        separation between the wires, then redraws a vertical section of the wire overtop.\n\n        :param painter: a painter (paint brush) that paints the foreground of this GraphicsScene\n        :type painter: QPainter, automatically recognized and overwritten from this method\n        :param rect: a rectangle that defines the dimensions of this GraphicsScene\n        :type rect: QRect, automatically recognized by the inbuilt function\n        \"\"\"\n        # Passes on the drawForeground so that this method wouldn't block any\n        # foreground drawing logic in other classes\n        super().drawForeground(painter, rect)\n\n        # If user has enabled intersections detection\n        if self.enable_intersections:\n\n            # Check first if any wires are present in the scene\n            if self.scene.wires:\n\n                # If there are intersection points to draw\n                if self.scene.intersection_list:\n\n                    # Check the current colour mode of the scene and set the pen to that colour\n                    self.checkMode()\n                    painter.setPen(Qt.NoPen)\n                    # painter.setBrush(QBrush(self._color_background))\n\n                    # Paint each intersection point\n                    for intersection_point in self.scene.intersection_list:\n                        painter.setBrush(QBrush(self._color_background))\n                        x = intersection_point[0]\n                        y = intersection_point[1]\n\n                        # Prepare an overlap rectangle to \"white-out\" the wires underneath\n                        rect = QRectF(x - 7, y - 7.6, 21, 15.2)\n                        painter.drawRect(rect)\n                        # painter.drawRect(x-7, y-6, 21, 12)\n\n                        # If there are grouping boxes present in the scene\n                        if self.scene.grouping_boxes:\n\n                            # Find which grouping boxes, if any, this rectangle overlaps\n                            for box in self.scene.grouping_boxes:\n                                # Grab QPath of the current location of this grouping box within the scene\n                                gbox_location = box.grGBox.mapToScene(box.grGBox.rect())\n\n                                # Find the intersecting area between the overlapping rect and this grouping box, if there is one\n                                intersecting = self.findIntersectingAreaPoints(\n                                    gbox_location.boundingRect(), rect\n                                )\n\n                                # If an overlap was found, an intersecting rect will be provided, else False\n                                if intersecting:\n                                    painter.setBrush(QBrush(box.grGBox.bg_color))\n                                    painter.drawRect(intersecting)\n\n                        # Paint an image over the intersection point\n                        self.overlap_image_renderer.render(\n                            painter, QRectF(x - 7.2, y - 8, 17, 16)\n                        )\n\n            # Else, if no wires in scene, clear intersection_list\n            else:\n                self.scene.intersection_list.clear()\n\n    # -----------------------------------------------------------------------------\n    def drawBackground(self, painter, rect):\n        \"\"\"\n        This is an inbuilt method of QGraphicsScene, that is overwritten by\n        ``GraphicsScene`` to draw a grid background, or a plain background,\n        depending on what grid mode is chosen. This background is drawn behind\n        all other items within the GraphicsScene.\n\n        :param painter: a painter (paint brush) that paints the background of this GraphicsScene\n        :type painter: QPainter, automatically recognized and overwritten from this method\n        :param rect: a rectangle that defines the dimensions of this GraphicsScene\n        :type rect: QRect, automatically recognized by the inbuilt function\n        \"\"\"\n        # Passes on the drawBackground so that this method wouldn't block any\n        # background drawing logic in other classes\n        super().drawBackground(painter, rect)\n\n        # Check the grid_mode the user has chosen (Light by default)\n        self.checkMode()\n\n        # If the grid_mode is not \"Off\", we want to draw grid lines,\n        # so continue with the following logic\n        if self.mode == False:\n            # Here we create our grid\n            left = int(math.floor(rect.left()))\n            right = int(math.ceil(rect.right()))\n            top = int(math.floor(rect.top()))\n            bottom = int(math.ceil(rect.bottom()))\n\n            first_left = left - (left % self.gridSize)\n            first_top = top - (top % self.gridSize)\n\n            # Compute all lines to be drawn\n            lines_light, lines_dark = [], []\n            for x in range(first_left, right, self.gridSize):\n                if x % (self.gridSize * self.gridSquares) != 0:\n                    lines_light.append(QLine(x, top, x, bottom))\n                else:\n                    lines_dark.append(QLine(x, top, x, bottom))\n\n            for y in range(first_top, bottom, self.gridSize):\n                if y % (self.gridSize * self.gridSquares) != 0:\n                    lines_light.append(QLine(left, y, right, y))\n                else:\n                    lines_dark.append(QLine(left, y, right, y))\n\n            # Draw lines for the smaller grid squares\n            painter.setPen(self._pen_light)\n            try:\n                painter.drawLines(*lines_light)\n            except TypeError:\n                painter.drawLines(lines_light)\n\n            # Draw lines for the larger grid squares\n            painter.setPen(self._pen_dark)\n            try:\n                painter.drawLines(*lines_dark)\n            except TypeError:\n                painter.drawLines(lines_dark)\n\n    # -----------------------------------------------------------------------------\n    def findIntersectingAreaPoints(self, rectA, rectB):\n        \"\"\"\n        This method takes in two QRectF's and finds the union area of overlap between\n        these two rects, as well as the points which make up the overlapping rectangle.\n        :param rectA: rectangle one (representing the grouping box)\n        :type rectA: QRectF\n        :param rectB: rectangle two (representing the wire overlap box)\n        :type rectB: QRectF\n        :return: a rectangle representing the intersection between the two given rectangles\n        :rtype: QRectF\n        \"\"\"\n        x1 = max(rectA.left(), rectB.left())\n        y1 = max(rectA.top(), rectB.top())\n        x2 = min(rectA.right(), rectB.right())\n        y2 = min(rectA.bottom(), rectB.bottom())\n\n        # If the area of the intersecting rectangle is greater than 0\n        if (max(0, x2 - x1) * max(0, y2 - y1)) > 0:\n            # Make a new QRectF representing the intersection\n            return QRectF(x1, y1, (max(0, x2 - x1)), (max(0, y2 - y1)))\n        else:\n            # Otherwise return False\n            return False\n"
  },
  {
    "path": "bdsim/bdedit/interface_graphics_view.py",
    "content": "# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import QGraphicsView\n\n# BdEdit imports\nfrom bdsim.bdedit.block import Block\nfrom bdsim.bdedit.block_graphics_wire import GraphicsWire\nfrom bdsim.bdedit.grouping_box_graphics import GraphicsGBox\nfrom bdsim.bdedit.block_graphics_socket import GraphicsSocket\nfrom bdsim.bdedit.floating_label_graphics import GraphicsLabel\nfrom bdsim.bdedit.block_graphics_block import GraphicsBlock, GraphicsConnectorBlock\nfrom bdsim.bdedit.block_wire import (\n    Wire,\n    WIRE_TYPE_STEP,\n    WIRE_TYPE_DIRECT,\n    WIRE_TYPE_BEZIER,\n)\n\n# =============================================================================\n#\n#   Defining and setting global variables\n#\n# =============================================================================\n# Wire mode variables - used for determining what type of wire to draw\nMODE_NONE = 1\nMODE_WIRE_DRAG = 2\nEDGE_DRAG_LIM = 10\n\n# Variable for enabling/disabling debug comments\nDEBUG = False\n\n\n# =============================================================================\n#\n#   Defining the GraphicsView Class, which handles most auto detected\n#   press/scroll/click/scroll/key events, and assigns logic to those actions as\n#   needed.\n#\n# =============================================================================\nclass GraphicsView(QGraphicsView):\n    \"\"\"\n    The ``GraphicsView`` Class extends the ``QGraphicsView`` Class from PyQt5,\n    and handles most of the user interactions with the ``Interface``, through\n    press/scroll/click/scroll/key events. It also contains the logic for what Wire\n    should be drawn and what Sockets it connects to. Here mouse click events\n    are used to drag the wires from a start to a end socket, when click is\n    dragged from a socket, the mode == MODE_WIRE_DRAG will be set to True and a\n    Wire will follow the mouse until a end socket is set or mode == MODE_WIRE_DRAG\n    is False and the Wire will be deleted.\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, grScene, mainwindow, parent=None):\n        \"\"\"\n        This method creates an ``QGraphicsView`` instance and associates it to this\n        ``GraphicsView`` instance.\n\n        :param grScene: the ``GraphicsScene`` to which this ``GraphicsView`` belongs to\n        :type grScene: GraphicsScene, required\n        :param parent: the parent widget this GraphicsView belongs to (should be None)\n        :type parent: None, optional\n        \"\"\"\n        super().__init__(parent)\n\n        # The GraphicsScene this GraphicsView belongs to, is assigned to an internal variable\n        self.grScene = grScene\n\n        # The InterfaceManager class this application is running within. Only used to access\n        # spinbox widget in toolbar, for displaying correct font size of selected floating text\n        self.interfaceManager = mainwindow\n\n        # The GraphicsScene is initialized with some settings to make things draw smoother\n        self.initUI()\n\n        # The GraphicsScene this GraphicsView belongs to is connected\n        self.setScene(self.grScene)\n\n        # The drawing mode of the wire is initially set to MODE_NONE\n        self.mode = MODE_NONE\n\n        # Definitions of zoom related variables\n        # The there are 10 zoom levels, with level 7 being the default level\n        # Levels 8-10 zoom in, while levels 0-6 zoom out\n        self._default_zoom_level = 7\n        self.zoom = self._default_zoom_level\n        self.zoomStep = 1\n        self.zoomRange = [0, 10]\n\n    # -----------------------------------------------------------------------------\n    def initUI(self):\n        \"\"\"\n        This method initializes the GraphicsScene with additional settings\n        to make things draw smoother\n        \"\"\"\n        self.setRenderHints(\n            QPainter.Antialiasing\n            | QPainter.HighQualityAntialiasing\n            | QPainter.TextAntialiasing\n            | QPainter.SmoothPixmapTransform\n        )\n        self.setViewportUpdateMode(QGraphicsView.FullViewportUpdate)\n        self.setDragMode(QGraphicsView.RubberBandDrag)\n        self.setTransformationAnchor(QGraphicsView.AnchorUnderMouse)\n\n    # -----------------------------------------------------------------------------\n    def closeParamWindows(self):\n        \"\"\"\n        This method will close the parameter window used for changing the\n        user-editable block variables.\n        \"\"\"\n\n        # If there are Blocks within the Scene\n        if len(self.grScene.scene.blocks) != 0:\n            # Iterate through all the Blocks\n            for block in self.grScene.scene.blocks:\n                # And if that Block has a ParamWindow, close it\n                if block.parameterWindow is not None:\n                    block.parameterWindow.setVisible(False)\n                    block._param_visible = False\n\n    # -----------------------------------------------------------------------------\n    def deleteSelected(self):\n        \"\"\"\n        This method removes the selected Block or Wire from the scene.\n        \"\"\"\n\n        # If any items are selected within the scene\n        if self.grScene.selectedItems():\n            # For each selected item within the GraphicsScene\n            for item in self.grScene.selectedItems():\n                # If the item is a Wire, remove it\n                if isinstance(item, GraphicsWire):\n                    item.wire.remove()\n                    self.grScene.scene.has_been_modified = True\n                    self.grScene.scene.history.storeHistory(\"Deleted selected wire\")\n                # Or if the item is a Block or Connector Block, remove it\n                elif isinstance(item, GraphicsBlock) or isinstance(\n                    item, GraphicsConnectorBlock\n                ):\n                    item.block.remove()\n                    self.grScene.scene.has_been_modified = True\n                    self.grScene.scene.history.storeHistory(\"Deleted selected block\")\n                # Or if the item is a Floating_Label, remove it\n                elif isinstance(item, GraphicsLabel):\n                    item.floating_label.remove()\n                    self.interfaceManager.updateToolbarValues()\n                    self.grScene.scene.has_been_modified = True\n                    self.grScene.scene.history.storeHistory(\n                        \"Deleted selected floating label\"\n                    )\n                # Or if item is a Grouping Box, remove it\n                elif isinstance(item, GraphicsGBox):\n                    item.grouping_box.remove()\n                    self.grScene.scene.has_been_modified = True\n                    self.grScene.scene.history.storeHistory(\n                        \"Deleted selected grouping box\"\n                    )\n\n    # -----------------------------------------------------------------------------\n    def flipBlockSockets(self):\n        \"\"\"\n        This method flips the selected Block so that the input and output\n        Sockets change sides.\n        \"\"\"\n\n        # For each selected item within the GraphicsScene\n        for item in self.grScene.selectedItems():\n            # If the item is a Block or Connector Block, flip its sockets\n            if isinstance(item, GraphicsBlock) or isinstance(\n                item, GraphicsConnectorBlock\n            ):\n                item.block.updateSocketPositions()\n                item.block.updateWireRoutingLogic()\n                item.block.flipped = not (item.block.flipped)\n\n        self.grScene.scene.has_been_modified = True\n        self.grScene.scene.history.storeHistory(\"Block Flipped\")\n\n    # -----------------------------------------------------------------------------\n    def dist_click_release(self, event):\n        \"\"\"\n        This method checks how for the cursor has moved. This is be used when the\n        Wire is dragged, to check that wire has been dragged away from the start\n        socket, so that when it is released on a socket we know its not the\n        start socket.\n\n        :param event: a mouse release event that has occurred with this GraphicsView\n        :type event: QMouseEvent, automatically recognized by the inbuilt function\n        :return: - True (if mouse has been released more than an defined distance from\n                   the start_socket)\n                 - False (if mouse has been released too close too the start_socket)\n        :rtype: bool\n        \"\"\"\n\n        # Measures that the cursor has moved a reasonable distance\n        click_release_poss = self.mapToScene(event.pos())\n        mouseMoved = click_release_poss - self.last_click_poss\n        edgeThreshSqr = EDGE_DRAG_LIM * EDGE_DRAG_LIM\n\n        return (\n            mouseMoved.x() * mouseMoved.x() + mouseMoved.y() * mouseMoved.y()\n        ) > edgeThreshSqr\n\n    # -----------------------------------------------------------------------------\n    def getItemAtClick(self, event):\n        \"\"\"\n        This method returns the object at the click location. It is used when\n        checking what item within the GraphicsView has been clicked when starting\n        to drag a wire.\n\n        :param event: a mouse click event that has occurred with this GraphicsView\n        :type event: QMouseEvent, automatically recognized by the inbuilt function\n        :return: the item that has been clicked on (can be ``GraphicsBlock``,\n                 ``GraphicsSocket``, ``GraphicsWireStep``, ``NoneType``), required\n        :rtype: GraphicsBlock, GraphicsSocket, GraphicsWireStep or NoneType\n        \"\"\"\n        pos = event.pos()\n        obj = self.itemAt(pos)\n        return obj\n\n    # -----------------------------------------------------------------------------\n    def intersectionTest(self):\n        \"\"\"\n        This method initiates the checking of all Wires within the Scene for\n        intersection points where they overlap.\n        \"\"\"\n        # If there are wires within the Scene\n        if self.grScene.scene.wires:\n\n            # print(\"Graphics view - intersection test\")\n            # for i, wire in enumerate(self.grScene.scene.wires):\n            #     print(\"Wire \" + str(i) + \" Coordinates: \", wire.wire_coordinates)\n            #     print()\n\n            # Call the first wire in the Scene to check the intersections\n            # Calling the first wire will still check intersection points\n            # of all wires, however since that code is located within the\n            # Wire class, this is how it's accessed.\n            self.grScene.scene.wires[0].checkIntersections()\n\n    # -----------------------------------------------------------------------------\n    def edgeDragStart(self, item):\n        \"\"\"\n        This method starts drawing a Wire between two Blocks. It will\n        construct a new ``Wire`` and set the start socket to the socket that\n        has been clicked on, and the end socket to None. The end socket will\n        be set when either another socket is clicked, or the mouse button is\n        released over another socket. If neither happen, the wire will be deleted.\n\n        :param item: the socket that has been clicked on\n        :type item: GraphicsSocket, required\n        \"\"\"\n        # If in DEBUG mode, the follow code will print the start and end\n        # sockets that have been recognized, as being relevant to this wire.\n        if DEBUG:\n            print(\"socket is input socket:\", item.socket.isInputSocket())\n        if DEBUG:\n            print(\"socket is output socket:\", item.socket.isOutputSocket())\n\n        # The start socket is extracted from the provided item\n        self.drag_start_socket = item.socket\n        # A step wire is made from the start socket, to nothing\n        self.drag_wire = Wire(self.grScene.scene, item.socket, None, WIRE_TYPE_STEP)\n\n        # If in DEBUG mode, the following code will print the wire that has\n        # just been created\n        if DEBUG:\n            print(\"View::wireDragStart ~   dragwire:\", self.drag_wire)\n\n    # -----------------------------------------------------------------------------\n    def edgeDragEnd(self, item):\n        \"\"\"\n        This method is used for setting the end socket of the Wire. The place\n        where the wire has been released will be checked, and if it is a\n        ``GraphicSocket`` and is not the start socket then a Wire is completed.\n\n        Next some check will be made to see that inputs are not connected to inputs\n        and outputs are not connected to outputs. Additionally, Block Sockets will\n        be checked to prevent multiple Wires from connecting to a single input socket.\n        No such restriction is placed on the output sockets. This same logic is\n        applied to Connector Blocks.\n\n        If these conditions are met, the wire that was dragged will be deleted, and\n        a new Wire will be created with the start socket from the block the wire\n        drag started at, and the end socket being from the socket of the block the\n        Wire was dragged to.\n\n        If the above-mentioned conditions not met, the wire is simply removed.\n\n        :param item: should be the socket that has been clicked on (however could\n        be one of the following: ``GraphicsBlock``, ``GraphicsSocket``,\n        ``GraphicsWireStep`` or ``NoneType``)\n        :type item: GraphicsSocket, required\n        :return: False (if the the Wire has been successfully drawn between Blocks)\n        :rtype: bool\n        \"\"\"\n\n        # The dragging mode of the wire is initially set to being None\n        self.mode = MODE_NONE\n\n        if DEBUG:\n            print(\"View::edgeDragEnd ~ End dragging edge\")\n        # The previous wire (drag_wire) is removed\n        self.drag_wire.remove()\n        self.drag_wire = None\n\n        # If the clicked item is a GraphicsSocket\n        if type(item) is GraphicsSocket:\n            # And the clicked socket is not the same socket the original wire started from\n            if item.socket != self.drag_start_socket:\n\n                # If we released dragging on a socket (other then the beginning socket)\n                # We want to keep all the wires coming from target socket\n                if not item.socket.is_multi_wire:\n                    item.socket.removeAllEdges()\n\n                # We want to keep all the wires coming from start socket\n                if not self.drag_start_socket.is_multi_wire:\n                    self.drag_start_socket.removeAllWires()\n\n                # If the block is a socket block, check the start socket of the\n                # wire that ends in the socket block before connecting an end block,\n                # so that 2 outputs or 2 inputs are not connected through the\n                # Socket block\n\n                if self.drag_start_socket.socket_type == 3:\n                    if len(self.drag_start_socket.wires) > 0:\n                        if (\n                            self.drag_start_socket.wires[0].start_socket.socket_type\n                            != item.socket.socket_type\n                        ):\n                            if item.socket.socket_type == 1:\n                                if len(item.socket.wires) == 0:\n                                    new_wire = Wire(\n                                        self.grScene.scene,\n                                        self.drag_start_socket,\n                                        item.socket,\n                                        WIRE_TYPE_STEP,\n                                    )\n                            else:\n                                new_wire = Wire(\n                                    self.grScene.scene,\n                                    self.drag_start_socket,\n                                    item.socket,\n                                    WIRE_TYPE_STEP,\n                                )\n\n                # Socket block can have multi outputs only and not multi inputs\n                elif item.socket.socket_type == 3:\n                    if len(item.socket.wires) > 0:\n                        i = len(self.drag_start_socket.wires)\n                        if i >= 1:\n                            self.drag_start_socket.wires[i - 1].remove()\n                    else:\n                        if item.socket.socket_type == 1:\n                            if len(item.socket.wires) == 0:\n                                new_wire = Wire(\n                                    self.grScene.scene,\n                                    self.drag_start_socket,\n                                    item.socket,\n                                    WIRE_TYPE_STEP,\n                                )\n                        else:\n                            new_wire = Wire(\n                                self.grScene.scene,\n                                self.drag_start_socket,\n                                item.socket,\n                                WIRE_TYPE_STEP,\n                            )\n\n                # Cannot connect a input to a input or a output to a output\n                # Input sockets can not have multiple wires\n                # Wire can only be drawn if start and end sockets are different (input to output, or output to input)\n                elif self.drag_start_socket.socket_type != item.socket.socket_type:\n                    # Additional logic to ensure the input socket (either at start or end of the wire) only has a single\n                    # wire coming into it\n                    if item.socket.socket_type == 1:\n                        if len(item.socket.wires) == 0:\n                            new_wire = Wire(\n                                self.grScene.scene,\n                                self.drag_start_socket,\n                                item.socket,\n                                WIRE_TYPE_STEP,\n                            )\n\n                    elif self.drag_start_socket.socket_type == 1:\n                        if len(self.drag_start_socket.wires) == 0:\n                            new_wire = Wire(\n                                self.grScene.scene,\n                                self.drag_start_socket,\n                                item.socket,\n                                WIRE_TYPE_STEP,\n                            )\n\n                    # Otherwise draw a wire between the two sockets\n                    else:\n                        new_wire = Wire(\n                            self.grScene.scene,\n                            self.drag_start_socket,\n                            item.socket,\n                            WIRE_TYPE_STEP,\n                        )\n\n                self.grScene.scene.has_been_modified = True\n                self.grScene.scene.history.storeHistory(\"Created new wire by dragging\")\n\n                if DEBUG:\n                    print(\"created wire\")\n                if DEBUG:\n                    print(\"View::edgeDragEnd ~ everything done.\")\n\n                # Call for the intersection code to be run\n                # print(\"edge drag end - before true\")\n                self.intersectionTest()\n\n                return True\n\n        return False\n\n    # -----------------------------------------------------------------------------\n    def keyPressEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QGraphicsView, that is overwritten by\n        ``GraphicsView`` to detect, and assign actions to the following key presses.\n\n        - DEL or BACKSPACE: removes selected item from the Scene\n        - F: flips the sockets on a Block or Connector Block\n        - I: toggles intersection detection amongst wires (Off by default)\n        - CTRL + S: previously connected to saving the Scene\n        - CTRL + L: previously connected to loading a Scene file\n\n        The saving and loading of a file using keys has since been disabled, as\n        it used an old method for saving/loading JSON files which has since been\n        overwritten in the Interface Class. However these key checks are still\n        connected if future development should take place.\n\n        :param event: key(s) press(es) that have been detected\n        :type event: QKeyPressEvent, automatically recognized by the inbuilt function\n        \"\"\"\n\n        # if event.key() == Qt.Key_1:\n        #     print(\"HISTORY:     len(%d)\" % len(self.grScene.scene.history.history_stack),\n        #           \" -- current_step\", self.grScene.scene.history.history_current_step)\n        #     ix = 0\n        #     for item in self.grScene.scene.history.history_stack:\n        #         print(\"#\", ix, \"--\", item['desc'])\n        #         ix += 1\n        # elif event.key() == Qt.Key_2:\n        #     for item in self.grScene.selectedItems():\n        #         if hasattr(item, 'wire'):\n        #             print(\"Wire coordinates:\", item.wire.wire_coordinates)\n        # elif event.key() == Qt.Key_3:\n        #     hist_stack_item = self.grScene.scene.history.history_stack[self.grScene.scene.history.history_current_step]\n        #     print(\"history stack current step:\", self.grScene.scene.history.history_current_step)\n        #     for item in hist_stack_item['snapshot'].items():\n        #         if item[0] == 'blocks':\n        #             print(item[0])\n        #             for i, block in enumerate(item[1]):\n        #                 print(\"\\n\\tnew block %d\" % i)\n        #                 for block_items in block.items():\n        #                     if block_items[0] in ['inputs', 'outputs']:\n        #                         for k, socket in enumerate(block_items[1]):\n        #                             print(\"\\n\\t\\tnew socket %d\" % k)\n        #                             for socket_items in socket.items():\n        #                                 print(\"\\t\\t\", socket_items)\n        #                     else:\n        #                         print(\"\\t\", block_items)\n        #         elif item[0] == 'wires':\n        #             print(item[0])\n        #             for j, wire in enumerate(item[1]):\n        #                 print(\"\\n\\tnew wire %d\" % j)\n        #                 for wire_items in wire.items():\n        #                     print(\"\\t\", wire_items)\n        #         else:\n        #             print(item)\n        # else:\n        #     super().keyPressEvent(event)\n\n        super().keyPressEvent(event)\n\n    # -----------------------------------------------------------------------------\n    def mousePressEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QGraphicsView, that is overwritten by\n        ``GraphicsView`` to detect, and direct the Left, Middle and Right mouse\n        button presses to methods that handle their associated logic.\n\n        Additionally, when the Left mouse button is pressed anywhere in the\n        ``GraphicsView``, any currently ``ParamWindow`` that relates to an active\n        ``Block`` within the ``Scene`` will be closed.\n\n        :param event: a mouse press event (Left, Middle or Right)\n        :type event: QMousePressEvent, automatically recognized by the inbuilt function\n        \"\"\"\n\n        if event.button() == Qt.MiddleButton:\n            self.middleMouseButtonPress(event)\n        elif event.button() == Qt.LeftButton:\n            self.leftMouseButtonPress(event)\n            self.closeParamWindows()\n        elif event.button() == Qt.RightButton:\n            self.closeParamWindows()\n            self.rightMouseButtonPress(event)\n        else:\n            super().mousePressEvent(event)\n\n    # -----------------------------------------------------------------------------\n    def mouseReleaseEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QGraphicsView, that is overwritten by\n        ``GraphicsView`` to detect, and direct the Left, Middle and Right mouse\n        button releases to methods that handle their associated logic.\n\n        :param event: a mouse release event (Left, Middle or Right)\n        :type event: QMouseReleaseEvent, required\n        \"\"\"\n\n        if event.button() == Qt.MiddleButton:\n            self.middleMouseButtonRelease(event)\n        elif event.button() == Qt.LeftButton:\n            self.leftMouseButtonRelease(event)\n        elif event.button() == Qt.RightButton:\n            self.rightMouseButtonRelease(event)\n        else:\n            super().mouseReleaseEvent(event)\n\n    # -----------------------------------------------------------------------------\n    def leftMouseButtonPress(self, event):\n        \"\"\"\n        This method handles the logic associate with the Left mouse button press.\n        It will always run the getItemAtClick method to return the item that\n        has been clicked on.\n\n        - If a GraphicsSocket is pressed on, then a draggable Wire will be started.\n        - If a GraphicWire is pressed, then the active draggable Wire will be ended\n          (when the wire is draggable, clicking off at a Socket, will register the\n          clicked item as a GraphicsWire).\n\n        Alternatively, the following logic is applied for selecting items.\n\n        - If an empty space within the GraphicsView is pressed, a draggable net\n          will appear, within which all items will be selected.\n        - If left clicking while holding the SHIFT or CTRL key, this will incrementally\n          select an item from within the GraphicsView. The items that are selectable\n          are ``GraphicsBlock``, ``GraphicsWire`` or ``GraphicsSocketBlock`` (which is\n          the Connector Block).\n\n\n        Otherwise nothing is done with the left mouse press.\n\n        :param event: a Left mouse button press\n        :type event: QMousePressEvent, required\n        :return: None to exit the method\n        :rtype: NoneType\n        \"\"\"\n\n        # Item that is clicked on is grabbed\n        item = self.getItemAtClick(event)\n\n        self.last_click_poss = self.mapToScene(event.pos())\n\n        # if isinstance(item, GraphicsBlock) or isinstance(item, GraphicsWire) or isinstance(item, GraphicsConnectorBlock) or item is None:\n        if (\n            isinstance(item, (GraphicsBlock, GraphicsWire, GraphicsConnectorBlock))\n            or item is None\n        ):\n            if self.grScene.scene.floating_labels:\n                # If floating labels are present and an open space is clicked, bring cursor out of focus from the labels\n                for label in self.grScene.scene.floating_labels:\n                    cursor = label.content.text_edit.textCursor()\n                    cursor.clearSelection()\n                    label.content.text_edit.setTextCursor(cursor)\n                    label.grContent.setLabelUnfocus()\n\n            if event.modifiers() & Qt.ShiftModifier:\n                event.ignore()\n                fakeEvent = QMouseEvent(\n                    QEvent.MouseButtonPress,\n                    event.localPos(),\n                    event.screenPos(),\n                    Qt.LeftButton,\n                    event.buttons() | Qt.LeftButton,\n                    event.modifiers() | Qt.ControlModifier,\n                )\n                super().mousePressEvent(fakeEvent)\n                return\n\n        if type(item) is GraphicsSocket:\n\n            if self.mode == MODE_NONE:\n                self.mode = MODE_WIRE_DRAG\n                self.edgeDragStart(item)\n                return\n\n            if self.mode == MODE_WIRE_DRAG:\n                res = self.edgeDragEnd(item)\n                # Call for the intersection code to be run\n                # print(\"left mouse press - wire drag - socket\")\n                self.intersectionTest()\n                if res:\n                    return\n\n        if issubclass(item.__class__, GraphicsWire):\n            if self.mode == MODE_WIRE_DRAG:\n                res = self.edgeDragEnd(item)\n                # Call for the intersection code to be run\n                # print(\"left mouse press - wire drag - wire\")\n                self.intersectionTest()\n                if res:\n                    return\n\n        super().mousePressEvent(event)\n\n    # -----------------------------------------------------------------------------\n    def leftMouseButtonRelease(self, event):\n        \"\"\"\n        This method handles the logic associate with the Left mouse button release.\n        It will always run the getItemAtClick method to return the item that\n        the mouse has been released from.\n\n        - If a Wire was the item being dragged, it will check how far the Wire has\n          moved, then an attempt to complete the Wire onto a Socket will be made.\n          If no Socket is found, the Wire will be ended.\n\n        Alternatively, the following logic is applied for selecting items.\n\n        - If an empty space within the GraphicsView is released, if a draggable net\n          was active, all items within that net will be selected.\n        - If left clicking while holding the SHIFT or CTRL key, this will incrementally\n          select an item from within the GraphicsView. The items that are selectable\n          are ``GraphicsBlock``, ``GraphicsWire`` or ``GraphicsSocketBlock`` (which is\n          the Connector Block).\n\n        :param event: a Left mouse button release\n        :type event: QMouseReleaseEvent, required\n        :return: None to exit the method\n        :rtype: NoneType\n        \"\"\"\n\n        # Get item which we clicked\n        item = self.getItemAtClick(event)\n\n        # if isinstance(item, GraphicsBlock) or isinstance(item, GraphicsWire) or isinstance(item, GraphicsConnectorBlock) or item is None:\n        if (\n            isinstance(item, (GraphicsBlock, GraphicsWire, GraphicsConnectorBlock))\n            or item is None\n        ):\n            if self.grScene.scene.floating_labels:\n                # Update font size box to display correct font size value of selected floating text\n                self.interfaceManager.updateToolbarValues()\n\n            if event.modifiers() & Qt.ShiftModifier:\n                event.ignore()\n                fakeEvent = QMouseEvent(\n                    event.type(),\n                    event.localPos(),\n                    event.screenPos(),\n                    Qt.LeftButton,\n                    Qt.NoButton,\n                    event.modifiers() | Qt.ControlModifier,\n                )\n                super().mouseReleaseEvent(fakeEvent)\n                return\n\n        if self.mode == MODE_WIRE_DRAG:\n            if self.dist_click_release(event):\n                res = self.edgeDragEnd(item)\n                # print(\"left mouse release - wire drag\")\n                self.intersectionTest()\n                if res:\n                    return\n\n        super().mouseReleaseEvent(event)\n\n    # -----------------------------------------------------------------------------\n    def rightMouseButtonPress(self, event):\n        \"\"\"\n        This method handles the logic associate with the Right mouse button press.\n        Currently no logic is linked to a right mouse press.\n\n        :param event: the detected right mouse press event\n        :type event: QMousePressEvent, required\n        :return: the mouse press event is returned\n        :rtype: QMousePressEvent\n        \"\"\"\n\n        return super().mousePressEvent(event)\n\n    # -----------------------------------------------------------------------------\n    def rightMouseButtonRelease(self, event):\n        \"\"\"\n        This method handles the logic associate with the Right mouse button release.\n        Currently no logic is linked to a right mouse release.\n\n        :param event: the detected right mouse release event\n        :type event: QMousePressEvent, required\n        :return: the mouse release event is returned\n        :rtype: QMouseReleaseEvent\n        \"\"\"\n\n        return super().mouseReleaseEvent(event)\n\n    # -----------------------------------------------------------------------------\n    def middleMouseButtonPress(self, event):\n        \"\"\"\n        This method handles the logic associate with the Middle mouse button press\n        (perhaps more intuitively understood as pressing the scroll wheel).\n        When the scroll wheel is pressed, the mouse cursor will appear as a hand\n        that pinches the GraphicsView, allowing the canvas to be dragged around.\n\n        :param event: the detected middle mouse press event\n        :type event: QMousePressEvent, required\n        \"\"\"\n\n        releaseEvent = QMouseEvent(\n            QEvent.MouseButtonRelease,\n            event.localPos(),\n            event.screenPos(),\n            Qt.LeftButton,\n            Qt.NoButton,\n            event.modifiers(),\n        )\n        super().mouseReleaseEvent(releaseEvent)\n        self.setDragMode(QGraphicsView.ScrollHandDrag)\n        fakeEvent = QMouseEvent(\n            event.type(),\n            event.localPos(),\n            event.screenPos(),\n            Qt.LeftButton,\n            event.buttons() | Qt.LeftButton,\n            event.modifiers(),\n        )\n        super().mousePressEvent(fakeEvent)\n\n    # -----------------------------------------------------------------------------\n    def middleMouseButtonRelease(self, event):\n        \"\"\"\n        This method handles the logic associate with the Middle mouse button release\n        (perhaps more intuitively understood as releasing the scroll wheel).\n        When the scroll wheel is releasing, the mouse cursor will change back from\n        appearing as a hand to the default mouse cursor (pointer arrow on Windows).\n\n        :param event: the detected middle mouse release event\n        :type event: QMouseReleaseEvent, required\n        \"\"\"\n        fakeEvent = QMouseEvent(\n            event.type(),\n            event.localPos(),\n            event.screenPos(),\n            Qt.LeftButton,\n            event.buttons() & ~Qt.LeftButton,\n            event.modifiers(),\n        )\n        super().mouseReleaseEvent(fakeEvent)\n        self.setDragMode(QGraphicsView.NoDrag)\n\n    # -----------------------------------------------------------------------------\n    def wheelEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QGraphicsView, that is overwritten by\n        ``GraphicsView`` to assign logic to detected scroll wheel movement.\n\n        - As the scroll wheel is moved up, this will make the zoom in on the work\n          area of the ``GraphicsScene``.\n        - As the scroll wheel is moved down, this will make the zoom out of the work\n          area of the ``GraphicsScene``.\n\n        :param event: the detected scroll wheel movement\n        :type event: QWheelEvent, automatically recognized by the inbuilt function\n        \"\"\"\n\n        # If scroll wheel vertical motion is detected to being upward\n        if event.angleDelta().y() > 0:\n            # Set the zoom factor to 1.25, and incrementally increase the zoom step\n            zoomFactor = 1.25\n            self.zoom += self.zoomStep\n\n        # Else the scroll wheel is moved downwards\n        else:\n            # Set the zoom factor to 1/1.25, and incrementally decrease the zoom step\n            zoomFactor = 0.8\n            self.zoom -= self.zoomStep\n\n        # If the current zoom is within the allowable zoom levels (0 to 10)\n        # Scale the Scene (in the x and y) by the above-set zoomFactor\n        if self.zoomRange[0] - 1 <= self.zoom <= self.zoomRange[1]:\n            self.scale(zoomFactor, zoomFactor)\n        # Otherwise if the current zoom is below the lowest allowable zoom level (0)\n        # Force the zoom level to the lowest allowable level\n        elif self.zoom < self.zoomRange[0] - 1:\n            self.zoom = self.zoomRange[0] - 1\n        # Otherwise if the current zoom is above the highest allowable zoom level (10)\n        # Force the zoom level to the highest allowable level\n        elif self.zoom > self.zoomRange[1]:\n            self.zoom = self.zoomRange[1]\n\n    # -----------------------------------------------------------------------------\n    def mouseMoveEvent(self, event):\n        \"\"\"\n        This is an inbuilt method of QGraphicsView, that is overwritten by\n        ``GraphicsView`` to assign logic to detected mouse movement.\n\n        - If the wire is in dragging mode, the position the wire is drawn to\n          will be updated to the mouse cursor as it is moved around.\n        - Additionally, the code to check for intersection amongst wires will\n          be run, and subsequently, if any are found, they will be automatically\n          marked within the ``GraphicsScene`` Class.\n\n        :param event: the detected mouse movement event\n        :type event: QMouseMoveEvent, automatically recognized by the inbuilt function\n        \"\"\"\n        super().mouseMoveEvent(event)\n\n        try:\n            # If the wire is in dragging mode\n            if self.mode == MODE_WIRE_DRAG:\n                # Grab the on-screen position of the mouse cursor\n                pos = self.mapToScene(event.pos())\n                # Set the point that the wire draws to, as the current x,y position of the mouse cursor\n                self.drag_wire.grWire.setDestination(pos.x(), pos.y())\n                # Call for the wire to be redrawn/updated accordingly\n                self.drag_wire.grWire.update()\n        except AttributeError:\n            self.mode = MODE_NONE\n"
  },
  {
    "path": "bdsim/bdedit/interface_manager.py",
    "content": "# Library imports\nimport os\nimport json\nimport subprocess\nimport datetime\nfrom sys import platform\nfrom pathlib import Path\n\n# PyQt5 imports\nfrom PyQt5.QtGui import *\nfrom PyQt5.QtCore import *\nfrom PyQt5.QtWidgets import *\n\n# BdEdit imports\nfrom bdsim.bdedit.Icons import *\nfrom bdsim.bdedit.interface import Interface\n\n\n# Todo - update documentation for this new class, handles any edits/saves/undo/redo within interface.\n#  Also handles the run related functionality now\n# =============================================================================\n#\n#   Defining the Interface Manager Class,\n#\n# =============================================================================\nclass InterfaceWindow(QMainWindow):\n    def __init__(self, resolution, debug=False):\n        super().__init__()\n\n        # The name of the current model is initially set to None, this is then\n        # overwritten when the model is saved\n        self.filename = None\n        self.bgmode = 0  # default background/grid mode\n\n        self.initUI(resolution, debug)\n\n    def initUI(self, resolution, debug):\n        # create node editor widget\n        self.interface = Interface(resolution, debug, self)\n        self.interface.scene.addHasBeenModifiedListener(self.updateApplicationName)\n        self.setCentralWidget(self.interface)\n\n        self.runButtonParameters = {\n            \"SimTime\": 10.0,\n            \"Graphics\": True,\n            \"Animation\": True,\n            \"Verbose\": False,\n            \"Progress\": True,\n            \"Debug\": \"\",\n        }\n\n        self.toolbar = QToolBar()\n        self.fontSizeBox = QSpinBox()\n        self.simTimeBox = QLineEdit()\n\n        self.floatValidator = QDoubleValidator()\n\n        # Create the toolbar action items and the toolbar itself\n        self.createActions()\n        self.createToolbar()\n\n        # set window properties\n        # self.setWindowIcon(QIcon(\":/Icons_Reference/Icons/bdsim_icon.png\"))\n        self.updateApplicationName()\n        self.show()\n\n    def createActions(self):\n        # Creates basic actions related to saving/loading files\n        self.actNew = QAction(\n            QIcon(\":/Icons_Reference/Icons/new_file.png\"),\n            \"&New\",\n            self,\n            shortcut=\"Ctrl+N\",\n            toolTip=\"Create new model.\",\n            triggered=self.newFile,\n        )\n        self.actOpen = QAction(\n            QIcon(\":/Icons_Reference/Icons/open_folder.png\"),\n            \"&Open\",\n            self,\n            shortcut=\"Ctrl+O\",\n            toolTip=\"Open model.\",\n            triggered=self.loadFromFile,\n        )\n        self.actSave = QAction(\n            QIcon(\":/Icons_Reference/Icons/save.png\"),\n            \"&Save\",\n            self,\n            shortcut=\"Ctrl+S\",\n            toolTip=\"Save model.\",\n            triggered=self.saveToFile,\n        )\n        self.actSaveAs = QAction(\n            QIcon(\":/Icons_Reference/Icons/save_as.png\"),\n            \"&Save As\",\n            self,\n            shortcut=\"Ctrl+Shift+S\",\n            toolTip=\"Save model as.\",\n            triggered=self.saveAsToFile,\n        )\n        self.actExit = QAction(\n            QIcon(\":/Icons_Reference/Icons/quit.png\"),\n            \"&Quit\",\n            self,\n            shortcut=\"Ctrl+Q\",\n            toolTip=\"Quit bdedit.\",\n            triggered=self.close,\n        )\n\n        # Actions related to editing files (undo/redo)\n        self.actUndo = QAction(\n            QIcon(\":/Icons_Reference/Icons/undo.png\"),\n            \"&Undo\",\n            self,\n            shortcut=\"Ctrl+Z\",\n            toolTip=\"Undo last action.\",\n            triggered=self.editUndo,\n        )\n        self.actRedo = QAction(\n            QIcon(\":/Icons_Reference/Icons/redo.png\"),\n            \"&Redo\",\n            self,\n            shortcut=\"Ctrl+Shift+Z\",\n            toolTip=\"Redo last action.\",\n            triggered=self.editRedo,\n        )\n        self.actDelete = QAction(\n            QIcon(\":/Icons_Reference/Icons/remove.png\"),\n            \"&Delete\",\n            self,\n            toolTip=\"Delete selected items.\",\n            triggered=self.editDelete,\n        )\n        self.actDelete.setShortcuts({QKeySequence(\"Delete\"), QKeySequence(\"Backspace\")})\n\n        # Miscellaneous actions\n        self.actFlipBlocks = QAction(\n            \"Flip Blocks\",\n            self,\n            shortcut=\"F\",\n            toolTip=\"Flip selected blocks.\",\n            triggered=self.miscFlip,\n        )\n        self.actScreenshot = QAction(\n            \"Screenshot\",\n            self,\n            shortcut=\"P\",\n            toolTip=\"Take and save a screenshot of your diagram.\",\n            triggered=lambda checked: self.miscScreenshot(None),\n        )\n        self.actWireOverlaps = QAction(\n            \"Toggle Wire Overlaps\",\n            self,\n            shortcut=\"I\",\n            toolTip=\"Toggle markers where wires overlap.\",\n            triggered=self.miscEnableOverlaps,\n            checkable=True,\n        )\n        self.actHideConnectors = QAction(\n            \"Toggle Connectors\",\n            self,\n            shortcut=\"H\",\n            toolTip=\"Toggle visibilitiy of connector blocks (hidden/visible).\",\n            triggered=self.miscHideConnectors,\n            checkable=True,\n        )\n        self.actDisableBackground = QAction(\n            \"Disable Background\",\n            self,\n            shortcut=\"T\",\n            toolTip=\"Toggle background mode (grey with grid / white without grid).\",\n            triggered=self.miscToggleBackground,\n            checkable=True,\n        )\n\n        # Actions related to model simulation\n        self.actRunButton = QAction(\n            QIcon(\":/Icons_Reference/Icons/run.png\"),\n            \"Run\",\n            self,\n            shortcut=\"R\",\n            toolTip=\"<b>Run Button (R)</b><p>Simulate your block diagram model.</p>\",\n            triggered=self.runButton,\n        )\n        self.actAbortButton = QAction(\n            QIcon(\":/Icons_Reference/Icons/abort.png\"),\n            \"Abort\",\n            self,\n            shortcut=\"Q\",\n            toolTip=\"<b>Abort Button (Q)</b><p>Abort simulation of your block diagram model.</p>\",\n            triggered=self.abortButton,\n        )\n        self.actSimTime = self.simTimeBox.addAction(\n            QIcon(\":/Icons_Reference/Icons/simTime.png\"),\n            self.simTimeBox.LeadingPosition,\n        )\n        self.actSimTime.setToolTip(\n            \"<b>Simulation Time</b><p>Description to be added</p>\"\n        )\n        self.simTimeBox.setText(str(self.runButtonParameters[\"SimTime\"]))\n        self.simTimeBox.setMinimumWidth(55)\n        self.simTimeBox.setMaximumWidth(75)\n        self.simTimeBox.setValidator(self.floatValidator)\n        self.simTimeBox.editingFinished.connect(self.updateSimTime)\n\n        # Actions related to formatting floating text labels\n        self.actAlignLeft = QAction(\n            QIcon(\":/Icons_Reference/Icons/left_align.png\"),\n            \"Left\",\n            self,\n            shortcut=\"Ctrl+Shift+L\",\n            toolTip=\"<b>Left Align (Ctrl+Shift+L)</b><p>Left align your selected floating text.</p>\",\n            triggered=lambda: self.textAlignment(\"AlignLeft\"),\n            checkable=True,\n        )\n        self.actAlignCenter = QAction(\n            QIcon(\":/Icons_Reference/Icons/center_align.png\"),\n            \"Center\",\n            self,\n            shortcut=\"Ctrl+Shift+C\",\n            toolTip=\"<b>Center (Ctrl+Shift+C)</b><p>Center your selected floating text.</p>\",\n            triggered=lambda: self.textAlignment(\"AlignCenter\"),\n            checkable=True,\n        )\n        self.actAlignRight = QAction(\n            QIcon(\":/Icons_Reference/Icons/right_align.png\"),\n            \"Right\",\n            self,\n            shortcut=\"Ctrl+Shift+R\",\n            toolTip=\"<b>Right Align (Ctrl+Shift+R)</b><p>Right align your selected floating text.</p>\",\n            triggered=lambda: self.textAlignment(\"AlignRight\"),\n            checkable=True,\n        )\n\n        self.actBoldText = QAction(\n            QIcon(\":/Icons_Reference/Icons/bold.png\"),\n            \"&Bold\",\n            self,\n            shortcut=\"Ctrl+B\",\n            toolTip=\"<b>Bold (Ctrl+B)</b><p>Toggle bold on selected floating text.</p>\",\n            triggered=self.textBold,\n            checkable=True,\n        )\n        self.actUnderLineText = QAction(\n            QIcon(\":/Icons_Reference/Icons/underline.png\"),\n            \"&Underline\",\n            self,\n            shortcut=\"Ctrl+U\",\n            toolTip=\"<b>Underline (Ctrl+U)</b><p>Toggle underline on selected floating text.</p>\",\n            triggered=self.textUnderline,\n            checkable=True,\n        )\n        self.actItalicText = QAction(\n            QIcon(\":/Icons_Reference/Icons/italic.png\"),\n            \"&Italicize\",\n            self,\n            shortcut=\"Ctrl+I\",\n            toolTip=\"<b>Italic (Ctrl+I)</b><p>Toggle italics on selected floating text.</p>\",\n            triggered=self.textItalicize,\n            checkable=True,\n        )\n\n        self.actFontType = QAction(\n            \"Font\",\n            self,\n            shortcut=\"Ctrl+Shift+F\",\n            toolTip=\"<b>Font (Ctrl+Shift+F)</b><p>Choose a font style for floating text.</p>\",\n            triggered=self.textFontStyle,\n        )\n        self.fontSizeBox.setValue(14)\n        self.fontSizeBox.valueChanged.connect(self.textFontSize)\n        self.actTextColor = QAction(\n            QIcon(\":/Icons_Reference/Icons/color_picker.png\"),\n            \"Text Color\",\n            self,\n            toolTip=\"<b>Font Color</b><p>Change the color of your text.</p>\",\n            triggered=self.textColor,\n        )\n        self.actRemoveFormat = QAction(\n            QIcon(\":/Icons_Reference/Icons/clear_format.png\"),\n            \"Clear Format\",\n            self,\n            toolTip=\"<b>Clear Text Formatting</b><p>Removes all formatting from selected floating text.</p>\",\n            triggered=self.removeFormat,\n        )\n\n        self.actRunBtnOp1 = QAction(\n            \"Graphics\",\n            self,\n            toolTip=\"<b>Toggle Graphics</b><p>Description to be added</p>\",\n            triggered=lambda checked: self.setRunBtnOptions(\"Graphics\"),\n            checkable=True,\n        )\n        self.actRunBtnOp2 = QAction(\n            \"Animation\",\n            self,\n            toolTip=\"<b>Toggle Animation</b><p>Description to be added</p>\",\n            triggered=lambda checked: self.setRunBtnOptions(\"Animation\"),\n            checkable=True,\n        )\n        self.actRunBtnOp3 = QAction(\n            \"Verbose\",\n            self,\n            toolTip=\"<b>Toggle Verbose</b><p>Description to be added</p>\",\n            triggered=lambda checked: self.setRunBtnOptions(\"Verbose\"),\n            checkable=True,\n        )\n        self.actRunBtnOp4 = QAction(\n            \"Progress\",\n            self,\n            toolTip=\"<b>Toggle Progress</b><p>Description to be added</p>\",\n            triggered=lambda checked: self.setRunBtnOptions(\"Progress\"),\n            checkable=True,\n        )\n        self.actRunBtnOp5 = QAction(\n            \"Debug\",\n            self,\n            toolTip=\"<b>Debug String</b><p>Description to be added</p>\",\n            triggered=lambda checked: self.setRunBtnOptions(\"Debug\"),\n        )\n        self.actRunBtnOp6 = QAction(\n            \"Simulation Time\",\n            self,\n            toolTip=\"<b>Simulation Time</b><p>Description to be added</p>\",\n            triggered=lambda checked: self.setRunBtnOptions(\"SimTime\"),\n        )\n\n        self.helpButton = QAction(\n            QIcon(\":/Icons_Reference/Icons/help.png\"),\n            \"Help\",\n            self,\n            toolTip=\"<b>Help</b><p>Open BdEdit documentation.</p>\",\n            triggered=self.displayHelpURL,\n        )\n\n    def createToolbar(self):\n        self.createFileMenu()\n        self.createEditMenu()\n        self.createToolsMenu()\n        self.createRunButtonParameters()\n        self.createToolbarItems()\n        self.createHelpItem()\n\n    def createFileMenu(self):\n        # self._file_menubar = QMenuBar() if platform == 'darwin' else self.menuBar()\n        # self.fileMenu = QMenu('File')\n        # self.fileMenu.setToolTipsVisible(True)\n        # self.fileMenu.addAction(self.actNew)\n        # self.fileMenu.addSeparator()\n        # self.fileMenu.addAction(self.actOpen)\n        # self.fileMenu.addAction(self.actSave)\n        # self.fileMenu.addAction(self.actSaveAs)\n        # self.fileMenu.addSeparator()\n        # self.fileMenu.addAction(self.actExit)\n        # self._file_menubar.addMenu(self.fileMenu)\n        # # self._file_menubar.setNativeMenuBar(False)\n\n        menubar = self.menuBar()\n        self.fileMenu = menubar.addMenu(\"File\")\n        self.fileMenu.setToolTipsVisible(True)\n        self.fileMenu.addAction(self.actNew)\n        self.fileMenu.addAction(self.actOpen)\n        self.fileMenu.addSeparator()\n        self.fileMenu.addAction(self.actSave)\n        self.fileMenu.addAction(self.actSaveAs)\n\n        exportMenu = QMenu(\"Export As\", self)\n        exportMenu.setIcon(QIcon(\":/Icons_Reference/Icons/export_as.png\"))\n        exportPDF = QAction(\n            \"PDF\",\n            self,\n            toolTip=\"Export model as a pdf.\",\n            triggered=lambda checked: self.exportAsToFile(\"pdf\"),\n        )\n        exportPNG = QAction(\n            \"PNG\",\n            self,\n            toolTip=\"Export model as a png.\",\n            triggered=lambda checked: self.exportAsToFile(\"png\"),\n        )\n        exportMenu.addAction(exportPDF)\n        exportMenu.addAction(exportPNG)\n        self.fileMenu.addMenu(exportMenu)\n\n        self.fileMenu.addSeparator()\n        self.fileMenu.addAction(self.actExit)\n\n    def createEditMenu(self):\n        # self._edit_menubar.setNativeMenuBar(False)\n        #     self._edit_menubar = QMenuBar() if platform == 'darwin' else self.menuBar()\n        #     self.editMenu = QMenu('Edit')\n        #     self.editMenu.setToolTipsVisible(True)\n        #     self.editMenu.addAction(self.actUndo)\n        #     self.editMenu.addAction(self.actRedo)\n        #     self.editMenu.addSeparator()\n        #     self.editMenu.addAction(self.actDelete)\n        #     self._edit_menubar.addMenu(self.editMenu)\n        #     # self._edit_menubar.setNativeMenuBar(False)\n        menubar = self.menuBar()\n        self.editMenu = menubar.addMenu(\"Edit\")\n        self.editMenu.setToolTipsVisible(True)\n        self.editMenu.addAction(self.actUndo)\n        self.editMenu.addAction(self.actRedo)\n        self.editMenu.addSeparator()\n        self.editMenu.addAction(self.actDelete)\n\n    def createToolsMenu(self):\n        # self._tools_menubar = QMenuBar() if platform == 'darwin' else self.menuBar()\n        # self.toolsMenu = QMenu('Tools')\n        # self.toolsMenu.setToolTipsVisible(True)\n        # self.toolsMenu.addAction(self.actFlipBlocks)\n        # self.toolsMenu.addAction(self.actScreenshot)\n        # self.toolsMenu.addSeparator()\n        # self.toolsMenu.addAction(self.actWireOverlaps)\n        # self.toolsMenu.addAction(self.actHideConnectors)\n        # self.toolsMenu.addAction(self.actDisableBackground)\n        # self.toolsMenu.addSeparator()\n        # self.toolsMenu.addAction(self.actDelete)\n        # self._tools_menubar.addMenu(self.toolsMenu)\n        # # self._tools_menubar.setNativeMenuBar(False)\n        menubar = self.menuBar()\n        self.toolsMenu = menubar.addMenu(\"Tools\")\n        self.toolsMenu.setToolTipsVisible(True)\n        self.toolsMenu.addAction(self.actFlipBlocks)\n        self.toolsMenu.addAction(self.actScreenshot)\n        self.toolsMenu.addSeparator()\n        self.toolsMenu.addAction(self.actWireOverlaps)\n        self.toolsMenu.addAction(self.actHideConnectors)\n        self.toolsMenu.addAction(self.actDisableBackground)\n        # self.toolsMenu.addSeparator()\n        # self.toolsMenu.addAction(self.actDelete)\n\n    def createRunButtonParameters(self):\n        # self._params_menubar = QMenuBar() if platform == 'darwin' else self.menuBar()\n        # self.runMenu = QMenu('Simulation')\n        # self.runMenu.setToolTipsVisible(True)\n        # self.runMenu.addAction(self.actRunBtnOp6)\n        # self.runMenu.addSeparator()\n        # self.runMenu.addAction(self.actRunBtnOp1)\n        # self.runMenu.addAction(self.actRunBtnOp2)\n        # self.runMenu.addAction(self.actRunBtnOp3)\n        # self.runMenu.addAction(self.actRunBtnOp4)\n        # self.runMenu.addSeparator()\n        # self.runMenu.addAction(self.actRunBtnOp5)\n        # self._params_menubar.addMenu(self.runMenu)\n        menubar = self.menuBar()\n        self.runMenu = menubar.addMenu(\"Simulation\")\n        self.runMenu.setToolTipsVisible(True)\n        self.runMenu.addAction(self.actRunBtnOp6)\n        self.runMenu.addSeparator()\n        self.runMenu.addAction(self.actRunBtnOp1)\n        self.runMenu.addAction(self.actRunBtnOp2)\n        self.runMenu.addAction(self.actRunBtnOp3)\n        self.runMenu.addAction(self.actRunBtnOp4)\n        self.runMenu.addSeparator()\n        self.runMenu.addAction(self.actRunBtnOp5)\n\n    def createHelpItem(self):\n        # self._help_menubar = QMenuBar() if platform == 'darwin' else self.menuBar()\n        # self.helpBar = QMenu('Help')\n        # self.helpBar.setToolTipsVisible(True)\n        # self.helpBar.addAction(self.helpButton)\n        # self._help_menubar.addMenu(self.helpBar)\n        # # self._help_menubar.setNativeMenuBar(False)\n        menubar = self.menuBar()\n        self.helpBar = menubar.addMenu(\"Help\")\n        self.helpBar.setToolTipsVisible(True)\n        self.helpBar.addAction(self.helpButton)\n\n    def createToolbarItems(self):\n        self.toolbar = self.addToolBar(\"ToolbarItems\")\n        self.toolbar.addAction(self.actRunButton)\n        self.toolbar.addAction(self.actAbortButton)\n        self.toolbar.addWidget(self.simTimeBox)\n        self.toolbar.addSeparator()\n        self.toolbar.addAction(self.actAlignLeft)\n        self.toolbar.addAction(self.actAlignCenter)\n        self.toolbar.addAction(self.actAlignRight)\n        self.toolbar.addSeparator()\n        self.toolbar.addAction(self.actBoldText)\n        self.toolbar.addAction(self.actUnderLineText)\n        self.toolbar.addAction(self.actItalicText)\n        self.toolbar.addSeparator()\n        self.toolbar.addAction(self.actFontType)\n        self.toolbar.addWidget(self.fontSizeBox)\n        self.toolbar.addAction(self.actTextColor)\n        self.toolbar.addAction(self.actRemoveFormat)\n        self.toolbar.addSeparator()\n\n    # -----------------------------------------------------------------------------\n\n    def updateApplicationName(self):\n        name = \"bdedit - \"\n        if self.filename is None:\n            name += \"untitled.bd\"\n        else:\n            name += os.path.basename(self.filename)\n\n        if self.centralWidget().scene.has_been_modified:\n            name += \"*\"\n\n        self.setWindowTitle(name)\n\n    def closeEvent(self, event):\n        if self.exitingWithoutSave():\n            event.accept()\n        else:\n            event.ignore()\n\n    def isModified(self):\n        return self.centralWidget().scene.has_been_modified\n\n    def exitingWithoutSave(self):\n        if not self.isModified():\n            return True\n\n        msg_prompt = QMessageBox.warning(\n            self,\n            \"Exiting without saving work.\",\n            \"The document has been modified.\\nDo you want to save your changes?\",\n            QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel,\n        )\n\n        if msg_prompt == QMessageBox.Save:\n            return self.saveToFile()\n        elif msg_prompt == QMessageBox.Cancel:\n            return False\n\n        return True\n\n    # -----------------------------------------------------------------------------\n    def setRunBtnOptions(self, value):\n        if value not in [\"Debug\", \"SimTime\"]:\n            self.runButtonParameters[value] = not (self.runButtonParameters[value])\n\n        elif value == \"Debug\":\n            arbitrary_string, done = QInputDialog.getText(\n                self, \"Input Dialog\", \"Enter a debug string:\"\n            )\n            if done:\n                self.runButtonParameters[value] = arbitrary_string\n\n        elif value == \"SimTime\":\n            sim_time, done = QInputDialog.getText(\n                self,\n                \"Input Dialog\",\n                \"Enter simulation time (sec):\",\n                QLineEdit.Normal,\n                str(self.runButtonParameters[value]),\n            )\n            if done:\n                try:\n                    # If simulation time is positive integer, update value\n                    if float(sim_time) > 0:\n                        self.runButtonParameters[value] = float(sim_time)\n                        self.simTimeBox.setText(str(self.runButtonParameters[value]))\n                        self.interface.scene.sim_time = float(sim_time)\n\n                    # Else return feedback\n                    else:\n                        print(\n                            \"Incompatible simulation time given. Expected a positive non-zero float or integer.\"\n                        )\n                        self.setRunBtnOptions(value)\n\n                # If value is not an integer, return feedback\n                except ValueError as e:\n                    print(\n                        \"Incompatible simulation time given. Expected a positive non-zero float or integer.\"\n                    )\n                    self.setRunBtnOptions(value)\n\n            else:\n                # Leave simulation time value unchanged.\n                pass\n\n        print(self.runButtonParameters)\n\n    def displayHelpURL(self):\n        QDesktopServices.openUrl(\n            QtCore.QUrl(\n                \"https://github.com/petercorke/bdsim/blob/master/bdsim/bdedit/README.md\"\n            )\n        )\n\n    # -----------------------------------------------------------------------------\n    def runButton(self):\n        self.saveToFile()\n\n        main_block_found = False\n\n        # Go through blocks within scene, if a main block exists, extract the file_name from the main block\n        for block in self.centralWidget().scene.blocks:\n            if block.block_type in [\"Main\", \"MAIN\"]:\n                main_block_found = True\n                main_file_name = block.parameters[0][2]\n                break\n\n        # Convert the GUI simulation options to command line args\n        args = []\n        for key, value in self.runButtonParameters.items():\n            arg = key.lower()\n            if isinstance(value, bool):\n                if not arg:\n                    arg = \"no-\" + arg\n                args.append(\"--\" + arg)\n            else:\n                if isinstance(value, str):\n                    if len(value) > 0:\n                        value = '\"' + value + '\"'\n                args.append(f\"--{arg}={value}\")\n        print(args)\n        print(self.args)\n\n        if main_block_found:\n\n            # Check if given file_name from the main block, contains a file extension\n\n            bdfile = Path(self.filename)\n            mainfile = Path(main_file_name)\n            if not mainfile.is_absolute():\n                mainfile = bdfile.resolve().with_name(mainfile.name)\n            mainfile = mainfile.with_suffix(\".py\")\n\n            # file_name, extension = os.path.splitext(main_file_name)\n            # if not extension:\n            #     main_file_name = os.path.join(main_file_name + \".py\")\n            model_name = os.path.basename(self.filename)\n            if not mainfile.is_file():\n                print(f\"Main block detected: file {main_file_name} could not be opened\")\n                return\n\n            command = [\"python\"]\n            if self.args.pdb:\n                command.extend([\"-m\", \"pdb\"])\n            command.extend([str(mainfile), str(bdfile)])\n            command.extend(args)\n\n        else:\n            model_name = os.path.basename(self.filename)\n\n            command = [\"bdrun\", model_name]\n            command.extend(args)\n\n        print(\"\\n\" + \"#\" * 100)\n        print(f\"{datetime.datetime.now()}:: {' '.join(command)}\")\n\n        try:\n            subprocess.Popen(command, shell=False)\n\n        except (ValueError, OSError):\n            print(f\"failed to spawn subprocess\")\n\n    # -----------------------------------------------------------------------------\n    def abortButton(self):\n        # Added function for handling what the abort button does when pressed.\n        print(\n            \"Abort button pressed. Functionality yet to be implemented. Function in 'interface_manager' under 'runButton' function\"\n        )\n        pass\n\n    # -----------------------------------------------------------------------------\n    def updateSimTime(self):\n        # This function is called when the Simulation Time value has been changed in the toolbar text widget.\n        sim_time = self.simTimeBox.text()\n\n        try:\n            # If simulation time is positive integer, update value\n            if float(sim_time) > 0:\n                self.runButtonParameters[\"SimTime\"] = float(sim_time)\n                self.simTimeBox.setText(str(self.runButtonParameters[\"SimTime\"]))\n                self.interface.scene.sim_time = float(sim_time)\n\n            # Else return feedback\n            else:\n                print(\n                    \"Incompatible simulation time given. Expected a positive non-zero float or integer.\"\n                )\n\n        # If value is not an integer, return feedback\n        except ValueError as e:\n            print(\n                \"Incompatible simulation time given. Expected a positive non-zero float or integer.\"\n            )\n\n        print(self.runButtonParameters)\n\n    # -----------------------------------------------------------------------------\n    def newFile(self):\n        if self.exitingWithoutSave():\n            # Clear scene and all its elements. Reset simulation time parameters\n            self.centralWidget().scene.clear()\n            self.runButtonParameters = {\n                \"SimTime\": 10.0,\n                \"Graphics\": True,\n                \"Animation\": True,\n                \"Verbose\": False,\n                \"Progress\": True,\n                \"Debug\": \"\",\n            }\n            self.simTimeBox.setText(str(self.runButtonParameters[\"SimTime\"]))\n            self.interface.scene.sim_time = self.runButtonParameters[\"SimTime\"]\n\n            # Reset filename and update GUI to display default file name\n            self.filename = None\n            self.updateApplicationName()\n\n            # Reset history stack\n            self.centralWidget().scene.history.clear()\n            self.centralWidget().scene.history.storeInitialHistoryStamp()\n\n    # -----------------------------------------------------------------------------\n    def loadFromFilePath(self, filepath):\n        \"\"\"\n        This method is only used when loading a file from the command line. It will\n        check if the file at the given path exists, and if so, will load its contents.\n        \"\"\"\n\n        if self.exitingWithoutSave():\n            # Check if file at given path exists, if so, run the deserializing method\n            if os.path.isfile(filepath):\n                self.centralWidget().scene.loadFromFile(filepath)\n                self.filename = filepath\n                self.updateApplicationName()\n                self.centralWidget().scene.history.clear()\n                self.centralWidget().scene.history.storeInitialHistoryStamp()\n\n    # -----------------------------------------------------------------------------\n    def loadFromFile(self):\n        \"\"\"\n        This method opens a QFileDialog window, prompting the user to select a file\n        to load from.\n        \"\"\"\n\n        if self.exitingWithoutSave():\n            # The filename of the selected file is grabbed\n            fname, filter = QFileDialog.getOpenFileName(self)\n            if fname == \"\":\n                return\n\n            # And the method for deserializing from a file is called, feeding in the\n            # extracted filename from above\n            if os.path.isfile(fname):\n                self.centralWidget().scene.loadFromFile(fname)\n                self.filename = fname\n                self.updateApplicationName()\n                # Update SimTime in runButtonParameters in case it was set in model\n                self.runButtonParameters[\"SimTime\"] = self.interface.scene.sim_time\n                self.simTimeBox.setText(str(self.runButtonParameters[\"SimTime\"]))\n\n    # -----------------------------------------------------------------------------\n    def saveToFile(self):\n        \"\"\"\n        This method calls the method from within the ``Scene`` to save a copy of the\n        current Scene, with all its items under a file with the current filename. If\n        this is the first time a user is saving their file, they will be prompted to\n        name the file and to choose where it will be saved.\n        \"\"\"\n\n        if self.filename is None:\n            return self.saveAsToFile()\n        self.centralWidget().scene.saveToFile(self.filename)\n        self.updateApplicationName()\n        return True\n\n    # -----------------------------------------------------------------------------\n    def saveAsToFile(self):\n        \"\"\"\n        This method opens a QFileDialog window, prompting the user to enter a name\n        under which the current file will be saved. This file will automatically be\n        given a .json file type.\n        \"\"\"\n\n        # The allowable file types are defined below\n        file_types = \"bdedit files(*.bd);;JSON files (*.json)\"\n        fname, _ = QFileDialog.getSaveFileName(self, \"untitled.bd\", filter=file_types)\n\n        # The filename is extracted from the QFileDialog\n        if fname == \"\":\n            return False\n\n        # The filename of the scene is stored as a variable inside the Interface, and\n        # the self.saveToFile method is called (which will call the self.scene.saveToFile\n        # method from within the Scene, which will serialize the contents of the Scene\n        # into a JSON file with the provided file name).\n        self.filename = fname\n        self.saveToFile()\n        return True\n\n    # -----------------------------------------------------------------------------\n    def exportAsToFile(self, fileType):\n        self.miscScreenshot(fileType)\n\n    # -----------------------------------------------------------------------------\n    def editUndo(self):\n        self.interface.scene.history.undo()\n\n    def editRedo(self):\n        self.interface.scene.history.redo()\n\n    def editDelete(self):\n        if self.interface:\n            self.interface.canvasView.deleteSelected()\n            self.interface.canvasView.intersectionTest()\n\n    # -----------------------------------------------------------------------------\n    def miscFlip(self):\n        if self.interface:\n            self.interface.canvasView.intersectionTest()\n            self.interface.canvasView.flipBlockSockets()\n\n    def miscEnableOverlaps(self):\n        if self.interface:\n            self.interface.scene.grScene.enable_intersections = (\n                not self.interface.scene.grScene.enable_intersections\n            )\n\n    def miscScreenshot(self, fileType):\n        if self.interface:\n            if self.filename is None:\n                print(\n                    \"Please save your model before taking a screenshot, then try again.\"\n                )\n                self.saveToFile()\n            else:\n                self.interface.save_image(\n                    self.filename, picture_name=None, picture_format=fileType\n                )\n\n    def miscHideConnectors(self):\n        if self.interface:\n            if self.actHideConnectors.isChecked():\n                # Set variable for hiding connector blocks to True\n                self.interface.scene.hide_connector_blocks = True\n            else:\n                # Set variable for hiding connector blocks to False\n                self.interface.scene.hide_connector_blocks = False\n\n    def miscToggleBackground(self):\n        \"\"\"\n        This method is called to cycle through various background and grid\n        options.\n        \"\"\"\n        # possible modes\n        modes = [(\"grey\", True), (\"white\", True), (\"white\", False)]\n\n        self.bgmode = (self.bgmode + 1) % len(modes)  # update current mode\n        mode = modes[self.bgmode]\n        self.interface.scene.grScene.updateBackgroundMode(*mode)\n        # # For each block within the Scene, the mode of their outline is also updated\n        # for eachBlock in self.interface.scene.blocks:\n        #     # If the block has a mode (Connector Blocks do not)\n        #     if not (eachBlock.block_type == \"CONNECTOR\" or eachBlock.block_type == \"Connector\"):\n        #         # eachBlock.grBlock.updateBackgroundMode(self.actDisableBackground.isChecked())\n        #         eachBlock.grBlock.updateBackgroundMode(mode[0], mode[1])\n\n    # -----------------------------------------------------------------------------\n    def textAlignment(self, alignment):\n        if self.interface.scene.floating_labels:\n            # Make a map of alignment text to actual Qt alignments\n            map = {\n                \"AlignLeft\": Qt.AlignLeft,\n                \"AlignCenter\": Qt.AlignCenter,\n                \"AlignRight\": Qt.AlignRight,\n            }\n\n            # Iterate through each floating label item and if the label is selected,\n            # then set the alignment of its contents\n            for label in self.interface.scene.floating_labels:\n                if self.checkSelection(label):\n                    label.content.text_edit.setAlignment(map[alignment])\n                    self.interface.scene.has_been_modified = True\n                    self.interface.scene.history.storeHistory(\n                        \"Floating label changed alignment\"\n                    )\n\n            self.updateToolbarValues()\n\n    def textBold(self):\n        if self.interface.scene.floating_labels:\n            for label in self.interface.scene.floating_labels:\n                if self.checkSelection(label):\n                    if self.actBoldText.isChecked():\n                        label.content.text_edit.setFontWeight(QFont.Bold)\n                    else:\n                        label.content.text_edit.setFontWeight(QFont.Normal)\n\n                    label.content.updateShape()\n\n                    self.interface.scene.has_been_modified = True\n                    self.interface.scene.history.storeHistory(\n                        \"Floating label changed boldness\"\n                    )\n\n    def textUnderline(self):\n        if self.interface.scene.floating_labels:\n            for label in self.interface.scene.floating_labels:\n                if self.checkSelection(label):\n                    if self.actUnderLineText.isChecked():\n                        label.content.text_edit.setFontUnderline(True)\n                    else:\n                        label.content.text_edit.setFontUnderline(False)\n\n                    label.content.updateShape()\n\n                    self.interface.scene.has_been_modified = True\n                    self.interface.scene.history.storeHistory(\n                        \"Floating label changed underline\"\n                    )\n\n    def textItalicize(self):\n        if self.interface.scene.floating_labels:\n            for label in self.interface.scene.floating_labels:\n                if self.checkSelection(label):\n                    if self.actItalicText.isChecked():\n                        label.content.text_edit.setFontItalic(True)\n                    else:\n                        label.content.text_edit.setFontItalic(False)\n\n                    label.content.updateShape()\n\n                    self.interface.scene.has_been_modified = True\n                    self.interface.scene.history.storeHistory(\n                        \"Floating label changed italics\"\n                    )\n\n    def textFontStyle(self):\n        (font, ok) = QFontDialog.getFont()\n        # print(\"ok, font name, font size:\", [ok, font.family(), font.styleName(), font.pointSize()])\n        if ok:\n            if self.interface.scene.floating_labels:\n                for label in self.interface.scene.floating_labels:\n                    if self.checkSelection(label):\n                        label.content.text_edit.setFont(font)\n                        label.content.text_edit.setFontWeight(font.weight())\n                        label.content.currentFontSize = font.pointSize()\n                        label.content.updateText()\n                        label.grContent.setLabelSizeBox()\n                        label.content.updateShape()\n\n                        self.interface.scene.has_been_modified = True\n                        self.interface.scene.history.storeHistory(\n                            \"Floating label changed font style\"\n                        )\n\n    def textFontSize(self):\n        if self.interface.scene.floating_labels:\n            for label in self.interface.scene.floating_labels:\n                if self.checkSelection(label):\n                    value = self.fontSizeBox.value()\n                    label.content.text_edit.setFontPointSize(value)\n                    label.content.currentFontSize = value\n                    label.content.updateShape()\n\n                    self.interface.scene.has_been_modified = True\n                    self.interface.scene.history.storeHistory(\n                        \"Floating label changed font size\"\n                    )\n\n    def textColor(self):\n        color = QColorDialog.getColor(options=QColorDialog.ShowAlphaChannel)\n\n        if color.isValid():\n            if self.interface.scene.floating_labels:\n                for label in self.interface.scene.floating_labels:\n                    if self.checkSelection(label):\n                        label.content.text_edit.setTextColor(color)\n\n                        self.interface.scene.has_been_modified = True\n                        self.interface.scene.history.storeHistory(\n                            \"Floating label changed font color\"\n                        )\n\n        # self.updateToolbarValues()     # Enable this if you ever make the font color icon update\n\n    # Clears all format on selected floating labels, reverting to default format\n    def removeFormat(self):\n        if self.interface.scene.floating_labels:\n            for label in self.interface.scene.floating_labels:\n                if self.checkSelection(label):\n                    label.content.setDefaultFormatting()\n                    label.content.updateText()\n\n                    self.interface.scene.has_been_modified = True\n                    self.interface.scene.history.storeHistory(\n                        \"Floating label cleared formatting\"\n                    )\n        self.updateToolbarValues()\n\n    # This function checks if the current label is selected\n    def checkSelection(self, label):\n        if label.grContent.isSelected():\n            label.content.text_edit.selectAll()\n            return True\n        return False\n\n    # This function contains the logic for when to select/unselect toolbar items\n    def updateToolbarValues(self):\n        selected_labels = []\n        any_bold = False\n        any_italics = False\n        any_underlined = False\n\n        if self.interface.scene.floating_labels:\n            for label in self.interface.scene.floating_labels:\n                if self.checkSelection(label):\n                    selected_labels.append(label)\n                    # If any label is bold, or italicized, or underlined,\n                    # when mutliple labels are selected the respective icon will be selected\n                    if label.content.text_edit.fontWeight() > 50:\n                        any_bold = True\n                    if label.content.text_edit.fontItalic():\n                        any_italics = True\n                    if label.content.text_edit.fontUnderline():\n                        any_underlined = True\n\n        if len(selected_labels) == 0:\n            # If no labels are selected, unselects all toolbar items (alignment, bold, italics, underline)\n            self.fontSizeBox.setValue(14)\n            self.actBoldText.setChecked(False)\n            self.actItalicText.setChecked(False)\n            self.actUnderLineText.setChecked(False)\n            self.unselectAlignmentIcons()\n\n        elif len(selected_labels) == 1:\n            # If only one label is selected, sets the correct values of all toolbar items based on the\n            # label's value (alignment, bold, italics, underline)\n            our_label = selected_labels[0].content\n            self.fontSizeBox.setValue(our_label.currentFontSize)\n            self.actBoldText.setChecked(our_label.text_edit.fontWeight() > 50)\n            self.actItalicText.setChecked(our_label.text_edit.fontItalic())\n            self.actUnderLineText.setChecked(our_label.text_edit.fontUnderline())\n            self.actAlignLeft.setChecked(\n                our_label.text_edit.alignment() == Qt.AlignLeft\n            )\n            self.actAlignCenter.setChecked(\n                our_label.text_edit.alignment() == Qt.AlignCenter\n            )\n            self.actAlignRight.setChecked(\n                our_label.text_edit.alignment() == Qt.AlignRight\n            )\n\n        else:\n            # If multiple labels are selected, font size box and alignment options are cleared\n            # but bold, italics, underline are selected/unselected depending on if any of the selected\n            # labels are bold, italicizied or underlined.\n            self.fontSizeBox.clear()\n            self.actBoldText.setChecked(any_bold)\n            self.actItalicText.setChecked(any_italics)\n            self.actUnderLineText.setChecked(any_underlined)\n            self.unselectAlignmentIcons()\n\n    def unselectAlignmentIcons(self):\n        self.actAlignLeft.setChecked(False)\n        self.actAlignCenter.setChecked(False)\n        self.actAlignRight.setChecked(False)\n"
  },
  {
    "path": "bdsim/bdedit/interface_scene.py",
    "content": "# Library imports\nimport json\nimport time\nimport getpass\nfrom PIL import ImageFont\nfrom collections import OrderedDict\n\n# PyQt5 imports\nfrom PyQt5.QtCore import Qt\nfrom PyQt5.QtGui import QPixmap\nfrom PyQt5.QtWidgets import QMessageBox, QWidget, QVBoxLayout\n\n# BdEdit imports\nfrom bdsim.bdedit.block import *\nfrom bdsim.bdedit.Icons import *\nfrom bdsim.bdedit.block_wire import Wire\nfrom bdsim.bdedit.block_main_block import Main\nfrom bdsim.bdedit.grouping_box import Grouping_Box\nfrom bdsim.bdedit.floating_label import Floating_Label\nfrom bdsim.bdedit.block_connector_block import Connector\nfrom bdsim.bdedit.interface_serialize import Serializable\nfrom bdsim.bdedit.interface_scene_history import SceneHistory\nfrom bdsim.bdedit.interface_graphics_scene import GraphicsScene\n\n\n# =============================================================================\n#\n#   Defining the Scene Class, which holds information of all the Blocks and\n#   Wires that exist within it.\n#\n# =============================================================================\nclass Scene(Serializable):\n    \"\"\"\n    The ``Scene`` Class extends the ``Serializable`` Class from BdEdit, and holds\n    the information of all the ``Block`` and ``Wire`` instances that are within it.\n    It also handles the storage of intersection points of the wires.\n\n    This class includes information about the:\n\n    - blocks, a list containing all ``Block`` instances\n    - wires, a list containing all ``Wire`` instances\n    - floating labels, a list containing all the ``Floating Label`` instances\n    - grouping boxes, a list containing all the ``Grouping Box`` instances\n    - intersection points, a list containing all intersection points between Wires\n    \"\"\"\n\n    # -----------------------------------------------------------------------------\n    def __init__(self, resolution, window, main_window):\n        \"\"\"\n        This method initializes an instance of the ``Scene`` Class.\n\n        :param resolution: the desktop screen resolution of the user\n        :type resolution: PyQt5.QtCore.QRect(0, 0, screen_width, screen_height), required\n        :param window: the application's layer manager\n        :type window: QGridLayout, required\n        \"\"\"\n        super().__init__()\n        # The application's layer manager and interface manager are assigned to internal variables\n        self.window = window\n        self.main_window = main_window\n\n        # Empty lists for the blocks, wires and intersection points are initialized\n        self.blocks = []\n        self.wires = []\n        self.floating_labels = []\n        self.grouping_boxes = []\n        self.intersection_list = []\n\n        # Set default font size of block names, to be used when they are spawned\n        self.block_name_fontsize = 12\n\n        # Variables to listen for modifications with in the scene\n        self._has_been_modified = False\n\n        # Initialize listener\n        self._has_been_modified_listeners = []\n\n        # Variable for toggling between connector blocks being visible or not\n        # False by default\n        self.hide_connector_blocks = False\n\n        # The scened dimensions are initially set to the width/height of the desktop\n        # screen, but later adjusted with self.updateSceneDimensions()\n        self.scene_width = resolution.width()\n        self.scene_height = resolution.height()\n\n        self.initUI()\n        self.determineFont()\n        self.history = SceneHistory(self)\n        self.history.storeHistory(\"Blank canvas loaded\")\n\n    # Todo - add doc for this method\n    # -----------------------------------------------------------------------------\n    @property\n    def has_been_modified(self):\n        return self._has_been_modified\n\n    # Todo - add doc for this method\n    # -----------------------------------------------------------------------------\n    @has_been_modified.setter\n    def has_been_modified(self, value):\n        if not self._has_been_modified and value:\n            self._has_been_modified = value\n\n            # call all registered listeners\n            for callback in self._has_been_modified_listeners:\n                callback()\n\n        self._has_been_modified = value\n\n    # -----------------------------------------------------------------------------\n    def initUI(self):\n        \"\"\"\n        This method creates an ``GraphicsScene`` instance and associates it to this\n        ``Scene`` instance. The GraphicsScene dictates how all items within the Scene\n        are visually represented.\n        \"\"\"\n\n        # A GraphicsScene is created and mapped to this Scene,\n        # and the scene dimensions are updated\n        self.grScene = GraphicsScene(self)\n        self.updateSceneDimensions()\n\n        # Create variables to record when and by whom this diagram was created\n        self.creation_time = int(time.time())\n        self.created_by = getpass.getuser()\n\n        # Copy variable of simulation time from interface manager for saving\n        # Initialized to 10.0, overwritten when changed in GUI or if loaded from model\n        self.sim_time = 10.0\n\n    # -----------------------------------------------------------------------------\n    def determineFont(self):\n        \"\"\"\n        This method sets the truetype font with which socket labels should be drawn.\n        Originally, this property was set within the sockets themselves, but when\n        they are constantly drawn/redrawn (i.e. when undo/redo is spammed) and as a\n        result, multiple attemps are made to access the truetype font, Windows issues\n        an OSError crashing the program... So since this font only needs to be defined\n        on startup, the font is accessed whenever the scene is created.\n        \"\"\"\n        try:\n            self._system_font = ImageFont.truetype(\"arial.ttf\", 14)\n        except OSError:\n            self._system_font = ImageFont.load_default()\n\n    # -----------------------------------------------------------------------------\n    def addHasBeenModifiedListener(self, callback: \"function\"):\n        self._has_been_modified_listeners.append(callback)\n\n    # -----------------------------------------------------------------------------\n    def addBlock(self, block):\n        \"\"\"\n        This method adds a ``Block`` to the ``Scene's`` list of blocks.\n        \"\"\"\n        self.blocks.append(block)\n\n    # -----------------------------------------------------------------------------\n    def addWire(self, wire):\n        \"\"\"\n        This method adds a ``Wire`` to the ``Scene's`` list of wires.\n        \"\"\"\n        self.wires.append(wire)\n\n    # -----------------------------------------------------------------------------\n    def addLabel(self, label):\n        \"\"\"\n        This method adds a ``Floating Label`` to the ``Scene's`` list of labels.\n        \"\"\"\n        self.floating_labels.append(label)\n\n    # -----------------------------------------------------------------------------\n    def addGBox(self, GBox):\n        \"\"\"\n        This method adds a ``Grouping Box`` to the ``Scene's`` list of grouping boxes.\n        \"\"\"\n        self.grouping_boxes.append(GBox)\n\n    # -----------------------------------------------------------------------------\n    def removeBlock(self, block):\n        \"\"\"\n        This method removes a ``Block`` to the ``Scene's`` list of blocks.\n        \"\"\"\n        self.blocks.remove(block)\n\n    # -----------------------------------------------------------------------------\n    def removeWire(self, wire):\n        \"\"\"\n        This method removes a ``Wire`` to the ``Scene's`` list of wires.\n        \"\"\"\n        self.wires.remove(wire)\n\n    # -----------------------------------------------------------------------------\n    def removeLabel(self, label):\n        \"\"\"\n        This method removes a ``Floating Label`` to the ``Scene's`` list of labels.\n        \"\"\"\n        self.floating_labels.remove(label)\n\n    # -----------------------------------------------------------------------------\n    def removeGBox(self, GBox):\n        \"\"\"\n        This method removes a ``Grouping Box`` to the ``Scene's`` list of grouping boxes.\n        \"\"\"\n        self.grouping_boxes.remove(GBox)\n\n    # -----------------------------------------------------------------------------\n    def getSceneWidth(self):\n        \"\"\"\n        This method returns the current width of the ``Scene``.\n        \"\"\"\n        return self.scene_width\n\n    # -----------------------------------------------------------------------------\n    def getSceneHeight(self):\n        \"\"\"\n        This method returns the current height of the ``Scene``.\n        \"\"\"\n        return self.scene_height\n\n    # -----------------------------------------------------------------------------\n    def setSceneWidth(self, width):\n        \"\"\"\n        This method sets the current width of the ``Scene``, to the given width.\n        \"\"\"\n        self.scene_width = width\n\n    # -----------------------------------------------------------------------------\n    def setSceneHeight(self, height):\n        \"\"\"\n        This method sets the current height of the ``Scene``, to the given height.\n        \"\"\"\n        self.scene_height = height\n\n    # -----------------------------------------------------------------------------\n    def updateSceneDimensions(self):\n        \"\"\"\n        This method sets the dimensions of the ``Scene`` to the currently set\n        scene_width and scene_height.\n        \"\"\"\n        self.grScene.setGrScene(self.scene_width, self.scene_height)\n\n    # -----------------------------------------------------------------------------\n    def getView(self):\n        \"\"\"\n        This method returns the associated ``GraphicsView`` for this ``Scene``.\n        :return: ``GraphicsView`` associated to this ``Scene``\n        :rtype: ``QGraphicsView``\n        \"\"\"\n        self.grScene.views()[0]\n\n    # -----------------------------------------------------------------------------\n    def clear(self):\n        \"\"\"\n        This method removes all blocks and floating text labels from the list of\n        blocks and list of floating labels respectively, within the ``Scene``.\n        This will subsequently remove any and all wires between these blocks.\n        \"\"\"\n\n        # Removes the first block from the self.blocks array, until the array is empty\n        while len(self.blocks) > 0:\n            self.blocks[0].parameterWindow.setVisible(False)\n            self.blocks[0].remove()\n\n        # Removes the first label from self.floating_labels array, until it is empty\n        while len(self.floating_labels) > 0:\n            self.floating_labels[0].remove()\n\n        # Removes the first GBox from self.grouping_boxes array, until it is empty\n        while len(self.grouping_boxes) > 0:\n            self.grouping_boxes[0].remove()\n\n        self.has_been_modified = False\n\n    # -----------------------------------------------------------------------------\n    def checkForDuplicates(self, name):\n        \"\"\"\n        This method checks if the given name would be a duplicate of an existing\n        block name.\n\n        :param name: the desired name for a ``Block``\n        :type name: str, required\n        :return: - False (if given name is not a duplicate)\n                 - True (if given name is a duplicate)\n        :rtype: bool\n        \"\"\"\n\n        # Duplicate found is initialized to False\n        duplicate = False\n\n        # For each block within the list of blocks\n        for block in self.blocks:\n            # If the given name matches the title of a block\n            if name == block.title:\n                # Change the duplicate found variable to True, and end the search\n                duplicate = True\n                break\n\n        # Return the duplicate variable\n        return duplicate\n\n    # -----------------------------------------------------------------------------\n    def saveToFile(self, filename):\n        \"\"\"\n        This method saves the contents of the ``Scene`` instance into a JSON file\n        under the given filename.\n        This method will call upon the self.serialize() method which will\n        subsequently call the self.serialize() method within each item displayed\n        in the ``Scene`` (these being the ``Block``, ``Wire`` and ``Socket``).\n\n        :param filename: name of the file to save into\n        :type filename: str, required\n        \"\"\"\n\n        with open(filename, \"w\") as file:\n            file.write(json.dumps(self.serialize(), indent=4))\n\n            self.has_been_modified = False\n\n    # -----------------------------------------------------------------------------\n    def loadFromFile(self, filename):\n        \"\"\"\n        This method loads the contents of a saved JSON file with the given filename\n        into an instance of the ``Scene``.\n\n        This method will call upon the self.deserialize() method which will\n        subsequently call the self.deserialize() method within each item that should\n        be reconstructed for the ``Scene`` (these being the ``Block``, ``Wire``\n        and ``Socket``).\n\n        :param filename:  name of the file to load from\n        :type filename: str\n        \"\"\"\n\n        with open(filename, \"r\") as file:\n            raw_data = file.read()\n            data = json.loads(raw_data)\n            self.deserialize(data, self.window)\n            self.has_been_modified = False\n\n    # -----------------------------------------------------------------------------\n    def serialize(self):\n        \"\"\"\n        This method is called to create an ordered dictionary of all of this Scenes'\n        parameters - necessary for the reconstruction of this Scene - as key-value\n        pairs. This dictionary is later used for writing into a JSON file.\n\n        :return: an ``OrderedDict`` of [keys, values] pairs of all essential ``Scene``\n                 parameters.\n        :rtype: ``OrderedDict`` ([keys, values]*)\n        \"\"\"\n\n        # The blocks and wires associated with this scene, have their own parameters\n        # that are required for their reconstruction, so the serialize method within the\n        # Block and Wire classes are called to package this information respectively,\n        # also into an OrderedDict. These ordered dictionaries are then stored in a temporary\n        # blocks/wires variable and are returned as part of the OrderedDict of this Scene.\n        blocks, wires, labels, gboxes = [], [], [], []\n        for block in self.blocks:\n            blocks.append(block.serialize())\n            # # If parameter window still opened for any block, close it\n            # if block.parameterWindow:\n            #     if block.parameterWindow.isVisible():\n            #         block.closeParamWindow()\n\n        for wire in self.wires:\n            wires.append(wire.serialize())\n        for label in self.floating_labels:\n            labels.append(label.serialize())\n        for gbox in self.grouping_boxes:\n            gboxes.append(gbox.serialize())\n        return OrderedDict(\n            [\n                (\"id\", self.id),\n                (\"created_by\", self.created_by),\n                (\"creation_time\", self.creation_time),\n                (\"simulation_time\", self.sim_time),\n                (\"scene_width\", self.scene_width),\n                (\"scene_height\", self.scene_height),\n                (\"blocks\", blocks),\n                (\"wires\", wires),\n                (\"labels\", labels),\n                (\"grouping_boxes\", gboxes),\n            ]\n        )\n\n    # -----------------------------------------------------------------------------\n    def deserialize(self, data, hashmap={}):\n        \"\"\"\n        This method is called to reconstruct a ``Scene`` and all its items when\n        loading a saved JSON.\n\n        :param data: a Dictionary of essential information for reconstructing a ``Scene``\n        :type data: OrderedDict, required\n        :param hashmap: a Dictionary for directly mapping the essential scene variables\n                        to this instance of ``Scene``, without having to individually map each variable\n        :type hashmap: Dict, required\n        :return: True when completed successfully\n        :rtype: bool\n        \"\"\"\n\n        # The current scene is cleared if anything inside it exists\n        self.clear()\n\n        # Extract data of who created this diagram and when\n        try:\n            self.creation_time = data[\"creation_time\"]\n            self.created_by = data[\"created_by\"]\n        # If that information isn't stored in the json file, set it to current user and time\n        except:\n            self.creation_time = int(time.time())\n            self.created_by = getpass.getuser()\n\n        # If sim_time parameter exists in model, load it\n        try:\n            self.sim_time = data[\"simulation_time\"]\n        # Otherwise, ignore as model will be updated on save\n        except:\n            pass\n\n        hashmap = {}\n\n        # All the blocks which were saved, are re-created from the JSON file\n        # For each block from the saved blocks\n        for block_data in data[\"blocks\"]:\n            block_type = block_data[\"block_type\"]\n            # If a block is one that is manually defined by bdedit (such as the connector\n            # or main blocks, or the text item), they must manaully be re-created.\n            if block_type == \"CONNECTOR\" or block_type == \"Connector\":\n                Connector(self, self.window).deserialize(block_data, hashmap)\n\n            elif block_type == \"MAIN\" or block_type == \"Main\":\n                Main(self, self.window).deserialize(block_data, hashmap)\n\n            # Otherwise if it is any other block (will be an auto-imported block)\n            else:\n                # For each block class within the blocklist\n                for block_class in blocklist:\n                    # Re-create an instance of a block class that matches a name of one of the blocks\n                    # from the blocklist. There will always be a match, as the block_type is determined\n                    # by the blockname(block_class) in the first place, and this will never change.\n                    # The block_class.__name__ supports older files which would of used self.__class__.__name__\n                    # to define the block type\n                    if (\n                        block_type == blockname(block_class)\n                        or block_type == block_class.__name__\n                    ):\n                        block_class().deserialize(block_data, hashmap)\n                        break\n\n        # Next recreate all the wires that were saved\n        for wire_data in data[\"wires\"]:\n            Wire(self).deserialize(wire_data, hashmap)\n\n        # Lastly, if it exists, add the floating text labels that were saved\n        try:\n            if data[\"labels\"]:\n                # If the data for the labels is not null, then create the labels\n                for label_data in data[\"labels\"]:\n                    if label_data is not None:\n                        Floating_Label(self, self.window, self.main_window).deserialize(\n                            label_data, hashmap\n                        )\n        except KeyError:\n            # If model data doesn't contain 'labels' then none were saved, so don't create any.\n            pass\n\n        # Finally, if it exists, add the grouping boxes that were saved\n        try:\n            if data[\"grouping_boxes\"]:\n                # If the data for the gboxes is not null, then create the grouping boxes\n                for gbox_data in data[\"grouping_boxes\"]:\n                    if gbox_data is not None:\n                        # Ensure essnetial Grouping Box info exists; if it does not, we cannot fully reconstruct Grouping Box, so ignore\n                        if (\n                            gbox_data[\"width\"]\n                            and gbox_data[\"height\"]\n                            and gbox_data[\"color\"]\n                        ):\n                            if (gbox_data[\"pos_x\"] is not None) and (\n                                gbox_data[\"pos_y\"] is not None\n                            ):\n                                pos = (gbox_data[\"pos_x\"], gbox_data[\"pos_y\"])\n                                Grouping_Box(\n                                    self,\n                                    self.window,\n                                    gbox_data[\"width\"],\n                                    gbox_data[\"height\"],\n                                    gbox_data[\"color\"],\n                                    pos,\n                                ).deserialize(gbox_data, hashmap)\n                            else:\n                                Grouping_Box(\n                                    self,\n                                    self.window,\n                                    gbox_data[\"width\"],\n                                    gbox_data[\"height\"],\n                                    gbox_data[\"color\"],\n                                ).deserialize(gbox_data, hashmap)\n        except KeyError:\n            # If model data doesn't contain 'grouping_boxes' then none were saved, so don't create any.\n            pass\n\n        return True\n"
  },
  {
    "path": "bdsim/bdedit/interface_scene_history.py",
    "content": "# Library imports\nimport sys\nimport traceback\n\n# BdEdit imports\nfrom bdsim.bdedit.block_graphics_wire import GraphicsWire\n\n\nDEBUG = False\nDEBUG_SELECTION = False\n\n\nclass SceneHistory:\n    def __init__(self, scene):\n        self.scene = scene\n\n        self.clear()\n        self.history_limit = 32\n\n        # listeners\n        self._history_modified_listeners = []\n        self._history_stored_listeners = []\n        self._history_restored_listeners = []\n\n        # Internal variable for catching fatal errors, and allowing user to save work before crashing\n        self.FATAL_ERROR = False\n\n    def clear(self):\n        self.history_stack = []\n        self.history_current_step = -1\n\n    def storeInitialHistoryStamp(self):\n        # After model has been loaded, add current deserialized state as the first stamp in the history stack\n        self.storeHistory(\"Initial History Stamp\")\n\n    def addHistoryModifiedListener(self, callback: \"function\"):\n        self._history_modified_listeners.append(callback)\n\n    def addHistoryStoredListener(self, callback: \"function\"):\n        self._history_stored_listeners.append(callback)\n\n    def addHistoryRestoredListener(self, callback: \"function\"):\n        self._history_restored_listeners.append(callback)\n\n    def undo(self):\n        if DEBUG:\n            print(\"UNDO\")\n\n        # Only able to undo steps if current pointer is not on first item of the history stack\n        if self.history_current_step > 0:\n            self.history_current_step -= 1\n            self.restroreHistory()\n            self.scene.has_been_modified = True\n\n    def redo(self):\n        if DEBUG:\n            print(\"REDO\")\n\n        # Only able to redo steps if current pointer is not on last item of the history stack\n        if self.history_current_step + 1 < len(self.history_stack):\n            self.history_current_step += 1\n            self.restroreHistory()\n            self.scene.has_been_modified = True\n\n    def restroreHistory(self):\n        if DEBUG:\n            print(\n                \"Resorting history ... current_step: @%d\" % self.history_current_step,\n                \"(%d)\" % len(self.history_stack),\n            )\n\n        self.restoreHistoryStamp(self.history_stack[self.history_current_step])\n        for callback in self._history_modified_listeners:\n            callback()\n        for callback in self._history_restored_listeners:\n            callback()\n\n    def storeHistory(self, desc, setModified: bool = False):\n        if setModified:\n            self.scene.has_been_modified = True\n\n        if DEBUG:\n            print(\n                \"Storing history\",\n                '\"%s\"' % desc,\n                \"... current_step: @%d\" % self.history_current_step,\n                \"(%d)\" % len(self.history_stack),\n            )\n\n        # If pointer (history_current_step), is not at end of history_stack and a change is made,\n        # then we must remove everything ahead of the pointer, as we've overwritten previous changes\n        if self.history_current_step + 1 < len(self.history_stack):\n            # Remove everything thats currently in the history stack ahead of the pointer\n            self.history_stack = self.history_stack[0 : self.history_current_step + 1]\n\n        # If history stack is larger than our history limit\n        if self.history_current_step + 1 >= self.history_limit:\n            # Remove first item in history stack and add new item to end of list\n            self.history_stack = self.history_stack[1:]\n            self.history_current_step -= 1\n\n        hs = self.createHistoryStamp(desc)\n\n        self.history_stack.append(hs)\n        self.history_current_step += 1\n        if DEBUG:\n            print(\" -- setting step to:\", self.history_current_step)\n\n        for callback in self._history_modified_listeners:\n            callback()\n        for callback in self._history_stored_listeners:\n            callback()\n\n    def captureCurrentSelection(self):\n        sel_obj = {\n            \"blocks\": [],\n            \"wires\": [],\n            \"floating_labels\": [],\n            \"grouping_boxes\": [],\n        }\n\n        for item in self.scene.grScene.selectedItems():\n            if hasattr(item, \"block\"):\n                sel_obj[\"blocks\"].append(item.block.id)\n            elif hasattr(item, \"wire\"):\n                sel_obj[\"wires\"].append(item.wire.id)\n            elif hasattr(item, \"floating_label\"):\n                sel_obj[\"floating_labels\"].append(item.floating_label.id)\n            elif hasattr(item, \"grouping_box\"):\n                sel_obj[\"grouping_boxes\"].append(item.grouping_box.id)\n        return sel_obj\n\n    def createHistoryStamp(self, desc):\n        history_stamp = {\n            \"desc\": desc,\n            \"snapshot\": self.scene.serialize(),\n            \"selection\": self.captureCurrentSelection(),\n        }\n\n        return history_stamp\n\n    def restoreHistoryStamp(self, history_stamp):\n        if DEBUG:\n            print(\"RHS: \", history_stamp[\"desc\"])\n\n        try:\n            self.scene.deserialize(history_stamp[\"snapshot\"])\n\n            # restore selection\n\n            # first clear selection on all wires, then restore selection on wires from history_stamp\n            for wire in self.scene.wires:\n                wire.grWire.setSelected(False)\n            for wire_id in history_stamp[\"selection\"][\"wires\"]:\n                for wire in self.scene.wires:\n                    if wire.id == wire_id:\n                        wire.grWire.setSelected(True)\n                        break\n\n            # first clear selection on all blocks, then restore selection on blocks from history_stamp\n            for block in self.scene.blocks:\n                block.grBlock.setSelected(False)\n            for block_id in history_stamp[\"selection\"][\"blocks\"]:\n                for block in self.scene.blocks:\n                    if block.id == block_id:\n                        block.grBlock.setSelected(True)\n                        break\n\n            # first clear selection on all floating labels, then restore selection on floating labels from history_stamp\n            for label in self.scene.floating_labels:\n                label.grContent.setSelected(False)\n            for label_id in history_stamp[\"selection\"][\"floating_labels\"]:\n                for label in self.scene.floating_labels:\n                    if label.id == label_id:\n                        label.grContent.setSelected(True)\n                        break\n\n            # first clear selection on all grouping boxes, then restore selection on grouping boxes from history_stamp\n            for gbox in self.scene.grouping_boxes:\n                gbox.grGBox.setSelected(False)\n            for gbox_id in history_stamp[\"selection\"][\"grouping_boxes\"]:\n                for gbox in self.scene.grouping_boxes:\n                    if gbox.id == gbox_id:\n                        gbox.grGBox.setSelected(True)\n                        break\n\n        except Exception as e:\n            if self.FATAL_ERROR == False:\n                print(\n                    \"-------------------------------------------------------------------------\"\n                )\n                print(\n                    \"Caught fatal exception while trying to undo/redo. \"\n                    \"\\nThis may have caused unsaved changes to become corrupted, apologies. \"\n                    \"\\nPlease note the error and report it to Daniel.\"\n                )\n                print(\n                    \"-------------------------------------------------------------------------\"\n                )\n                traceback.print_exc(file=sys.stderr)\n                self.FATAL_ERROR = True\n"
  },
  {
    "path": "bdsim/bdedit/interface_serialize.py",
    "content": "class Serializable:\n    \"\"\"\n    The ``Serializable`` class provides three essential methods for: ensuring uniqueness\n    amongst necessary data (1), saving (2) and loading (3) of this data that is needed\n    for the reconstruction of a Block Diagram.\n    \"\"\"\n\n    def __init__(self):\n        \"\"\"\n        This method extracts the unique identification number of the class instance\n        that calls this method, and stores it as a variable within that class instance.\n        \"\"\"\n        self.id = id(self)\n\n    def serialize(self):\n        \"\"\"\n        This method is inherited and overwritten by all classes that have graphical\n        components related to them (``Scene``, ``Block``, ``Socket`` and ``Wire``).\n        This allows those classes to package (save) essential variables necessary\n        for the later reconstruction of those class instances, into a JSON file.\n        \"\"\"\n        raise NotImplemented()\n\n    def deserialize(self, data, hashmap={}):\n        \"\"\"\n        This method is inherited and overwritten by all classes that have graphical\n        components related to them (``Scene``, ``Block``, ``Socket`` and ``Wire``).\n        This allows those classes to un-package (load) the data stored within the\n        saved JSON file in order to reconstruct the respective class instance.\n\n        :param data: a Dictionary of essential data for reconstructing a Block Diagram\n        :type data: OrderedDict, required\n        :param hashmap: a Dictionary for of the same data, but used for simpler mapping\n        of variables to class instances\n        :type hashmap: Dict, required\n        \"\"\"\n        raise NotImplemented()\n"
  },
  {
    "path": "bdsim/bdrun.py",
    "content": "import json\nimport sys\nimport traceback\n\nfrom bdsim import BDSim\nfrom colored import fg, attr\n\n# available for use in bdedit expressions\nimport numpy as np\nimport math\nfrom math import pi\n\ntry:\n    from spatialmath import SE3, SE2\nexcept:\n    pass\n\n\ndef bdload(bd, filename, globalvars={}, verbose=False, **kwargs):\n    \"\"\"\n    Load a block diagram model\n\n    :param bd: block diagram to load into\n    :type bd: BlockDiagram instance\n    :param filename: name of JSON file to load from\n    :type filename: str or Path\n    :param globalvars: global variables for evaluating expressions, defaults to {}\n    :type globalvars: dict, optional\n    :param verbose: print parameters of all blocks as they are instantiated, defaults to False\n    :type verbose: bool, optional\n    :raises RuntimeError: unable to load the file\n    :raises ValueError: unable to load the file\n    :return: the loaded block diagram\n    :rtype: BlockDiagram instance\n\n    Block diagrams are saved as JSON files.\n\n    A number of errors can arise at this stage:\n\n    * a parameter starting with \"=\" cannot be evaluated\n    * the block throws an error when instantiated, incorrect parameter values\n    * unconnected input port\n\n    If the JSON file contains a parameter of the form ``\"=expression\"`` then\n    it is evaluated using ``eval`` with the global name space given by\n    ``globalvars``.  This means that you can embed lambda expressions that use\n    functions/classes defined in your module if ``globalargs`` is set to ``globals()``.\n\n    \"\"\"\n\n    # load the JSON file\n    with open(filename, \"r\") as f:\n        model = json.load(f)\n\n    # result is a dict with elements: blocks, wires\n\n    # load the blocks and build mappings\n\n    # blocks and wires have unique ids.\n    #  block input and output ports have an associated socket id\n    #  each wire is specified by the socket ids of its start and end\n\n    output_dict = {}  # block output id -> Plug\n    connector_dict = {}  # connector block: input socket -> output socket\n    wire_dict = {}  # wire: start socket t-> end socket\n    block_dict = {}  # block: block id -> Block instance\n\n    namespace = {**globals(), **globalvars}\n\n    # create a dictionary of all blocks\n    for block in model[\"blocks\"]:\n        # Connector block, create a dict that maps end port id to start port id\n        if block[\"block_type\"] == \"CONNECTOR\":\n            start = block[\"inputs\"][0][\"id\"]\n            end = block[\"outputs\"][0][\"id\"]\n            connector_dict[end] = start\n\n        elif block[\"block_type\"] == \"MAIN\":\n            continue  # nothing to be done\n\n        else:\n            # regular bdsim Block\n            try:\n                block_init = bd.__dict__[block[\"block_type\"]]  # block class\n            except KeyError:\n                print(fg(\"red\"))\n                print(f\"block [{block['block_type']}] not loaded, check BDSIMPATH\")\n                print(attr(0))\n\n            params = dict(block[\"parameters\"])  # block params as a dict\n\n            if verbose:\n                print(f\"[{block['title']}]:\")\n            # process the parameters\n            default_params = []\n            for key, value in params.items():\n                if verbose:\n                    print(f\"    {key}: \", end=\"\")\n\n                newvalue = None\n                if isinstance(value, str):\n                    # either an \"any\" type or an assignment\n                    if value[0] == \"=\":\n                        # assignment\n                        try:\n                            newvalue = eval(value[1:], namespace)\n                        except (ValueError, TypeError, NameError, SyntaxError):\n                            print(fg(\"red\"))\n                            print(\n                                f\"bdload: error resolving parameter {key}: {value} for\"\n                                f\" block [{block['title']}]\"\n                            )\n                            traceback.print_exc(limit=-1, file=sys.stderr)\n                            print(attr(0))\n                            raise RuntimeError(\n                                f\"cannot instantiate block [{block['title']}] - bad\"\n                                \" parameters?\"\n                            )\n                    else:\n                        # assume it's an \"any\" type, attempt to evaluate it\n                        try:\n                            newvalue = eval(value, namespace)\n                        except (NameError, SyntaxError):\n                            pass\n                else:\n                    newvalue = value\n\n                if newvalue is None:\n                    # default_params.append(key)\n                    if verbose:\n                        print(f\" {value} default\")\n                else:\n                    params[key] = newvalue\n                    if verbose:\n                        print(f\" {value} -> {newvalue}\")\n\n            # for key in default_params:\n            #     del params[key]\n\n            # instantiate the block\n            try:\n                if \"blockargs\" in params:\n                    blockargs = params[\"blockargs\"]\n                    del params[\"blockargs\"]\n                else:\n                    blockargs = {}\n\n                blockargs = blockargs or {}\n\n                newblock = block_init(\n                    name=block[\"title\"], **params, **blockargs\n                )  # instantiate the block\n\n            except (\n                ValueError,\n                TypeError,\n                NameError,\n                SyntaxError,\n                AssertionError,\n                AttributeError,\n            ):\n                print(fg(\"red\"))\n                print(f\"bdload: error instantiating block [{block['title']}]\")\n                args = \", \".join(\n                    [f\"{arg[0]} = {arg[1]}\" for arg in block[\"parameters\"]]\n                )\n                print(f\"  {block['block_type']}({args})\")\n                print(attr(0))\n                raise RuntimeError(\n                    f\"cannot instantiate block [{block['title']}] - bad parameters?\"\n                )\n\n            block_dict[block[\"id\"]] = newblock  # add to mapping\n            for output in block[\"outputs\"]:\n                # each output id is mapped to the output Plug\n                output_dict[output[\"id\"]] = newblock[output[\"index\"]]\n\n    # create a dictionary of all wires: map end id -> start id\n    # end id is associated with a block input port (socket)\n    # this maps to a unique output port\n    for wire in model[\"wires\"]:\n        start = wire[\"start_socket\"]\n        end = wire[\"end_socket\"]\n        wire_dict[end] = start\n\n    # do the wiring\n    for block in model[\"blocks\"]:\n        if block[\"block_type\"] == \"CONNECTOR\":\n            continue\n\n        # only process real blocks\n        id = block[\"id\"]\n\n        for input in block[\"inputs\"]:\n            # for every input port\n            in_id = input[\"id\"]  # get the socket id\n\n            if in_id not in wire_dict:\n                raise ValueError(\n                    f\"bdload: error block [{block['title']}] has unconnected input port\"\n                )\n\n            # if input has a wire attached (should have!)\n            start_id = wire_dict[in_id]\n\n            while start_id in connector_dict:\n                start_id = wire_dict[\n                    connector_dict[start_id]\n                ]  # other side of the connector\n\n            # start_id now refers to a bdsim block output\n            end = block_dict[id][input[\"index\"]]  # create an output Plug\n            start = output_dict[start_id]  # get Plug it goes to\n\n            if verbose:\n                print(start, \" --> \", end)\n            bd.connect(start, end)\n\n    return bd\n\n\ndef bdrun(filename=None, globals={}, **kwargs):\n    if filename is None:\n        if len(sys.argv) > 1:\n            filename = sys.argv[1]\n        else:\n            print(\"Usage:\\n  bdrun file.bd <bdsim args>\")\n            return\n\n    sim = BDSim(**kwargs)  # create simulator\n    bd = sim.blockdiagram()  # create diagram\n\n    bd = bdload(bd, filename=filename, globalvars=globals, **kwargs)\n    bd.compile()\n    bd.report()\n\n    out = sim.run(bd)  # simulate\n    print(\"bdrun exiting\")\n\n\nif __name__ == \"__main__\":\n    bdrun()\n"
  },
  {
    "path": "bdsim/bin/stubgen.py",
    "content": "#!/usr/bin/env python3\n\nimport bdsim\nimport inspect\n\nsim = bdsim.BDSim()\nfilename = \"blockdiagram.pyi\"\n\nwith open(filename, \"w\") as f:\n    print(\"writing stubs --> \", filename)\n    print(\"\"\"from spatialmath.base.types import *\nimport numpy as np\nimport math\n\nclass BlockDiagram:\"\"\", file=f)\n\n    for block, info in sim._blocklibrary.items():\n        meth = info[\"class\"]\n        sig = inspect.signature(meth.__init__)\n\n        print(\"\\n\", file=f)\n        print(f\"    # {info['module']}.{info['classname']}\", file=f)\n        print(f\"    def {block}{str(sig)}:\", file=f)\n        print('        \"\"\"', end=\"\", file=f)\n        print(meth.__init__.__doc__, end=\"\", file=f)\n        print('\\n        \"\"\"\\n        ...', file=f)\n\n"
  },
  {
    "path": "bdsim/blockdiagram.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 18 21:43:18 2020\n\n@author: corkep\n\"\"\"\nimport os\nfrom pathlib import Path\nimport sys\nimport importlib\nimport inspect\nimport traceback\nfrom collections import Counter, namedtuple\nfrom copy import deepcopy\nimport numpy as np\nfrom colored import fg, attr\nimport warnings\n\n\nfrom ansitable import ANSITable, Column\n\nfrom bdsim.components import *\n\n# from stubs import BlockDiagramMixin\n\n# ------------------------------------------------------------------------- #\n\n\n# class BlockDiagram(BlockDiagramMixin):\nclass BlockDiagram:\n    r\"\"\"\n    Block diagram class.  This object is the parent of all blocks and wires in\n    the system.\n\n    :ivar wirelist: all wires in the diagram\n    :vartype wirelist: list of Wire instances\n    :ivar blocklist: all blocks in the diagram\n    :vartype blocklist: list of Block subclass instances\n    :ivar x: state vector\n    :vartype x: np.ndarray\n    :ivar compiled: diagram has successfully compiled\n    :vartype compiled: bool\n    :ivar blockcounter: unique counter for each block type\n    :vartype blockcounter: collections.Counter\n    :ivar blockdict: index of all blocks by category\n    :vartype blockdict: dict of lists\n    :ivar name: name of this diagram\n    :vartype name: str\n\n    This object:\n\n    * holds all the blocks and wires that comprise the system\n    * manages continuous- and discrete-time state vector for the whole system, splitting\n      it across blocks as required\n    * evaluates the entire diagram as a function to compute :meth:`\\dot{x} = f(x, t)`\n    \"\"\"\n\n    def __init__(self, name=\"main\", **kwargs):\n        self.wirelist = []  # list of all wires\n        self.blocklist = []  # list of all blocks\n        self.clocklist = []  # list of all clock sources\n        self.compiled = False  # network has been compiled\n        self.blockcounter = Counter()\n        self.name = name\n        self.nstates = 0\n        self.ndstates = 0\n        self._issubsystem = False\n        self.blocknames = {}\n        self.options = None\n        self.n_auto_sum = 0\n        self.n_auto_prod = 0\n        self.n_auto_const = 0\n        self.n_auto_gain = 0\n        self.n_auto_pow = 0\n\n    def __getitem__(self, id):\n        print(id)\n        if isinstance(id, str):\n            return self.blocknames[id]\n        else:\n            for b in self.blocklist:\n                if b.id == id:\n                    return b\n            raise ValueError(f\"block {id} not found\")\n\n    def __len__(self):\n        return len(self.blocklist)\n\n    def __deepcopy__(self, memo):\n        # deep copy a block diagram\n        # retain references (don't copy) to blocks and the runtime\n        cls = self.__class__\n        result = cls.__new__(cls)\n        memo[id(self)] = result\n        for k, v in self.__dict__.items():\n            if type(v).__name__ == \"method\":\n                # it's a block factory method\n                setattr(result, k, v)\n            elif k == \"runtime\":\n                # it's a reference to the runtime\n                setattr(result, k, v)\n            else:\n                # otherwise, do a deepcopy\n                setattr(result, k, deepcopy(v, memo))\n        return result\n\n    @property\n    def issubsystem(self):\n        return self._issubsystem\n\n    def clock(self, *args, **kwargs):\n        clock = Clock(*args, **kwargs)\n        clock.bd = self\n        self.clocklist.append(clock)\n        return clock\n\n    def add_block(self, block):\n        if block.name in self.blocknames:\n            raise ValueError(\"block {} already added\".format(block.name))\n        block.id = len(self.blocklist)\n        if block.name is None:\n            i = self.blockcounter[block.type]\n            self.blockcounter[block.type] += 1\n            block.name = \"{:s}.{:d}\".format(block.type, i)\n        block.bd = self\n        self.blocklist.append(block)  # add to the list of available blocks\n        if block in self.blocknames:\n            raise Warning(f\"block name {block} is not unique\")\n        self.blocknames[block.name] = block\n\n    def add_wire(self, wire, name=None):\n        wire.id = len(self.wirelist)\n        wire.name = name\n        # just add wire to the list, gets instantiated at compile time\n        # when add_output_wire and add_input_wire are called on the blocks\n        return self.wirelist.append(wire)\n\n    def __str__(self):\n        return \"BlockDiagram: {:s}\".format(self.name)\n\n    def __repr__(self):\n        return str(self) + \" with {:d} blocks and {:d} wires\".format(\n            len(self.blocklist), len(self.wirelist)\n        )\n        # for block in self.blocklist:\n        #     s += str(block) + \"\\n\"\n        # s += \"\\n\"\n        # for wire in self.wirelist:\n        #     s += str(wire) + \"\\n\"\n        # return s.lstrip(\"\\n\")\n\n    def ls(self):\n        for k, v in self.blockdict.items():\n            print(\"{:12s}: \".format(k), \", \".join(v))\n\n    def connect(self, start, *ends, name=None):\n        \"\"\"\n        TODO:\n            s.connect(out[3], in1[2], in2[3])  # one to many\n            block[1] = SigGen()  # use setitem\n            block[1] = SumJunction(block2[3], block3[4]) * Gain(value=2)\n        \"\"\"\n\n        # start.type = 'start'\n\n        # ensure all blocks are in the blocklist\n        for x in [start, *ends]:\n            if isinstance(x, Block):\n                if x.bd is None:\n                    self.add_block(x)\n            elif isinstance(x, Plug):\n                if x.block.bd is None:\n                    self.add_block(x.block)\n\n        for end in ends:\n            if isinstance(start, Block):\n                if isinstance(end, Block):\n                    # connect(X, Y)\n                    # wires from all outport to all inports\n                    assert start.nout == end.nin, (\n                        \"can only connect blocks where number of input and output ports\"\n                        \" match\"\n                    )\n                    for i in range(start.nout):\n                        wire = Wire(StartPlug(start, i), EndPlug(end, i), name)\n                        self.add_wire(wire)\n\n                elif isinstance(end, Plug) and not end.isslice:\n                    # connect(X, Y[i])\n                    assert (\n                        start.nout == 1\n                    ), \"can only connect single output block to a port\"\n                    end.type = \"end\"\n                    wire = Wire(StartPlug(start, 0), end, name)\n                    self.add_wire(wire)\n\n                elif isinstance(end, Plug) and end.isslice:\n                    # connect(X, Y[m:n])\n                    assert start.nout == end.width, (\n                        \"can only connect single output block to an input port slice of\"\n                        \" width 1\"\n                    )\n                    end.type = \"end\"\n                    for i in range(start.nout):\n                        wire = Wire(StartPlug(start, i), end[i], name)\n                        self.add_wire(wire)\n\n                else:\n                    raise ValueError(\"bad end type\")\n\n            elif isinstance(start, Plug) and not start.isslice:\n                if isinstance(end, Block):\n                    # connect(X[i], Y)\n                    # wires from all outport to all inports\n                    assert (\n                        end.nin == 1\n                    ), \"can only connect a port to a block with single input port\"\n                    wire = Wire(start, EndPlug(end, 0), name)\n                    self.add_wire(wire)\n\n                elif isinstance(end, Plug) and not end.isslice:\n                    # connect(X[i], Y[i])\n                    end.type = \"end\"\n                    wire = Wire(start, end, name)\n                    self.add_wire(wire)\n\n                elif isinstance(end, Plug) and end.isslice:\n                    # connect(X[i], Y[m:n])\n                    assert (\n                        end.width == 1\n                    ), \"can only connect output port to an input port slice of width 1\"\n                    end.type = \"end\"\n                    wire = Wire(start, end[0], name)\n                    self.add_wire(wire)\n\n                else:\n                    raise ValueError(\"bad end type\")\n\n            elif isinstance(start, Plug) and start.isslice:\n                if isinstance(end, Block):\n                    # connect(X[i:j], Y)\n                    assert start.width == end.nin, (\n                        \"can only connect output slice to a block with matching number\"\n                        \" of input ports\"\n                    )\n                    for i in range(end.nin):\n                        wire = Wire(start[i], EndPlug(end, i), name)\n                        self.add_wire(wire)\n\n                elif isinstance(end, Plug) and not end.isslice:\n                    # connect(X[i:j], Y[m])\n                    assert (\n                        start.width == 1\n                    ), \"can only connect output slice of width 1 to a port\"\n                    wire = Wire(start[0], end, name)\n                    self.add_wire(wire)\n\n                if isinstance(end, Plug) and end.isslice:\n                    # connect(X[i:j], Y[m:n])\n                    assert (\n                        start.width == end.width\n                    ), \"can only connect port slices of same width\"\n                    for i in range(start.width):\n                        wire = Wire(start[i], end[i], name)\n                        self.add_wire(wire)\n\n                else:\n                    raise ValueError(\"bad end type\")\n\n            else:\n                raise ValueError(\"bad start type\")\n\n    # ---------------------------------------------------------------------- #\n\n    def compile(\n        self, subsystem=False, doimport=True, evaluate=True, report=False, verbose=True\n    ):\n        \"\"\"\n        Compile the block diagram\n\n        :param subsystem: importing a subsystems, defaults to False\n        :type subsystem: bool, optional\n        :param doimport: import subsystems, defaults to True\n        :type doimport: bool, optional\n        :raises RuntimeError: various block diagram errors\n        :return: Compile status\n        :rtype: bool\n\n        Performs a number of operations:\n\n            - Check sanity of block parameters\n            - Recursively clone and import subsystems\n            - Check for loops without dynamics\n            - Check for inputs driven by more than one wire\n            - Check for unconnected inputs and outputs\n            - Link all output ports to outgoing wires\n            - Link all input ports to incoming wires\n            - Evaluate all blocks in the network\n\n        \"\"\"\n\n        # name the elements\n        self.nblocks = len(self.blocklist)\n        self.nwires = len(self.wirelist)\n\n        error = False\n\n        self.nstates = 0\n        self.ndstates = 0\n        self.statenames = []\n        self.dstatenames = []\n        self.blocknames = {}\n\n        if not subsystem and verbose:\n            print(\"\\nCompiling:\")\n\n        # process all subsystem imports\n        # ssblocks = [b for b in self.blocklist if b.type == 'subsystem']\n        # for b in ssblocks:\n        #     print('  importing subsystem', b.name)\n        #     if b.ssvar is not None:\n        #         print('-- Wiring in subsystem', b, 'from module local variable ', b.ssvar)\n        self.blocklist, self.wirelist = self._subsystem_import(\n            self, None, verbose=verbose\n        )\n\n        # check that wires all point to valid blocks\n        for w in self.wirelist:\n            if w.start.block not in self.blocklist:\n                raise RuntimeError(\n                    f\"wire {w} starts at unreferenced block {w.start.block}\"\n                )\n            if w.end.block not in self.blocklist:\n                raise RuntimeError(f\"wire {w} ends at unreferenced block {w.end.block}\")\n\n        # run block specific checks\n        for b in self.blocklist:\n            try:\n                b.check()\n            except:\n                raise RuntimeError(\"block failed check \" + str(b))\n\n        # build a dictionary of all block names\n        self.blocknames = {b.name: b for b in self.blocklist}\n\n        # visit all stateful blocks\n        for b in self.blocklist:\n            if b.blockclass == \"transfer\":\n                self.nstates += b.nstates\n                if b._state_names is not None:\n                    assert (\n                        len(b._state_names) == b.nstates\n                    ), \"number of state names not consistent with number of states\"\n                    self.statenames.extend(b._state_names)\n                else:\n                    # create default state names\n                    self.statenames.extend(\n                        [b.name + \"x\" + str(i) for i in range(0, b.nstates)]\n                    )\n            if b.blockclass == \"clocked\":\n                self.ndstates += b.ndstates\n                if b._state_names is not None:\n                    assert (\n                        len(b._state_names) == b.nstates\n                    ), \"number of state names not consistent with number of states\"\n                    self.dstatenames.extend(b._state_names)\n                else:\n                    # create default state names\n                    self.statenames.extend(\n                        [b.name + \"X\" + str(i) for i in range(0, b.nstates)]\n                    )\n\n        # initialize lists of input and output ports\n        for b in self.blocklist:\n            b.output_wires = [[] for i in range(0, b.nout)]\n            b.input_wires = [None for i in range(0, b.nin)]\n            b.sources = [None for i in range(0, b.nin)]\n\n            # used to build execution plan\n            # TODO: might overlap with sources\n            b._parents = [None for i in range(0, b.nin)]\n\n        # connect the source and destination blocks to each wire\n        for w in self.wirelist:\n            try:\n                w.start.block.add_output_wire(w)\n                w.end.block.add_input_wire(w)\n                w.end.block._parents[w.end.port] = w.start.block\n\n            except:\n                print(fg(\"red\"))\n                print(\"error connecting wire \", w.fullname + \": \", sys.exc_info()[1])\n                print(attr(0))\n                error = True\n\n        # check connections every block\n        for b in self.blocklist:\n            # check all inputs are connected\n            for port, connection in enumerate(b.input_wires):\n                if connection is None:\n                    print(\n                        \"  ERROR: [{:s}] input {:d} is not connected\".format(\n                            str(b), port\n                        )\n                    )\n                    error = True\n\n            # check all outputs are connected\n            for port, connections in enumerate(b.output_wires):\n                if len(connections) == 0:\n                    print(\n                        \"  INFORMATION: [{:s}] output {:d} is not connected\".format(\n                            str(b), port\n                        )\n                    )\n\n            if b._inport_names is not None:\n                assert (\n                    len(b._inport_names) == b.nin\n                ), \"incorrect number of input names given: \" + str(b)\n            if b._outport_names is not None:\n                assert (\n                    len(b._outport_names) == b.nout\n                ), \"incorrect number of output names given: \" + str(b)\n            if b._state_names is not None:\n                assert (\n                    len(b._state_names) == b.nstates\n                ), \"incorrect number of state names given: \" + str(b)\n\n        # check for cycles of function blocks\n        def _DFS(path):\n            start = path[0]\n            tail = path[-1]\n            for outgoing in tail.output_wires:\n                # for every port on this block\n                for w in outgoing:\n                    dest = w.end.block\n                    if dest == start:\n                        print(\n                            \"  ERROR: cycle found: \",\n                            \" - \".join([str(x) for x in path + [dest]]),\n                        )\n                        return True\n                    if dest.blockclass == \"function\":\n                        return _DFS(path + [dest])  # recurse\n            return False\n\n        for b in self.blocklist:\n            if b.blockclass == \"function\":\n                # do depth first search looking for a cycle\n                if _DFS([b]):\n                    error = True\n\n        if error:\n            if not subsystem:\n                raise RuntimeError(\"could not compile system\")\n\n        # create the execution plan/schedule\n        self.schedule_generate()\n\n        ## evaluate the network once to check out wire types\n        x = self.getstate0()\n\n        for clock in self.clocklist:\n            clock._x = clock.getstate0()\n\n        if report:\n            self.report()\n            self.schedule_report()\n\n        if not subsystem and evaluate:\n            # run all the blocks for one step\n            try:\n                self.schedule_evaluate(x, 0.0, sinks=False)\n            except RuntimeError as err:\n                print(\"\\nFrom compile: unrecoverable error in value propagation:\", err)\n                traceback.print_exc(file=sys.stderr)\n                error = True\n\n        if error:\n            # show report if there was an error\n            if not report:\n                self.report()\n            if not subsystem:\n                raise RuntimeError(\"could not compile system\")\n        else:\n            self.compiled = True\n\n        return self.compiled\n\n    def _subsystem_import(self, bd, sspath, verbose=False):\n        blocks = []\n        wires = bd.wirelist\n\n        for b in bd.blocklist:\n            # rename the block to include subsystem path\n            if sspath is not None:\n                b.name = sspath + \"/\" + b.name\n\n            if b.type == \"subsystem\":\n                # deal with a subsystem\n                #  - recurse to import it\n                #  - add its blocks and wires to the set\n                if verbose:\n                    print(\"instantiating subsystem \", b.name)\n                ssb, ssw = self._subsystem_import(b.subsystem, b.name)\n                blocks.extend(ssb)\n                wires.extend(ssw)\n\n                # INPORT/OUTPORT blocks now become simple pass throughs\n                # same number of inputs and outputs\n                b.inport.nin = b.inport.nout\n                b.outport.nout = b.outport.nin\n\n                # modify the wiring, keep the INPORT/OUTPORT blocks but lose\n                # the SUBSYSTEM blocks\n                for w in bd.wirelist:\n                    # for all wires at this level, find those that connect\n                    # to the subsystem and tweak them\n                    if w.start.block == b:\n                        # SS output\n                        w.start.block = b.outport\n                    if w.end.block == b:\n                        # SS input\n                        w.end.block = b.inport\n\n            else:\n                # not a subsystem, just add the block to the list\n                blocks.append(b)\n\n        # systematically renumber all blocks and wires\n        for i, b in enumerate(blocks):\n            b.id = i\n        for i, w in enumerate(wires):\n            w.id = i\n        return blocks, wires\n\n    # ---------------------------------------------------------------------- #\n\n    def schedule_evaluate(self, x, t, checkfinite=True, sinks=True, simstate=None):\n        \"\"\"\n        Evaluate all blocks in the network\n\n        :param x: state\n        :type x: ndarray\n        :param t: current time\n        :type t: float\n        :param checkfinite: check for Inf or Nan values in block outputs\n        :type checkfinite: bool\n        :param sinks: evaluate sink blocks, defaults to Trye\n        :type sinks: bool, optional\n        :param simstate: simulation state\n        :return: state derivative\n        :rtype: numpy.ndarray\n\n        Performs the following steps:\n\n        1. Partition the state vector ``x`` to all stateful blocks\n        2. Execute the blocks in the order given by the ``plan``. The block\n           outputs are \"sent\" to their connected inputs.\n\n        Sink blocks are not executed here, but after completion their inputs\n        will all be valid.\n        \"\"\"\n\n        # TODO: don't copy outputs to inputs of next block, have inputs\n        # pull the value from connected inputs\n\n        self.runtime.DEBUG(\"state\", \">>>>>>>>> t={}, x={} >>>>>>>>>>>>>>>>\", t, x)\n\n        # reset all the blocks ready for the evalation\n        self.reset()\n\n        # split the state vector to stateful blocks\n        for b in self.blocklist:\n            if b.blockclass == \"transfer\":\n                x = b.setstate(x)\n\n        # split the discrete state vector to clocked blocks\n        for clock in self.clocklist:\n            clock.setstate()\n\n        self.runtime.DEBUG(\"propagate\", \"t={:.3f}\", t)\n\n        for sequence, group in enumerate(self.plan):\n            # self.runtime.DEBUG('propagate', '---- sequence = ', sequence)\n\n            for b in group:\n                # ask the block for output, check for errors\n                try:\n                    if sequence == 0:\n                        # blocks called at step 0 have no inputs\n                        out = b.output(t, None, b._x)\n                    else:\n                        out = b.output(t, b.inputs, b._x)\n                except Exception as err:\n                    # output method failed, report it\n                    print(fg(\"red\"))\n                    print(\n                        \"--Error at t={:f} when computing output of [{:s}::{:s}]\".format(\n                            t, b.type, str(b)\n                        )\n                    )\n                    print()\n                    # print('  {}'.format(err))\n                    traceback.print_exc(file=sys.stderr)\n\n                    print()\n                    for i, input in enumerate(b.inputs):\n                        print(f\"Input[{i}] = {input}\")\n\n                    if b.nstates > 0:\n                        print(f\"Block state x = {b._x}\")\n                    print(attr(0))\n                    raise RuntimeError from None\n\n                self.runtime.DEBUG(\"propagate\", \"block {:s}: output = {}\", b, out)\n\n                # check that output is a list of correct length\n                if not isinstance(out, (tuple, list)):\n                    raise AssertionError(\n                        f\"block {b} output {b} must be a list: {type(out)}\"\n                    )\n                if len(out) != b.nout:\n                    raise AssertionError(\n                        f\"block {b} output {b} has incorrect length: {len(out)} instead\"\n                        f\" of {b.nout}\"\n                    )\n\n                # TODO check output validity once at the startq\n\n                # check it has no nan or inf values\n                if (\n                    checkfinite\n                    and isinstance(out, (int, float, np.ndarray))\n                    and not np.isfinite(out).any()\n                ):\n                    raise RuntimeError(f\"block {b} output contains NaN\")\n\n                # # send block outputs to all downstream connected blocks\n                # for (port, outwires) in enumerate(b.outports): # every port\n                #     value = out[port]\n                #     for w in outwires:     # every wire\n\n                #         self.DEBUG('propagate', '  [{}] = {} -->  {}[{}]', port, value, w.end.block.name, w.end.port)\n\n                #         # send value to wire\n                #         w.send(value)\n\n                #         # TODO send return status no longer needed\n                #         # TODO use common error handler in all cases above\n                b.output_values = out\n\n        if sinks:\n            for b in self.blocklist:\n                if isinstance(b, SinkBlock):\n                    b.step(t, b.inputs)\n\n        # gather the derivative\n        YD = self.deriv(t)\n\n        self.runtime.DEBUG(\"deriv\", YD)\n        return YD\n\n    def schedule_generate(self):\n        \"\"\"\n        Create execution plan\n\n        The plan is saved in the attribute ``plan`` and is a list\n        ``[L0, L1, ... LN]`` where each ``Li`` is a list of blocks.  The blocks\n        in the lists are executed sequentially, ie. all the blocks in ``L0``\n        then all the blocks in ``L1`` etc.\n\n        The plan ensures that the inputs of all blocks in ``Li`` have been\n        previously computed.\n\n        .. note::\n            - The plan is essentially a dataflow graph.\n            - The blocks in list ``Li`` could potentially be executed in\n              parallel.\n            - Constant blocks and stateful blocks are all executed in ``L0``\n            - The block attribute ``_sequence`` is ``i`` and indicates its\n              execution order\n\n        :seealso: :func:`schedule_report`, :func:`schedule_dotfile`\n        \"\"\"\n\n        plan = []\n        group = []\n        for b in self.blocklist:\n            b._sequence = None\n            if b.blockclass in (\"source\", \"transfer\", \"clocked\"):\n                b._sequence = 0\n                group.append(b)\n        plan.append(group)\n        sequence = len(plan)\n\n        while True:\n            group = []\n            for b in self.blocklist:\n                if b._sequence is not None:\n                    continue  # already has a sequence assigned\n\n                if all(\n                    [\n                        p._sequence < sequence if p._sequence is not None else False\n                        for p in b._parents\n                    ]\n                ):\n                    group.append(b)\n\n            for b in group.copy():\n                b._sequence = sequence\n                if b.blockclass in (\"sink\", \"graphics\"):\n                    group.remove(b)\n            if len(group) == 0:\n                break\n            plan.append(group)\n            sequence += 1\n\n        self.plan = plan\n\n    def schedule_dotfile(self, filename):\n        \"\"\"\n        Write a GraphViz dot file representing the execution schedule\n\n        :param file: Name of file to write to\n        :type file: str\n\n        The file can be processed using neato or dot::\n\n            % dot -Tpng -o out.png dotfile.dot\n\n        Display execution plan as a dataflow graph.\n\n        :seealso: :func:`schedule_plan`, :func:`schedule_print`\n        \"\"\"\n\n        if isinstance(filename, str):\n            file = open(filename, \"w\")\n        else:\n            file = filename\n\n        header = r\"\"\"digraph G {\n\n    graph [splines=ortho, rankdir=LR, splines=spline]\n    node [shape=box]\n    \n    \"\"\"\n        file.write(header)\n\n        for sequence, group in enumerate(self.plan):\n            # for each execution group, place the blocks in a subgraph\n            file.write(\"\\tsubgraph step{:d} {{\\n\".format(sequence))\n            file.write(\"\\t\\trank=same;\\n\")\n\n            for b in group:\n                file.write('\\t\\t\"{:s}\"\\n'.format(b.name))\n\n            file.write(\"\\t}\\n\\n\")\n\n        # connect them to their parents, except if a transfer block\n        for b in self.blocklist:\n            if not b.blockclass == \"transfer\":\n                for p in b._parents:\n                    file.write('\\t\"{:s}\" -> \"{:s}\"\\n'.format(p.name, b.name))\n\n        file.write(\"}\\n\")\n\n    # ---------------------------------------------------------------------- #\n\n    def _debugger(self, simstate=None, integrator=None):\n        if simstate.t_stop is not None and simstate.t < simstate.t_stop:\n            return\n\n        def print_output(b, t, inports, x):\n            out = b.output(t, inports, x)\n            if len(out) == 1:\n                print(f\"{b.name} = {out[0]}\")\n            else:\n                print(f\"{b.name}:\")\n                for i, o in enumerate(out):\n                    print(f\"  [{i}] = {o}\")\n\n        np.set_printoptions(precision=6, linewidth=120)\n        simstate.t_stop = None\n        if not hasattr(self, \"debug_watch\"):\n            self.debug_watch = None\n        print(\"\\n\")\n        if self.debug_watch is not None:\n            t = simstate.t\n            for b in self.debug_watch:\n                print_output(b, t, b.inputs, b._x)\n\n        while True:\n            try:\n                t = simstate.t\n                cmd = input(f\"(bdsim, t={t:.6f}) \")\n\n                if len(cmd) == 0:\n                    continue\n\n                if cmd[0] == \"p\":\n                    # print variables\n                    if len(cmd) > 1:\n                        id = int(cmd[1:])\n                        b = self.blocklist[id]\n                        print_output(b, t, b.inputs, b._x)\n                    else:\n                        for b in self.blocklist:\n                            if b.nout > 0:\n                                print_output(b, t, b.inputs, b._x)\n                elif cmd[0] == \"i\":\n                    print(\n                        f\"status={integrator.status}, dt={integrator.step_size:.4g}, nfev={integrator.nfev}\"\n                    )\n                elif cmd[0] == \"s\":\n                    # step\n                    break\n                elif cmd[0] == \"c\":\n                    # continue\n                    self.debug_stop = False\n                    self.t_stop = None\n                    break\n                elif cmd[0] == \"t\":\n                    self.t_stop = float(cmd[1:])\n                    break\n                elif cmd[0] == \"q\":\n                    sys.exit(1)\n                elif cmd[0] == \"r\":\n                    self.report()\n                elif cmd[0] == \"w\":\n                    if len(cmd) == 1:\n                        # clear the watch list\n                        print(self.debug_watch)\n                        self.debug_watch = None\n                    else:\n                        self.debug_watch = [\n                            self.blocklist[int(s.strip())] for s in cmd[2:].split(\" \")\n                        ]\n                elif cmd == \"pdb\":\n                    import pdb\n\n                    pdb.runeval('print(\"type exit to leave Pdb\")')\n                elif cmd[0] in \"h?\":\n                    print(\"p    print all outputs\")\n                    print(\"pI   print block id I output\")\n                    print(\"i    print integrator status\")\n                    print(\"s    single step\")\n                    print(\"c    continue\")\n                    print(\"tT   stop at or after time T\")\n                    print(\"r    print block and wires\")\n                    print(\"pdb  enter PDB debugger\")\n                    print(\"w id watch list, display at every step\")\n                    print(\"q    quit\")\n\n            except (IndexError, ValueError, TypeError):\n                print(\"??\")\n                pass\n\n    # ---------------------------------------------------------------------- #\n\n    def report_summary(self, sortby=\"name\", **kwargs):\n        \"\"\"\n        Print a summary of block diagram.\n\n        :param sortby: sort rows by specified block attribute: \"name\" [default] or \"type\"\n        :type sortby: str, optional\n        :param style: table style, one of: ansi (default), markdown, latex\n        :type style: str\n\n        Print a table with 4 columns:\n\n        1. Block name, sorted in alphabetical order\n        2. The input port (if not a source block)\n        3. The block driving this port (if not a source block)\n        4. The type of value driving this port (if not a source block)\n\n        If the block is an event source, add a ``@`` suffix.\n        \"\"\"\n\n        table = ANSITable(\n            Column(\"block\", headalign=\"^\", colalign=\"<\"),\n            Column(\"type\", headalign=\"^\", colalign=\"<\"),\n            Column(\"inport\", headalign=\"^\", colalign=\"<\"),\n            Column(\"source\", headalign=\"^\", colalign=\"<\"),\n            Column(\"source type\", headalign=\"^\", colalign=\"<\"),\n            border=\"thin\",\n        )\n\n        if sortby == \"name\":\n            sortfunc = lambda x: x.name\n        elif sortby == \"type\":\n            sortfunc = lambda x: x.type\n\n        first = True\n        legend = None\n        for b in sorted(self.blocklist, key=sortfunc):\n            name = str(b)\n            if isinstance(b, EventSource):\n                name += \"@\"\n                legend = \"Note: @ = event source\"\n            # add a divider before each subsequent row\n            if not first:\n                table.rule()\n            else:\n                first = False\n\n            # print the details\n            if len(b.sources) > 0:\n                # non source block, list all its inputs, one per row\n                inputs = b.inputs\n                for port, source in enumerate(b.sources):  # every port\n                    value = inputs[port]\n                    typ = type(value).__name__\n                    if isinstance(value, np.ndarray):\n                        typ += \"{:s}.{:s}\".format(str(value.shape), str(value.dtype))\n                    src_name = source.block.name\n                    if source.block.nout > 1:\n                        src_name += f\"[{source.port}]\"\n                    if port == 0:\n                        # first row for this block\n                        table.row(name, b.type, port, src_name, typ)\n                    else:\n                        # subsequent rows\n                        table.row(\"\", \"\", port, src_name, typ)\n            else:\n                # source block, just list the name\n                table.row(name, b.type, \"\", \"\", \"\")\n        table.print(**kwargs)\n\n        if legend:\n            print(legend + \"\\n\")\n\n    def report(self, **kwargs):\n        warnings.warn(\"use reports_lists() method instead\", DeprecationWarning)\n        self.report_lists(**kwargs)\n\n    def report_lists(self, **kwargs):\n        \"\"\"\n        Print a tabular report about the block diagram.\n\n        :param kwargs: options passed to :meth:`ansitable.ANSITable.print`\n\n        Print the important lists in pretty format.\n\n        * block list, all blocks\n        * wire list, all wires\n        * clock list, all discrete time clocks\n\n        \"\"\"\n        # print all the blocks\n        print(\"\\nBlocks::\\n\")\n        table = ANSITable(\n            Column(\"id\"),\n            Column(\"name\"),\n            Column(\"nin\"),\n            Column(\"nout\"),\n            Column(\"nstate\"),\n            Column(\"ndstate\"),\n            Column(\"type\", headalign=\"^\", colalign=\"<\"),\n            border=\"thin\",\n        )\n        for b in self.blocklist:\n            table.row(b.id, str(b), b.nin, b.nout, b.nstates, b.ndstates, b.type)\n        table.print(**kwargs)\n\n        # print all the wires\n        print(\"\\nWires::\\n\")\n        table = ANSITable(\n            Column(\"id\"),\n            Column(\"from\", headalign=\"^\"),\n            Column(\"to\", headalign=\"^\"),\n            Column(\"description\", headalign=\"^\", colalign=\"<\"),\n            Column(\"type\", headalign=\"^\", colalign=\"<\"),\n            border=\"thin\",\n        )\n        for w in self.wirelist:\n            start = \"{:d}[{:d}]\".format(w.start.block.id, w.start.port)\n            end = \"{:d}[{:d}]\".format(w.end.block.id, w.end.port)\n\n            try:\n                value = w.end.block.inputs[w.end.port]\n                typ = type(value).__name__\n                if isinstance(value, np.ndarray):\n                    typ += \"{:s}.{:s}\".format(str(value.shape), str(value.dtype))\n            except:\n                typ = \"??\"\n            table.row(w.id, start, end, w.fullname, typ)\n        table.print(**kwargs)\n\n        if len(self.clocklist) > 0:\n            # print all the clocked blocks\n            print(\"\\nClocked blocks::\\n\")\n            table = ANSITable(\n                Column(\"id\"),\n                Column(\"block\"),\n                Column(\"clock\"),\n                Column(\"period\"),\n                Column(\"offset\"),\n                border=\"thin\",\n            )\n            for b in self.blocklist:\n                if b.blockclass == \"clocked\":\n                    c = b.clock\n                    table.row(b.id, str(b), c.name, c.T, c.offset)\n            table.print(**kwargs)\n\n        if not self.compiled:\n            print(\"** System has not been compiled, or had a compile time error\")\n\n    def report_schedule(self, **kwargs):\n        \"\"\"\n        Display execution schedule in tabular form\n\n        :param kwargs: options passed to :meth:`ansitable.ANSITable.print`\n\n        :seealso: :func:`schedule_plan`, :func:`schedule_dotfile`\n        \"\"\"\n        table = ANSITable(\n            Column(\"Step\"),\n            Column(\"Blocks\", colalign=\"<\", headalign=\"^\"),\n            border=\"thin\",\n        )\n\n        for sequence, group in enumerate(self.plan):\n            table.row(sequence, \", \".join([str(b) for b in group]))\n\n        table.print(**kwargs)\n\n    # ---------------------------------------------------------------------- #\n\n    def _error_handler(self, where, block):\n        # called from except clause\n\n        import traceback\n        import types\n\n        t, v, tb = sys.exc_info()  # get the exception\n\n        print(fg(\"red\"))  # red text\n\n        # print the traceback\n        print(f\"[{block.type} block: {block.name}.{where}]: exception {t.__name__}\")\n        print(f\"  {v}\\n\")\n        traceback.print_tb(tb)\n\n        # print all block inputs\n        print()\n        for i in range(block.nin):\n            input = block.inputs[i]\n            print(\n                f\"input {i} from\"\n                f\" {block.sources[i].block.name} [{input.__class__.__name__}]\"\n            )\n            print(\"  \", input)\n\n        print(attr(0))  # default text\n\n        # traceback = err[2]\n        # back_frame = traceback.tb_frame.f_back\n\n        # back_tb = types.TracebackType(tb_next=None,\n        #                           tb_frame=back_frame,\n        #                           tb_lasti=back_frame.f_lasti,\n        #                           tb_lineno=back_frame.f_lineno)\n        # raise RuntimeError('Fatal failure').with_traceback(back_tb)\n        raise RuntimeError(\"Fatal failure\") from None\n\n    def getstate0(self):\n        # get the state from each stateful block\n        x0 = np.array([])\n        for b in self.blocklist:\n            try:\n                if b.blockclass == \"transfer\":\n                    x0 = np.r_[x0, b.getstate0()]\n                # print('x0', x0)\n            except:\n                self._error_handler(\"getstate0\", b)\n        return x0\n\n    def reset(self):\n        \"\"\"\n        Reset conditions within every active block.  Most importantly, all\n        inputs are marked as unknown.\n\n        Invokes the `reset` method on all blocks.\n\n        \"\"\"\n        for b in self.blocklist:\n            try:\n                b.reset()\n            except:\n                self._error_handler(\"reset\", b)\n\n    def step(self, t):\n        \"\"\"\n        Step all blocks\n\n        :param t: simulation time, defaults to None\n        :type t: float\n        :param inports: block input port values\n        :type inports: list\n\n        Tell all blocks to take action on new inputs by invoking their\n        ``step`` method and passing the ``state`` object.  Used to save\n        results to a figure or file.\n\n        Called at the end of every integration interval.\n\n        .. note::\n            - if ``graphics`` is False, Graphics blocks are not called\n        \"\"\"\n\n        # TODO could be done by output method, even if no outputs\n\n        for b in self.blocklist:\n            try:\n                if isinstance(b, SinkBlock):\n                    b.step(t, b.inputs)\n            except:\n                self._error_handler(\"step\", b)\n\n    def deriv(self, t):\n        \"\"\"\n        Harvest derivatives from all blocks.\n\n        :param t: simulation time, defaults to None\n        :type t: float\n        :param simstate: simulation state, defaults to None\n        :type simstate: SimState, optional\n        \"\"\"\n        YD = np.array([])\n        for b in self.blocklist:\n            if b.blockclass == \"transfer\":\n                try:\n                    yd = b.deriv(t, b.inputs, b._x)\n                    if not isinstance(yd, np.ndarray):\n                        raise AssertionError(f\"deriv: block {b} did not return ndarray\")\n                    if yd.ndim != 1 or yd.shape[0] != b.nstates:\n                        raise AssertionError(\n                            f\"deriv: block {b} returns wrong shape {yd.shape}, should\"\n                            f\" be ({b.nstates},)\"\n                        )\n                    YD = np.r_[YD, yd]\n                except:\n                    self._error_handler(\"deriv\", b)\n        return YD\n\n    def start(self, simstate=None):\n        \"\"\"\n        Start all blocks\n\n        :param simstate: simulation state, defaults to None\n        :type simstate: SimState, optional\n\n        Inform all blocks that BlockDiagram execution is about to start by\n        invoking their ``start`` method and passing the ``state`` object.  Used\n        to open files, create figures etc.\n\n        .. note:: if ``graphics`` is False, Graphics blocks are not called\n\n        \"\"\"\n\n        for c in self.clocklist:\n            try:\n                c.start(simstate)\n            except:\n                self._error_handler(\"start_clocked\", c)\n\n        # safe wrapper for block starting, does error handling\n        for b in self.blocklist:\n            # print('starting block', b)\n            try:\n                b.start(simstate)\n            except:\n                self._error_handler(\"start\", b)\n\n    def initialstate(self):\n        for b in self.blocklist:\n            if b.blockclass in (\"transfer\", \"clocked\"):\n                b._x = b._x0\n\n    def done(self, block=False):\n        \"\"\"\n        Finishup all blocks\n\n        :param state: simulation state, defaults to None\n        :type state: SimState, optional\n        :param graphics: graphics enabled, defaults to False\n        :type graphics: bool, optional\n\n        Inform all blocks that BlockDiagram execution is complete by invoking their\n        ``done`` method and passing options.  Used\n        to close files, display figures etc.\n\n        .. note:: if ``graphics`` is False, Graphics blocks are not called\n        \"\"\"\n        for b in self.blocklist:\n            try:\n                b.done(block=block)\n            except:\n                self._error_handler(\"done\", b)\n\n    def dotfile(self, filename, shapes=None):\n        \"\"\"\n        Write a GraphViz dot file representing the network.\n\n        :param file: Name of file to write to, or file handle\n        :type file: str, file handle\n        :param shapes: block shapes\n        :type shapes: dict\n\n        Create a GraphViz format file for procesing by ``dot``.  The graph is:\n\n        * directed graph, drawn left to right\n        * source blocks are in the first column\n        * sink and graphics blocks are in the last column\n        * ``SUM`` and ``PROD`` blocks have the sign or operation of their input wires\n          labeled.\n\n        The file can be processed using ``dot``::\n\n            % dot -Tpng -o out.png dotfile.dot\n\n        .. image:: ../../figs/eg1.png\n            :width: 600\n            :alt: Block diagram represented as a mathematical graph\n\n        .. note:: By default all blocks have the default shape, with source blocks shown\n            as a rectangle (\"record\"), and sink/graphics blocks as a rounded rectangle\n            (\"Mrecord\").  This can be overriden by provide a dictionary ``shapes`` that\n            maps block class (sink, source, graphics, function, transfer) to the names\n            of GraphViz shapes.\n\n        :seealso: :meth:`showgraph`\n        \"\"\"\n        if shapes is None:\n            shapes = dict(source=\"record\", sink=\"Mrecord\", graphics=\"Mrecord\")\n\n        if isinstance(filename, str):\n            file = open(filename, \"w\")\n        else:\n            file = filename\n\n        header = r\"\"\"digraph G {\n    rankdir = \"LR\"\n\n\"\"\"\n        file.write(header)\n        # add the blocks\n        for b in self.blocklist:\n            options = []\n            if b.blockclass in shapes:\n                options.append(\"shape={:s}\".format(shapes[b.blockclass]))\n            if b.blockclass == \"source\":\n                options.append('rank=\"source\"')\n            if b.blockclass in (\"sink\", \"graphics\"):\n                options.append('rank=\"sink\"')\n            if b.pos is not None:\n                options.append('pos=\"{:g},{:g}!\"'.format(b.pos[0], b.pos[1]))\n            # options.append(\n            #     'xlabel=<<BR/><FONT POINT-SIZE=\"8\" COLOR=\"blue\">{:s}</FONT>>'.format(\n            #         b.type\n            #     )\n            # )\n            if len(options) > 0:\n                file.write('\\t\"{:s}\" [{:s}]\\n'.format(b.name, \", \".join(options)))\n        file.write(\"\\n\")\n\n        # add the wires\n        for w in self.wirelist:\n            options = []\n            # options.append('xlabel=\"{:s}\"'.format(w.name))\n            if w.end.block.type == \"sum\":\n                options.append(\n                    'headlabel=\"{:s} \"'.format(w.end.block.signs[w.end.port])\n                )\n                options.append(\"labeldistance=1.5\")\n            if w.end.block.type == \"prod\":\n                options.append('headlabel=\"{:s} \"'.format(w.end.block.ops[w.end.port]))\n                options.append(\"labeldistance=1.5\")\n            file.write(\n                '\\t\"{:s}\" -> \"{:s}\" [{:s}]\\n'.format(\n                    w.start.block.name, w.end.block.name, \", \".join(options)\n                )\n            )\n\n        file.write(\"}\\n\")\n\n    def showgraph(self):\n        \"\"\"\n        Display diagram as a graph in browser tab\n\n        :seealso: :meth:`dotfile`\n        \"\"\"\n\n        # Lazy import\n        try:\n            import tempfile\n            import subprocess\n            import webbrowser\n        except ModuleNotFoundError:\n            return\n\n        # create the temporary dotfile\n        dotfile = tempfile.TemporaryFile(mode=\"w\")\n        self.dotfile(dotfile)\n\n        # rewind the dot file, create PDF file in the filesystem, run dot\n        dotfile.seek(0)\n        pdffile = tempfile.NamedTemporaryFile(suffix=\".pdf\", delete=False)\n        subprocess.run(\"dot -Tpdf\", shell=True, stdin=dotfile, stdout=pdffile)\n\n        # open the PDF file in browser (hopefully portable), then cleanup\n        webbrowser.open(f\"file://{pdffile.name}\")\n\n    def blockvalues(self, t=None, simstate=None):\n        for b in self.blocklist:\n            print(\"Block {:s}:\".format(b.name))\n            print(\"  inputs:  \", b.inputs)\n            print(\"  outputs: \", b.output(t, b.inputs, b._x))\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    import bdsim\n\n    bd = bdsim.BlockDiagram()\n\n    # define the blocks\n    demand = bd.STEP(T=1, pos=(0, 0), name=\"demand\")\n    sum = bd.SUM(\"+-\", pos=(1, 0))\n    gain = bd.GAIN(10, pos=(1.5, 0))\n    plant = bd.LTI_SISO(0.5, [2, 1], name=\"plant\", pos=(3, 0))\n    # scope = bd.SCOPE(pos=(4,0), styles=[{'color': 'blue'}, {'color': 'red', 'linestyle': '--'})\n    scope = bd.SCOPE(nin=2, styles=[\"k\", \"r--\"], pos=(4, 0))\n\n    # connect the blocks\n    bd.connect(demand, sum[0], scope[1])\n    bd.connect(plant, sum[1])\n    bd.connect(sum, gain)\n    bd.connect(gain, plant)\n    bd.connect(plant, scope[0])\n\n    bd.compile()  # check the diagram\n    bd.report()  # list all blocks and wires\n    bd.run(5, debug=True)\n\n    # from pathlib import Path\n\n    # exec(open(Path(__file__).parent.absolute() / \"test_blockdiagram.py\").read())\n"
  },
  {
    "path": "bdsim/blockdiagram.pyi",
    "content": "from spatialmath.base.types import *\nimport numpy as np\nimport math\n\nclass BlockDiagram:\n\n\n    # bdsim.blocks.functions.Sum\n    def SUM(self, signs: str = '++', mode: str = None, **blockargs):\n        \"\"\"\n        :param signs: signs associated with input ports, accepted characters: + or -, defaults to \"++\"\n        :type signs: str, optional\n        :param mode: controls addition mode, per element, string comprises ``r`` or ``c`` or ``C`` or ``L``, defaults to None\n        :type mode: str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        ``mode`` controls how elements of the input vectors are added/subtracted.\n        Elements which are angles must be treated specially, and this is indicated by\n        the corresponding characters in ``mode``.  The string's length must equal the\n        width of the input vectors. The characters of the string can be:\n\n        ==============  ============================================\n        mode character  purpose\n        ==============  ============================================\n        r               real number, don't wrap (default)\n        c               angle on circle, wrap to [-π, π)\n        C               angle on circle, wrap to [0, 2π)\n        L               colatitude angle, wrap to [0, π]\n        ==============  ============================================\n\n        For example if ``mode=\"rc\"`` then a 2-element array would have its\n        second element wrapped to the range [-π, π).\n\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.functions.Prod\n    def PROD(self, ops: str = '**', matrix: bool = False, **blockargs):\n        \"\"\"\n        :param ops: operations associated with input ports, accepted characters: * or /, defaults to '**'\n        :type ops: str, optional\n        :param inputs: Optional incoming connections\n        :type inputs: Block or Plug\n        :param matrix: Arguments are matrices, defaults to False\n        :type matrix: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.functions.Gain\n    def GAIN(self, K: Union[int, float, numpy.ndarray] = 1, premul: bool = False, **blockargs):\n        \"\"\"\n        :param K: The gain value, defaults to 1\n        :type K: scalar, array_like\n        :param premul: premultiply by constant, default is postmultiply, defaults to False\n        :type premul: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.functions.Pow\n    def POW(self, p: Union[int, float] = 1, matrix: bool = False, **blockargs):\n        \"\"\"\n        :param p: The exponent value, defaults to 1\n        :type p: scalar\n        :param matrix: premultiply by constant, default is postmultiply, defaults to False\n        :type matrix: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.functions.Clip\n    def CLIP(self, min: Union[numpy.ndarray, int, float, list, tuple] = -inf, max: Union[numpy.ndarray, int, float, list, tuple] = inf, **blockargs):\n        \"\"\"\n        :param min: Minimum value, defaults to -math.inf\n        :type min: scalar or array_like, optional\n        :param max: Maximum value, defaults to math.inf\n        :type max: float or array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.functions.Function\n    def FUNCTION(self, func: Callable = None, nin: int = 1, nout: int = 1, persistent: bool = False, fargs: list = None, fkwargs: dict = None, **blockargs):\n        \"\"\"\n        :param func: function or lambda, or list thereof, defaults to None\n        :type func: callable or sequence of callables, optional\n        :param nin: number of inputs, defaults to 1\n        :type nin: int, optional\n        :param nout: number of outputs, defaults to 1\n        :type nout: int, optional\n        :param persistent: pass in a reference to a dictionary instance to hold persistent state, defaults to False\n        :type persistent: bool, optional\n        :param fargs: extra positional arguments passed to the function, defaults to []\n        :type fargs: list, optional\n        :param fkwargs: extra keyword arguments passed to the function, defaults to {}\n        :type fkwargs: dict, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict, optional\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.functions.Interpolate\n    def INTERPOLATE(self, x: Union[list, tuple, numpy.ndarray] = None, y: Union[list, tuple, numpy.ndarray] = None, xy: numpy.ndarray = None, time: bool = False, kind: str = 'linear', **blockargs):\n        \"\"\"\n        :param x: x-values of function, defaults to None\n        :type x: array_like, shape (N,) optional\n        :param y: y-values of function, defaults to None\n        :type y: array_like, optional\n        :param xy: combined x- and y-values of function, defaults to None\n        :type xy: array_like, optional\n        :param time: x new is simulation time, defaults to False\n        :type time: bool, optional\n        :param kind: interpolation method, defaults to 'linear'\n        :type kind: str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sources.Constant\n    def CONSTANT(self, value=0, **blockargs):\n        \"\"\"\n        :param value: the constant, defaults to 0\n        :type value: any, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sources.Time\n    def TIME(self, value=None, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sources.WaveForm\n    def WAVEFORM(self, wave='square', freq=1, unit='Hz', phase=0, amplitude=1, offset=0, min=None, max=None, duty=0.5, **blockargs):\n        \"\"\"\n        :param wave: type of waveform to generate, one of: 'sine', 'square' [default], 'triangle'\n        :type wave: str, optional\n        :param freq: frequency, defaults to 1\n        :type freq: float, optional\n        :param unit: frequency unit, one of: 'rad/s', 'Hz' [default]\n        :type unit: str, optional\n        :param amplitude: amplitude, defaults to 1\n        :type amplitude: float, optional\n        :param offset: signal offset, defaults to 0\n        :type offset: float, optional\n        :param phase: Initial phase of signal in the range [0,1], defaults to 0\n        :type phase: float, optional\n        :param min: minimum value, defaults to None\n        :type min: float, optional\n        :param max: maximum value, defaults to None\n        :type max: float, optional\n        :param duty: duty cycle for square wave in range [0,1], defaults to 0.5\n        :type duty: float, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sources.Piecewise\n    def PIECEWISE(self, *args, seq=None, **blockargs):\n        \"\"\"\n        :param seq: sequence of time, value pairs\n        :type seq: list of 2-element iterables\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sources.Step\n    def STEP(self, T=1, off=0, on=1, **blockargs):\n        \"\"\"\n        :param T: time of step, defaults to 1\n        :type T: float, optional\n        :param off: initial value, defaults to 0\n        :type off: float, optional\n        :param on: final value, defaults to 1\n        :type on: float, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sources.Ramp\n    def RAMP(self, T=1, off=0, slope=1, **blockargs):\n        \"\"\"\n        :param T: time of ramp start, defaults to 1\n        :type T: float, optional\n        :param off: initial value, defaults to 0\n        :type off: float, optional\n        :param slope: gradient of slope, defaults to 1\n        :type slope: float, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sinks.Print\n    def PRINT(self, fmt=None, file=None, **blockargs):\n        \"\"\"\n        :param fmt: Format string, defaults to None\n        :type fmt: str, optional\n        :param file: file to write data to, defaults to None\n        :type file: file object, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: A PRINT block\n        :rtype: Print instance\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sinks.Stop\n    def STOP(self, func=None, **blockargs):\n        \"\"\"\n        :param func: evaluate stop condition, defaults to None\n        :type func: callable, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sinks.Null\n    def NULL(self, nin=1, **blockargs):\n        \"\"\"\n        :param nin: number of input ports, defaults to 1\n        :type nin: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.sinks.Watch\n    def WATCH(self, **blockargs):\n        \"\"\"\n        :param nin: number of input ports, defaults to 1\n        :type nin: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.transfers.Integrator\n    def INTEGRATOR(self, x0=0, gain=1.0, min=None, max=None, enable=None, **blockargs):\n        \"\"\"\n        :param x0: Initial state, defaults to 0\n        :type x0: array_like, optional\n        :param gain: gain or scaling factor, defaults to 1\n        :type gain: float\n        :param min: Minimum value of state, defaults to None\n        :type min: float or array_like, optional\n        :param max: Maximum value of state, defaults to None\n        :type max: float or array_like, optional\n        :param enable: enable or disable integration\n        :type enable: callable\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.transfers.PoseIntegrator\n    def POSEINTEGRATOR(self, x0=None, **blockargs):\n        \"\"\"\n        :param x0: Initial pose, defaults to null\n        :type x0: SE3, Twist3, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.transfers.LTI_SS\n    def LTI_SS(self, A=None, B=None, C=None, x0=None, **blockargs):\n        \"\"\"\n        :param N: numerator coefficients, defaults to 1\n        :type N: array_like, optional\n        :param D: denominator coefficients, defaults to [1,1]\n        :type D: array_like, optional\n        :param x0: initial states, defaults to None\n        :type x0: array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.transfers.LTI_SISO\n    def LTI_SISO(self, N=1, D=[1, 1], x0=None, **blockargs):\n        \"\"\"\n        :param N: numerator coefficients, defaults to 1\n        :type N: array_like, optional\n        :param D: denominator coefficients, defaults to [1,1]\n        :type D: array_like, optional\n        :param x0: initial states, defaults to None\n        :type x0: array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: LTI_SISO block\n        :rtype: ``LTI_SISO`` instance\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.connections.SubSystem\n    def SUBSYSTEM(self, subsys, nin=1, nout=1, **blockargs):\n        \"\"\"\n        :param subsys: Subsystem as either a filename or a ``BlockDiagram`` instance\n        :type subsys: str or BlockDiagram\n        :param nin: Number of input ports, defaults to 1\n        :type nin: int, optional\n        :param nout: Number of output ports, defaults to 1\n        :type nout: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :raises ImportError: DESCRIPTION\n        :raises ValueError: DESCRIPTION\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.transfers.Deriv\n    def DERIV(self, alpha, x0=0, y0=None, **blockargs):\n        \"\"\"\n        :param alpha: filter pole in units of rad/s\n        :type alpha: float\n        :param x0: initial states, defaults to 0\n        :type x0: array_like, optional\n        :param y0: inital outputs\n        :type y0: array_like\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.transfers.PID\n    def PID(self, type: str = 'PID', P: float = 0.0, D: float = 0.0, I: float = 0.0, D_pole=1, I_limit=None, I_band=0, **blockargs):\n        \"\"\"\n        :param type: the controller type, defaults to \"PID\"\n        :type type: str, optional\n        :param P: proportional gain, defaults to 0\n        :type P: float\n        :param D: derivative gain, defaults to 0\n        :type D: float\n        :param I: integral gain, defaults to 0\n        :type I: float\n        :param D_pole: filter pole for derivative estimate, defaults to 1 rad/s\n        :type D_pole: float\n        :param I_limit: integral limit\n        :type I_limit: float or 2-tuple\n        :param I_band: band within which integral action is active\n        :type I_band: float\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.discrete.ZOH\n    def ZOH(self, clock, x0=0, **blockargs):\n        \"\"\"\n        :param clock: clock source\n        :type clock: Clock\n        :param x0: Initial value of the hold, defaults to 0\n        :type x0: array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.discrete.DIntegrator\n    def DINTEGRATOR(self, clock, x0=0, gain=1.0, min=None, max=None, **blockargs):\n        \"\"\"\n        :param clock: clock source\n        :type clock: Clock\n        :param x0: Initial state, defaults to 0\n        :type x0: array_like, optional\n        :param gain: gain or scaling factor, defaults to 1\n        :type gain: float\n        :param min: Minimum value of state, defaults to None\n        :type min: float or array_like, optional\n        :param max: Maximum value of state, defaults to None\n        :type max: float or array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.discrete.DPoseIntegrator\n    def DPOSEINTEGRATOR(self, clock, x0=None, **blockargs):\n        \"\"\"\n        :param clock: clock source\n        :type clock: Clock\n        :param x0: Initial pose, defaults to null\n        :type x0: SE3, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.linalg.Inverse\n    def INVERSE(self, pinv=False, **blockargs):\n        \"\"\"\n        :param pinv: force pseudo inverse, defaults to False\n        :type pinv: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.linalg.Transpose\n    def TRANSPOSE(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.linalg.Norm\n    def NORM(self, ord=None, axis=None, **blockargs):\n        \"\"\"\n        :param axis: specifies the axis along which to compute the vector norms, defaults to None.\n        :type axis: int, optional\n        :param ord: Order of the norm, default to None.\n        :type ord: int or str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.linalg.Flatten\n    def FLATTEN(self, order='C', **blockargs):\n        \"\"\"\n        :param order: flattening order, either \"C\" or \"F\", defaults to \"C\"\n        :type order: str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.linalg.Slice2\n    def SLICE2(self, rows=None, cols=None, **blockargs):\n        \"\"\"\n        :param rows: row selection, defaults to None\n        :type rows: tuple(3) or list\n        :param cols: column selection, defaults to None\n        :type cols: tuple(3) or list\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.linalg.Slice1\n    def SLICE1(self, index, **blockargs):\n        \"\"\"\n        :param index: slice, defaults to None\n        :type index: tuple(3)\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.linalg.Det\n    def DET(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.linalg.Cond\n    def COND(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.displays.Scope\n    def SCOPE(self, nin=1, vector=None, styles=None, stairs=False, scale='auto', labels=None, grid=True, watch=False, title=None, loc='best', **blockargs):\n        \"\"\"\n        :param nin: number of inputs, defaults to 1 or if given, the length of\n                    style vector\n        :type nin: int, optional\n        :param vector: vector signal on single input port, defaults to None\n        :type vector: int or list, optional\n        :param styles: styles for each line to be plotted\n        :type styles: str or dict, list of strings or dicts; one per line, optional\n        :param stairs: force staircase style plot for all lines, defaults to False\n        :type stairs: bool, optional\n        :param scale: fixed y-axis scale or defaults to 'auto'\n        :type scale: str or array_like(2)\n        :param labels: vertical axis labels\n        :type labels: sequence of strings\n        :param grid: draw a grid, defaults to True. Can be boolean or a tuple of\n                     options for grid()\n        :type grid: bool or sequence\n        :param watch: add these signals to the watchlist, defaults to False\n        :type watch: bool, optional\n        :param title: title of plot\n        :type title: str\n        :param loc: location of legend, see :meth:`matplotlib.pyplot.legend`, defaults to \"best\"\n        :type loc: str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.displays.ScopeXY\n    def SCOPEXY(self, style=None, scale='auto', aspect='equal', labels=['X', 'Y'], init=None, nin=2, **blockargs):\n        \"\"\"\n        :param style: line style, defaults to None\n        :type style: optional str or dict\n        :param scale: fixed y-axis scale or defaults to 'auto'\n        :type scale: str or array_like(2) or array_like(4)\n        :param labels: axis labels (xlabel, ylabel), defaults to [\"X\",\"Y\"]\n        :type labels: 2-element tuple or list\n        :param init: function to initialize the graphics, defaults to None\n        :type init: callable\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.displays.ScopeXY1\n    def SCOPEXY1(self, indices=[0, 1], **blockargs):\n        \"\"\"\n        :param indices: indices of elements to select from block input vector, defaults to [0,1]\n        :type indices: array_like(2)\n        :param style: line style\n        :type style: optional str or dict\n        :param scale: fixed y-axis scale or defaults to 'auto'\n        :type scale: str or array_like(2) or array_like(4)\n        :param labels: axis labels (xlabel, ylabel)\n        :type labels: 2-element tuple or list\n        :param init: function to initialize the graphics, defaults to None\n        :type init: callable\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.connections.Item\n    def ITEM(self, item, **blockargs):\n        \"\"\"\n        :param item: name of dictionary item\n        :type item: str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.connections.Dict\n    def DICT(self, keys, **blockargs):\n        \"\"\"\n        :param keys: list of dictionary keys\n        :type keys: list\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.connections.Mux\n    def MUX(self, nin=1, **blockargs):\n        \"\"\"\n        :param nin: Number of input ports, defaults to 1\n        :type nin: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.connections.DeMux\n    def DEMUX(self, nout=1, **blockargs):\n        \"\"\"\n        :param nout: number of outputs, defaults to 1\n        :type nout: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.connections.Index\n    def INDEX(self, index=[], **blockargs):\n        \"\"\"\n        Index an iterable signal.\n\n        :param index: elements of input array, defaults to []\n        :type index: list, slice or str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.connections.InPort\n    def INPORT(self, nout=1, **blockargs):\n        \"\"\"\n        :param nout: Number of output ports, defaults to 1\n        :type nout: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.connections.OutPort\n    def OUTPORT(self, nin=1, **blockargs):\n        \"\"\"\n        :param nin: Number of input ports, defaults to 1\n        :type nin: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.spatial.Pose_postmul\n    def POSE_POSTMUL(self, pose=None, **blockargs):\n        \"\"\"\n            :param pose: pose to apply\n            :type pose: SO2, SE2, SO3 or SE3\n            :param blockargs: |BlockOptions|\n            :type blockargs: dict\n            \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.spatial.Pose_premul\n    def POSE_PREMUL(self, pose=None, **blockargs):\n        \"\"\"\n            :param pose: pose to apply\n            :type pose: SO2, SE2, SO3 or SE3\n            :param blockargs: |BlockOptions|\n            :type blockargs: dict\n            \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.spatial.Transform_vector\n    def TRANSFORM_VECTOR(self, **blockargs):\n        \"\"\"\n            :param blockargs: |BlockOptions|\n            :type blockargs: dict\n            \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.spatial.Pose_inverse\n    def POSE_INVERSE(self, **blockargs):\n        \"\"\"\n            :param blockargs: |BlockOptions|\n            :type blockargs: dict\n            \n        \"\"\"\n        ...\n\n\n    # bdsim.blocks.io.DOUT\n    def DOUT(self, pin=0, **blockargs):\n        \"\"\"\n        Constant value.\n\n        :param value: the constant, defaults to 0\n        :type value: any, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: a CONSTANT block\n        :rtype: Constant instance\n\n        This block has only one output port, but the value can be any\n        Python type, for example float, list or Numpy ndarray.\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.FKine\n    def FKINE(self, robot=None, args={}, **blockargs):\n        \"\"\"\n        :param ``*inputs``: Optional incoming connections\n        :type ``*inputs``: Block or Plug\n        :param robot: Robot model, defaults to None\n        :type robot: Robot subclass, optional\n        :param args: Options for fkine, defaults to {}\n        :type args: dict, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.IKine\n    def IKINE(self, robot=None, q0=None, useprevious=True, ik=None, args={}, seed=None, **blockargs):\n        \"\"\"\n        :param robot: Robot model, defaults to None\n        :type robot: Robot subclass, optional\n        :param q0: Initial joint angles, defaults to None\n        :type q0: array_like(n), optional\n        :param useprevious: Use previous IK solution as q0, defaults to True\n        :type useprevious: bool, optional\n        :param ik: Specify an IK function, defaults to \"LM\"\n        :type ik: str\n        :param args: Options passed to IK function\n        :type args: dict\n        :param seed: random seed for solution\n        :type seed: int\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.Jacobian\n    def JACOBIAN(self, robot, frame='0', representation=None, inverse=False, pinv=False, damping=None, transpose=False, **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param frame: Frame to compute Jacobian for, one of: \"0\" [default], \"e\"\n        :type frame: str, optional\n        :param representation: representation for analytical Jacobian\n        :type representation: str, optional\n        :param inverse: output inverse of Jacobian, defaults to False\n        :type inverse: bool, optional\n        :param pinv: output pseudo-inverse of Jacobian, defaults to False\n        :type pinv: bool, optional\n        :param damping: damping term for inverse, defaults to None\n        :type damping: float or array_like(N)\n        :param transpose: output transpose of Jacobian, defaults to False\n        :type transpose: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        If an inverse is requested and ``damping`` is not None it is added to the\n        diagonal of the Jacobian prior to the inversion.  If a scalar is provided it is\n        added to each element of the diagonal, otherwise an N-vector is assumed.\n\n        .. note::\n            - Only one of ``inverse`` or ``pinv`` can be True\n            - ``inverse`` or ``pinv`` can be used in conjunction with ``transpose``\n            - ``inverse`` requires that the Jacobian is square\n            - If ``inverse`` is True and the Jacobian is singular a runtime\n              error will occur.\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.ArmPlot\n    def ARMPLOT(self, robot=None, q0=None, backend=None, **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param q0: initial joint angles, defaults to None\n        :type q0: ndarray(N)\n        :param backend: RTB backend name, defaults to 'pyplot'\n        :type backend: str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.JTraj\n    def JTRAJ(self, q0, qf, qd0=None, qdf=None, T=None, **blockargs):\n        \"\"\"\n\n        :param q0: initial joint coordinate\n        :type q0: array_like(n)\n        :param qf: final joint coordinate\n        :type qf: array_like(n)\n        :param T: time vector or number of steps, defaults to None\n        :type T: array_like or int, optional\n        :param qd0: initial velocity, defaults to None\n        :type qd0: array_like(n), optional\n        :param qdf: final velocity, defaults to None\n        :type qdf: array_like(n), optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.CTraj\n    def CTRAJ(self, T1, T2, T, trapezoidal=True, **blockargs):\n        \"\"\"\n        :param T1: initial pose\n        :type T1: SE3\n        :param T2: final pose\n        :type T2: SE3\n        :param T: motion time\n        :type T: float\n        :param trapezoidal: Use LSPB motion profile along the path\n        :type trapezoidal: bool\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.CirclePath\n    def CIRCLEPATH(self, radius=1, centre=(0, 0, 0), pose=None, frequency=1, unit='rps', phase=0, **blockargs):\n        \"\"\"\n        :param radius: radius of circle, defaults to 1\n        :type radius: float\n        :param centre: center of circle, defaults to [0,0,0]\n        :type centre: array_like(3)\n        :param pose: SE3 pose of output, defaults to None\n        :type pose: SE3\n        :param frequency: rotational frequency, defaults to 1\n        :type frequency: float\n        :param unit: unit for frequency, one of: 'rps' [default], 'rad'\n        :type unit: str\n        :param phase: phase\n        :type phase: float\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.Trapezoidal\n    def TRAPEZOIDAL(self, q0, qf, V=None, T=None, **blockargs):\n        \"\"\"\n        Compute a joint-space trajectory\n\n        :param q0: initial joint coordinate\n        :type q0: float\n        :param qf: final joint coordinate\n        :type qf: float\n        :param T: maximum time, defaults to None\n        :type T: float, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        If ``T`` is given the value ``qf`` is reached at this time.  This can be\n        less or greater than the simulation time.\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.Traj\n    def TRAJ(self, y0=0, yf=1, T=None, time=False, traj='trapezoidal', **blockargs):\n        \"\"\"\n        :param y0: initial value, defaults to 0\n        :type y0: array_like(m), optional\n        :param yf: final value, defaults to 1\n        :type yf: array_like(m), optional\n        :param T: maximum time, defaults to None\n        :type T: float, optional\n        :param time: x is simulation time, defaults to False\n        :type time: bool, optional\n        :param traj: trajectory type, one of: 'trapezoidal' [default], 'quintic'\n        :type traj: str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.IDyn\n    def IDYN(self, robot, gravity=None, **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param gravity: gravitational acceleration\n        :type gravity: float\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.Gravload\n    def GRAVLOAD(self, robot, gravity=None, **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param gravity: gravitational acceleration\n        :type gravity: float\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.Gravload_X\n    def GRAVLOAD_X(self, robot, representation='rpy/xyz', gravity=None, **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param representation: task-space representation, defaults to \"rpy/xyz\"\n        :type representation: str\n        :param gravity: gravitational acceleration\n        :type gravity: float\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.Inertia\n    def INERTIA(self, robot, **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.Inertia_X\n    def INERTIA_X(self, robot, representation='rpy/xyz', pinv=False, **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param representation: task-space representation, defaults to \"rpy/xyz\"\n        :type representation: str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.FDyn\n    def FDYN(self, robot, q0=None, **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param q0: Initial joint configuration\n        :type q0: array_like(n)\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.arm.FDyn_X\n    def FDYN_X(self, robot, q0=None, gravcomp=False, velcomp=False, representation='rpy/xyz', **blockargs):\n        \"\"\"\n        :param robot: Robot model\n        :type robot: Robot subclass\n        :param q0: Initial joint configuration\n        :type q0: array_like(n)\n        :param gravcomp: perform gravity compensation\n        :type gravcomp: bool\n        :param velcomp: perform velocity term compensation\n        :type velcomp: bool\n        :param representation: task-space representation, defaults to \"rpy/xyz\"\n        :type representation: str\n    \n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.mobile.Bicycle\n    def BICYCLE(self, L=1, speed_max=inf, accel_max=inf, steer_max=1.413716694115407, x0=None, **blockargs):\n        \"\"\"\n        :param L: Wheelbase, defaults to 1\n        :type L: float, optional\n        :param speed_max: Velocity limit, defaults to math.inf\n        :type speed_max: float, optional\n        :param accel_max: maximum acceleration, defaults to math.inf\n        :type accel_max: float, optional\n        :param steer_max: maximum steered wheel angle, defaults to math.pi*0.45\n        :type steer_max: float, optional\n        :param x0: Initial state, defaults to [0,0,0]\n        :type x0: array_like(3), optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.mobile.Unicycle\n    def UNICYCLE(self, w=1, speed_max=inf, accel_max=inf, steer_max=inf, x0=None, **blockargs):\n        \"\"\"\n\n        :param w: vehicle width, defaults to 1\n        :type w: float, optional\n        :param speed_max: Velocity limit, defaults to math.inf\n        :type speed_max: float, optional\n        :param accel_max: maximum acceleration, defaults to math.inf\n        :type accel_max: float, optional\n        :param steer_max: maximum turn rate :math:`\\omega`, defaults to math.inf\n        :type steer_max: float, optional\n        :param x0: Inital state, defaults to [0,0,0]\n        :type x0: array_like(3), optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.mobile.DiffSteer\n    def DIFFSTEER(self, w=1, R=1, speed_max=inf, accel_max=inf, steer_max=None, a=0, x0=None, **blockargs):\n        \"\"\"\n        :param w: vehicle width, defaults to 1\n        :type w: float, optional\n        :param R: Wheel radius, defaults to 1\n        :type R: float, optional\n        :param speed_max: Velocity limit, defaults to 1\n        :type speed_max: float, optional\n        :param accel_max: maximum acceleration, defaults to math.inf\n        :type accel_max: float, optional\n        :param steer_max: maximum steering rate, defaults to 1\n        :type steer_max: float, optional\n        :param x0: Inital state, defaults to None\n        :type x0: array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.mobile.VehiclePlot\n    def VEHICLEPLOT(self, animation=None, path=None, labels=['X', 'Y'], square=True, init=None, scale='auto', polyargs={}, **blockargs):\n        \"\"\"\n        :param animation: Graphical animation of vehicle, defaults to None\n        :type animation: VehicleAnimation subclass, optional\n        :param path: linestyle to plot path taken by vehicle, defaults to None\n        :type path: str or dict, optional\n        :param labels: axis labels (xlabel, ylabel), defaults to [\"X\",\"Y\"]\n        :type labels: array_like(2) or list\n        :param square: Set aspect ratio to 1, defaults to True\n        :type square: bool, optional\n        :param init: function to initialize graphics, defaults to None\n        :type init: callable, optional\n        :param scale: scale of plot, defaults to \"auto\"\n        :type scale: list or str, optional\n        :param polyargs: arguments passed to :meth:`Animation.Polygon`\n        :type polyargs: dict\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        .. note::\n\n            - The ``init`` function is called after the axes are initialized\n              and can be used to draw application specific detail on the\n              plot. In the example below, this is the dot and star.\n            - A dynamic trail, showing path to date can be animated if\n              the option ``path`` is set to a linestyle.\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.uav.MultiRotor\n    def MULTIROTOR(self, model, groundcheck=True, speedcheck=True, x0=None, **blockargs):\n        \"\"\"\n        Create a multi-rotor dynamic model block.\n\n        :param model: A dictionary of vehicle geometric and inertial properties\n        :type model: dict\n        :param groundcheck: Prevent vehicle moving below ground :math:`z>0`, defaults to True\n        :type groundcheck: bool\n        :param speedcheck: Check for non-positive rotor speed, defaults to True\n        :type speedcheck: bool\n        :param x0: Initial state, defaults to None\n        :type x0: array_like(6) or array_like(12), optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.uav.MultiRotorMixer\n    def MULTIROTORMIXER(self, model=None, wmax=1000, wmin=5, **blockargs):\n        \"\"\"\n        :param model: A dictionary of vehicle geometric and inertial properties\n        :type model: dict\n        :param maxw: maximum rotor speed in rad/s, defaults to 1000\n        :type maxw: float\n        :param minw: minimum rotor speed in rad/s, defaults to 5\n        :type minw: float\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.uav.MultiRotorPlot\n    def MULTIROTORPLOT(self, model, scale=[-2, 2, -2, 2, 10], flapscale=1, projection='ortho', **blockargs):\n        \"\"\"\n        :param model: A dictionary of vehicle geometric and inertial properties\n        :type model: dict\n        :param scale: dimensions of workspace: xmin, xmax, ymin, ymax, zmin, zmax, defaults to [-2,2,-2,2,10]\n        :type scale: array_like, optional\n        :param flapscale: exagerate flapping angle by this factor, defaults to 1\n        :type flapscale: float\n        :param projection: 3D projection, one of: 'ortho' [default], 'perspective'\n        :type projection: str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.spatial.Tr2Delta\n    def TR2DELTA(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.spatial.Delta2Tr\n    def DELTA2TR(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.spatial.Point2Tr\n    def POINT2TR(self, T=None, **blockargs):\n        \"\"\"\n        :param T: the transform\n        :type T: SE3\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        If ``T`` is None then it defaults to the identity matrix.\n        \n        \"\"\"\n        ...\n\n\n    # roboticstoolbox.blocks.spatial.TR2T\n    def TR2T(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \n        \"\"\"\n        ...\n\n\n    # machinevisiontoolbox.blocks.camera.Camera\n    def CAMERA(self, camera=None, args={}, **blockargs):\n        \"\"\"\n        :param camera: Camera model, defaults to None\n        :type camera: Camera subclass, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: a CAMERA block\n        :rtype: Camera instance\n\n        Camera projection model.\n\n        **Block ports**\n\n            :input pose: Camera pose as an SE3 object.\n            :input P: world points as ndarray(3,N)\n\n            :output p: image plane points as ndarray(2,N)\n        \n        \"\"\"\n        ...\n\n\n    # machinevisiontoolbox.blocks.camera.Visjac_p\n    def VISJAC_P(self, camera, depth=1, depthest=False, **blockargs):\n        \"\"\"\n        :param camera: Camera model, defaults to None\n        :type camera: Camera subclass, optional\n        :param depth: Point depth\n        :type depth: float or ndarray\n        :param depthest: Use depth estimation, defaults to True\n        :type depthest: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: a VISJAC_P block\n        :rtype: Visjac_p instance\n\n        If the Jacobian\n\n\n        \n        \"\"\"\n        ...\n\n\n    # machinevisiontoolbox.blocks.camera.EstPose_p\n    def ESTPOSE_P(self, camera, P, frame='world', method='iterative', **blockargs):\n        \"\"\"\n        :param camera: Camera model, defaults to None\n        :type camera: Camera subclass, optional\n        :param P: World point coordinates\n        :type P: ndarray(2,N)\n        :param frame: return pose of points with respect to reference frame which is one of: 'world' [default] or 'camera'\n        :type frame: str, optional\n        :param method: pose estimation algorithm one of: 'iterative' [default], 'epnp', 'p3p', 'ap3p', 'ippe', 'ippe-square'\n        :type method: str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: a ESTPOSE_P block\n        :rtype: EstPose_p instance\n\n        \n        \"\"\"\n        ...\n\n\n    # machinevisiontoolbox.blocks.camera.ImagePlane\n    def IMAGEPLANE(self, camera, style=None, labels=None, grid=True, retain=False, watch=False, init=None, **blockargs):\n        \"\"\"\n        Create a block that plots image plane coordinates.\n\n        :param camera: a camera model\n        :type camera: Camera instance\n        :param style: styles for each point to be plotted\n        :type style: str or dict, list of strings or dicts; one per line, optional\n        :param grid: draw a grid, defaults to True. Can be boolean or a tuple of\n                     options for grid()\n        :type grid: bool or sequence\n        :param retain: keep previous image plane points, defaults to False\n        :type retain: bool, optional\n        :param watch: add these signals to the watchlist, defaults to False\n        :type watch: bool, optional\n        :param init: function to initialize the graphics, defaults to None\n        :type init: callable, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: An IMAGEPLANE block\n        :rtype: ImagePlane instance\n\n        Create a block that plots points on a camera object's virtual image plane.\n\n        Examples::\n\n            SCOPE()\n            SCOPE(nin=2)\n            SCOPE(nin=2, scale=[-1,2])\n            SCOPE(styles='k--')\n            SCOPE(styles=[{'color': 'blue'}, {'color': 'red', 'linestyle': '--'}])\n            SCOPE(styles=['k', 'r--'])\n\n\n        .. figure:: ../../figs/Figure_1.png\n           :width: 500px\n           :alt: example of generated graphic\n\n           Example of scope display.\n        \n        \"\"\"\n        ...\n"
  },
  {
    "path": "bdsim/blocks/IO/Firmata.py",
    "content": "\"\"\"\nDefine real-time i/o blocks for use in block diagrams.  These are blocks that:\n\n- have inputs or outputs\n- have no state variables\n- are a subclass of ``SourceBlock`` or ``SinkBlock``\n\n\"\"\"\n# The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.\n\nfrom bdsim.components import SinkBlock, SourceBlock\nimport time\nimport sys\n\n\nclass FirmataIO:\n    board = None\n    port = \"/dev/cu.usbmodem1441401\"\n\n    def __init__(self):\n        from pyfirmata import Arduino, util\n\n        if FirmataIO.board is None:\n            print(f\"connecting to Arduino/firmata node on {self.port}...\", end=\"\")\n            sys.stdout.flush()\n            FirmataIO.board = Arduino(self.port)\n            print(\" done\")\n\n            # start a background thread to read inputs\n            iterator = util.Iterator(FirmataIO.board)\n            iterator.start()\n            time.sleep(0.25)  # allow time for the iterator thread to start\n\n    def pin(self, name):\n        return FirmataIO.board.get_pin(name)\n\n\nclass AnalogIn(SourceBlock):\n    nin = 0\n    nout = 1\n\n    def __init__(self, pin=None, scale=1.0, offset=0.0, **blockargs):\n        super().__init__(**blockargs)\n        self.board = FirmataIO()\n        self.pin = self.board.pin(f\"a:{pin}:i\")\n        self.scale = scale\n        self.offset = offset\n\n        # deal with random None values at startup\n        while self.pin.read() == None:\n            time.sleep(0.1)\n\n    def output(self, t, inports, x):\n        return [self.scale * self.pin.read() + self.offset]\n\n\nclass AnalogOut(SinkBlock):\n    nin = 1\n    nout = 0\n\n    def __init__(self, pin=None, scale=1.0, offset=0.0, **blockargs):\n        super().__init__(**blockargs)\n        self.board = FirmataIO()\n        self.pin = self.board.pin(f\"d:{pin}:p\")  # PWM output\n        self.scale = scale\n        self.offset = offset\n\n    def step(self, t, inports):\n        self.pin.write(self.scale * inports[0] + self.offset)\n\n\nclass DigitalIn(FirmataIO, SourceBlock):\n    nin = 0\n    nout = 1\n\n    def __init__(self, pin=None, bool=False, **blockargs):\n        super().__init__(**blockargs)\n        self.pin = self.board.get_pin(f\"d:{pin}:i\")\n\n    def output(self, t, inports, x):\n        if self.bool:\n            return [self.pin.read()]\n        else:\n            return [self.pin.read() > 0]\n\n\nclass DigitalOut(FirmataIO, SinkBlock):\n    nin = 1\n    nout = 0\n\n    def __init__(self, pin=None, **blockargs):\n        super().__init__(**blockargs)\n        self.pin = self.board.get_pin(f\"d:{pin}:o\")\n\n    def step(self, t, inports):\n        self.pin.write(inports[0] > 0)\n"
  },
  {
    "path": "bdsim/blocks/IO/README.md",
    "content": "This folder contains \"drivers\" for particular i/o hardware configurations.\n\nEach file contains a set of class definitions which are imported in the normal\nPython fashion, not dynamically as are most bdsim blocks.\n\n| File | Purpose |\n|------|---------|\n|Firmata.py | analog and digital i/o for Arduino + Firmata |\n\nNotes:\n\n- For [Firmata](https://github.com/firmata/protocol) you need to load a Firmata sketch onto the Arduino.  \n- For now the port and the baudrate (57600) are hardwired.  Perhaps the i/o system is initialized by a\n  separate function, or options passed through BDRealTime.\n- There are myriad Firmata variants, but StandardFirmata is provided as a built-in \n  example with the Arduino IDE and does digital and analog i/o.  It runs fine on a Uno.\n- ConfigurableFirmata has more device options but needs to be installed, and its default\n  baud rate is 115200.  It does not include quadrature encoders :(\n- The Firmata interface is [pyfirmata](https://github.com/tino/pyFirmata), old but quite solid and efficient."
  },
  {
    "path": "bdsim/blocks/Icons/README.md",
    "content": "# Icon files\n\nIcons are 250x250 greyscale PNG images with black paint and a transparent background, and\nused only by `bdedit`. Icons are black \"ink\" with a transparent background.\n\nIcon names are all lower-case versions of the CamelCase class name, eg. the class `Gain` has the icon file named `gain.png`.\n\n![gain.png](https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/gain.png)\n\nIcons are drawn to be interpretted with inputs on the left and outputs on the right.  Icons can be flipped so that inputs are on the right, and\nif it makes sense for an alternative icon in that situation its name has the `_flipped` suffix.  For the case of the `Gain` block that would be `gain_flipped.png`\n\n![gain_flipped.png](https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/gain_flipped.png)\n\nThe bulk of icons are defined in this folder, but blocks can be imported from folders in other toolboxes.  In that case, the `Icons` folder\nin those folders contains the corresponding icon files.\n\n# Creating icons from LaTeX\n\nIcons are created by the script `bdtex2icon` which is run like this from the `Icons` folder\n\n```\nbdtex2icon -r 300 -o sum.png -t '\\sum'\n```\n\nwhere the `-o` option specifies the name of the output file and the `-t` option is\nthe LaTeX string. The `-r` option is the resolution or scale of the icon.  If it is too\nbig or too small it will suggest a better value for resolution.  Choose a value just\nunder the recommended value, check that that `bdtex2icon` is happy with the value and\ninspect the icon file.\n\nAdd the line to the file `icons.sh` which is a shell script that builds all icon files.\n\n**Note that you must have a working LaTeX installation that includes `pdflatex`, `pdfcrop`\nand `gs`**\n\n# Drawing icons by hand\n\nSee [details here](https://github.com/petercorke/bdsim/blob/master/bdsim/bdedit/docstring.md)."
  },
  {
    "path": "bdsim/blocks/Icons/icons.sh",
    "content": "#! /bin/bash\n\nbdtex2icon -r 300 -o sum.png -t '\\sum'\nbdtex2icon -r 450 -o prod.png -t '\\Pi'\nbdtex2icon -r 200 -o norm.png -t '\\| \\cdot \\|'\nbdtex2icon -r 250 -o det.png -t '| \\cdot |'\nbdtex2icon -r 110 -o cond.png -t '\\mathrm{cond}(\\cdot)'\nbdtex2icon -r 150 -o fkine.png -t '\\vec{T}\\!\\left(\\mat{q}\\right)'\nbdtex2icon -r 150 -o ikine.png -t '\\mat{q}\\!\\left(\\vec{T}\\right)'\nbdtex2icon -r 150 -o jacobian.png -t '\\mat{J}\\!\\left(\\vec{q}\\right)'\nbdtex2icon -r 300 -o time.png -t 't'\nbdtex2icon -r 100 -o point2tr.png -t '\\begin{array}{c|c} \\mat{1} & \\vec{t}\\\\ \\hline 0 & 1 \\end{array}'\nbdtex2icon -r 120 -o tr2delta.png -t '\\vec{\\Delta}\\!\\left(\\mat{T}\\right)'\nbdtex2icon -r 120 -o delta2tr.png -t '\\mat{T}\\!\\left(\\vec{\\Delta}\\right)'\n\nbdtex2icon -r 140 -o dposeintegrator.png -t '\\sum_0^T \\vec{\\nu}'\n\nbdtex2icon -r 150 -o dict.png -t '\\mathbf{\\{\\cdots\\}}'\nbdtex2icon -r 150 -o index.png -t '\\mathbf{[}k\\mathrm{]}'\nbdtex2icon -r 150 -o item.png -t '\\mathbf{\\{\\}[}k\\mathrm{]}'\n\nbdtex2icon -r 180 -o transpose.png -t '\\mat{A}^{\\!\\top}'\nbdtex2icon -r 180 -o inverse.png -t '\\mat{A}^{\\!-\\!1}'\n\nbdtex2icon -r 250 -o integrator.png -t '\\frac{1}{s}'\nbdtex2icon -r 220 -o dintegrator.png -t '\\frac{z}{z-1}'\n\nbdtex2icon -r 150 -o lti_siso.png -t '\\frac{N(s)}{D(s)}'\nbdtex2icon -r 90 -o lti_ss.png -t '\\begin{array}{c|c} A & B\\\\ \\hline C & D \\end{array}'\n\nbdtex2icon -r 90 -o tr2t.png -t '\\begin{array}{c|c} \\mat{R} & \\vec{t}\\\\ \\hline 0 & 1 \\end{array}'\n\nbdtex2icon -r 100 -o gravload.png -t '\\vec{g}\\!\\left(\\vec{q}\\right)'\nbdtex2icon -r 100 -o coriolis.png -t '\\mat{C}\\left(\\vec{q}, \\dvec{q}\\right)'\nbdtex2icon -r 100 -o inertia.png -t '\\mat{M}\\!\\left(\\vec{q}\\right)'\n\nbdtex2icon -r 100 -o fdyn.png -t '\\ddvec{q}\\left(\\vec{q}, \\vec{\\tau}\\right)'\nbdtex2icon -r 100 -o fdynx.png -t '\\ddvec{x}\\left(\\vec{q}, \\vec{w}\\right)'\n\nbdtex2icon -r 80 -o idyn.png -t '\\vec{\\tau}\\!\\left(\\vec{q}, \\dvec{q}, \\ddvec{q}\\right)'\nbdtex2icon -r 80 -o idynx.png -t '\\vec{w}\\!\\left(\\vec{q}, \\dvec{q}, \\ddvec{x}\\right)'\n\nbdtex2icon -r 180 -o pose_postmul.png -t '\\mathbf{\\oplus\\\\!\\pose[x]_y}'\nbdtex2icon -r 180 -o pose_premul.png -t '\\mathbf{\\pose[x]_y\\\\!\\oplus}'\nbdtex2icon -r 170 -o pose_inverse.png -t '\\mathbf{\\ominus}'\nbdtex2icon -r 150 -o transform_vector.png -t '\\mathbf{\\pose[x]_y}\\\\!\\sbullet\\\\!\\vec{p}'\nbdtex2icon -r 140 -o poseintegerator.png -t \"\\int\\! \\nu\\, dt\"\n\nbdtex2icon -r 192 -o pid.png -t '\\mbox{PID}'\nbdtex2icon -r 190 -o deriv.png -t 's'\nbdtex2icon -r 300 -o deriv.png -t 's'"
  },
  {
    "path": "bdsim/blocks/README.md",
    "content": "This folder holds the core bdsim block definitions.\nEach block is a class with a CamelCase name.\nThe class definitions are grouped by block class\n\n| File | Purpose |\n|------|---------|\n|connections.py | signal grouping, subsystems etc. |\n|discrete.py |  discrete transfer blocks |\n|displays.py | graphical sink blocks |\n|functions.py | function blocks without state |\n|linalg.py | linear algebra blocks |\n|sinks.py | signal sink blocks |\n|sources.py | signal source blocks | \n|transfers.py | transfer function blocks |\n|tex2icon.py | convert LaTeX string to an icon image file |\n|Icons | folder of icon images |\n"
  },
  {
    "path": "bdsim/blocks/__init__.py",
    "content": "from .functions import *\nfrom .sources import *\nfrom .sinks import *\nfrom .transfers import *\nfrom .discrete import *\nfrom .linalg import *\nfrom .displays import *\nfrom .connections import *\nfrom .spatial import *\n\nurl = \"https://petercorke.github.io/bdsim/\" + __package__\n"
  },
  {
    "path": "bdsim/blocks/connections.py",
    "content": "\"\"\"\nConnection blocks are in two categories:\n\n1. Signal manipulation:\n    - have inputs and outputs\n    - have no state variables\n    - are a subclass of ``FunctionBlock`` |rarr| ``Block``\n2. Subsystem support\n    - have inputs or outputs\n    - have no state variables\n    - are a subclass of ``SubsysytemBlock`` |rarr| ``Block``\n\n\"\"\"\n\n# The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.\n\nimport importlib.util\nimport numpy as np\nimport copy\n\nimport bdsim\nfrom bdsim.components import SubsystemBlock, SourceBlock, SinkBlock, FunctionBlock\n\n# ------------------------------------------------------------------------ #\nclass Item(FunctionBlock):\n\n    \"\"\"\n    :blockname:`ITEM`\n\n    Select item from a dictionary signal.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - dict\n            - ``D``\n        *   - Output\n            - 0\n            - any\n            - ``D[i]``\n\n    For a dictionary type input signal, select one item as the output signal.\n    For example::\n\n        item = bd.ITEM(\"xd\")\n\n    selects the ``xd`` item from the dictionary signal input to the block.\n\n    This is somewhat like a demultiplexer :class:`DeMux` but allows for\n    named heterogeneous data.\n    A dictionary signal can serve a similar purpose to a \"bus\" in Simulink(R).\n\n    :seealso: :class:`Dict`\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, item, **blockargs):\n        \"\"\"\n        :param item: name of dictionary item\n        :type item: str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n\n        super().__init__(**blockargs)\n        self.item = item\n\n    def output(self, t, inports, x):\n        input = inports[0]\n        # TODO, handle inputs that are vectors themselves\n        assert isinstance(input, dict), \"Input signal must be a dict\"\n        assert self.item in input, \"Item is not in input dict\"\n        return [input[self.item]]\n\n\nclass Dict(FunctionBlock):\n\n    \"\"\"\n    :blockname:`DICT`\n\n    Create a dictionary signal.\n\n    :inputs: N\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - any\n            - :math:`x_i`\n        *   - Output\n            - 0\n            - dict\n            - ``{key: x[i] for i, key in enumerate(keys)}``\n\n    Inputs are assigned to a dictionary signal, using the corresponding\n    names from ``keys``.\n    For example::\n\n        dd = bd.DICT([\"x\", \"xd\", \"xdd\"])\n\n    expects three inputs and assigns them to dictionary items ``x``, ``xd``, ``xdd`` of\n    the output dictionary respectively.\n\n    This is somewhat like a multiplexer :class:`Mux` but allows for named heterogeneous\n    data.  A dictionary signal can serve a similar purpose to a \"bus\" in Simulink(R).\n\n\n    :seealso: :class:`Item` :class:`Mux`\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, keys, **blockargs):\n        \"\"\"\n        :param keys: list of dictionary keys\n        :type keys: list\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n\n        super().__init__(**blockargs)\n        self.keys = keys\n\n    def output(self, t, inports, x):\n        return {key: inports[i] for i, key in enumerate(self.keys)}\n\n\n# ------------------------------------------------------------------------ #\nclass Mux(FunctionBlock):\n    \"\"\"\n    :blockname:`MUX`\n\n    Multiplex signals.\n\n    :inputs: N\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - float, ndarray\n            - :math:`x_i`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`[x_0 \\ldots x_{N-1}]`\n\n    This block takes a number of scalar or 1D-array signals and concatenates\n    them into a single 1-D array signal.  For example::\n\n        mux = bd.MUX(2)\n\n    :seealso: :class:`Demux` :class:`Dict`\n    \"\"\"\n\n    # TODO could be generalized to creating a list of non numeric data\n\n    nin = -1\n    nout = 1\n\n    def __init__(self, nin=1, **blockargs):\n        \"\"\"\n        :param nin: Number of input ports, defaults to 1\n        :type nin: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(nin=nin, **blockargs)\n\n    def output(self, t, inports, x):\n        # TODO, handle inputs that are vectors themselves\n        out = []\n        for input in inports:\n            if isinstance(input, (int, float, bool)):\n                out.append(input)\n            elif isinstance(input, np.ndarray):\n                out.extend(input.flatten().tolist())\n        return [np.array(out)]\n\n\n# ------------------------------------------------------------------------ #\nclass DeMux(FunctionBlock):\n    \"\"\"\n    :blockname:`DEMUX`\n\n    Demultiplex signals.\n\n    :inputs: 1\n    :outputs: N\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - iterable\n            - :math:`x`\n        *   - Output\n            - i\n            - any\n            - :math:`x_i`\n\n    This block has a single input port and ``nout`` output ports.  The input signal is\n    an iterable whose ``nout`` elements are routed element-wise to individual scalar\n    output ports.  If the input is a 1D Numpy array, then each output port is an\n    element of that array.\n\n    :seealso: :class:`Mux`\n    \"\"\"\n\n    nin = 1\n    nout = -1\n\n    def __init__(self, nout=1, **blockargs):\n        \"\"\"\n        :param nout: number of outputs, defaults to 1\n        :type nout: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(nout=nout, **blockargs)\n\n    def output(self, t, inports, x):\n        input = inports[0]\n        # TODO, handle inputs that are vectors themselves\n        assert (\n            len(input) == self.nout\n        ), \"Input width not equal to number of output ports\"\n        return list(input)\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Index(FunctionBlock):\n    \"\"\"\n    :blockname:`INDEX`\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - iterable\n            - :math:`x`\n        *   - Output\n            - j\n            - iterable\n            - :math:`x_i`\n\n    The specified element(s) of the input iterable (list, string, etc.)\n    are output.  The index can be an integer, sequence of integers, a Python slice\n    object, or a string with Python slice notation, eg. ``\"::-1\"``.\n\n    :seealso: :class:`Slice1` :class:`Slice2`\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, index=[], **blockargs):\n        \"\"\"\n        Index an iterable signal.\n\n        :param index: elements of input array, defaults to []\n        :type index: list, slice or str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n        if isinstance(index, str):\n            args = [None if a == \"\" else int(a) for a in index.split(\":\")]\n            self.index = slice(*args)\n        self.index = index\n\n    def output(self, t, inports, x):\n        input = inports[0]\n        if len(self.index) == 1:\n            return [input[self.index[0]]]\n        elif isinstance(input, np.ndarray):\n            return [np.array([input[i] for i in self.index])]\n        else:\n            return [[input[i] for i in self.index]]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass SubSystem(SubsystemBlock):\n    \"\"\"\n    :blockname:`SUBSYSTEM`\n\n    Instantiate a subsystem.\n\n    :inputs: N\n    :outputs: M\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - any\n            - :math:`x_i`\n        *   - Output\n            - j\n            - any\n            - :math:`y_j`\n\n    This block represents a subsystem in a block diagram.  The definition\n    of the subsystem can be:\n\n    - the name of a module which is imported and must contain only\n      only ``BlockDiagram`` instance, or\n    - a ``BlockDiagram`` instance\n\n    The referenced block diagram must contain one or both of:\n\n    - one ``InPort`` block, which has outputs but no inputs. These\n      outputs are connected to the inputs to the enclosing ``SubSystem`` block.\n    - one ``OutPort`` block, which has inputs but no outputs. These\n      inputs are connected to the outputs to the enclosing ``SubSystem`` block.\n\n    .. note::\n\n        - The referenced block diagram is treated like a macro and copied into\n          the parent block diagram at compile time. The ``SubSystem``, ``InPort`` and\n          ``OutPort`` blocks are eliminated, that is, all hierarchical structure is\n          lost.\n        - The same subsystem can be used multiple times, its blocks and wires\n          will be cloned.  Subsystems can also include subsystems.\n        - The number of input and output ports is not specified, they are computed\n          from the number of ports on the ``InPort`` and ``OutPort`` blocks within the\n          subsystem.\n    \"\"\"\n\n    nin = -1\n    nout = -1\n\n    def __init__(self, subsys, nin=1, nout=1, **blockargs):\n        \"\"\"\n        :param subsys: Subsystem as either a filename or a ``BlockDiagram`` instance\n        :type subsys: str or BlockDiagram\n        :param nin: Number of input ports, defaults to 1\n        :type nin: int, optional\n        :param nout: Number of output ports, defaults to 1\n        :type nout: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :raises ImportError: DESCRIPTION\n        :raises ValueError: DESCRIPTION\n        \"\"\"\n        super().__init__(**blockargs)\n\n        if isinstance(subsys, str):\n            # attempt to import the file\n            try:\n                module = importlib.import_module(subsys, package=\".\")\n            except SyntaxError:\n                print(\"-- syntax error in block definiton: \" + subsys)\n            except ModuleNotFoundError:\n                print(\"-- module not found \", subsys)\n            # get all the bdsim.BlockDiagram instances\n            simvars = [\n                name\n                for name, ref in module.__dict__.items()\n                if isinstance(ref, bdsim.BlockDiagram)\n            ]\n            if len(simvars) == 0:\n                raise ImportError(\"no bdsim.Simulation instances in imported module\")\n            elif len(simvars) > 1:\n                raise ImportError(\n                    \"multiple bdsim.Simulation instances in imported module\"\n                    + str(simvars)\n                )\n            subsys = module.__dict__[simvars[0]]\n            self.ssvar = simvars[0]\n        elif isinstance(subsys, bdsim.BlockDiagram):\n            # use an in-memory diagram\n            self.ssvar = None\n        else:\n            raise ValueError(\"argument must be filename or BlockDiagram instance\")\n\n        # check if valid input and output ports\n        ninp = 0\n        noutp = 0\n        for b in subsys.blocklist:\n            if b.type == \"inport\":\n                ninp += 1\n            elif b.type == \"outport\":\n                noutp += 1\n\n        if ninp > 1:\n            raise ValueError(\"subsystem cannot have more than one INPORT block\")\n        if noutp > 1:\n            raise ValueError(\"subsystem cannot have more than one OUTPORT block\")\n        if ninp + noutp == 0:\n            raise ValueError(\"subsystem cannot have zero INPORT or OUTPORT blocks\")\n\n        # it's valid, make a deep copy\n        self.subsystem = copy.deepcopy(subsys)\n\n        # get references to the input and output port blocks\n        self.inport = None\n        self.outport = None\n        for b in self.subsystem.blocklist:\n            if b.type == \"inport\":\n                self.inport = b\n            elif b.type == \"outport\":\n                self.outport = b\n\n        self.ssname = subsys.name\n\n        self.nin = ninp\n        self.nout = noutp\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass InPort(SubsystemBlock):\n    \"\"\"\n    :blockname:`INPORT`\n\n    Input ports for a subsystem.\n\n    :inputs: 0\n    :outputs: N\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Output\n            - j\n            - any\n            - :math:`y_j`\n\n    This block connects a subsystem to a parent block diagram.  Inputs to the\n    parent-level ``SubSystem`` block appear as the outputs of this block.\n\n    .. note:: Only one ``INPORT`` block can appear in a block diagram but it\n        can have multiple ports.  This is different to Simulink(R) which\n        would require multiple single-port input blocks.\n    \"\"\"\n\n    nin = 0\n    nout = -1\n\n    def __init__(self, nout=1, **blockargs):\n        \"\"\"\n        :param nout: Number of output ports, defaults to 1\n        :type nout: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(nout=nout, **blockargs)\n\n    def output(self, t, inports, x):\n        # signal feed through\n\n        return inports\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass OutPort(SubsystemBlock):\n    \"\"\"\n    :blockname:`OUTPORT`\n\n    Output ports for a subsystem.\n\n    :inputs: N\n    :outputs: 0\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - any\n            - :math:`x_i`\n\n    This block connects a subsystem to a parent block diagram.  The\n    inputs of this block become the outputs of the parent-level ``SubSystem``\n    block.\n\n    .. note:: Only one ``OUTPORT`` block can appear in a block diagram but it\n        can have multiple ports.  This is different to Simulink(R) which\n        would require multiple single-port output blocks.\n    \"\"\"\n\n    nin = -1\n    nout = 0\n\n    def __init__(self, nin=1, **blockargs):\n        \"\"\"\n        :param nin: Number of input ports, defaults to 1\n        :type nin: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(nin=nin, **blockargs)\n\n    def output(self, t, inports, x):\n        # signal feed through\n        return inports\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n\n    from pathlib import Path\n\n    exec(\n        open(\n            Path(__file__).parent.parent.parent / \"tests\" / \"test_connections.py\"\n        ).read()\n    )\n"
  },
  {
    "path": "bdsim/blocks/discrete.py",
    "content": "\"\"\"\nTransfer blocks:\n\n- have inputs and outputs\n- have discrete-time state variables that are sampled/updated at the times\n  specified by the associated clock\n- are a subclass of ``TransferBlock`` |rarr| ``Block``\n\n\"\"\"\n\nimport numpy as np\nimport math\nfrom math import sin, cos, atan2, sqrt, pi\n\nimport matplotlib.pyplot as plt\nimport inspect\nfrom spatialmath import Twist3, SE3\nimport spatialmath.base as smb\n\nfrom bdsim.components import ClockedBlock\n\n# ------------------------------------------------------------------------\n\n\nclass ZOH(ClockedBlock):\n    \"\"\"\n    :blockname:`ZOH`\n\n    Zero-order hold.\n\n    :inputs: 1\n    :outputs: 1\n    :states: N\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - float, ndarray\n            - :math:`x`\n        *   - Output\n            - 0\n            - float, ndarray\n            - :math:`y`\n\n    Output is the input at the previous clock time $y_{k} = x_{k-1}.  The state can be a\n    scalar or a vector, this is given by the type of ``x0``.\n\n    .. note:: If input is not a scalar, ``x0`` must have the shape of the\n        input signal.\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, clock, x0=0, **blockargs):\n        \"\"\"\n        :param clock: clock source\n        :type clock: Clock\n        :param x0: Initial value of the hold, defaults to 0\n        :type x0: array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        self.type = \"sampler\"\n        super().__init__(nin=1, nout=1, clock=clock, **blockargs)\n\n        x0 = smb.getvector(x0)\n        self._x0 = x0\n        self.ndstates = len(x0)\n        # print('nstates', self.nstates)\n\n    def output(self, t, inports, x):\n        # print('* output, x is ', self._x)\n        return [x]\n\n    def next(self, t, inports, x):\n        u = smb.getvector(inports[0])\n        return u  # must be an ndarray\n\n\n# ------------------------------------------------------------------------\n\n\nclass DIntegrator(ClockedBlock):\n    \"\"\"\n    :blockname:`DINTEGRATOR`\n\n    Discrete-time integrator.\n\n    :inputs: 1\n    :outputs: 1\n    :states: N\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - float, ndarray\n            - :math:`x`\n        *   - Output\n            - 0\n            - float, ndarray\n            - :math:`y`\n\n    Create a discrete-time integrator block.\n\n    Output is the time integral of the input.  The state can be a scalar or a\n    vector, this is given by the type of ``x0``.\n\n    The minimum and maximum values can be:\n\n        - a scalar, in which case the same value applies to every element of\n          the state vector, or\n        - a vector, of the same shape as ``x0`` that applies elementwise to\n          the state.\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, clock, x0=0, gain=1.0, min=None, max=None, **blockargs):\n        \"\"\"\n        :param clock: clock source\n        :type clock: Clock\n        :param x0: Initial state, defaults to 0\n        :type x0: array_like, optional\n        :param gain: gain or scaling factor, defaults to 1\n        :type gain: float\n        :param min: Minimum value of state, defaults to None\n        :type min: float or array_like, optional\n        :param max: Maximum value of state, defaults to None\n        :type max: float or array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(clock=clock, **blockargs)\n\n        if isinstance(x0, (int, float)):\n            x0 = np.r_[x0]\n\n        elif isinstance(x0, np.ndarray):\n            if x0.ndim > 1:\n                raise ValueError(\"state must be a 1D vector\")\n        else:\n            x0 = smb.getvector(x0)\n\n        self.ndstates = x0.shape[0]\n\n        if min is not None:\n            min = smb.getvector(min, self.ndstates)\n        if max is not None:\n            max = smb.getvector(max, self.ndstates)\n\n        self._x0 = x0\n        self.min = min\n        self.max = max\n        self.gain = gain\n\n    def output(self, t, u, x):\n        return [x]\n\n    def next(self, t, u, x):\n        xnext = x + self.gain * self.clock.T * np.array(u[0])\n        if self.min is not None or self.max is not None:\n            xnext = np.clip(xnext, self.min, self.max)\n        return xnext\n\n\nclass DPoseIntegrator(ClockedBlock):\n    \"\"\"\n    :blockname:`DPOSEINTEGRATOR`\n\n    Discrete-time spatial velocity integrator.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 6\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray(6,)\n            - :math:`x`\n        *   - Output\n            - 0\n            - SE3\n            - :math:`y`\n\n    This block integrates spatial velocity over time.\n    The block input is a spatial velocity as a 6-vector\n    :math:`(v_x, v_y, v_z, \\omega_x, \\omega_y, \\omega_z)` and the output\n    is pose as an ``SE3`` instance.\n\n    .. note:: State is a velocity twist.\n    \"\"\"\n\n    nin = 1\n    nout = 1\n    inlabels = (\"ν\",)\n    outlabels = (\"ξ\",)\n\n    def __init__(self, clock, x0=None, **blockargs):\n        r\"\"\"\n        :param clock: clock source\n        :type clock: Clock\n        :param x0: Initial pose, defaults to null\n        :type x0: SE3, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(clock=clock, **blockargs)\n\n        if x0 is None:\n            x0 = Twist3()\n        elif isinstance(x0, SE3):\n            x0 = Twist3(x0).A\n        elif isinstance(x0, Twist3):\n            x0 = x0.A\n        elif isvector(x0, 6):\n            x0 = getvector(x0, 6)\n\n        self.ndstates = 6\n\n        self._x0 = x0\n\n        print(\"nstates\", self.nstates, x0)\n\n    def output(self, t, u, x):\n        return [Twist3(x).SE3()]\n\n    def next(self, t, u, x):\n        T_delta = SE3.Delta(u[0] * self.clock.T)\n        pose = Twist3(x).SE3() * T_delta\n        return Twist3(pose).A\n\n\n# ------------------------------------------------------------------------ #\n\n\n# @block\n# class LTI_SS(TransferBlock):\n#     \"\"\"\n#     :blockname:`LTI_SS`\n\n#     .. table::\n#        :align: left\n\n#        +------------+---------+---------+\n#        | inputs     | outputs |  states |\n#        +------------+---------+---------+\n#        | 1          | 01      | nc      |\n#        +------------+---------+---------+\n#        | float,     | float,  |         |\n#        | A(nb,)     | A(nc,)  |         |\n#        +------------+---------+---------+\n#     \"\"\"\n\n#     def __init__(self, *inputs, A=None, B=None, C=None, x0=None, verbose=False, **blockargs):\n#         r\"\"\"\n#         :param ``*inputs``: Optional incoming connections\n#         :type ``*inputs``: Block or Plug\n#         :param N: numerator coefficients, defaults to 1\n#         :type N: array_like, optional\n#         :param D: denominator coefficients, defaults to [1, 1]\n#         :type D: array_like, optional\n#         :param x0: initial states, defaults to zero\n#         :type x0: array_like, optional\n#         :param ``**blockargs``: |BlockOptions|\n#         :return: A SCOPE block\n#         :rtype: LTI_SISO instance\n\n#         Create a state-space LTI block.\n\n#         Describes the dynamics of a single-input single-output (SISO) linear\n#         time invariant (LTI) system described by numerator and denominator\n#         polynomial coefficients.\n\n#         Coefficients are given in the order from highest order to zeroth\n#         order, ie. :math:`2s^2 - 4s +3` is ``[2, -4, 3]``.\n\n#         Only proper transfer functions, where order of numerator is less\n#         than denominator are allowed.\n\n#         The order of the states in ``x0`` is consistent with controller canonical\n#         form.\n\n#         Examples::\n\n#             LTI_SISO(N=[1,2], D=[2, 3, -4])\n\n#         is the transfer function :math:`\\frac{s+2}{2s^2+3s-4}`.\n#         \"\"\"\n#         #print('in SS constructor')\n#         self.type = 'LTI SS'\n\n#         assert A.shape[0] == A.shape[1], 'A must be square'\n#         n = A.shape[0]\n#         if len(B.shape) == 1:\n#             nin = 1\n#             B = B.reshape((n, 1))\n#         else:\n#             nin = B.shape[1]\n#         assert B.shape[0] == n, 'B must have same number of rows as A'\n\n#         if len(C.shape) == 1:\n#             nout = 1\n#             assert C.shape[0] == n, 'C must have same number of columns as A'\n#             C = C.reshape((1, n))\n#         else:\n#             nout = C.shape[0]\n#             assert C.shape[1] == n, 'C must have same number of columns as A'\n\n#         super().__init__(nin=nin, nout=nout, inputs=inputs, **blockargs)\n\n#         self.A = A\n#         self.B = B\n#         self.C = C\n\n#         self.nstates = A.shape[0]\n\n#         if x0 is None:\n#             self._x0 = np.zeros((self.nstates,))\n#         else:\n#             self._x0 = x0\n\n#     def output(self, t=None):\n#         return list(self.C @ self._x)\n\n#     def deriv(self):\n#         return self.A @ self._x + self.B @ np.array(self.inputs)\n# # ------------------------------------------------------------------------ #\n\n\n# @block\n# class LTI_SISO(LTI_SS):\n#     \"\"\"\n#     :blockname:`LTI_SISO`\n\n#     .. table::\n#        :align: left\n\n#        +------------+---------+---------+\n#        | inputs     | outputs |  states |\n#        +------------+---------+---------+\n#        | 1          | 1       | n       |\n#        +------------+---------+---------+\n#        | float      | float   |         |\n#        +------------+---------+---------+\n\n#     \"\"\"\n\n#     def __init__(self, N=1, D=[1, 1], *inputs, x0=None, verbose=False, **blockargs):\n#         r\"\"\"\n#         :param N: numerator coefficients, defaults to 1\n#         :type N: array_like, optional\n#         :param D: denominator coefficients, defaults to [1, 1]\n#         :type D: array_like, optional\n#         :param ``*inputs``: Optional incoming connections\n#         :type ``*inputs``: Block or Plug\n#         :param x0: initial states, defaults to zero\n#         :type x0: array_like, optional\n#         :param ``**blockargs``: |BlockOptions|\n#         :return: A SCOPE block\n#         :rtype: LTI_SISO instance\n\n#         Create a SISO LTI block.\n\n#         Describes the dynamics of a single-input single-output (SISO) linear\n#         time invariant (LTI) system described by numerator and denominator\n#         polynomial coefficients.\n\n#         Coefficients are given in the order from highest order to zeroth\n#         order, ie. :math:`2s^2 - 4s +3` is ``[2, -4, 3]``.\n\n#         Only proper transfer functions, where order of numerator is less\n#         than denominator are allowed.\n\n#         The order of the states in ``x0`` is consistent with controller canonical\n#         form.\n\n#         Examples::\n\n#             LTI_SISO(N=[1, 2], D=[2, 3, -4])\n\n#         is the transfer function :math:`\\frac{s+2}{2s^2+3s-4}`.\n#         \"\"\"\n#         #print('in SISO constscutor')\n\n#         if not isinstance(N, list):\n#             N = [N]\n#         if not isinstance(D, list):\n#             D = [D]\n#         self.N = N\n#         self.D = N\n#         n = len(D) - 1\n#         nn = len(N)\n#         if x0 is None:\n#             x0 = np.zeros((n,))\n#         assert nn <= n, 'direct pass through is not supported'\n\n#         # convert to numpy arrays\n#         N = np.r_[np.zeros((len(D) - len(N),)), np.array(N)]\n#         D = np.array(D)\n\n#         # normalize the coefficients to obtain\n#         #\n#         #   b_0 s^n + b_1 s^(n-1) + ... + b_n\n#         #   ---------------------------------\n#         #   a_0 s^n + a_1 s^(n-1) + ....+ a_n\n\n#         # normalize so leading coefficient of denominator is one\n#         D0 = D[0]\n#         D = D / D0\n#         N = N / D0\n\n#         A = np.eye(len(D) - 1, k=1)  # control canonic (companion matrix) form\n#         A[-1, :] = -D[1:]\n\n#         B = np.zeros((n, 1))\n#         B[-1] = 1\n\n#         C = (N[1:] - N[0] * D[1:]).reshape((1, n))\n\n#         if verbose:\n#             print('A=', A)\n#             print('B=', B)\n#             print('C=', C)\n\n#         super().__init__(A=A, B=B, C=C, x0=x0, **blockargs)\n#         self.type = 'LTI'\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    from pathlib import Path\n\n    exec(\n        open(Path(__file__).parent.parent.parent / \"tests\" / \"test_discrete.py\").read()\n    )\n"
  },
  {
    "path": "bdsim/blocks/displays.py",
    "content": "\"\"\"\nSink blocks:\n\n- have inputs but no outputs\n- have no state variables\n- are a subclass of ``SinkBlock`` |rarr| ``Block``\n- that perform graphics are a subclass of  ``GraphicsBlock`` |rarr| ``SinkBlock`` |rarr| ``Block``\n\n\"\"\"\n\nimport numpy as np\nfrom math import pi, sqrt, sin, cos, atan2\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import Polygon\n\nimport spatialmath.base as sm\n\nfrom bdsim.components import SinkBlock\nfrom bdsim.graphics import GraphicsBlock\n\n# ------------------------------------------------------------------------ #\n\n\nclass Scope(GraphicsBlock):\n    r\"\"\"\n    :blockname:`SCOPE`\n\n    Plot input signals against time.\n\n    :inputs: N\n    :outputs: 0\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - float\n            - :math:`x_i` is the i'th line\n\n    Create a scope block that plots multiple signals against time.\n\n    For each line plotted we can specify the:\n\n    * line style as a heterogeneous list of:\n\n      * Matplotlib `fmt` string comprising a color and line style, eg. ``\"k\"`` or ``\"r:\"``\n\n      * a dict of Matplotlib line style options for `Line2D <https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D>`_\n        , eg. ``{\"color\": \"k\", \"linewidth\": 3, \"alpha\": 0.5)``\n\n    * line label, used in the legend and vertical axis. This can include math mode\n      notation or unicode characters.\n\n    The vertical scale factor defaults to auto-scaling but can be fixed by\n    providing a 2-tuple ``[ymin, ymax]``. All lines are plotted against the\n    same vertical scale.\n\n    .. figure:: ../../figs/Figure_1.png\n        :width: 500px\n        :alt: example of generated graphic\n\n        Example of scope display.\n\n    **Scalar input ports against time**\n\n    The number of lines to plot will be inferred from:\n\n    * the length of the ``labels`` list if specified\n    * the length of the ``styles`` list if specified\n    * ``nin`` if specified, it defaults to 1\n\n    These numbers must be consistent.\n\n    Examples::\n\n        bd.SCOPE()       # a scope with 1 input port\n        bd.SCOPE(nin=3)  # a scope with 3 input ports\n        bd.SCOPE(styles=[\"k\", \"r--\"])        # a scope with 2 input ports\n        bd.SCOPE(labels=[\"x\", r\"$\\gamma$\"])  # a scope with 2 input ports\n        bd.SCOPE(styles=[{'color': 'blue'}, {'color': 'red', 'linestyle': '--'}])\n\n    **Single input port with NumPy array**\n\n    The port is fed with a 1D-array, and ``vector`` is an:\n\n    * int, this is the expected width of the array, all its elements will be plotted\n    * a list of ints, interpretted as indices of the elements to plot.\n\n    Examples::\n\n        bd.SCOPE(vector=[0,1,2]) # display elements 0, 1, 2 of array on port 0\n        bd.SCOPE(vector=[0,1], styles=[{'color': 'blue'}, {'color': 'red', 'linestyle': '--'}])\n\n    .. note::\n        * If the vector is of width 3, by default the inputs are plotted as red, green\n          and blue lines.\n        * If the vector is of width 6, by default the first three inputs are plotted as\n          solid red, green and blue lines and the last three inputs are plotted as\n          dashed red, green and blue lines.\n    \"\"\"\n\n    nin = -1\n    nout = 0\n\n    def __init__(\n        self,\n        nin=1,\n        vector=None,\n        styles=None,\n        stairs=False,\n        scale=\"auto\",\n        labels=None,\n        grid=True,\n        watch=False,\n        title=None,\n        loc=\"best\",\n        **blockargs,\n    ):\n        \"\"\"\n        :param nin: number of inputs, defaults to 1 or if given, the length of\n                    style vector\n        :type nin: int, optional\n        :param vector: vector signal on single input port, defaults to None\n        :type vector: int or list, optional\n        :param styles: styles for each line to be plotted\n        :type styles: str or dict, list of strings or dicts; one per line, optional\n        :param stairs: force staircase style plot for all lines, defaults to False\n        :type stairs: bool, optional\n        :param scale: fixed y-axis scale or defaults to 'auto'\n        :type scale: str or array_like(2)\n        :param labels: vertical axis labels\n        :type labels: sequence of strings\n        :param grid: draw a grid, defaults to True. Can be boolean or a tuple of\n                     options for grid()\n        :type grid: bool or sequence\n        :param watch: add these signals to the watchlist, defaults to False\n        :type watch: bool, optional\n        :param title: title of plot\n        :type title: str\n        :param loc: location of legend, see :meth:`matplotlib.pyplot.legend`, defaults to \"best\"\n        :type loc: str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n\n        def listify(s):\n            # guarantee that result is a list\n            if isinstance(s, str):\n                return [s]\n            elif isinstance(s, (list, tuple)):\n                return s\n            else:\n                raise ValueError(\"unknown argument to listify\")\n\n        # number of lines plotted (nplots) is inferred from the number of labels\n        # or linestyles\n\n        nplots = None\n        if vector is not None:\n            # vector argument is given\n            #  block has single input which is an array\n            #  vector is int, width of vector\n            #  vector is a list of ints, select those inputs from the input vector\n\n            if nin != 1:\n                raise ValueError(\"if vector is given, nin must be 1\")\n\n            if isinstance(vector, int):\n                nplots = vector\n            elif isinstance(vector, list):\n                nplots = len(vector)\n            else:\n                raise ValueError(\"vector must be an int or list of indices\")\n\n        if styles is not None:\n            self.styles = listify(styles)\n            if nplots is None:\n                nplots = len(self.styles)\n            else:\n                assert nplots == len(self.styles), \"need one style per plot\"\n        else:\n            self.styles = None\n\n        if labels is not None:\n            self.labels = listify(labels)\n            if nplots is None:\n                nplots = len(self.labels)\n            else:\n                assert nplots == len(self.labels), \"need one label per plot\"\n        else:\n            self.labels = None\n\n        if nplots is None:\n            # nplots has not been determined from styles or labels, so use nin\n            nplots = nin\n        elif nin == 1 and vector is None:\n            # nplots is different to the default nin value, override it\n            nin = nplots\n\n        self.nplots = nplots\n        self.vector = vector\n\n        super().__init__(nin=nin, **blockargs)\n\n        self.xlabel = \"Time (s)\"\n\n        self.grid = grid\n        self.stairs = stairs\n\n        self.line = [None] * nplots\n        self.scale = scale\n\n        self.watch = watch\n        self.title = title\n        self.loc = loc\n\n        # TODO, wire width\n        # inherit names from wires, block needs to be able to introspect\n\n    def start(self, simstate):\n        super().start(simstate)\n\n        if not self._enabled:\n            return\n\n        # init the arrays that hold the data\n        self.tdata = np.array([])\n        self.ydata = [\n            np.array([]),\n        ] * self.nplots\n\n        # create the figures\n        self.fig = self.create_figure(simstate)\n        self.ax = self.fig.add_subplot(111)\n\n        # get labels if not provided\n        if self.labels is None:\n            if self.vector is None:\n                self.labels = [self.sourcename(i) for i in range(self.nin)]\n            else:\n                self.labels = [str(i) for i in range(self.vector)]\n                if self.styles is None:\n                    if self.vector == 3:\n                        self.styles = [\"r\", \"g\", \"b\"]\n                    elif self.vector == 6:\n                        self.styles = [\"r\", \"g\", \"b\", \"r--\", \"g--\", \"b--\"]\n\n        if self.styles is None:\n            self.styles = [None] * self.nplots\n\n        # create empty lines with defined styles\n        for i in range(0, self.nplots):\n            args = []\n            kwargs = {}\n            style = self.styles[i]\n            if isinstance(style, dict):\n                kwargs = style\n            elif isinstance(style, str):\n                args = [style]\n            if self.stairs:\n                kwargs[\"drawstyle\"] = \"steps\"  # force steppy plot\n\n            (self.line[i],) = self.ax.plot(\n                self.tdata,\n                self.ydata[i],\n                *args,\n                label=self.styles[i],\n                linewidth=2,\n                **kwargs,\n            )\n\n        # label the axes\n        if self.labels is not None:\n            self.ax.set_ylabel(\",\".join(self.labels))\n        self.ax.set_xlabel(self.xlabel)\n\n        if self.title is not None:\n            name = self.title\n        else:\n            name = self.name_tex\n        self.ax.set_title(name)\n\n        # grid control\n        if self.grid is True:\n            self.ax.grid(self.grid)\n        elif isinstance(self.grid, (list, tuple)):\n            self.ax.grid(True, *self.grid)\n\n        # set limits\n        self.ax.set_xlim(0, simstate.T)\n\n        if self.scale != \"auto\":\n            self.ax.set_ylim(*self.scale)\n        if self.labels is not None:\n\n            def fix_underscore(s):\n                if s[0] == \"_\":\n                    return \"-\" + s[1:]\n                else:\n                    return s\n\n            self.ax.legend(\n                [fix_underscore(label) for label in self.labels], loc=self.loc\n            )\n\n        if self.watch:\n            for wire in self.input_wires:\n                plug = wire.start  # start plug for input wire\n\n                # append to the watchlist, bdsim.run() will do the rest\n                simstate.watchlist.append(plug)\n                simstate.watchnamelist.append(str(plug))\n        plt.draw()\n        plt.show(block=False)\n\n    def step(self, t, inports):\n        if not self._enabled:\n            return\n\n        # inputs are set\n        self.tdata = np.append(self.tdata, t)\n\n        if self.vector is None:\n            # take data from multiple inputs as a list\n            data = inports\n            if len(data) != self.nplots:\n                raise RuntimeError(\n                    \"number of signals to plot doesnt match init parameters\"\n                )\n\n        else:\n            # single input with vector data\n            data = self.inputs[0]\n            if isinstance(self.vector, list):\n                data = data[self.vector]\n\n        # append new data to the set\n        for i, y in enumerate(data):\n            self.ydata[i] = np.append(self.ydata[i], y)\n\n        # plot the data\n        for i in range(0, self.nplots):\n            self.line[i].set_data(self.tdata, self.ydata[i])\n\n        if self.scale == \"auto\":\n            self.ax.relim()\n            self.ax.autoscale_view(scalex=False, scaley=True)\n\n        super().step(t, inports)\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass ScopeXY(GraphicsBlock):\n    \"\"\"\n    :blockname:`SCOPEXY`\n\n    Plot X against Y.\n\n    :inputs: 2\n    :outputs: 0\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - float\n            - :math:`x`\n        *   - Input\n            - 1\n            - float\n            - :math:`y`\n\n    Create an XY scope where input :math:`y` (vertical axis) is plotted against :math:`x`\n    (horizontal axis).\n\n    Line style is one of:\n\n      * Matplotlib `fmt` string comprising a color and line style, eg. ``\"k\"`` or ``\"r:\"``\n\n      * a dict of Matplotlib line style options for `Line2D <https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D>`_\n        , eg. ``dict(color=\"k\", linewidth=3, alpha=0.5)``\n\n    The scale factor defaults to auto-scaling but can be fixed by\n    providing either:\n\n        - a 2-tuple ``[min, max]`` which is used for the x- and y-axes\n        - a 4-tuple ``[xmin, xmax, ymin, ymax]``\n    \"\"\"\n\n    nin = 2\n    nout = 0\n\n    def __init__(\n        self,\n        style=None,\n        scale=\"auto\",\n        aspect=\"equal\",\n        labels=[\"X\", \"Y\"],\n        init=None,\n        nin=2,\n        **blockargs,\n    ):\n        \"\"\"\n        :param style: line style, defaults to None\n        :type style: optional str or dict\n        :param scale: fixed y-axis scale or defaults to 'auto'\n        :type scale: str or array_like(2) or array_like(4)\n        :param labels: axis labels (xlabel, ylabel), defaults to [\"X\",\"Y\"]\n        :type labels: 2-element tuple or list\n        :param init: function to initialize the graphics, defaults to None\n        :type init: callable\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.xdata = []\n        self.ydata = []\n        if init is not None:\n            assert callable(init), \"graphics init function must be callable\"\n        self.init = init\n\n        self.styles = style\n        if scale != \"auto\":\n            scale = sm.expand_dims(scale, 2)\n        self.scale = scale\n        self.aspect = aspect\n        self.labels = labels\n        self.inport_names((\"x\", \"y\"))\n\n    def start(self, simstate):\n        super().start(simstate)\n\n        if not self._enabled:\n            return\n\n        # create the plot\n        super().reset()\n\n        self.fig = self.create_figure(simstate)\n        self.ax = self.fig.gca()\n\n        args = []\n        blockargs = {}\n        style = self.styles\n        if isinstance(style, dict):\n            blockargs = style\n        elif isinstance(style, str):\n            args = [style]\n        (self.line,) = self.ax.plot(self.xdata, self.ydata, *args)\n\n        self.ax.grid(True)\n        self.ax.set_xlabel(self.labels[0])\n        self.ax.set_ylabel(self.labels[1])\n        self.ax.set_title(self.name)\n        if not (isinstance(self.scale, str) and self.scale == \"auto\"):\n            self.ax.set_xlim(*self.scale[0:2])\n            self.ax.set_ylim(*self.scale[2:4])\n        self.ax.set_aspect(self.aspect)\n        if self.init is not None:\n            self.init(self.ax)\n\n        plt.draw()\n        plt.show(block=False)\n\n    def step(self, t, inports):\n        if not self._enabled:\n            return\n        self._step(inports[0], inports[1], t)\n\n    def _step(self, x, y, t):\n        self.xdata.append(x)\n        self.ydata.append(y)\n\n        plt.figure(self.fig.number)\n        self.line.set_data(self.xdata, self.ydata)\n\n        if self.bd.runtime.options.animation:\n            self.fig.canvas.flush_events()\n\n        if isinstance(self.scale, str) and self.scale == \"auto\":\n            self.ax.relim()\n            self.ax.autoscale_view()\n        super().step(t, None)\n\n    # def done(self, block=False, **blockargs):\n    #     if self.bd.runtime.options.graphics:\n    #         plt.show(block=block)\n    #         super().done()\n\n\nclass ScopeXY1(ScopeXY):\n    \"\"\"\n    :blockname:`SCOPEXY1`\n\n    Plot X[0] against X[1].\n\n    :inputs: 1\n    :outputs: 0\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`x`\n\n    Create an XY scope where input :math:`x_j` (vertical axis) is plotted against\n    :math:`x_i` (horizontal axis). This block has one vector input and the elements to\n    be plotted are given by a 2-element iterable :math:`(i, j)`.\n\n    Line style is one of:\n\n      * Matplotlib `fmt` string comprising a color and line style, eg. ``\"k\"`` or ``\"r:\"``\n\n      * a dict of Matplotlib line style options for `Line2D <https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.lines.Line2D.html#matplotlib.lines.Line2D>`_\n        , eg. ``dict(color=\"k\", linewidth=3, alpha=0.5)``\n\n    The scale factor defaults to auto-scaling but can be fixed by\n    providing either:\n\n        - a 2-tuple ``[min, max]`` which is used for the x- and y-axes\n        - a 4-tuple ``[xmin, xmax, ymin, ymax]``\n    \"\"\"\n\n    nin = 1\n    nout = 0\n\n    def __init__(self, indices=[0, 1], **blockargs):\n        \"\"\"\n        :param indices: indices of elements to select from block input vector, defaults to [0,1]\n        :type indices: array_like(2)\n        :param style: line style\n        :type style: optional str or dict\n        :param scale: fixed y-axis scale or defaults to 'auto'\n        :type scale: str or array_like(2) or array_like(4)\n        :param labels: axis labels (xlabel, ylabel)\n        :type labels: 2-element tuple or list\n        :param init: function to initialize the graphics, defaults to None\n        :type init: callable\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.inport_names((\"xy\",))\n        if len(indices) != 2:\n            raise ValueError(\"indices must have 2 elements\")\n        self.indices = [int(x) for x in indices]\n\n    def step(self, t, inports):\n        if not self._enabled:\n            return\n\n        # inputs are set\n        x = inports[0][self.indices[0]]\n        y = inports[0][self.indices[1]]\n\n        super()._step(x, y, t)\n\n\n# ------------------------------------------------------------------------ #\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n\n    from pathlib import Path\n\n    exec(\n        open(Path(__file__).parent.parent.parent / \"tests\" / \"test_displays.py\").read()\n    )\n"
  },
  {
    "path": "bdsim/blocks/functions.py",
    "content": "\"\"\"\nFunction blocks:\n\n- have inputs and outputs\n- have no state variables\n- are a subclass of ``FunctionBlock`` |rarr| ``Block``\n\n\"\"\"\n\n# The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.\n\nimport numpy as np\nfrom scipy import linalg\nimport scipy.interpolate\nimport math\nimport inspect\nimport spatialmath.base as smb\nfrom typing import Any, Union, Callable\n\nArrayLike = Union[np.ndarray, int, float, list, tuple]\n\nfrom bdsim.components import FunctionBlock\n\n# TODO:\n# transform 3D points\n\n\nclass Sum(FunctionBlock):\n    \"\"\"\n    :blockname:`SUM`\n\n    Summing junction.\n\n    :inputs: N\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        * - Port type\n          - Port number\n          - Types\n          - Description\n        * - Input\n          - i\n          - int, float, ndarray\n          - :math:`x_i`\n        * - Output\n          - 0\n          - int, float, ndarray\n          - :math:`\\sum_i \\pm x_i`\n\n    Add or subtract input signals according to the ``signs`` string.  The\n    number of input ports is the length of this string.\n\n    For example::\n\n        sum = bd.SUM('+-+')\n\n    is a 3-input summing junction which computes ``in[0] - in[1] + in[2]``.\n\n    :note: The signals must be compatible for addition, and if some are\n        arrays they must be broadcastable.\n    \"\"\"\n\n    nin = -1\n    nout = 1\n\n    _modefuncs = {\n        \"r\": lambda x: x,\n        \"c\": smb.wrap_mpi_pi,\n        \"C\": smb.wrap_0_2pi,\n        \"L\": smb.wrap_0_pi,\n        \"l\": smb.wrap_0_pi,\n    }\n\n    def __init__(self, signs: str = \"++\", mode: str = None, **blockargs):\n        \"\"\"\n        :param signs: signs associated with input ports, accepted characters: + or -, defaults to \"++\"\n        :type signs: str, optional\n        :param mode: controls addition mode, per element, string comprises ``r`` or ``c`` or ``C`` or ``L``, defaults to None\n        :type mode: str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        ``mode`` controls how elements of the input vectors are added/subtracted.\n        Elements which are angles must be treated specially, and this is indicated by\n        the corresponding characters in ``mode``.  The string's length must equal the\n        width of the input vectors. The characters of the string can be:\n\n        ==============  ============================================\n        mode character  purpose\n        ==============  ============================================\n        r               real number, don't wrap (default)\n        c               angle on circle, wrap to [-π, π)\n        C               angle on circle, wrap to [0, 2π)\n        L               colatitude angle, wrap to [0, π]\n        ==============  ============================================\n\n        For example if ``mode=\"rc\"`` then a 2-element array would have its\n        second element wrapped to the range [-π, π).\n\n        \"\"\"\n        super().__init__(nin=len(signs), **blockargs)\n\n        assert isinstance(signs, str), \"first argument must be signs string\"\n        assert all([x in \"+-\" for x in signs]), \"invalid sign\"\n        self.signs = signs\n        self.mode = mode\n\n    def output(self, t, inports, x):\n        for i, input in enumerate(inports):\n            # code makes no assumption about types of inputs\n            # NOTE: use sum = sum =/- input rather than sum +/-= input since\n            #       these are references\n            if self.signs[i] == \"-\":\n                if i == 0:\n                    sum = -input\n                else:\n                    sum = sum - input\n            else:\n                if i == 0:\n                    sum = input\n                else:\n                    sum = sum + input\n\n        if self.mode is not None:\n            if isinstance(sum, np.ndarray):\n                # sum is an array\n                if sum.ndim == 1:\n                    if len(self.mode) != len(sum):\n                        raise ValueError(\"length of mode string doesn't match\")\n                    sum = np.array(\n                        [self._modefuncs[m](x) for (m, x) in zip(self.mode, sum)]\n                    )\n                elif sum.ndim == 2:\n                    if len(self.mode) != sum.shape[0]:\n                        raise ValueError(\n                            \"length of mode string doesn't match number of rows\"\n                        )\n                    out = []\n                    for col in sum.T:\n                        out.append(\n                            [self._modefuncs[m](x) for (m, x) in zip(self.mode, col)]\n                        )\n                    sum = np.array(out).T\n\n                else:\n                    raise ValueError(\"expecting 1D or 2D array\")\n            else:\n                # sum is a scalar\n                sum = self._modefuncs[self.mode[0]](sum)\n\n        return [sum]\n\n\n# ------------------------------------------------------------------------ #\nclass Prod(FunctionBlock):\n    r\"\"\"\n    :blockname:`PROD`\n\n    Product junction.\n\n    :inputs: N\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        * - Port type\n          - Port number\n          - Types\n          - Description\n        * - Input\n          - i\n          - int, float, ndarray\n          - :math:`x_i`\n        * - Output\n          - 0\n          - int, float, ndarray\n          - :math:`\\prod_i \\{x_i | \\frac{1}{x_i}\\}`\n\n    Multiply or divide input signals according to the ``ops`` string.  The\n    number of input ports is the length of this string.\n\n    For example::\n\n        prod = PROD('*/*')\n\n    is a 3-input product junction which computes ``in[0] / in[1] * in[2]``.\n\n    :note: By default the ``*`` and ``/`` operators are used which perform element-wise\n        operations.\n\n    :note: The option ``matrix`` will instead use ``@`` and ``@ np.linalg.inv()``. The\n        shapes of matrices must conform.  A matrix on a ``/`` input must be square and\n        non-singular.  Matrices are multiplied in ascending port order.\n    \"\"\"\n\n    nin = -1\n    nout = 1\n\n    def __init__(self, ops: str = \"**\", matrix: bool = False, **blockargs):\n        \"\"\"\n        :param ops: operations associated with input ports, accepted characters: * or /, defaults to '**'\n        :type ops: str, optional\n        :param inputs: Optional incoming connections\n        :type inputs: Block or Plug\n        :param matrix: Arguments are matrices, defaults to False\n        :type matrix: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \"\"\"\n        super().__init__(nin=len(ops), **blockargs)\n        assert isinstance(ops, str), \"first argument must be signs string\"\n        assert all([x in \"*/\" for x in ops]), \"invalid op\"\n        self.ops = ops\n        self.matrix = matrix\n\n    def output(self, t, inports, x):\n        for i, input in enumerate(inports):\n            if i == 0:\n                if self.ops[i] == \"*\":\n                    prod = input\n                else:\n                    if self.matrix:\n                        prod = np.linalg.inv(input)\n                    prod = 1.0 / input\n            else:\n                if self.ops[i] == \"*\":\n                    if self.matrix:\n                        prod = prod @ input\n                    else:\n                        prod = prod * input\n                else:\n                    if self.matrix:\n                        prod = prod @ np.linalg.inv(input)\n                    else:\n                        prod = prod / input\n\n        return [prod]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Gain(FunctionBlock):\n    \"\"\"\n    :blockname:`GAIN`\n\n    Gain block.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        * - Port type\n          - Port number\n          - Types\n          - Description\n        * - Input\n          - 0\n          - int, float, ndarray\n          - :math:`x`\n        * - Output\n          - 0\n          - int, float, ndarray\n          - :math:`K x`\n\n    Either or both the input and gain can be Numpy arrays and Numpy will\n    compute the appropriate product :math:`u K`.\n\n    If :math:`u` and ``K`` are both NumPy arrays the ``@`` operator is used\n    and :math:`u` is postmultiplied by the gain. To premultiply by the gain,\n    to compute :math:`K u` use the ``premul`` option.\n\n    For example::\n\n        gain = bd.GAIN(2.5)\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(\n        self, K: Union[int, float, np.ndarray] = 1, premul: bool = False, **blockargs\n    ):\n        \"\"\"\n        :param K: The gain value, defaults to 1\n        :type K: scalar, array_like\n        :param premul: premultiply by constant, default is postmultiply, defaults to False\n        :type premul: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \"\"\"\n        super().__init__(**blockargs)\n        self.K = K\n        self.premul = premul\n\n        self.add_param(\"K\")\n\n    def output(self, t, inports, x):\n        input = inports[0]\n\n        if isinstance(input, np.ndarray) and isinstance(self.K, np.ndarray):\n            # array x array case\n            if self.premul:\n                # premultiply by gain\n                return [self.K @ input]\n            else:\n                # postmultiply by gain\n                return [input @ self.K]\n        else:\n            return [input * self.K]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Pow(FunctionBlock):\n    \"\"\"\n    :blockname:`POW`\n\n    Power block.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        * - Port type\n          - Port number\n          - Types\n          - Description\n        * - Input\n          - 0\n          - int, float, ndarray\n          - :math:`x`\n        * - Output\n          - 0\n          - int, float, ndarray\n          - :math:`x^p`\n\n    If the input is a Numpy array the result depends on ``matrix``.\n    If ``matrix`` is False the block performs an elementwise exponentiation and\n    the result is a Numpy array of the same size.\n\n    If ``matrix`` is True and the input is a square matrix and ``p`` is an integer\n    then matrixwise exponentiation is performedand using repeated matrix\n    multiplication and matrix inversion.  If ``p`` is not an integer it uses SciPy\n    to compute the power using an eigenvalue decomposition.\n\n    For example::\n\n        pow = bd.POW(2)\n\n    :seealso: :func:`numpy.linalg.matrix_power` :func:`scipy.linalg.fractional_matrix_power`\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, p: Union[int, float] = 1, matrix: bool = False, **blockargs):\n        \"\"\"\n        :param p: The exponent value, defaults to 1\n        :type p: scalar\n        :param matrix: premultiply by constant, default is postmultiply, defaults to False\n        :type matrix: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \"\"\"\n        super().__init__(**blockargs)\n\n        self.p = p\n        self.matrix = matrix\n        self.add_param(\"p\")\n\n    def output(self, t, inports, x):\n        input = inports[0]\n\n        if isinstance(input, np.ndarray):\n            # input is an array\n            if self.matrix:\n                # matrixwise exponentiation\n                if isinstance(self.p, int):\n                    # integer case\n                    return [np.linalg.matrix_power(input, self.p)]\n                else:\n                    # general fractional case\n                    return [linalg.fractional_matrix_power(input, self.p)]\n            else:\n                # elementwise exponentiation\n                return [input**self.p]\n        else:\n            return [input**self.p]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Clip(FunctionBlock):\n    r\"\"\"\n    :blockname:`CLIP`\n\n    Signal clipping.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - int, float, ndarray\n            - :math:`x`\n        *   - Output\n            - 0\n            - int, float, ndarray\n            - :math:`\\min(\\max(x,a), b)`\n\n    The input signal is clipped to the range from ``minimum`` to ``maximum`` inclusive.\n\n    The signal can be a 1D-array in which case each element is clipped.  The\n    minimum and maximum values can be:\n\n        - a scalar, in which case the same value applies to every element of\n          the input vector , or\n        - a 1D-array, of the same shape as the input vector that applies elementwise to\n          the input vector.\n\n    For example::\n\n        clip = bd.CLIP(-1, 1)\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(\n        self, min: ArrayLike = -math.inf, max: ArrayLike = math.inf, **blockargs\n    ):\n        \"\"\"\n        :param min: Minimum value, defaults to -math.inf\n        :type min: scalar or array_like, optional\n        :param max: Maximum value, defaults to math.inf\n        :type max: float or array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.min = min\n        self.max = max\n\n    def output(self, t, inports, x):\n        input = inports[0]\n\n        if isinstance(input, np.ndarray):\n            out = np.clip(input, self.min, self.max)\n        else:\n            out = min(self.max, max(input, self.min))\n        return [out]\n\n\n# ------------------------------------------------------------------------ #\n\n# TODO can have multiple outputs: pass in a tuple of functions, return a tuple\nclass Function(FunctionBlock):\n    r\"\"\"\n    :blockname:`FUNCTION`\n\n    Python function.\n\n    :inputs: N\n    :outputs: M\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - any\n            - :math:`x_i`\n        *   - Output\n            - j\n            - any\n            - :math:`f_j(x_0, \\ldots, x_{N-1})`\n\n    Inputs to the block are passed as separate arguments to the function.\n    Programmatic ositional or keyword arguments can also be passed to the function.\n\n    A block with one output port that sums its two input ports is::\n\n        func = bd.FUNCTION(lambda u1, u2: u1+u2, nin=2)\n\n    A block with a function that takes two inputs and has two additional arguments::\n\n        def myfun(u1, u2, param1, param2):\n            pass\n\n        FUNCTION(myfun, nin=2, args=(p1,p2))\n\n    If we need access to persistent (static) data, to keep some state::\n\n        def myfun(u1, u2, param1, param2, state):\n            pass\n\n        func = bd.FUNCTION(myfun, nin=2, args=(p1,p2), persistent=True)\n\n    where a dictionary is passed in as the last argument and which is kept from call to call.\n\n    A block with a function that takes two inputs and additional keyword arguments::\n\n        def myfun(u1, u2, param1=1, param2=2, param3=3, param4=4):\n            pass\n\n        func = bd.FUNCTION(myfun, nin=2, kwargs=dict(param2=7, param3=8))\n\n    A block with two inputs and two outputs, the outputs are defined by two lambda\n    functions with the same inputs::\n\n        FUNCTION( [ lambda x, y: x_t, lambda x, y: x* y])\n\n    A block with two inputs and two outputs, the outputs are defined by a\n    single function which returns a list::\n\n        def myfun(u1, u2):\n            return [ u1+u2, u1*u2 ]\n\n        func = bd.FUNCTION( myfun, nin=2, nout=2)\n    \"\"\"\n\n    nin = -1\n    nout = -1\n\n    def __init__(\n        self,\n        func: Callable = None,\n        nin: int = 1,\n        nout: int = 1,\n        persistent: bool = False,\n        fargs: list = None,\n        fkwargs: dict = None,\n        **blockargs,\n    ):\n\n        \"\"\"\n        :param func: function or lambda, or list thereof, defaults to None\n        :type func: callable or sequence of callables, optional\n        :param nin: number of inputs, defaults to 1\n        :type nin: int, optional\n        :param nout: number of outputs, defaults to 1\n        :type nout: int, optional\n        :param persistent: pass in a reference to a dictionary instance to hold persistent state, defaults to False\n        :type persistent: bool, optional\n        :param fargs: extra positional arguments passed to the function, defaults to []\n        :type fargs: list, optional\n        :param fkwargs: extra keyword arguments passed to the function, defaults to {}\n        :type fkwargs: dict, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict, optional\n        \"\"\"\n        if func is None:\n            raise ValueError(\"function is not defined\")\n\n        super().__init__(nin=nin, nout=nout, **blockargs)\n\n        if fargs is None:\n            fargs = list()\n        if fkwargs is None:\n            fkwargs = dict()\n\n        # TODO, don't know why this happens\n        if len(fargs) > 0 and fargs[0] == {}:\n            fargs = []\n\n        if isinstance(func, (list, tuple)):\n            for f in func:\n                assert callable(f), \"Function must be a callable\"\n                if fkwargs is None:\n                    # we can check the number of arguments\n                    n = len(inspect.signature(func).parameters)\n                    if persistent:\n                        n -= 1  # discount dict if used\n                    if nin + len(fargs) != n:\n                        raise ValueError(\n                            f\"argument count mismatch: function has {n} args,\"\n                            f\" dict={dict}, nin={nin}\"\n                        )\n        elif callable(func):\n            if len(fkwargs) == 0:\n                # we can check the number of arguments\n                n = len(inspect.signature(func).parameters)\n                if persistent:\n                    n -= 1  # discount dict if used\n                if nin + len(fargs) != n:\n                    raise ValueError(\n                        f\"argument count mismatch: function has {n} args, dict={dict},\"\n                        f\" nin={nin}\"\n                    )\n            # self.nout = nout\n\n        self.func = func\n        if persistent:\n            self.userdata = dict()\n            fargs += (self.userdata,)\n        else:\n            self.userdata = None\n        self.args = fargs\n        self.kwargs = fkwargs\n\n    def start(self, simstate):\n        super().start(simstate)\n        if self.userdata is not None:\n            self.userdata.clear()\n            print(\"clearing user data\")\n\n    def output(self, t, inports, x):\n\n        if callable(self.func):\n            # single function\n            try:\n                val = self.func(*inports, *self.args, **self.kwargs)\n            except TypeError:\n                raise RuntimeError(\n                    \"Function invocation failed, check number of arguments\"\n                ) from None\n            if isinstance(val, (list, tuple)):\n                if len(val) != self.nout:\n                    raise RuntimeError(\n                        \"Function returns wrong number of arguments: \" + str(self)\n                    )\n                return val\n            else:\n                if self.nout != 1:\n                    raise RuntimeError(\n                        \"Function returns wrong number of arguments: \" + str(self)\n                    )\n                return [val]\n        else:\n            # list of functions\n            out = []\n            for f in self.func:\n                try:\n                    val = f(*inports, *self.args, **self.kwargs)\n                except TypeError:\n                    raise RuntimeError(\n                        \"Function invocation failed, check number of arguments\"\n                    ) from None\n                out.append(val)\n            return out\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Interpolate(FunctionBlock):\n    \"\"\"\n    :blockname:`INTERPOLATE`\n\n    Interpolate signal.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - int, float\n            - :math:`x`\n        *   - Output\n            - 0\n            - float\n            - :math:`f(x)`\n\n    Interpolate a scalar function of a scalar.\n\n    A simple triangle function with domain [0,10] and range [0,1] can be\n    defined by::\n\n        interp = bd.INTERPOLATE(x=(0,5,10), y=(0,1,0))\n\n    We might also express this as a list of 2D-coordinates::\n\n        interp = bd.INTERPOLATE(xy=[(0,0), (5,1), (10,0)])\n\n    .. plot::\n\n        import matplotlib.pyplot as plt\n        plt.plot([0, 5, 10], \n                 [0, 1, 0], lw=2)\n        plt.grid(True)\n        plt.xlabel(\"in[0]\")\n        plt.ylabel(\"out[0]\")\n\n    The data can also be expressed as Numpy arrays.  If that is the case,\n    the interpolation function can be vector valued. ``x`` has a shape of\n    (N,1) and ``y`` has a shape of (N,M).  Alternatively ``xy`` has a shape\n    of (N,M+1) and the first column is the x-data.\n\n    :note: if ``time=True``.  In this case the block has no\n        input ports and is a ``Source`` not a ``Function`` block.\n\n    :seealso: :func:`scipy.interpolate.interp1d`\n    \"\"\"\n\n    nin = -1\n    nout = 1\n\n    def __init__(\n        self,\n        x: Union[list, tuple, np.ndarray] = None,\n        y: Union[list, tuple, np.ndarray] = None,\n        xy: np.ndarray = None,\n        time: bool = False,\n        kind: str = \"linear\",\n        **blockargs,\n    ):\n        \"\"\"\n        :param x: x-values of function, defaults to None\n        :type x: array_like, shape (N,) optional\n        :param y: y-values of function, defaults to None\n        :type y: array_like, optional\n        :param xy: combined x- and y-values of function, defaults to None\n        :type xy: array_like, optional\n        :param time: x new is simulation time, defaults to False\n        :type time: bool, optional\n        :param kind: interpolation method, defaults to 'linear'\n        :type kind: str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        self.time = time\n        if time:\n            nin = 0\n            self.blockclass = \"source\"\n        else:\n            nin = 1\n        super().__init__(nin=nin, **blockargs)\n\n        if xy is None:\n            # process separate x and y vectors\n            x = np.array(x)\n            y = np.array(y)\n            assert x.shape[0] == y.shape[0], \"x and y data must be same length\"\n        else:\n            # process mixed xy data\n            if isinstance(xy, (list, tuple)):\n                x = [_[0] for _ in xy]\n                y = [_[1] for _ in xy]\n                # x = np.array(x).T\n                # y = np.array(y).T\n                print(x, y)\n            elif isinstance(xy, np.ndarray):\n                x = xy[:, 0]\n                y = xy[:, 1:]\n        self.f = scipy.interpolate.interp1d(x=x, y=y, kind=kind, axis=0)\n        self.x = x\n\n    def start(self, simstate, **blockargs):\n        super().start(simstate)\n\n        if simstate is not None:\n            if self.time:\n                assert self.x[0] >= 0, \"interpolation not defined for t<0\"\n                if self.x[-1] is np.inf:\n                    self.x[-1] = simstate.T\n                assert self.x[-1] >= simstate.T, \"interpolation not defined for t>T\"\n\n    def output(self, t, inports, x):\n        if self.time:\n            xnew = t\n        else:\n            xnew = inports[0]\n        return [self.f(xnew)]\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n\n    from pathlib import Path\n\n    exec(\n        open(Path(__file__).parent.parent.parent / \"tests\" / \"test_functions.py\").read()\n    )\n"
  },
  {
    "path": "bdsim/blocks/linalg.py",
    "content": "\"\"\"\nLinear algebra blocks:\n\n- have inputs and outputs\n- have no state variables\n- are a subclass of ``FunctionBlock`` |rarr| ``Block``\n\n\"\"\"\n\n# The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.\n\nimport numpy as np\nimport math\n\nfrom bdsim.components import FunctionBlock\n\n\nclass Inverse(FunctionBlock):\n    r\"\"\"\n    :blockname:`INVERSE`\n\n    Matrix inverse.\n\n    :inputs: 1\n    :outputs: 2\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}^{-1}`\n        *   - Output\n            - 1\n            - float\n            - :math:`\\mbox{cond}(\\mathbf{A})`\n\n    Compute inverse of the 2D-array input signal.  If the matrix is square\n    the inverse is computed unless the ``pinv`` flag is True.  For a\n    non-square matrix the pseudo-inverse is used.  The condition number is\n    output on the second port.\n\n    :seealso: `numpy.linalg.inv <https://numpy.org/doc/stable/reference/generated/numpy.linalg.inv.html>`_,\n        `numpy.linalg.pinv <https://numpy.org/doc/stable/reference/generated/numpy.linalg.pinv.html>`_,\n        `numpy.linalg.cond <https://numpy.org/doc/stable/reference/generated/numpy.linalg.cond.html>`_\n    \"\"\"\n\n    nin = 1\n    nout = 2\n\n    onames = (\"inv\", \"cond\")\n\n    def __init__(self, pinv=False, **blockargs):\n        \"\"\"\n        :param pinv: force pseudo inverse, defaults to False\n        :type pinv: bool, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"inverse\"\n\n        self.pinv = pinv\n\n    def output(self, t, inports, x):\n        mat = inports[0]\n        if isinstance(mat, np.ndarray):\n            if mat.shape[0] != mat.shape[1]:\n                pinv = True\n            else:\n                pinv = self.pinv\n\n            if pinv:\n                out = np.linalg.pinv(mat)\n            else:\n                try:\n                    out = np.linalg.inv(mat)\n                except np.linalg.LinAlgError:\n                    raise RuntimeError(\"matrix is singular\")\n            return [out, np.linalg.cond(mat)]\n\n        elif hasattr(mat, \"inv\"):\n            # ask the object to invert itself\n            return [mat.inv(), None]\n        else:\n            raise RuntimeError(\"object cannot be inverted\")\n\n\n# ------------------------------------------------------------------------ #\nclass Transpose(FunctionBlock):\n    r\"\"\"\n    :blockname:`TRANSPOSE`\n\n    Matrix transpose.\n\n    :inputs: 1\n    :outputs: 2\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}^{\\top}`\n\n    Compute transpose of the 2D-array input signal.\n\n    .. note::\n        - An input 1D-array of shape (N,) is turned into a 2D-array column vector\n          with shape (N,1).\n        - An input 2D-array column vector of shape (N,1) becomes a 2D-array\n          row vector with shape (1,N).\n\n    :seealso: `numpy.linalg.transpose <https://numpy.org/doc/stable/reference/generated/numpy.linalg.transpose.html>`_\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"transpose\"\n\n    def output(self, t, inports, x):\n        mat = inports[0]\n\n        if mat.ndim == 1:\n            out = mat.reshape((mat.shape[0], 1))\n        else:\n            out = mat.T\n\n        return [out]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Norm(FunctionBlock):\n    r\"\"\"\n    :blockname:`NORM`\n\n    Array norm.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`\\|\\mathbf{A}\\|`\n\n    Computes the specified norm for a 1D- or 2D-array.\n\n    :seealso: `numpy.linalg.norm <https://numpy.org/doc/stable/reference/generated/numpy.linalg.norm.html>`_\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, ord=None, axis=None, **blockargs):\n        \"\"\"\n        :param axis: specifies the axis along which to compute the vector norms, defaults to None.\n        :type axis: int, optional\n        :param ord: Order of the norm, default to None.\n        :type ord: int or str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"norm\"\n        self.args = dict(ord=ord, axis=axis)\n\n    def output(self, t, inports, x):\n        vec = inports[0]\n        out = np.linalg.norm(vec, **self.args)\n        return [out]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Flatten(FunctionBlock):\n    r\"\"\"\n    :blockname:`FLATTEN`\n\n    Flatten a multi-dimensional array.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`\\mbox{vec}(\\mathbf{A})`\n\n    Flattens the incoming array in either row major ('C') or column major ('F') order.\n\n    :seealso: `numpy.flatten <https://numpy.org/doc/stable/reference/generated/numpy.flatten.html>`_\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, order=\"C\", **blockargs):\n        \"\"\"\n        :param order: flattening order, either \"C\" or \"F\", defaults to \"C\"\n        :type order: str\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"flatten\"\n        self.order = order\n\n    def output(self, t, inports, x):\n        vec = inports[0]\n        out = vec.flatten(self.order)\n        return [out]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Slice2(FunctionBlock):\n    r\"\"\"\n    :blockname:`SLICE2`\n\n    Slice out subarray of 2D-array.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}_{i\\ldots j, m\\ldots n}`\n\n    Compute a 2D slice of input 2D array.\n\n    If ``rows`` or ``cols`` is ``None`` it means all rows or columns\n    respectively.\n\n    If ``rows`` or ``cols`` is a list, perform NumPy fancy indexing, returning\n    the specified rows or columns\n\n    Example::\n\n        slice = bd.SLICE2(rows=[2,3])  # return rows 2 and 3, all columns\n        slice = bd.SLICE2(cols=[4,1])  # return columns 4 and 1, all rows\n        slice = bd.SLICE2(rows=[2,3], cols=[4,1]) # return elements [2,4] and [3,1] as a 1D array\n\n    If a single row or column is selected, the result will be a 1D array\n\n    If ``rows`` or ``cols`` is a tuple, it must have three elements.  It\n    describes a Python slice ``(start, stop, step)`` where any element can be ``None``\n\n        * ``start=None`` means start at first element\n        * ``stop=None`` means finish at last element\n        * ``step=None`` means step by one\n\n    ``rows=None`` is equivalent to ``rows=(None, None, None)``.\n\n    Example::\n\n        slice = bd.SLICE2(rows=(None,None,2))  # return every second row\n        slice = bd.SLICE2(cols=(None,None,-1)) # reverse the columns\n\n    The list and tuple notation can be mixed, for example, one for rows\n    and one for columns.\n\n    :seealso: :class:`Slice1` :class:`Index`\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, rows=None, cols=None, **blockargs):\n        \"\"\"\n        :param rows: row selection, defaults to None\n        :type rows: tuple(3) or list\n        :param cols: column selection, defaults to None\n        :type cols: tuple(3) or list\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"slice2\"\n\n        if rows is None:\n            self.rows = slice(None, None, None)\n        elif isinstance(rows, list):\n            self.rows = rows\n        elif isinstance(rows, tuple) and len(rows) == 3:\n            self.rows = slice(*rows)\n        else:\n            raise ValueError(\"bad rows specifier\")\n\n        if cols is None:\n            self.cols = slice(None, None, None)\n        elif isinstance(cols, list):\n            self.cols = cols\n        elif isinstance(cols, tuple) and len(cols) == 3:\n            self.cols = slice(*cols)\n        else:\n            raise ValueError(\"bad columns specifier\")\n\n    def output(self, t, inports, x):\n        array = inports[0]\n        if array.ndim != 2:\n            raise RuntimeError(\"Slice2 block expecting 2d array\")\n        return [array[self.rows, self.cols]]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Slice1(FunctionBlock):\n    r\"\"\"\n    :blockname:`SLICE1`\n\n    Slice out subarray of 1D-array.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`v`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`v_{i\\dots j}`\n\n    Compute a 1D slice of input 1D array.\n\n    If ``index`` is ``None`` it means all elements.\n\n    If ``index`` is a list, perform NumPy fancy indexing, returning\n    the specified elements\n\n    Example::\n\n        slice = bd.SLICE1(index=[2,3]) # return elements 2 and 3 as a 1D array\n        slice = bd.SLICE1(index=[2])   # return element 2 as a 1D array\n        slice = bd.SLICE1(index=2)     # return element 2 as a NumPy scalar\n\n    If ``index`` is a tuple, it must have three elements.  It\n    describes a Python slice ``(start, stop, step)`` where any element can be ``None``\n\n        * ``start=None`` means start at first element\n        * ``stop=None`` means finish at last element\n        * ``step=None`` means step by one\n\n    ``rows=None`` is equivalent to ``rows=(None, None, None)``.\n\n    Example::\n\n        slice = bd.SLICE1(index=(None,None,2))  # return every second element\n        slice = bd.SLICE1(index=(None,None,-1)) # reverse the elements\n\n    :seealso: :class:`Slice1`\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, index, **blockargs):\n        \"\"\"\n        :param index: slice, defaults to None\n        :type index: tuple(3)\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"slice1\"\n\n        if index is None:\n            self.index = slice(None, None, None)\n        elif isinstance(index, list):\n            self.index = index\n        elif isinstance(index, tuple) and len(index) == 3:\n            self.index = slice(*index)\n        else:\n            raise ValueError(\"bad index specifier\")\n\n    def output(self, t, inports, x):\n        array = inports[0]\n        if array.ndim != 1:\n            raise RuntimeError(\"Slice1 block expecting 1d array\")\n        return [array[self.index]]\n\n\n# ------------------------------------------------------------------------ #\nclass Det(FunctionBlock):\n    r\"\"\"\n    :blockname:`DET`\n\n    Matrix determinant.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`\\mbox{det}(\\mathbf{A})`\n\n    Compute the matrix determinant.\n\n    :seealso: `numpy.linalg.det <https://numpy.org/doc/stable/reference/generated/numpy.linalg.det.html>`_\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"det\"\n\n    def output(self, t, inports, x):\n        mat = inports[0]\n        out = np.linalg.det(mat)\n        return [out]\n\n\n# ------------------------------------------------------------------------ #\nclass Cond(FunctionBlock):\n    r\"\"\"\n    :blockname:`COND`\n\n    Matrix condition number.\n\n    :inputs: 1\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray\n            - :math:`\\mathbf{A}`\n        *   - Output\n            - 0\n            - ndarray\n            - :math:`\\mbox{cond}(\\mathbf{A})`\n\n    :seealso: `numpy.linalg.cond <https://numpy.org/doc/stable/reference/generated/numpy.linalg.cond.html>`_\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"cond\"\n\n    def output(self, t, inports, x):\n        mat = inports[0]\n        out = np.linalg.cond(mat)\n        return [out]\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n\n    from pathlib import Path\n\n    exec(open(Path(__file__).parent.parent.parent / \"tests\" / \"test_linalg.py\").read())\n"
  },
  {
    "path": "bdsim/blocks/sinks.py",
    "content": "\"\"\"\nSink blocks:\n\n- have inputs but no outputs\n- have no state variables\n- are a subclass of ``SinkBlock`` |rarr| ``Block``\n- that perform graphics are a subclass of  ``GraphicsBlock`` |rarr| ``SinkBlock`` |rarr| ``Block``\n\n\"\"\"\n\n\nimport numpy as np\nfrom math import pi, sqrt, sin, cos, atan2\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import Polygon\n\nfrom bdsim.components import SinkBlock\n\n# ------------------------------------------------------------------------ #\n\n\nclass Print(SinkBlock):\n    \"\"\"\n    :blockname:`PRINT`\n\n    Print signal.\n\n    :inputs: 1\n    :outputs: 0\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - any\n            - :math:`x`\n\n    Creates a console print block which displays the value of the input signal\n    at each simulation time step. The display format is like::\n\n        PRINT(print.0 @ t=0.100) [-1.0 0.2]\n\n    and includes the block name, time, and the formatted value.\n\n    The numerical formatting of the signal is controlled by ``fmt``:\n\n    - if not provided, ``str()`` is used to format the signal\n    - if provided:\n\n        - a scalar is formatted by the ``fmt.format()``\n        - a NumPy array is formatted by ``fmt.format()`` applied to every\n          element\n\n    Examples::\n\n        bd.PRINT(name=\"X\")  # block name appears in the printed text\n        bd.PRINT(fmt=\"{:.1f}\") # print with explicit format\n\n    .. note::\n        - By default writes to stdout\n        - The output is cleaner if progress bar printing is disabled using the\n          ``-p`` command line option.\n    \"\"\"\n\n    nin = 1\n    nout = 0\n\n    def __init__(self, fmt=None, file=None, **blockargs):\n        \"\"\"\n        :param fmt: Format string, defaults to None\n        :type fmt: str, optional\n        :param file: file to write data to, defaults to None\n        :type file: file object, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: A PRINT block\n        :rtype: Print instance\n        \"\"\"\n        super().__init__(**blockargs)\n        self.format = fmt\n        self.file = file\n\n        # TODO format can be a string or function\n\n    def step(self, t, inports):\n        prefix = \"{:12s}\".format(\"PRINT({:s} (t={:.3f})\".format(self.name, t))\n        value = inports[0]\n        if self.format is None:\n            # no format string\n            if hasattr(value, \"strline\"):\n                print(prefix, value.strline(), file=self.file)\n            else:\n                print(prefix, str(value), file=self.file)\n        else:\n            # format string provided\n            if isinstance(value, (int, float)):\n                print(prefix, self.format.format(value), file=self.file)\n\n            elif isinstance(value, np.ndarray):\n                with np.printoptions(\n                    formatter={\"all\": lambda x: self.format.format(x)}\n                ):\n                    print(prefix, value, file=self.file)\n            else:\n                print(prefix, str(value), file=self.file)\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Stop(SinkBlock):\n    \"\"\"\n    :blockname:`STOP`\n\n    Conditionally stop simulation.\n\n    :inputs: 1\n    :outputs: 0\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - any\n            - :math:`x`\n\n    Conditionally stop the simulation if the input :math:`x` is:\n\n    - bool type and True\n    - numeric type and > 0\n\n    If ``func`` is provided, then it is applied to the block input\n    and if it returns True the simulation is stopped.\n    \"\"\"\n\n    nin = 1\n    nout = 0\n\n    def __init__(self, func=None, **blockargs):\n        \"\"\"\n        :param func: evaluate stop condition, defaults to None\n        :type func: callable, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n        if func is not None and not callable(func):\n            raise TypeError(\"argument must be a callable\")\n        self.stopfunc = func\n\n    def start(self, simstate):\n        self._simstate = simstate\n\n    def step(self, t, inports):\n        value = inports[0]\n\n        if self.stopfunc is not None:\n            value = self.stopfunc(value)\n\n        stop = False\n        if isinstance(value, bool):\n            stop = value\n        else:\n            try:\n                stop = value > 0\n            except:\n                raise RuntimeError(\"bad input type to stop block\")\n\n        # we signal stop condition by setting simstate.stop to the block calling\n        # the stop\n        if stop:\n            self._simstate.stop = self\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Null(SinkBlock):\n    \"\"\"\n    :blockname:`NULL`\n\n    Discard signal.\n\n    :inputs: N\n    :outputs: 0\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - any\n            - :math:`x_i`\n\n    Create a sink block with arbitrary number of input ports that discards\n    all data, like ``/dev/null``. Useful for testing.\n\n    .. note:: ``bdsim`` issues a warning for unconnected outputs but execution can continue.\n    \"\"\"\n\n    nin = -1\n    nout = 0\n\n    def __init__(self, nin=1, **blockargs):\n        \"\"\"\n        :param nin: number of input ports, defaults to 1\n        :type nin: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(nin=nin, **blockargs)\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Watch(SinkBlock):\n    \"\"\"\n    :blockname:`WATCH`\n\n    Watch a signal.\n\n    :inputs: N\n    :outputs: 0\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - i\n            - any\n            - :math:`x_i`\n\n    Causes the output ports connected to this block's input ports :math:`x_i` to be\n    logged during the simulation run. Equivalent to adding it as the ``watch=`` argument\n    to ``bdsim.run``.\n\n    For example::\n\n        step = bd.STEP(5)\n        ramp = bd.RAMP()\n        watch = bd.WATCH(2) # watch 2 ports\n        watch[0] = step\n        watch[1] = ramp\n\n    :seealso: :method:`BDSim.run`\n    \"\"\"\n\n    nin = 1\n    nout = 0\n\n    def __init__(self, **blockargs):\n        \"\"\"\n        :param nin: number of input ports, defaults to 1\n        :type nin: int, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n    def start(self, simstate):\n        # called at start of simulation, add this block to the watchlist\n        plug = self.sources[0]  # start plug for input wire\n\n        # append to the watchlist, bdsim.run() will do the rest\n        simstate.watchlist.append(plug)\n        simstate.watchnamelist.append(str(plug))\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n\n    from pathlib import Path\n\n    exec(open(Path(__file__).parent.parent.parent / \"tests\" / \"test_sinks.py\").read())\n"
  },
  {
    "path": "bdsim/blocks/sources.py",
    "content": "\"\"\"\nSource blocks:\n\n- have outputs but no inputs\n- have no state variables\n- are a subclass of ``SourceBlock`` |rarr| ``Block``\n\n\"\"\"\n\nimport numpy as np\nimport math\nfrom bdsim.components import SourceBlock, EventSource\n\n# ------------------------------------------------------------------------ #\nclass Constant(SourceBlock):\n    \"\"\"\n    :blockname:`CONSTANT`\n\n    Constant value.\n\n    :inputs: 0\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Output\n            - 0\n            - any\n            - constant ``value``\n\n    The output value is a constant and can be any\n    Python type, for example float, list or Numpy ndarray.\n    \"\"\"\n\n    nin = 0\n    nout = 1\n\n    def __init__(self, value=0, **blockargs):\n        \"\"\"\n        :param value: the constant, defaults to 0\n        :type value: any, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n        if isinstance(value, (tuple, list)):\n            value = np.array(value)\n        self.value = value\n\n        self.add_param(\"value\")\n\n    def output(self, t, inports, x):\n        return [self.value]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Time(SourceBlock):\n    \"\"\"\n    :blockname:`TIME`\n\n    Simulation time.\n\n    :inputs: 0\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Output\n            - 0\n            - float\n            - :math:`t`\n\n    Outputs the current simulation time.\n\n    For example::\n\n        time = bd.TIME()\n    \"\"\"\n\n    nin = 0\n    nout = 1\n\n    def __init__(self, value=None, **blockargs):\n        \"\"\"\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n    def output(self, t, inports, x):\n        return [t]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass WaveForm(SourceBlock, EventSource):\n    \"\"\"\n    :blockname:`WAVEFORM`\n\n    Waveform generator.\n\n    :inputs: 0\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Output\n            - 0\n            - float\n            - :math:`y(t)`\n\n    A general waveform generator.  For example::\n\n        wave = bd.WAVEFORM(wave='sine', freq=2)   # 2Hz sine wave varying from -1 to 1\n        wave = bd.WAVEFORM(wave='square', freq=2, unit='rad/s') # 2rad/s square wave varying from -1 to 1\n\n    The minimum and maximum values of the waveform are given by default in\n    terms of amplitude and offset. The signals are symmetric about the offset\n    value. For example::\n\n        wave = bd.WAVEFORM(wave='sine') # varies between -1 and +1\n        wave = bd.WAVEFORM(wave='sine', amplitude=2) # varies between -2 and +2\n        wave = bd.WAVEFORM(wave='sine', offset=1) # varies between 0 and +2\n        wave = bd.WAVEFORM(wave='sine', amplitude=2, offset=1) # varies between -1 and +3\n\n    Alternatively we can specify the minimum and maximum values which override\n    amplitude and offset::\n\n        wave = bd.WAVEFORM(wave='triangle', min=0, max=5) # varies between 0 and +5\n\n    At time 0 the sine and triangle wave are zero and increasing, and the\n    square wave has its first rise.  We can specify a phase shift with\n    a number in the range [0,1] where 1 corresponds to one cycle.\n\n    .. note:: For discontinuous signals (square, triangle) the block declares\n        events for every discontinuity.\n\n    :seealso: :meth:`declare_events`\n    \"\"\"\n\n    nin = 0\n    nout = 1\n\n    def __init__(\n        self,\n        wave=\"square\",\n        freq=1,\n        unit=\"Hz\",\n        phase=0,\n        amplitude=1,\n        offset=0,\n        min=None,\n        max=None,\n        duty=0.5,\n        **blockargs,\n    ):\n        \"\"\"\n        :param wave: type of waveform to generate, one of: 'sine', 'square' [default], 'triangle'\n        :type wave: str, optional\n        :param freq: frequency, defaults to 1\n        :type freq: float, optional\n        :param unit: frequency unit, one of: 'rad/s', 'Hz' [default]\n        :type unit: str, optional\n        :param amplitude: amplitude, defaults to 1\n        :type amplitude: float, optional\n        :param offset: signal offset, defaults to 0\n        :type offset: float, optional\n        :param phase: Initial phase of signal in the range [0,1], defaults to 0\n        :type phase: float, optional\n        :param min: minimum value, defaults to None\n        :type min: float, optional\n        :param max: maximum value, defaults to None\n        :type max: float, optional\n        :param duty: duty cycle for square wave in range [0,1], defaults to 0.5\n        :type duty: float, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \"\"\"\n        super().__init__(**blockargs)\n\n        assert 0 < duty < 1, \"duty must be in range [0,1]\"\n\n        if wave in (\"square\", \"triangle\", \"sine\"):\n            self.wave = wave\n        else:\n            raise ValueError(\"bad waveform\")\n        if unit == \"Hz\":\n            self.freq = freq\n        elif unit == \"rad/s\":\n            self.freq = freq / (2 * math.pi)\n        else:\n            raise ValueError(\"bad unit\")\n        if 0 <= phase <= 1:\n            self.phase = phase\n        else:\n            raise ValueError(\"phase out of range\")\n        if max is not None and min is not None:\n            amplitude = (max - min) / 2\n            offset = (max + min) / 2\n            self.min = min\n            self.mablock = max\n        if 0 <= duty <= 1:\n            self.duty = duty\n        else:\n            raise ValueError(\"duty out of range\")\n        self.amplitude = amplitude\n        self.offset = offset\n\n    def start(self, simstate):\n        super().start(simstate)\n\n        if self.wave == \"square\":\n            t1 = self.phase / self.freq\n            t2 = (self.duty + self.phase) / self.freq\n        elif self.wave == \"triangle\":\n            t1 = (0.25 + self.phase) / self.freq\n            t2 = (0.75 + self.phase) / self.freq\n        else:\n            return\n\n        # t1 < t2\n        T = 1.0 / self.freq\n        if simstate is not None:\n            while t1 < simstate.T:\n                simstate.declare_event(self, t1)\n                simstate.declare_event(self, t2)\n                t1 += T\n                t2 += T\n\n    def output(self, t, inports, x):\n        T = 1.0 / self.freq\n        phase = (t * self.freq - self.phase) % 1.0\n\n        # define all signals in the range -1 to 1\n        if self.wave == \"square\":\n            if phase < self.duty:\n                out = 1\n            else:\n                out = -1\n        elif self.wave == \"triangle\":\n            if phase < 0.25:\n                out = phase * 4\n            elif phase < 0.75:\n                out = 1 - 4 * (phase - 0.25)\n            else:\n                out = -1 + 4 * (phase - 0.75)\n        elif self.wave == \"sine\":\n            out = math.sin(phase * 2 * math.pi)\n        else:\n            raise ValueError(\"bad option for signal\")\n\n        out = out * self.amplitude + self.offset\n\n        # print('waveform = ', out)\n        return [out]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Piecewise(SourceBlock, EventSource):\n    \"\"\"\n    :blockname:`PIECEWISE`\n\n    Piecewise constant signal.\n\n    :inputs: 0\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Output\n            - 0\n            - float\n            - :math:`y(t)`\n\n    Generate a signal that is a piecewise constant function of time.  This is described\n    as a series of 2-tuples (time, value).  The output value is taken from the active\n    tuple, that is, the latest one in the list whose time is no greater than simulation\n    time.\n\n    The tuples can be provided in two different ways.  Firstly, a form convenient for\n    Python programming::\n\n        steering = bd.PIECEWISE((0,0), (2, 0.5), (3,0), (4,-0.5), (5,0))\n\n    Secondly, in a form that can be used from ``bdsim`` where we explicitly pass\n    in a list in a way that can be represented in a JSON file::\n\n        steering = bd.PIECEWISE(seq=[(0,0), (3, 0.5), (4,0), (5,-0.5), (6,0)])\n\n    .. plot::\n\n        import matplotlib.pyplot as plt\n        plt.plot([0, 2, 2,   3,   3, 4,   4,   5,   5, 5.2], \n                 [0, 0, 0.5, 0.5, 0, 0, -0.5, -0.5, 0, 0], lw=2)\n        plt.grid(True)\n\n    .. note::\n        - The tuples must be ordered by monotonically increasing time.\n        - There is no default initial value, the list should contain\n          a tuple with time zero otherwise the output will be undefined.\n        - The 2-tuples can\n\n    .. note:: The block declares an event for the start of each segment.\n\n    :seealso: :meth:`declare_events`\n    \"\"\"\n\n    nin = 0\n    nout = 1\n\n    def __init__(self, *args, seq=None, **blockargs):\n        \"\"\"\n        :param seq: sequence of time, value pairs\n        :type seq: list of 2-element iterables\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n\n        \"\"\"\n        super().__init__(**blockargs)\n\n        if len(args) > 0:\n            seq = args\n\n        self.t = [x[0] for x in seq]\n        self.y = [x[1] for x in seq]\n\n    def start(self, simstate):\n        super().start(simstate)\n\n        if simstate is not None:\n            for t in self.t:\n                simstate.declare_event(self, t)\n\n    def output(self, t, inports, x):\n        i = sum([1 if t >= _t else 0 for _t in self.t]) - 1\n        out = self.y[i]\n        # print(out)\n        return [out]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Step(SourceBlock, EventSource):\n    \"\"\"\n    :blockname:`STEP`\n\n    Step signal.\n\n    :inputs: 0\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Output\n            - 0\n            - float\n            - :math:`y(t)`\n\n    Generate a step signal that transitions from the value ``off`` to ``on`` when time\n    equals ``T``.\n\n    Example:\n\n        step = bd.STEP(2, off=-1, on=1)\n\n    .. plot::\n\n        import matplotlib.pyplot as plt\n        plt.plot([0, 2, 2, 5], [-1, -1, 1, 1], lw=2)\n        plt.grid(True)\n\n    .. note:: The block declares an event for the step time.\n\n    :seealso: :meth:`declare_events`\n    \"\"\"\n\n    nin = 0\n    nout = 1\n\n    def __init__(self, T=1, off=0, on=1, **blockargs):\n        \"\"\"\n        :param T: time of step, defaults to 1\n        :type T: float, optional\n        :param off: initial value, defaults to 0\n        :type off: float, optional\n        :param on: final value, defaults to 1\n        :type on: float, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n        self.T = T\n        self.off = off\n        self.on = on\n\n    def start(self, simstate):\n        simstate.declare_event(self, self.T)\n\n    def output(self, t, inports, x):\n        if t >= self.T:\n            out = self.on\n        else:\n            out = self.off\n\n        # print(out)\n        return [out]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass Ramp(SourceBlock, EventSource):\n    \"\"\"\n    :blockname:`RAMP`\n\n    Ramp signal.\n\n    :inputs: 0\n    :outputs: 1\n    :states: 0\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Output\n            - 0\n            - float\n            - :math:`y(t)`\n\n    Generate a signal that starts increasing from the value ``off`` when time equals\n    ``T`` linearly with time, with a gradient of ``slope``.\n\n    Example:\n\n        step = bd.RAMP(2, off=-1, slope=2/3, T=2)\n\n    .. plot::\n\n        import matplotlib.pyplot as plt\n        plt.plot([0, 2, 5], [-1, -1, 5], lw=2)\n        plt.grid(True)\n\n    .. note:: The block declares an event for the ramp start time.\n\n    :seealso: :meth:`declare_event`\n    \"\"\"\n\n    nin = 0\n    nout = 1\n\n    def __init__(self, T=1, off=0, slope=1, **blockargs):\n\n        \"\"\"\n        :param T: time of ramp start, defaults to 1\n        :type T: float, optional\n        :param off: initial value, defaults to 0\n        :type off: float, optional\n        :param slope: gradient of slope, defaults to 1\n        :type slope: float, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n        self.T = T\n        self.off = off\n        self.slope = slope\n\n    def start(self, simstate):\n        simstate.declare_event(self, self.T)\n\n    def output(self, t, inports, x):\n        if t >= self.T:\n            out = self.off + self.slope * (t - self.T)\n        else:\n            out = self.off\n\n        # print(out)\n        return [out]\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n\n    from pathlib import Path\n\n    exec(open(Path(__file__).parent.parent.parent / \"tests\" / \"test_sources.py\").read())\n"
  },
  {
    "path": "bdsim/blocks/spatial.py",
    "content": "try:\n    from spatialmath import SE2, SE3, SO2, SO3\n\n    sm = True\nexcept:\n    sm = False\n\nfrom bdsim.components import FunctionBlock\n\nif sm:\n\n    class Pose_postmul(FunctionBlock):\n        r\"\"\"\n        :blockname:`POSE_POSTMUL`\n\n        Post multiply pose.\n\n        :inputs: 1\n        :outputs: 1\n        :states: 0\n\n        .. list-table::\n            :header-rows: 1\n\n            *   - Port type\n                - Port number\n                - Types\n                - Description\n            *   - Input\n                - 0\n                - SEn, SOn\n                - :math:`\\xi`\n            *   - Output\n                - 0\n                - SEn, SOn\n                - :math:`\\xi \\oplus \\xi_c`\n\n        Postmultiply the input pose by a constant pose.\n\n        .. note:: Pose objects must be of the same type.\n\n        :seealso: :class:`Pose_premul`\n        \"\"\"\n\n        nin = 1\n        nout = 1\n\n        def __init__(self, pose=None, **blockargs):\n            \"\"\"\n            :param pose: pose to apply\n            :type pose: SO2, SE2, SO3 or SE3\n            :param blockargs: |BlockOptions|\n            :type blockargs: dict\n            \"\"\"\n            if not isinstance(pose, (SO2, SO3, SE2, SE3)):\n                raise ValueError(\"pose must be SO2, SE2, SO3 or SE3\")\n\n            super().__init__(**blockargs)\n            self.pose = pose\n\n        def output(self, t, inports, x):\n            input = inports[0]\n            return [input * self.pose]\n\n    # ------------------------------------------------------------------------ #\n\n    class Pose_premul(FunctionBlock):\n        r\"\"\"\n        :blockname:`POSE_PREMUL`\n\n        Pre multiply pose.\n\n        :inputs: 1\n        :outputs: 1\n        :states: 0\n\n        .. list-table::\n            :header-rows: 1\n\n            *   - Port type\n                - Port number\n                - Types\n                - Description\n            *   - Input\n                - 0\n                - SEn, SOn\n                - :math:`\\xi`\n            *   - Output\n                - 0\n                - SEn, SOn\n                - :math:`\\xi_c \\oplus \\xi`\n\n        Premultiply the input pose by a constant pose.\n\n        .. note:: Pose objects must be of the same type.\n\n        :seealso: :class:`Pose_postmul`\n        \"\"\"\n\n        nin = 1\n        nout = 1\n\n        def __init__(self, pose=None, **blockargs):\n            \"\"\"\n            :param pose: pose to apply\n            :type pose: SO2, SE2, SO3 or SE3\n            :param blockargs: |BlockOptions|\n            :type blockargs: dict\n            \"\"\"\n            if not isinstance(pose, (SO2, SO3, SE2, SE3)):\n                raise ValueError(\"pose must be SO2, SE2, SO3 or SE3\")\n\n            super().__init__(**blockargs)\n            self.pose = pose\n\n        def output(self, t, inports, x):\n            input = inports[0]\n            return [self.pose * input]\n\n    # ------------------------------------------------------------------------ #\n\n    class Transform_vector(FunctionBlock):\n        r\"\"\"\n        :blockname:`TRANSFORM_VECTOR`\n\n        Transform a vector.\n\n        :inputs: 2\n        :outputs: 1\n        :states: 0\n\n        .. list-table::\n            :header-rows: 1\n\n            *   - Port type\n                - Port number\n                - Types\n                - Description\n            *   - Input\n                - 0\n                - SEn, SOn\n                - :math:`\\xi`\n            *   - Input\n                - 1\n                - ndarray\n                - :math:`v`, Euclidean 2D or 3D\n            *   - Output\n                - 0\n                - ndarray\n                - :math:`\\xi \\bullet v`\n\n        Linearly transform the input vector by the input pose.\n        \"\"\"\n\n        nin = 2\n        nout = 1\n\n        def __init__(self, **blockargs):\n            \"\"\"\n            :param blockargs: |BlockOptions|\n            :type blockargs: dict\n            \"\"\"\n            super().__init__(nin=2, **blockargs)\n\n        def output(self, t, inports, x):\n            pose = inports[0]\n            if not isinstance(pose, (SO2, SO3, SE2, SE3)):\n                raise ValueError(\"pose must be SO2, SE2, SO3 or SE3\")\n            return [pose * inports[1]]\n\n    # ------------------------------------------------------------------------ #\n\n    class Pose_inverse(FunctionBlock):\n        r\"\"\"\n        :blockname:`POSE_INVERSE`\n\n        Pose inverse.\n\n        :inputs: 1\n        :outputs: 1\n        :states: 0\n\n        .. list-table::\n            :header-rows: 1\n\n            *   - Port type\n                - Port number\n                - Types\n                - Description\n            *   - Input\n                - 0\n                - SEn, SOn\n                - :math:`\\xi`\n            *   - Output\n                - 0\n                - SEn, SOn\n                - :math:`\\ominus \\xi`\n\n        Invert the pose on the input port.\n\n        \"\"\"\n\n        nin = 1\n        nout = 1\n\n        def __init__(self, **blockargs):\n            \"\"\"\n            :param blockargs: |BlockOptions|\n            :type blockargs: dict\n            \"\"\"\n            super().__init__(**blockargs)\n\n        def output(self, t, inports, x):\n            input = inports[0]\n            return [input.inv()]\n\n\n# ------------------------------------------------------------------------ #\n\nif __name__ == \"__main__\":  # pragma: no cover\n\n    from pathlib import Path\n\n    exec(open(Path(__file__).parent.parent.parent / \"tests\" / \"test_spatial.py\").read())\n"
  },
  {
    "path": "bdsim/blocks/transfers.py",
    "content": "\"\"\"\nTransfer blocks:\n\n- have inputs and outputs\n- have state variables\n- are a subclass of ``TransferBlock`` |rarr| ``Block``\n\n\"\"\"\n\nimport numpy as np\nimport scipy.signal\nimport math\nfrom math import sin, cos, atan2, sqrt, pi\nimport matplotlib.pyplot as plt\nfrom spatialmath import base\n\nfrom bdsim.components import TransferBlock, SubsystemBlock\n\n\nclass Integrator(TransferBlock):\n    r\"\"\"\n    :blockname:`INTEGRATOR`\n\n    Continuous-time integrator.\n\n    :inputs: 1\n    :outputs: 1\n    :states: N\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - float, ndarray\n            - :math:`x`\n        *   - Output\n            - 0\n            - any\n            - :math:`y`\n\n    Output is the time integral of the input :math:`y(t) = \\int_0^T x(t) dt`.\n\n    The state can be a scalar or a vector. The initial state, and type, is given by\n    ``x0``.  The shape of the input signal must match ``x0``.\n\n    The minimum and maximum values can be:\n\n        - a scalar, in which case the same value applies to every element of\n          the state vector, or\n        - a vector, of the same shape as ``x0`` that applies elementwise to\n          the state.\n\n    .. note:: The minimum and maximum prevent integration outside the limits,\n        but assume that the initial state is within the limits.\n\n    Integration can be controlled by an ``enable`` function::\n\n        enable(t, u, x): bool\n\n    where the arguments are current time, a list of inputs to the block and the state\n    as an ndarray.  If the function returns False then the integrator's output is set\n    to zero.\n\n    .. todo:: Make enable an optional input to the block, or the input for a subclassed\n        variant of the block.\n\n    :seealso: :class:`Deriv`\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, x0=0, gain=1.0, min=None, max=None, enable=None, **blockargs):\n        \"\"\"\n        :param x0: Initial state, defaults to 0\n        :type x0: array_like, optional\n        :param gain: gain or scaling factor, defaults to 1\n        :type gain: float\n        :param min: Minimum value of state, defaults to None\n        :type min: float or array_like, optional\n        :param max: Maximum value of state, defaults to None\n        :type max: float or array_like, optional\n        :param enable: enable or disable integration\n        :type enable: callable\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n        if isinstance(x0, (int, float)):\n            x0 = np.r_[x0]\n\n        elif isinstance(x0, np.ndarray):\n            if x0.ndim > 1:\n                raise ValueError(\"state must be a 1D vector\")\n        else:\n            x0 = base.getvector(x0)\n\n        self.nstates = x0.shape[0]\n\n        if min is not None:\n            min = base.getvector(min, self.nstates)\n        if max is not None:\n            max = base.getvector(max, self.nstates)\n\n        self._x0 = x0\n        self.min = min\n        self.max = max\n        self.gain = gain\n\n        self._x0 = x0\n        self.min = min\n        self.max = max\n        self.enable = enable\n        if enable is not None and not callable(enable):\n            raise ValueError(\"enable must be callable\")\n        # print(\"nstates\", self.nstates)\n\n    def output(self, t, u, x):\n        return [self.gain * x]\n\n    def deriv(self, t, u, x):\n        xd = base.getvector(u[0])\n        if self.enable is not None and not self.enable(t, u, x):\n            # if enable function returns False then integrator output is jammed at zero\n            self._x = np.zeros(x.shape)\n            return np.zeros(x.shape)\n        if self.min is not None:\n            xd[x < self.min] = 0\n        if self.max is not None:\n            xd[x > self.max] = 0\n\n        return self.gain * xd\n\n\nclass PoseIntegrator(TransferBlock):\n    r\"\"\"\n    :blockname:`POSEINTEGRATOR`\n\n    Continuous-time pose integrator\n\n    :inputs: 1\n    :outputs: 1\n    :states: 6\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - ndarray(6,)\n            - :math:`x`\n        *   - Output\n            - 0\n            - SE3\n            - :math:`y`\n\n    This block integrates spatial velocity over time. The block input is a spatial\n    velocity as a 6-vector :math:`(v_x, v_y, v_z, \\omega_x, \\omega_y, \\omega_z)` and the\n    output is pose as an ``SE3`` instance.\n\n    .. note:: The state vector is a velocity twist.\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, x0=None, **blockargs):\n        r\"\"\"\n        :param x0: Initial pose, defaults to null\n        :type x0: SE3, Twist3, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n\n        if x0 is None:\n            x0 = np.zeros((6,))\n\n        self.nstates = len(x0)\n\n        self._x0 = x0\n\n    def output(self, t, u, x):\n        return [Twist3(x).SE3(1)]\n\n    def deriv(self, t, u, x):\n        return u[0]\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass LTI_SS(TransferBlock):\n    r\"\"\"\n    :blockname:`LTI_SS`\n\n    Continuous-time state-space LTI dynamics\n\n    :inputs: 1\n    :outputs: 1\n    :states: N\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - float, ndarray\n            - :math:`u`\n        *   - Output\n            - 0\n            - float, ndarray\n            - :math:`y`\n\n    Implements the dynamics of a multi-input multi-output (MIMO) linear\n    time invariant (LTI) system described in statespace form.  The dynamics are given by\n\n    .. math::\n\n        \\dot{x} &= A x + B u\n\n        y &= C x\n\n    The order of the states in ``x0`` is consistent with controller canonical\n    form.  A direct passthrough component, typically :math:`D`, is not allowed in order\n    to avoid algebraic loops.\n\n    Examples::\n\n        lti = bd.LTI_SS(A=-2, B=1, C=-1)\n\n    is the system :math:`\\dot{x}=-2x+u, y=-x`.\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, A=None, B=None, C=None, x0=None, **blockargs):\n        r\"\"\"\n        :param N: numerator coefficients, defaults to 1\n        :type N: array_like, optional\n        :param D: denominator coefficients, defaults to [1,1]\n        :type D: array_like, optional\n        :param x0: initial states, defaults to None\n        :type x0: array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        # print('in SS constructor')\n        assert A.shape[0] == A.shape[1], \"A must be square\"\n        n = A.shape[0]\n        if len(B.shape) == 1:\n            nin = 1\n            B = B.reshape((n, 1))\n        else:\n            nin = B.shape[1]\n        assert B.shape[0] == n, \"B must have same number of rows as A\"\n\n        if len(C.shape) == 1:\n            nout = 1\n            assert C.shape[0] == n, \"C must have same number of columns as A\"\n            C = C.reshape((1, n))\n        else:\n            nout = C.shape[0]\n            assert C.shape[1] == n, \"C must have same number of columns as A\"\n\n        super().__init__(**blockargs)\n\n        self.A = A\n        self.B = B\n        self.C = C\n\n        self.nstates = A.shape[0]\n\n        if x0 is None:\n            self._x0 = np.zeros((self.nstates,))\n        else:\n            self._x0 = x0\n\n    def output(self, t, u, x):\n        return list(self.C @ x)\n\n    def deriv(self, t, u, x):\n        # Reshape u and x to (N,1), i.e. column vectors, so\n        # no problems with broadcasting between A@x and B@u\n        x = x.reshape(-1, 1)\n        u = np.array(u).reshape(-1, 1)\n        xd = self.A @ x + self.B @ u\n        return xd.flatten()\n\n\n# ------------------------------------------------------------------------ #\n\n\nclass LTI_SISO(LTI_SS):\n    r\"\"\"\n    :blockname:`LTI_SISO`\n\n    Continuous-time SISO LTI dynamics.\n\n    :inputs: 1\n    :outputs: 1\n    :states: N\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - float\n            - :math:`u`\n        *   - Output\n            - 0\n            - float\n            - :math:`y`\n\n    Implements the dynamics of a single-input single-output (SISO) linear\n    time invariant (LTI) system described by numerator and denominator\n    polynomial coefficients.  The dynamics are given by\n\n    .. math::\n\n        \\frac{Y(s)}{U(s)} = \\frac{N(s)}{D(s)}\n\n    Coefficients are given in the order from highest order to zeroth\n    order, ie. :math:`2s^2 - 4s +3` is ``[2, -4, 3]``.\n\n    Only proper transfer functions, where order of numerator is less\n    than denominator are allowed.\n\n    The order of the states in ``x0`` is consistent with controller canonical\n    form.\n\n    Examples::\n\n        lti = bd.LTI_SISO(N=[1, 2], D=[2, 3, -4])\n\n    is the transfer function :math:`\\frac{s+2}{2s^2+3s-4}`.\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, N=1, D=[1, 1], x0=None, **blockargs):\n        r\"\"\"\n        :param N: numerator coefficients, defaults to 1\n        :type N: array_like, optional\n        :param D: denominator coefficients, defaults to [1,1]\n        :type D: array_like, optional\n        :param x0: initial states, defaults to None\n        :type x0: array_like, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: LTI_SISO block\n        :rtype: ``LTI_SISO`` instance\n        \"\"\"\n        # print('in SISO constscutor')\n\n        if not isinstance(N, list):\n            N = [N]\n        if not isinstance(D, list):\n            D = [D]\n        self.N = N\n        self.D = N\n        n = len(D) - 1\n        nn = len(N)\n        if x0 is None:\n            x0 = np.zeros((n,))\n        assert nn <= n, \"direct pass through is not supported\"\n\n        # convert to numpy arrays\n        # N = np.r_[np.zeros((len(D) - len(N),)), np.array(N)]\n        N = np.array(N)\n\n        D = np.array(D)\n\n        # normalize the coefficients to obtain\n        #\n        #   b_0 s^n + b_1 s^(n-1) + ... + b_n\n        #   ---------------------------------\n        #   a_0 s^n + a_1 s^(n-1) + ....+ a_n\n\n        # normalize so leading coefficient of denominator is one\n        # D0 = D[0]\n        # D = D / D0\n        # N = N / D0\n\n        # A = np.eye(len(D) - 1, k=1)  # control canonic (companion matrix) form\n        # A[-1, :] = -D[1:]\n\n        # B = np.zeros((n, 1))\n        # B[-1] = 1\n\n        # C = (N[1:] - N[0] * D[1:]).reshape((1, n))\n\n        A, B, C, D = scipy.signal.tf2ss(N, D)\n\n        self.num = N\n        self.den = D\n\n        if len(np.flatnonzero(D)) > 0:\n            raise ValueError(\"D matrix is not zero\")\n\n        super().__init__(A=A, B=B, C=C, x0=x0, **blockargs)\n\n        if self.verbose:\n            print(\"A=\", A)\n            print(\"B=\", B)\n            print(\"C=\", C)\n\n        def change_param(self, param, newvalue):\n            if param == \"num\":\n                self.num = newvalue\n            elif param == \"den\":\n                self.den = newvalue\n            self.A, self.B, self.C, self.D = scipy.signal.tf2ss(self.num, self.den)\n\n        self.add_param(\"num\", change_param)\n        self.add_param(\"den\", change_param)\n\n\n# ------------------------------------------------------------------------ #\n\nfrom bdsim.blocks.connections import SubSystem\n\n\nclass Deriv(SubsystemBlock):\n    r\"\"\"\n    :blockname:`DERIV`\n\n    Continuous-time derivative.\n\n    :inputs: 1\n    :outputs: 1\n    :states: N\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - float\n            - :math:`x`\n        *   - Output\n            - 0\n            - float\n            - :math:`y`\n\n    Implements the dynamics of a derivative filter, but to be causal it has a single\n    pole given by ``alpha``.  The dynamics is\n\n    .. math:: \\frac{s}{\\frac{s}{\\alpha} + 1}\n\n    It is implemented as a subsystem with an integrator and a feedback loop.  The\n    initial state of the integrator is given by ``x0``.\n\n    If the initial output of the derivative block is known it can be provided as ``y0``\n    which is related to ``x0`` by :math:`x_0 = - \\alpha y_0`.\n\n    :seealso: :class:`Integrator`\n    \"\"\"\n\n    nin = 1\n    nout = 1\n\n    def __init__(self, alpha, x0=0, y0=None, **blockargs):\n        r\"\"\"\n        :param alpha: filter pole in units of rad/s\n        :type alpha: float\n        :param x0: initial states, defaults to 0\n        :type x0: array_like, optional\n        :param y0: inital outputs\n        :type y0: array_like\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"subsystem\"\n\n        bd = self.bd.runtime.blockdiagram()\n\n        if y0 is not None:\n            x0 = -y0 * alpha\n        integrator = bd.INTEGRATOR(x0=x0)\n        inp = bd.INPORT(1)\n        outp = bd.OUTPORT(1)\n        sum = bd.SUM(\"+-\")\n        gain = bd.GAIN(1.0 / alpha)\n        bd.connect(inp, sum[0])\n        bd.connect(sum[0], gain)\n        bd.connect(gain, outp, integrator)\n        bd.connect(integrator, sum[1])\n\n        # get references to the input and output port blocks\n        self.inport = inp\n        self.outport = outp\n        self.subsystem = bd\n\n        self.ssname = \"derivative\"\n\n# ------------------------------------------------------------------------ #\n\nclass PID(SubsystemBlock):\n    r\"\"\"\n    :blockname:`PID`\n\n    Continuous-time PID control.\n\n    :inputs: 2\n    :outputs: 1\n    :states: 2\n\n    .. list-table::\n        :header-rows: 1\n\n        *   - Port type\n            - Port number\n            - Types\n            - Description\n        *   - Input\n            - 0\n            - float\n            - :math:`x`, plant output\n        *   - Input\n            - 1\n            - float\n            - :math:`x^*`, demanded output\n        *   - Output\n            - 0\n            - any\n            - :math:`u`, control to plant\n\n    Implements the dynamics of a PID controller:\n\n    .. math::\n\n        e &= x^* - x\n\n        u &= Pe + D \\frac{d}{dt} e + I \\int e dt\n\n    If the I or D terms are not required the ``type`` can be specified as ``\"PD\"`` or\n    ``\"PI\"`` in which case the respective gain terms ``I`` and ``D`` will be ignored.\n\n    To reduce noise the derivative is computed by the DERIV block which implements a\n    first-order system\n\n    .. math::\n\n        \\frac{s}{s/a + 1}\n\n    where the pole :math:`a=` ``D_filt`` can be positioned appropriately.\n\n    If ``I_limit`` is provided it specifies the limits of the integrator\n    state, before multiplication by ``I``.  If ``I_limit`` is:\n\n    * a scalar :math:`a` the integrator state is clipped to the interval :math:`[-a, a]`\n    * a 2-tuple :math:`(a,b)` the integrator state is clipped to the interval :math:`[a, b]`\n\n    If ``I_band`` is provided the integrator is reset to zero whenever the\n    error :math:`e` is outside the band given by ``I_band`` which is:\n\n    * a scalar :math:`s` the band is the interval :math:`[-s, s]`\n    * a 2-tuple :math:`(a,b)` the band is the interval :math:`[a, b]`\n\n\n    Examples::\n\n        pid = bd.PID(P=3, D=2, I=1)\n\n    ..note:: The result is a subsystem which will be expanded into 12 blocks for the\n        PID case, fewer for the PI or PD cases.\n\n    :seealso: :class:`Deriv`\n    \"\"\"\n\n    nin = 2\n    nout = 1\n\n    def __init__(\n        self,\n        type: str = \"PID\",\n        P: float = 0.0,\n        D: float = 0.0,\n        I: float = 0.0,\n        D_pole=1,\n        I_limit=None,\n        I_band=None,\n        **blockargs,\n    ):\n        r\"\"\"\n        :param type: the controller type, defaults to \"PID\"\n        :type type: str, optional\n        :param P: proportional gain, defaults to 0\n        :type P: float\n        :param D: derivative gain, defaults to 0\n        :type D: float\n        :param I: integral gain, defaults to 0\n        :type I: float\n        :param D_pole: filter pole for derivative estimate, defaults to 1 rad/s\n        :type D_pole: float\n        :param I_limit: integral limit\n        :type I_limit: float or 2-tuple\n        :param I_band: band within which integral action is active\n        :type I_band: float\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        \"\"\"\n        super().__init__(**blockargs)\n        self.type = \"subsystem\"\n\n        subsystem = self.bd.runtime.blockdiagram()\n\n        bd = blockargs[\"bd\"]\n        blockargs.pop(\"bd\")\n        Pblock = subsystem.GAIN(P)  # proportional gain block\n\n        if \"I\" in type:\n            # if the I term is required, create the block\n            if I_limit is None:\n                min = -np.inf\n                max = np.inf\n            elif isinstance(I_limit, float):\n                min = -I_limit\n                max = I_limit\n            elif isinstance(I_limit, tuple) and len(I_limit) == 2:\n                min, max = I_limit\n\n            if I_band is not None:\n                def ifunc(t, u, x):\n                    return abs(u[0]) < I_band\n            else:\n                ifunc = None\n\n            # integrator block\n            Iblock = subsystem.INTEGRATOR(min=min, max=max, gain=I, enable=ifunc)\n\n        if \"D\" in type:\n            # if the D term is required, create the blocks\n            Dblock = subsystem.DERIV(alpha=D_pole)  # derivative block\n            Dgain = subsystem.GAIN(D)               # derivative gain\n            subsystem.connect(Dblock, Dgain)\n\n        error_sum = subsystem.SUM(\"-+\", name=\"errsum\")  # error summing junction\n        inp = subsystem.INPORT(2)   # PID block inputs\n        outp = subsystem.OUTPORT(1) # PID block output\n\n        # for each case sum the various terms\n        if type == \"PID\":\n            out_sum = subsystem.SUM(\"+++\", name=\"outsum\")\n            subsystem.connect(error_sum, Pblock, Dblock, Iblock)\n            subsystem.connect(Pblock, out_sum[0])\n            subsystem.connect(Iblock, out_sum[1])\n            subsystem.connect(Dgain, out_sum[2])\n        elif type == \"PI\":\n            out_sum = subsystem.SUM(\"++\", name=\"outsum\")\n            subsystem.connect(error_sum, Pblock, Iblock)\n            subsystem.connect(Pblock, out_sum[0])\n            subsystem.connect(Iblock, out_sum[1])\n        elif type == \"PD\":\n            out_sum = subsystem.SUM(\"++\", name=\"outsum\")\n            subsystem.connect(error_sum, Pblock, Dblock)\n            subsystem.connect(Pblock, out_sum[0])\n            subsystem.connect(Dgain, out_sum[1])\n    \n        subsystem.connect(inp, error_sum)\n        subsystem.connect(out_sum, outp)\n\n        subsystem.report()\n        # super().__init__(subsystem, name=name, bd=bd)\n        # get references to the input and output port blocks\n        self.inport = inp\n        self.outport = outp\n        self.subsystem = subsystem\n\n        self.ssname = \"PID\"\n\nif __name__ == \"__main__\":\n\n    from bdsim import BDSim\n\n    sim = BDSim(hold=False)\n    bd = sim.blockdiagram()\n    deriv = bd.DERIV(alpha=0.1, verbose=True)\n\n    c = bd.WAVEFORM(wave=\"sine\", freq=1)\n    s = bd.SCOPE(2)\n    bd.connect(c, deriv, s[0])\n    bd.connect(deriv, s[1])\n\n    bd.compile()\n    bd.report_summary()\n    out = sim.run(bd, 10, dt=0.02)\n\n    import matplotlib.pyplot as plt\n\n    plt.plot(out.t, out.x)\n    sim.done(bd, block=True)\n\n    # sim = BDSim()\n    # bd = sim.blockdiagram()\n    # pid = bd.PID(P=2, D=0.01, verbose=True)\n\n    # c = bd.CONSTANT(1)\n    # s = bd.SCOPE()\n    # bd.connect(c, pid)\n    # bd.connect(pid, s)\n\n    # bd.compile(report=True)\n    # bd.report()\n\n    # from pathlib import Path\n\n    # exec(\n    #     open(Path(__file__).parent.parent.parent / \"tests\" / \"test_transfers.py\").read()\n    # )\n"
  },
  {
    "path": "bdsim/blocks/vision.py",
    "content": "\"\"\"\nDefine vision processing blocks for use in block diagrams.  These are blocks that:\n\n- have inputs or outputs\n- have no state variables\n- are a subclass of ``SourceBlock``, ``SinkBlock`` or ``FunctionBlock``\n\n\"\"\"\n# The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.\n\n\n# camera\n# display\n# threshold\n# blobs\n# colorseg\n\n# surf mesh (XYZ) display\n# STL display\n"
  },
  {
    "path": "bdsim/components.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nComponents of the simulation system, namely blocks, wires and plugs.\n\"\"\"\nimport types\nimport math\nfrom re import S\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import animation\nfrom collections import UserDict\n\n# decorator for debugging implicit block creation with operator overloading\ndef oodebug(func):\n    def wrapper(*args, **kwargs):\n        ret = func(*args, **kwargs)\n        # print(f\"{func.__qualname__}{args} --> {ret}\")\n        return ret\n\n    return wrapper\n\n\nclass BDStruct:\n    \"\"\"\n    A simple data container object that allows items to be added by attribute or by\n    index.\n\n    For example::\n\n        >>> d = BDStruct('thing')\n        >>> d.foo = 1\n        >>> d.foo\n        1\n        >>> d[\"foo\"]\n        ]\n        >>> d[\"bar\"] = 2\n        >>> d.bar\n        >>> d\n        bar   = 2 (int)\n        foo   = 1 (int)\n    \"\"\"\n\n    def __init__(self, name=\"BDStruct2\", **kwargs):\n        self._name = name\n        for key, value in kwargs.items():\n            # self.__dict__[key] = value\n            setattr(self, key, value)\n\n    def add(self, name, value):\n        # self.__dict__[name] = value\n        setattr(self, name, value)\n\n    def __repr__(self):\n        return str(self)\n\n    def __len__(self):\n        return len([k for k in self.__dict__.keys() if not k.startswith(\"_\")])\n\n    def __getitem__(self, key):\n        return getattr(self, key)\n\n    def __setitem__(self, key, value):\n        setattr(self, key, value)\n\n    def __str__(self):\n        \"\"\"\n        Display struct as a string\n\n        :return: struct in indented string format\n        :rtype: str\n\n        The struct is rendered with one line per element, and substructures\n        are indented.\n        \"\"\"\n        rows = []\n\n        if len(self) == 0:\n            return \"\"\n        maxwidth = max([len(key) for key in self.__dict__.keys()])\n        # if self.name is not None:\n        #     rows.append(self.name + '::')\n        for k, v in sorted(self.__dict__.items(), key=lambda x: x[0]):\n            if k.startswith(\"_\"):\n                continue\n            if isinstance(v, BDStruct):\n                rows.append(\"{:s}.{:s}::\".format(k.ljust(maxwidth), v._name))\n                rows.append(\n                    \"\\n\".join(\n                        [\" \" * (maxwidth + 3) + line for line in str(v).split(\"\\n\")]\n                    )\n                )\n            elif isinstance(v, str):\n                rows.append(\n                    '{:s} = \"{:s}\" ({:s})'.format(\n                        k.ljust(maxwidth), str(v), type(v).__name__\n                    )\n                )\n            elif isinstance(v, np.ndarray):\n                rows.append(\n                    \"{:s} = ndarray:{:s} {:s}\".format(\n                        k.ljust(maxwidth), v.dtype.type.__name__, str(v.shape)\n                    )\n                )\n            else:\n                rows.append(\n                    \"{:s} = {:s} ({:s})\".format(\n                        k.ljust(maxwidth), str(v), type(v).__name__\n                    )\n                )\n\n        return \"\\n\".join(rows)\n\n    def dump(self, outfile):\n        import pickle\n\n        with open(outfile, \"wb\") as f:\n            pickle.dump(self, f)\n\n\nclass OptionsBase:\n    \"\"\"A struct like object for option handling\n\n    Maintains an internal dict to keep options and their values.  Some of these\n    values, names in the ``_priority`` list are read-only and cannot be changed.\n\n    Values can be read/written as attributes, or the ``set`` method can take\n    a sequence of ``option=value`` arguments.\n    \"\"\"\n\n    def __init__(self, readonly={}, args={}):\n        self._readonly = list(readonly)\n        self._dict = {**args, **readonly}\n\n    def items(self):\n        return self._dict.items()\n\n    def __getattr__(self, name):\n        try:\n            if name.startswith(\"_\"):\n                return self.__dict__[name]\n            else:\n                return self.__dict__[\"_dict\"][name]\n        except KeyError:\n            raise AttributeError(name)\n\n    def __setattr__(self, name, value):\n        if name.startswith(\"_\"):\n            self.__dict__[name] = value\n        else:\n            dict = self.__dict__[\"_dict\"]\n            if name not in self._readonly:\n                dict[name] = value\n                self.__dict__[\"_dict\"] = self.sanity(dict)\n\n    def set(self, **changes):\n        changes = self.sanity(changes)\n        dict = self._dict\n        for name, value in changes.items():\n            if name not in self._readonly:\n                dict[name] = value\n            elif dict[name] != value:\n                print(\n                    f\"attempt to programmatically set option {name}={value} is\"\n                    f\" overriden by command line option {name}={dict[name]}, ignored\"\n                )\n\n        self._dict = dict\n\n    def sanity(self, options):\n        return options\n\n    def __str__(self):\n        dict = self._dict\n        maxwidth = max([len(option) for option in dict.keys()])\n        options = sorted(dict.keys())\n        return \"\\n\".join(\n            [f\"{option.ljust(maxwidth)}: {dict[option]}\" for option in options]\n        )\n\n    def __repr__(self):\n        return str(self)\n\n\nclass Wire:\n    \"\"\"\n    Create a wire.\n\n    :param start: Plug at the start of a wire, defaults to None\n    :type start: Plug, optional\n    :param end: Plug at the end of a wire, defaults to None\n    :type end: Plug, optional\n    :param name: Name of wire, defaults to None\n    :type name: str, optional\n    :return: A wire object\n    :rtype: Wire\n\n    A Wire object connects two block ports.  A Wire has a reference to the\n    start and end ports.\n\n    A wire records all the connections defined by the user.  At compile time\n    wires are used to build inter-block references.\n\n    Between two blocks, a wire can connect one or more ports, ie. it can connect\n    a set of output ports on one block to a same sized set of input ports on\n    another block.\n    \"\"\"\n\n    def __init__(self, start=None, end=None, name=None):\n\n        self.name = name\n        self.id = None\n        self.start = start\n        self.end = end\n        self.value = None\n        self.type = None\n        self.name = None\n\n    @property\n    def info(self):\n        \"\"\"\n        Interactive display of wire properties.\n\n        Displays all attributes of the wire for debugging purposes.\n\n        \"\"\"\n        print(\"wire:\")\n        for k, v in self.__dict__.items():\n            print(\"  {:8s}{:s}\".format(k + \":\", str(v)))\n\n    def __repr__(self):\n        \"\"\"\n        Display wire with name and connection details.\n\n        :return: Long-form wire description\n        :rtype: str\n\n        String format::\n\n            wire.5: d2goal[0] --> Kv[0]\n\n        \"\"\"\n        return str(self) + \": \" + self.fullname\n\n    @property\n    def fullname(self):\n        \"\"\"\n        Display wire connection details.\n\n        :return: Wire name\n        :rtype: str\n\n        String format::\n\n            d2goal[0] --> Kv[0]\n\n        \"\"\"\n        return \"{:s}[{:d}] --> {:s}[{:d}]\".format(\n            str(self.start.block), self.start.port, str(self.end.block), self.end.port\n        )\n\n    def __str__(self):\n        \"\"\"\n        Display wire name.\n\n        :return: Wire name\n        :rtype: str\n\n        String format::\n\n            wire.5\n\n        \"\"\"\n        s = \"wire.\"\n        if self.name is not None:\n            s += self.name\n        elif self.id is not None:\n            s += str(self.id)\n        else:\n            s += \"??\"\n        return s\n\n\n# ------------------------------------------------------------------------- #\n\n\nclass Plug:\n    \"\"\"\n    Create a plug.\n\n    :param block: The block being plugged into\n    :type block: Block\n    :param port: The port on the block, defaults to 0\n    :type port: int, optional\n    :param type: 'start' or 'end', defaults to None\n    :type type: str, optional\n    :return: Plug object\n    :rtype: Plug\n\n    Plugs are the interface between a wire and block and have information\n    about port number and wire end. Plugs are on the end of each wire, and connect a\n    Wire to a specific port on a Block.\n\n    The ``type`` argument indicates if the ``Plug`` is at:\n        - the start of a wire, ie. the port is an output port\n        - the end of a wire, ie. the port is an input port\n\n    A plug can specify a set of ports on a block.\n\n    \"\"\"\n\n    __array_ufunc__ = None  # allow block operators with NumPy values\n\n    def __init__(self, block, port=0, type=None):\n\n        self.block = block\n        self.port = port\n        self.type = type  # start\n\n    def __str__(self):\n        \"\"\"\n        Display plug details.\n\n        :return: Plug description\n        :rtype: str\n\n        String format::\n\n            bicycle.0[1]\n\n        \"\"\"\n        return str(self.block) + \"[\" + str(self.port) + \"]\"\n\n    def __repr__(self):\n        \"\"\"\n        Display plug details.\n\n        :return: Plug description\n        :rtype: str\n\n        String format::\n\n            bicycle.0[1]\n\n        \"\"\"\n        return \"Plug/\" + self.type + \":\" + str(self)\n\n    @property\n    def isslice(self):\n        \"\"\"\n        Test if port number is a slice.\n\n        :return: Whether the port is a slice\n        :rtype: bool\n\n        Returns ``True`` if the port is a slice, eg. ``[0:3]``, and ``False``\n        for a simple index, eg. ``[2]``.\n        \"\"\"\n        return isinstance(self.port, slice)\n\n    @property\n    def portlist(self):\n        \"\"\"\n        Return port numbers.\n\n        :return: Port numbers\n        :rtype: iterable of int\n\n        If the port is a simple index, eg. ``[2]`` returns [2].\n\n        If the port is a slice, eg. ``[0:3]``, returns [0, 1, 2].\n        For the case ``[2:]`` the upper bound is the maximum number of input\n        or output ports of the block.\n        \"\"\"\n        if isinstance(self.port, int):\n            # easy case, this plug is a single wire\n            return [self.port]\n\n        elif isinstance(self.port, slice):\n            # this plug is a bunch of wires\n            start = self.port.start or 0\n            step = self.port.step or 1\n            if self.port.stop is None:\n                if self.type == \"start\":\n                    stop = self.block.nout\n                else:\n                    stop = self.block.nin\n            else:\n                stop = self.port.stop\n\n            return range(start, stop, step)\n        else:\n            return ValueError(\"bad plug index\")\n\n    def __getitem__(self, i):\n        return self.__class__(self.block, self.portlist[i])\n\n    @property\n    def width(self):\n        \"\"\"\n        Return number of ports connected.\n\n        :return: Number of ports\n        :rtype: int\n\n        If the port is a simple index, eg. ``[2]`` returns 1.\n\n        If the port is a slice, eg. ``[0:3]``, returns 3.\n        \"\"\"\n        return len(self.portlist)\n\n    @oodebug\n    def __rshift__(left, right):\n        \"\"\"\n        Overloaded >> operator for implicit wiring.\n\n        :param left: A plug to be wired from\n        :type left: Plug\n        :param right: A block or plug to be wired to\n        :type right: Block or Plug\n        :return: ``right``\n        :rtype: Block or Plug\n\n        Implements implicit wiring, where the left-hand operator is a Plug, for example::\n\n            a = bike[2] >> bd.GAIN(3)\n\n        will connect port 2 of ``bike`` to the input of the GAIN block.\n\n        Note that::\n\n           a = bike[2] >> func[1]\n\n        will connect port 2 of ``bike`` to port 1 of ``func``, and port 1 of ``func``\n        will be assigned to ``a``.  To specify a different outport port on ``func``\n        we need to use parentheses::\n\n            a = (bike[2] >> func[1])[0]\n\n        which will connect port 2 of ``bike`` to port 1 of ``func``, and port 0 of ``func``\n        will be assigned to ``a``.\n\n        :seealso: Block.__mul__\n        \"\"\"\n\n        # called for the cases:\n        # block * block\n        # block * plug\n        s = left.block.bd\n        # assert isinstance(right, Block), 'arguments to * must be blocks not ports (for now)'\n        w = s.connect(left, right)  # add a wire\n        # print('plug * ' + str(w))\n        return right\n\n    @oodebug\n    def __add__(self, other):\n        \"\"\"\n        Overloaded + operator for implicit block creation.\n\n        :param self: A signal (plug) to be added\n        :type self: Plug\n        :param other: A signal (block or plug) to be added\n        :type other: Block or Plug\n        :return: SUM block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the + operator when the left operand is a ``Plug``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X[i] + Y\n            result = X[i] + Y[j]\n            result = X[i] + C\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Create a ``SUM(\"++\")`` block named ``_sum.N`` whose inputs are the\n        left and right operands.  For the third case, a new ``CONSTANT(C)`` block\n        named ``_const.N`` is also created.\n\n        :seealso: :meth:`Plug.__radd__` :meth:`Block.__add__`\n        \"\"\"\n        if isinstance(other, (int, float, np.ndarray)):\n            # plug + constant, create a CONSTANT block\n            other = self.block.bd.CONSTANT(other)\n        return self.block.bd.SUM(\"++\", inputs=(self, other))\n\n    @oodebug\n    def __radd__(self, other):\n        \"\"\"\n        Overloaded + operator for implicit block creation.\n\n        :param self: A signal (plug) to be added\n        :type self: Plug\n        :param other: A signal (block or plug) to be added\n        :type other: Block or Plug\n        :return: SUM block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the + operator when the right operand is a ``Plug``\n        and the left operand is a ``Plug``, ``Block`` or constant::\n\n            result = X + Y[j]\n            result = X[i] + Y[j]\n            result = C + Y[j]\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Create a ``SUM(\"++\") block named ``_sum.N`` whose inputs are the\n        left and right operands.  For the third case, a new ``CONSTANT(C)`` block\n        named ``_const.N`` is also created.\n\n        .. note:: The inputs to the summing junction are reversed: right then left operand.\n\n        :seealso: :meth:`Plug.__add__` :meth:`Block.__radd__`\n        \"\"\"\n        if isinstance(other, (int, float, np.ndarray)):\n            # constant + plug, create a CONSTANT block\n            other = self.block.bd.CONSTANT(other)\n        return self.block.bd.SUM(\"++\", inputs=(other, self))\n\n    @oodebug\n    def __sub__(self, other):\n        \"\"\"\n        Overloaded - operator for implicit block creation.\n\n        :param self: A signal (plug) to be added (minuend)\n        :type self: Plug\n        :param other: A signal (block or plug) to be subtracted (subtrahend)\n        :type other: Block or Plug\n        :return: SUM block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the - operator when the left operand is a ``Plug``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X[i] - Y\n            result = X[i] - Y[j]\n            result = X[i] - C\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Create a ``SUM(\"+-\")`` block named ``_sum.N`` whose inputs are the\n        left and right operands.  For the third case, a new ``CONSTANT(C)`` block\n        named ``_const.N`` is also created.\n\n        .. note::\n                * The ``mode`` is None, regular addition\n\n        :seealso: :meth:`Plug.__rsub__` :meth:`Block.__sub__`\n        \"\"\"\n        if isinstance(other, (int, float, np.ndarray)):\n            # plug - constant, create a CONSTANT block\n            other = self.block.bd.CONSTANT(other)\n        return self.block.bd.SUM(\"+-\", inputs=(self, other))\n\n    @oodebug\n    def __rsub__(self, other):\n        \"\"\"\n        Overloaded - operator for implicit block creation.\n\n        :param self: A signal (plug) to be added (minuend)\n        :type self: Plug\n        :param other: A signal (block or plug) to be subtracted (subtrahend)\n        :type other: Block or Plug\n        :return: SUM block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the - operator when the left operand is a ``Plug``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X - Y[j]\n            result = X[i] - Y[j]\n            result = C - Y[j]\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Create a ``SUM(\"+-\")`` block named ``_sum.N`` whose inputs are the\n        left and right operands.  For the third case, a new ``CONSTANT(C)`` block\n        named ``_const.N`` is also created.\n\n        .. note:: The inputs to the summing junction are reversed: right then left operand.\n\n        :seealso: :meth:`Plug.__sub__` :meth:`Block.__rsub__`\n        \"\"\"\n        # TODO deal with other cases as per above\n        if isinstance(other, (int, float, np.ndarray)):\n            # constant - plug, create a CONSTANT block\n            other = self.block.bd.CONSTANT(other)\n        return self.block.bd.SUM(\"+-\", inputs=(other, self))\n\n    @oodebug\n    def __neg__(self):\n        \"\"\"\n        Overloaded unary minus operator for implicit block creation.\n\n        :param self: A signal (plug) to be negated\n        :type self: Plug\n        :return: GAIN block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the - operator for unary minus when the operand is a ``Plug``::\n\n            result = -X[i]\n\n        where ``X`` is a block.\n\n        Create a ``GAIN(-1)`` block named ``_gain.N`` whose input is the\n        operand.\n\n        :seealso: :meth:`Block.__neg__`\n        \"\"\"\n        return self.block.bd.GAIN(-1, inputs=[self])\n\n    @oodebug\n    def __pow__(self, p):\n        \"\"\"\n        Overloaded unary power operator for implicit block creation.\n\n        :param self: A signal (plug) to be exponentiated\n        :type self: Plug\n        :return: POW block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the ** operator for unary power when the operand is a ``Block``::\n\n            result = X**3\n\n        where ``X`` is a block.\n\n        Creates a ``POW(3)`` block named ``_pow.N`` whose input is the\n        operand.\n\n        :seealso: :meth:`Plug.__pow__`\n        \"\"\"\n        return self.block.bd.POW(p, inputs=[self])\n\n    @oodebug\n    def __mul__(self, other):\n        \"\"\"\n        Overloaded * operator for implicit block creation.\n\n        :param self: A signal (plug) to be multiplied\n        :type self: Plug\n        :param other: A signal (block or plug) to be multiplied\n        :type other: Block or Plug\n        :return: PROD or GAIN block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the * operator when the left operand is a ``Plug``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X[i] * Y\n            result = X[i] * Y[j]\n            result = X[i] * C\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Create a ``PROD(\"**\")`` block named ``_prod.N`` whose inputs are the\n        left and right operands.\n\n        For the third case, create a ``GAIN(C)`` block named ``_gain.N``.\n\n        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy\n            array then the option ``matrix`` is set to True.\n\n        :seealso: :meth:`Plug.__rmul__` :meth:`Block.__mul__`\n        \"\"\"\n        if isinstance(other, (int, float, np.ndarray)):\n            # plug * constant, create a GAIN block\n            return self.block._autogain(other, inputs=[self])\n        else:\n            # value * value, create a PROD block\n            name = \"_prod.{:d}\".format(self.bd.n_auto_prod)\n            self.bd.n_auto_prod += 1\n            return self.block.bd.PROD(\n                \"**\", matrix=True, name=name, inputs=[self, other]\n            )\n\n    @oodebug\n    def __rmul__(self, other):\n        \"\"\"\n        Overloaded * operator for implicit block creation.\n\n        :param self: A signal (plug) to be multiplied\n        :type self: Plug\n        :param other: A signal (block or plug) to be multiplied\n        :type other: Block or Plug\n        :return: PROD or GAIN block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the * operator when the right operand is a ``Plug``\n        and the left operand is a ``Plug``, ``Block`` or constant::\n\n            result = X * Y[j]\n            result = X[i] * Y[j]\n            result = C * Y[j]\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        For the first two cases, a ``PROD(\"**\")`` block named ``_prod.N`` whose inputs are the\n        left and right operands.\n\n        For the third case, create a ``GAIN(C)`` block named ``_gain.N``.\n\n        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy\n            array then the option ``matrix`` is set to True.\n\n        :seealso: :meth:`Plug.__mul__` :meth:`Block.__rmul__`\n        \"\"\"\n        if isinstance(other, (int, float, np.ndarray)):\n            # constant * plug, create a CONSTANT block\n            matrix = isinstance(other, np.ndarray)\n            return self.block._autogain(other, premul=matrix, inputs=[self])\n\n    @oodebug\n    def __truediv__(self, other):\n        \"\"\"\n        Overloaded / operator for implicit block creation.\n\n        :param self: A signal (plug) to be multiplied (dividend)\n        :type self: Plug\n        :param other: A signal (block or plug) to be divided (divisor)\n        :type other: Block or Plug\n        :return: PROD or GAIN block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the / operator when the left operand is a ``Plug``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X[i] / Y\n            result = X[i] / Y[j]\n            result = X[i] / C\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Create a ``PROD(\"**\")`` block named ``_prod.N`` whose inputs are the\n        left and right operands.\n\n        For the third case, create a ``GAIN(1/C)`` block named ``_gain.N``.\n\n        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy\n            array then the option ``matrix`` is set to True.\n\n        :seealso: :meth:`Plug.__rtruediv__` :meth:`Block.__truediv__`\n        \"\"\"\n        if isinstance(other, (int, float, np.ndarray)):\n            # plug / constant , create a CONSTANT block\n            other = self.block.bd.CONSTANT(other)\n        return self.block.bd.PROD(\"*/\", inputs=(self, other))\n\n    @oodebug\n    def __rtruediv__(self, other):\n        \"\"\"\n        Overloaded / operator for implicit block creation.\n\n        :param self: A signal (plug) to be multiplied (dividend)\n        :type self: Plug\n        :param other: A signal (block or plug) to be divided (divisor)\n        :type other: Block or Plug\n        :return: PROD block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the / operator when the right operand is a ``Plug``\n        and the left operand is a ``Plug``, ``Block`` or constant::\n\n            result = X / Y[j]\n            result = X[i] / Y[j]\n            result = C / Y[j]\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        For the first two cases, a ``PROD(\"*/\")`` block named ``_prod.N`` whose inputs are the\n        left and right operands.  For the third case, a new CONSTANT block\n        named ``_const.N`` is also created.\n\n        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy\n            array then the option ``matrix`` is set to True.\n\n        :seealso: :meth:`Plug.__truediv__` :meth:`Block.__rtruediv__`\n        \"\"\"\n        if isinstance(other, (int, float, np.ndarray)):\n            # constant / plug, create a CONSTANT block\n            other = self.block.bd.CONSTANT(other)\n        return self.block.bd.PROD(\"*/\", inputs=(other, self))\n\n\nclass StartPlug(Plug):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, type=\"start\", **kwargs)\n\n\nclass EndPlug(Plug):\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, type=\"end\", **kwargs)\n\n\n# ------------------------------------------------------------------------- #\n\nclocklist = []\n\n\nclass Clock:\n    def __init__(self, arg, unit=\"s\", offset=0, name=None):\n        global clocklist\n        if unit == \"s\":\n            self.T = arg\n        elif unit == \"ms\":\n            self.T = arg / 1000\n        elif unit == \"Hz\":\n            self.T = 1 / arg\n        else:\n            raise ValueError(\"unknown clock unit\", unit)\n\n        self.offset = offset\n\n        self.blocklist = []\n\n        self.x = []  # discrete state vector numpy.ndarray\n        self.t = []\n        self.tick = 0\n        self.timer = None\n\n        if name is None:\n            self.name = \"clock.\" + str(len(clocklist))\n        else:\n            self.name = name\n\n        clocklist.append(self)\n\n        # events happen at time t = kT + offset\n\n    def add_block(self, block):\n        self.blocklist.append(block)\n\n    def __repr__(self):\n        return str(self)\n\n    def __str__(self):\n        s = f\"{self.name}: T={self.T} sec\"\n        if self.offset != 0:\n            s += f\", offset={self.offset}\"\n        s += f\", clocking {len(self.blocklist)} blocks\"\n        return s\n\n    def getstate0(self):\n        # get the state from each stateful block on this clock\n        x0 = np.array([])\n        for b in self.blocklist:\n            x0 = np.r_[x0, b.getstate0()]\n            # print('x0', x0)\n        return x0\n\n    def getstate(self, t):\n\n        x = np.array([])\n        for b in self.blocklist:\n            # update dstate\n            xb = b.next(t, b.inputs, b._x)\n            x = np.r_[x, xb.flatten()]\n\n        return x\n\n    def setstate(self):\n        x = self._x\n        for b in self.blocklist:\n            x = b.setstate(x)  # send it to blocks\n\n    def start(self, simstate=None):\n        self.i = 1\n        simstate.declare_event(self, self.time(self.i))\n        self.i += 1\n\n    def next_event(self, simstate=None):\n        simstate.declare_event(self, self.time(self.i))\n        self.i += 1\n\n    def time(self, i):\n        # return (math.floor((t - self.offset) / self.T) + 1) * self.T + self.offset\n        # k = int((t - self.offset) / self.T + 0.5)\n        return i * self.T + self.offset\n\n    def savestate(self, t):\n        # save clock state at time t\n        self.t.append(t)\n        self.x.append(self.getstate(t))\n\n\n# ------------------------------------------------------------------------- #\n\n\nclass Block:\n\n    varinputs = False\n    varoutputs = False\n\n    __array_ufunc__ = None  # allow block operators with NumPy values\n\n    def __new__(cls, *args, bd=None, **kwargs):\n        \"\"\"\n        Construct a new Block object.\n\n        :param cls: The class to construct\n        :type cls: class type\n        :param *args: positional args passed to constructor\n        :type *args: list\n        :param **kwargs: keyword args passed to constructor\n        :type **kwargs: dict\n        :return: new Block instance\n        :rtype: Block instance\n        \"\"\"\n        # print('Block __new__', args,bd, kwargs)\n        block = super(Block, cls).__new__(cls)  # create a new instance\n\n        # we overload setattr, so need to know whether it is being passed a port\n        # name.  Add this attribute now to allow proper operation.\n        block.__dict__[\"portnames\"] = []  # must be first, see __setattr__\n\n        block.nstates = 0\n        block.ndstates = 0\n        block._sequence = None\n        block._x = None  # state vector\n\n        return block\n\n    _latex_remove = str.maketrans({\"$\": \"\", \"\\\\\": \"\", \"{\": \"\", \"}\": \"\", \"^\": \"\"})\n\n    def __init__(\n        self,\n        name=None,\n        nin=None,\n        nout=None,\n        inputs=None,\n        type=None,\n        inames=None,\n        onames=None,\n        snames=None,\n        pos=None,\n        bd=None,\n        blockclass=None,\n        verbose=False,\n        **kwargs,\n    ):\n\n        \"\"\"\n        Construct a new block object.\n\n        :param name: Name of the block, defaults to None\n        :type name: str, optional\n        :param nin: Number of inputs, defaults to None\n        :type nin: int, optional\n        :param nout: Number of outputs, defaults to None\n        :type nout: int, optional\n        :param inputs: Optional incoming connections\n        :type inputs: Block, Plug or list of Block or Plug\n        :param inames: Names of input ports, defaults to None\n        :type inames: list of str, optional\n        :param onames: Names of output ports, defaults to None\n        :type onames: list of str, optional\n        :param snames: Names of states, defaults to None\n        :type snames: list of str, optional\n        :param pos: Position of block on the canvas, defaults to None\n        :type pos: 2-element tuple or list, optional\n        :param bd: Parent block diagram, defaults to None\n        :type bd: BlockDiagram, optional\n        :param verbose: enable diagnostic prints, defaults to False\n        :type verbose: bool, optional\n        :param kwargs: Unused arguments\n        :type kwargs: dict\n        :return: A Block superclass\n        :rtype: Block\n\n        A block object is the superclass of all blocks in the simulation environment.\n\n        This is the top-level initializer, and handles most options passed to\n        the superclass initializer for each block in the library.\n\n        \"\"\"\n\n        # print('Block constructor, bd = ', bd)\n        if name is not None:\n            self.name_tex = name\n            self.name = self._fixname(name)\n        else:\n            self.name_tex = None\n            self.name = None\n\n        self.bd = bd\n        self.pos = pos\n        self.id = None\n        self.out = []\n        self.inputs = None\n        self.updated = False\n        self.shape = \"block\"  # for box\n        self._inport_names = None\n        self._outport_names = None\n        self._state_names = None\n        self.initd = True\n        self._clocked = False\n        self._graphics = False\n        self._parameters = {}\n        self.verbose = verbose\n\n        if nin is not None:\n            self.nin = nin\n        if nout is not None:\n            self.nout = nout\n        if blockclass is not None:\n            self.blockclass = blockclass\n\n        if type is None:\n            self.type = self.__class__.__name__.lower()\n\n        if bd is not None:\n            bd.add_block(self)\n\n        if inames is not None:\n            self.inport_names(inames)\n        if onames is not None:\n            self.outport_names(onames)\n        if snames is not None:\n            self.state_names(snames)\n\n        if isinstance(inputs, Block):\n            inputs = (inputs,)\n        if inputs is not None and len(inputs) > 0:\n            # assert len(inputs) == self.nin, 'Number of input connections must match number of inputs'\n            for i, input in enumerate(inputs):\n                self.bd.connect(input, Plug(self, port=i))\n\n        if len(kwargs) > 0:\n            print(\"WARNING: unused arguments\", kwargs.keys())\n\n    def add_param(self, param, handler=None):\n        if handler == None:\n\n            def handler(self, name, newvalue):\n                setattr(self, name, newvalue)\n\n        self.__dict__[\"_parameters\"][param] = handler\n\n    def set_param(self, name, newvalue):\n        print(f\"setting parameter {name} of block {self.name} to {newvalue}\")\n        self._parameters[name](self, name, newvalue)\n\n    @property\n    def info(self):\n        \"\"\"\n        Interactive display of block properties.\n\n        Displays all attributes of the block for debugging purposes.\n\n        \"\"\"\n        print(\"block: \" + type(self).__name__)\n        for k, v in self.__dict__.items():\n            if k != \"sim\":\n                print(\"  {:11s}{:s}\".format(k + \":\", str(v)))\n\n    @property\n    def isclocked(self):\n        \"\"\"\n        Test if block is clocked\n\n        :return: True if block is clocked\n        :rtype: bool\n\n        True if block is clocked, False if it is continuous time.\n        \"\"\"\n        return self._clocked\n\n    @property\n    def isgraphics(self):\n        \"\"\"\n        Test if block does graphics\n\n        :return: True if block does graphics\n        :rtype: bool\n        \"\"\"\n        return self._graphics\n\n    # for use in unit testing\n\n    # TODO: should redo this, eliminate the monkey patch\n    # TODO: make T_step(), dummpy out the state object\n\n    def T_output(self, *inputs, t=0.0, x=None):\n        \"\"\"\n        Evaluate a block for unit testing.\n\n        :param *inputs: Input port values\n        :param t: Simulation time, defaults to 0.0\n        :type t: float, optional\n        :param x: state vector\n        :type x: ndarray\n        :return: Block output port values\n        :rtype: list\n\n        The output ports of the block are evaluated for a given simulation time\n        and set of input port values. Input ports are assigned to consecutive inputs,\n        output port values are a list.\n\n        Mostly used for making concise unit tests.\n\n        .. warning:: the instance is monkey patched, not useable in a block\n            diagram subsequently.\n\n        \"\"\"\n        # check inputs and assign to attribute\n        assert len(inputs) == self.nin, \"wrong number of inputs provided\"\n\n        # evaluate the block\n        out = self.output(t, inputs, x)\n\n        # sanity check the output\n        assert isinstance(out, list), \"result must be a list\"\n        assert len(out) == self.nout, \"result list is wrong length\"\n        return out\n\n    def T_deriv(self, *inputs, t=0.0, x=None):\n        \"\"\"\n        Evaluate a block for unit testing.\n\n        :param inputs: input port values\n        :type inputs: list\n        :param t: Simulation time, defaults to 0.0\n        :type t: float, optional\n        :param x: state vector\n        :type x: ndarray\n        :return: Block derivative value\n        :rtype: ndarray\n\n        The derivative of the block is evaluated for a given set of input port\n        values. Input port values are treated as lists.\n\n        Mostly used for making concise unit tests.\n\n        .. warning:: the instance is monkey patched, not useable in a block\n            diagram subsequently.\n\n        \"\"\"\n\n        # check inputs and assign to attribute\n        assert len(inputs) == self.nin, \"wrong number of inputs provided\"\n\n        if x is not None:\n            assert len(x) == self.nstates, \"passed state is wrong length\"\n\n        # evaluate the block\n        out = self.deriv(t, inputs, x)\n\n        # sanity check the output\n        assert isinstance(out, np.ndarray), \"result must be an ndarray\"\n        assert out.shape == (self.nstates,), \"result array is wrong length\"\n        return out\n\n    def T_next(self, *inputs, t=0.0, x=None):\n        \"\"\"\n        Evaluate a block for unit testing.\n\n        :param inputs: input port values\n        :type inputs: list\n        :param t: Simulation time, defaults to 0.0\n        :type t: float, optional\n        :param x: state vector\n        :type x: ndarray\n        :return: Block next state value\n        :rtype: ndarray\n\n        The next value of a discrete time block is evaluated for a given set of input port\n        values. Input port values are treated as lists.\n\n        Mostly used for making concise unit tests.\n\n        \"\"\"\n\n        # check inputs and assign to attribute\n        assert len(inputs) == self.nin, \"wrong number of inputs provided\"\n\n        if x is not None:\n            assert len(x) == self.ndstates, \"passed state is wrong length\"\n\n        # evaluate the block\n        out = self.next(t, inputs, x)\n\n        # sanity check the output\n        assert isinstance(out, np.ndarray), \"next state must be an ndarray\"\n        assert out.shape == (self.ndstates,), \"next state array is wrong length\"\n        return out\n\n    def T_step(self, *inputs, t=0.0):\n        \"\"\"\n        Step a block for unit testing.\n\n        :param inputs: input port values\n        :type inputs: list\n        :param t: Simulation time, defaults to 0.0\n        :type t: float, optional\n\n        Step the block for a given set of input port\n        values. Input port values are treated as lists.\n\n        Mostly used for making concise unit tests.\n\n        \"\"\"\n\n        # check inputs and assign to attribute\n        assert len(inputs) == self.nin, \"wrong number of inputs provided\"\n\n        # step the block\n        self.step(t, inputs)\n\n    def T_start(self, simstate=None):\n\n        from bdsim.run_sim import BDSimState, Options\n\n        if simstate is None:\n\n            class RunTime:\n                def DEBUG(*args):\n                    pass\n\n            class BlockDiagram:\n                pass\n\n            self.bd = BlockDiagram()\n            self.bd.runtime = RunTime()\n            self.bd.runtime.options = Options()\n            simstate = BDSimState()\n            simstate.options = self.bd.runtime.options\n            simstate.t = 0.0\n\n        # step the block\n        self.start(simstate)\n        return simstate\n\n    def _output(self, *inputs, t=0.0, x=None):\n        return self.T_output(*inputs, t=t, x=x)\n\n    def _step(self, *inputs, t=0.0):\n        return self.T_step(*inputs, t=t)\n\n    # def input(self, port):\n    #     \"\"\"\n    #     Get input to block on specified port\n\n    #     :param port: port number\n    #     :type port: int\n    #     :return: value applied to specified input port\n    #     :rtype: any\n\n    #     Return the value of the input applied to the input port numbered\n    #     ``port``.  The type depends on the source port connected to this input.\n\n    #     .. note:: When a block's ``output`` method is evaluated the resulting list is\n    #         saved as an attribute of that block.  The ``input`` method traces back\n    #         along the wire connected to the input port to obtain a reference to the\n    #         output value held by the predecessor block.\n\n    #     .. note:: For unit testing purposes, it the block is simply an instance\n    #         of the class, then setting its attribute ``T_inputs`` to a list\n    #         provides the input values to the block.\n\n    #     :seealso: :meth:`inputs`\n    #     \"\"\"\n    #     try:\n    #         p = self.sources[port]  # get plug for source block output\n    #         return p.block.output_values[p.port]\n\n    @property\n    def inputs(self):\n        \"\"\"\n        Get block inputs as a list\n\n        :return: list of block inputs\n        :rtype: list\n\n        Returns a list of values corresponding to the input ports of the block.  The\n        types of the elements are dictated by the blocks connected to the input ports.\n\n        .. note:: When a block's ``output`` method is evaluated the resulting list is\n            saved as an attribute of that block.  The ``inputs`` method uses the\n            ``sources`` attribute which has references to the output values held by\n            the predecessor block.\n\n        :seealso: :meth:`input`\n        \"\"\"\n        values = []\n        for port in range(self.nin):\n            plug = self.sources[port]  # get plug for source block output\n            values.append(plug.block.output_values[plug.port])\n        return values\n\n    def __getitem__(self, port):\n        \"\"\"\n        Convert a block slice reference to a plug.\n\n        :param port: Port number\n        :type port: int\n        :return: A port plug\n        :rtype: Plug\n\n        Invoked whenever a block is referenced as a slice, for example::\n\n            c = bd.CONSTANT(1)\n\n            bd.connect(x, c[0])\n            bd.connect(c[0], x)\n\n        In both cases ``c[0]`` is converted to a ``Plug`` by this method.\n        \"\"\"\n        # block[i] is a plug object\n        # print('getitem called', self, port)\n        return Plug(self, port)\n\n    def __setitem__(self, port, src):\n        \"\"\"\n        Convert a LHS block slice reference to a wire.\n\n        :param port: Port number\n        :type port: int\n        :param src: the RHS\n        :type src: Block or Plug\n\n        Used to create a wired connection by assignment, for example::\n\n            X[0] = Y\n\n        where ``X`` and ``Y`` are blocks. This method is implicitly invoked and\n        creates a wire from ``Y`` to input port 0 of ``X``.\n\n        .. note:: The square brackets on the left-hand-side is critical, and\n            ``X = Y`` will simply overwrite the reference to ``X``.\n        \"\"\"\n        # b[port] = src\n        # src --> b[port]\n        # print('connecting', src, self, port)\n        self.bd.connect(src, self[port])\n\n    def __setattr__(self, name, value):\n        \"\"\"\n        Convert a LHS block name reference to a wire.\n\n        :param name: Port name\n        :type port: str\n        :param value: the RHS\n        :type value: Block or Plug\n\n        Used to create a wired connection by assignment, for example::\n\n            c = bd.CONSTANT(1, inames=['u'])\n\n            c.u = x\n\n        Ths method is invoked to create a wire from ``x`` to port 'u' of\n        the constant block ``c``.\n\n        Notes:\n\n            - this overloaded method handles all instances of ``setattr`` and\n              implements normal functionality as well, only creating a wire\n              if ``name`` is a known port name.\n        \"\"\"\n\n        # b[port] = src\n        # src --> b[port]\n        # gets called for regular attribute settings, as well as for wiring\n\n        if name in self.portnames:\n            # we're doing wiring\n            # print('in __setattr___', self, name, value)\n            self.bd.connect(value, getattr(self, name))\n        else:\n            # regular case, add attribute to the instance's dictionary\n            self.__dict__[name] = value\n\n    @oodebug\n    def __rshift__(left, right):\n        \"\"\"\n        Operator for implicit wiring.\n\n        :param left: A block to be wired from\n        :type left: Block\n        :param right: A block or plugto be wired to\n        :type right: Block or Plug\n        :return: ``right``\n        :rtype: Block or Plug\n\n        Implements implicit wiring, for example::\n\n            a = bd.CONSTANT(1) >> bd.GAIN(2)\n\n        will connect the output of the CONSTANT block to the input of the\n        GAIN block.  The result will be GAIN block, whose output in this case\n        will be assigned to ``a``.\n\n        Note that::\n\n           a = bd.CONSTANT(1) >> func[1]\n\n        will connect port 0 of CONSTANT to port 1 of ``func``, and port 1 of ``func``\n        will be assigned to ``a``.  To specify a different outport port on ``func``\n        we need to use parentheses::\n\n            a = (bd.CONSTANT(1) >> func[1])[0]\n\n        which will connect port 0 of CONSTANT ` to port 1 of ``func``, and port 0 of ``func``\n        will be assigned to ``a``.\n\n        :seealso: Plug.__rshift__\n\n        \"\"\"\n        # called for the cases:\n        # block * block\n        # block * plug\n        s = left.bd\n        # assert isinstance(right, Block), 'arguments to * must be blocks not ports (for now)'\n        w = s.connect(left, right)  # add a wire\n        # print('block * ' + str(w))\n        return right\n\n        # make connection, return a plug\n\n    def _autoconstant(self, value):\n        if isinstance(value, (int, float, str)):\n            name = \"_const.{:d}({})\".format(self.bd.n_auto_const, value)\n        else:\n            name = \"_const.{:d}<{}>\".format(self.bd.n_auto_const, type(value).__name__)\n        self.bd.n_auto_const += 1\n        return self.bd.CONSTANT(value, name=name)\n\n    def _autogain(self, value, **kwargs):\n        if isinstance(value, (int, float, str)):\n            name = \"_gain.{:d}({})\".format(self.bd.n_auto_gain, value)\n        else:\n            name = \"_gain.{:d}<{}>\".format(self.bd.n_auto_gain, type(value).__name__)\n        self.bd.n_auto_gain += 1\n        return self.bd.GAIN(value, name=name, **kwargs)\n\n    def _autopow(self, value, **kwargs):\n        name = \"_pow.{:d}({})\".format(self.bd.n_auto_pow, value)\n        self.bd.n_auto_pow += 1\n        return self.bd.POW(value, name=name, **kwargs)\n\n    @oodebug\n    def __add__(self, other):\n        \"\"\"\n        Overloaded + operator for implicit block creation.\n\n        :param self: A signal (block) to be added\n        :type self: Block\n        :param other: A signal (block or plug) to be added\n        :type other: Block or Plug\n        :return: SUM block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the + operator\n        when the right operand is a ``Block``\n        and the left operand is a ``Plug``, ``Block`` or constant::\n\n            result = X + Y\n            result = X + Y[j]\n            result = X + C\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Creates a ``SUM(\"++\") block named ``_sum.N`` whose inputs are the\n        left and right operands.  For the third case, a new ``CONSTANT(C)`` block\n        named ``_const.N`` is also created.\n\n        .. note::\n            * The inputs to the summing junction are reversed: right then left operand.\n            * The ``mode`` is None, regular addition\n\n        :seealso: :meth:`Block.__radd__` :meth:`Plug.__add__`\n        \"\"\"\n        # value + value, create a SUM block\n        name = \"_sum.{:d}\".format(self.bd.n_auto_sum)\n        self.bd.n_auto_sum += 1\n        if isinstance(other, (int, float, np.ndarray)):\n            # block + constant, create a CONSTANT block\n            other = self._autoconstant(other)\n        return self.bd.SUM(\"++\", inputs=(self, other), name=name)\n\n    @oodebug\n    def __radd__(self, other):\n        \"\"\"\n        Overloaded + operator for implicit block creation.\n\n        :param self: A signal (block) to be added\n        :type self: Block\n        :param other: A signal (block or plug) to be added\n        :type other: Block or Plug\n        :return: SUM block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the + operator\n        when the right operand is a ``Block``\n        and the left operand is a ``Plug``, ``Block`` or constant::\n\n            result = X + Y[j]\n            result = X[i] + Y[j]\n            result = C + Y[j]\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Creates a ``SUM(\"++\") block named ``_sum.N`` whose inputs are the\n        left and right operands.  For the third case, a new ``CONSTANT(C)`` block\n        named ``_const.N`` is also created.\n\n        .. note::\n            * The inputs to the summing junction are reversed: right then left operand.\n            * The ``mode`` is None, regular addition\n\n        :seealso: :meth:`Block.__add__` :meth:`Plug.__radd__`\n        \"\"\"\n        # value + value, create a SUM block\n        name = \"_sum.{:d}\".format(self.bd.n_auto_sum)\n        self.bd.n_auto_sum += 1\n        if isinstance(other, (int, float, np.ndarray)):\n            # constant + block, create a CONSTANT block\n            other = self._autoconstant(other)\n        return self.bd.SUM(\"++\", inputs=(other, self), name=name)\n\n    @oodebug\n    def __sub__(self, other):\n        \"\"\"\n        Overloaded - operator for implicit block creation.\n\n        :param self: A signal (block) to be added (minuend)\n        :type self: Block\n        :param other: A signal (block or plug) to be subtracted (subtrahend)\n        :type other: Block or Plug\n        :return: SUM block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the - operator when the left operand is a ``Block``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X - Y\n            result = X - Y[j]\n            result = X - C\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Creates a ``SUM(\"+-\")`` block named ``_sum.N`` whose inputs are the\n        left and right operands.  For the third case, a new ``CONSTANT(C)`` block\n        named ``_const.N`` is also created.\n\n        :seealso: :meth:`Block.__rsub__` :meth:`Plug.__sub__`\n        \"\"\"\n        # value - value, create a SUM block\n        name = \"_sum.{:d}\".format(self.bd.n_auto_sum)\n        self.bd.n_auto_sum += 1\n        if isinstance(other, (int, float, np.ndarray)):\n            # block - constant, create a CONSTANT block\n            other = self._autoconstant(other)\n        return self.bd.SUM(\"+-\", inputs=(self, other), name=name)\n\n    @oodebug\n    def __rsub__(self, other):\n        \"\"\"\n        Overloaded - operator for implicit block creation.\n\n        :param self: A signal (block) to be added (minuend)\n        :type self: Block\n        :param other: A signal (block or plug) to be subtracted (subtrahend)\n        :type other: Block or Plug\n        :return: SUM block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the - operator when the left operand is a ``Block``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X - Y\n            result = X[i] - Y\n            result = C - Y\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Creates a ``SUM(\"+-\")`` block named ``_sum.N`` whose inputs are the\n        left and right operands.  For the third case, a new ``CONSTANT(C)`` block\n        named ``_const.N`` is also created.\n\n        .. note::\n            * The inputs to the summing junction are reversed: right then left operand.\n            * The ``mode`` is None, regular addition\n\n        :seealso: :meth:`Block.__sub__` :meth:`Plug.__rsub__`\n        \"\"\"\n        # value - value, create a SUM block\n        name = \"_sum.{:d}\".format(self.bd.n_auto_sum)\n        self.bd.n_auto_sum += 1\n        if isinstance(other, (int, float, np.ndarray)):\n            # constant - block, create a CONSTANT block\n            other = self._autoconstant(other)\n        return self.bd.SUM(\"+-\", inputs=(other, self), name=name)\n\n    @oodebug\n    def __neg__(self):\n        \"\"\"\n        Overloaded unary minus operator for implicit block creation.\n\n        :param self: A signal (block) to be negated\n        :type self: Block\n        :return: GAIN block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the - operator for unary minus when the operand is a ``Block``::\n\n            result = -X\n\n        where ``X`` is a block.\n\n        Creates a ``GAIN(-1)`` block named ``_gain.N`` whose input is the\n        operand.\n\n        :seealso: :meth:`Plug.__neg__`\n        \"\"\"\n        return self._autogain(-1.0, inputs=[self])\n\n    @oodebug\n    def __pow__(self, p):\n        \"\"\"\n        Overloaded unary power operator for implicit block creation.\n\n        :param self: A signal (block) to be negated\n        :type self: Block\n        :return: POW block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the ** operator for unary power when the operand is a ``Block``::\n\n            result = X**3\n\n        where ``X`` is a block.\n\n        Creates a ``POW(3)`` block named ``_pow.N`` whose input is the\n        operand.\n\n        :seealso: :meth:`Plug.__pow__`\n        \"\"\"\n        return self._autopow(p, inputs=[self])\n\n    @oodebug\n    def __mul__(self, other):\n        \"\"\"\n        Overloaded * operator for implicit block creation.\n\n        :param self: A signal (block) to be multiplied\n        :type self: Block\n        :param other: A signal (block or plug) to be multiplied\n        :type other: Block or Plug\n        :return: PROD or GAIN block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the * operator when the left operand is a ``Block``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X * Y\n            result = X * Y[j]\n            result = X * C\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Create a ``PROD(\"**\")`` block named ``_prod.N`` whose inputs are the\n        left and right operands.\n\n        For the third case, create a ``GAIN(C)`` block named ``_gain.N``.\n\n        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy\n            array then the option ``matrix`` is set to True.\n\n        :seealso: :meth:`Block.__rmul__` :meth:`Plug.__mul__`\n        \"\"\"\n        matrix = False\n        if isinstance(other, (int, float, np.ndarray)):\n            # block * constant, create a GAIN block\n            matrix = isinstance(other, np.ndarray)\n            return self._autogain(other, premul=matrix, matrix=matrix, inputs=[self])\n        else:\n            # value * value, create a PROD block\n            name = \"_prod.{:d}\".format(self.bd.n_auto_prod)\n            self.bd.n_auto_prod += 1\n            return self.bd.PROD(\"**\", inputs=[self, other], matrix=matrix, name=name)\n\n    @oodebug\n    def __rmul__(self, other):\n        \"\"\"\n        Overloaded * operator for implicit block creation.\n\n        :param self: A signal (block) to be multiplied\n        :type self: Block\n        :param other: A signal (block or plug) to be multiplied\n        :type other: Block or Plug\n        :return: PROD or GAIN block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the * operator when the right operand is a ``Block``\n        and the left operand is a ``Plug``, ``Block`` or constant::\n\n            result = X * Y\n            result = X[i] * Y\n            result = C * Y\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        For the first two cases, a ``PROD(\"**\")`` block named ``_prod.N`` whose inputs are the\n        left and right operands.\n\n        For the third case, create a ``GAIN(C)`` block named ``_gain.N``.\n\n        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy\n            array then the option ``matrix`` is set to True.\n\n        :seealso: :meth:`Block.__mul__` :meth:`Plug.__rmul__`\n        \"\"\"\n        matrix = False\n        if isinstance(other, (int, float, np.ndarray)):\n            # constant * block, create a GAIN block\n            matrix = isinstance(other, np.ndarray)\n            return self._autogain(other, premul=matrix, inputs=[self])\n\n    @oodebug\n    def __truediv__(self, other):\n        \"\"\"\n        Overloaded / operator for implicit block creation.\n\n        :param self: A signal (block) to be multiplied (dividend)\n        :type self: Block\n        :param other: A signal (block or plug) to be divided (divisor)\n        :type other: Block or Plug\n        :return: PROD or GAIN block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the / operator when the left operand is a ``Block``\n        and the right operand is a ``Plug``, ``Block`` or constant::\n\n            result = X / Y\n            result = X / Y[j]\n            result = X / C\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        Create a ``PROD(\"**\")`` block named ``_prod.N`` whose inputs are the\n        left and right operands.\n\n        For the third case, create a ``GAIN(1/C)`` block named ``_gain.N``.\n\n        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy\n            array then the option ``matrix`` is set to True.\n\n        :seealso: :meth:`Block.__rtruediv__` :meth:`Plug.__truediv__`\n        \"\"\"\n        # value / value, create a PROD block\n        name = \"_prod.{:d}\".format(self.bd.n_auto_prod)\n        self.bd.n_auto_prod += 1\n        matrix = False\n        if isinstance(other, (int, float, np.ndarray)):\n            # block / constant, create a CONSTANT block\n            other = self._autoconstant(other)\n            matrix = isinstance(other, np.ndarray)\n        return self.bd.PROD(\"*/\", inputs=(self, other), matrix=matrix, name=name)\n\n    @oodebug\n    def __rtruediv__(self, other):\n        \"\"\"\n        Overloaded / operator for implicit block creation.\n\n        :param self: A signal (block) to be multiplied (dividend)\n        :type self: Block\n        :param other: A signal (block or plug) to be divided (divisor)\n        :type other: Block or Plug\n        :return: PROD block\n        :rtype: Block subclass\n\n        This method is implicitly invoked by the / operator when the right operand is a ``Block``\n        and the left operand is a ``Plug``, ``Block`` or constant::\n\n            result = X / Y\n            result = X[i] / Y\n            result = C / Y\n\n        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.\n\n        For the first two cases, a ``PROD(\"*/\")`` block named ``_prod.N`` whose inputs are the\n        left and right operands.  For the third case, a new CONSTANT block\n        named ``_const.N`` is also created.\n\n        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy\n            array then the option ``matrix`` is set to True.\n\n        :seealso: :meth:`Block.__truediv__` :meth:`Plug.__rtruediv__`\n        \"\"\"\n        # value / value, create a PROD block\n        name = \"_prod.{:d}\".format(self.bd.n_auto_prod)\n        self.bd.n_auto_prod += 1\n        matrix = False\n        if isinstance(other, (int, float, np.ndarray)):\n            # constant / block, create a CONSTANT block\n            other = self._autoconstant(other)\n            matrix = isinstance(other, np.ndarray)\n        return self.bd.PROD(\"*/\", inputs=(other, self), matrix=matrix, name=name)\n\n    # TODO arithmetic with a constant, add a gain block or a constant block\n\n    def __str__(self):\n        if hasattr(self, \"name\") and self.name is not None:\n            return self.name\n        else:\n            return self.blockclass + \".??\"\n\n    def __repr__(self):\n        return self.__str__()\n\n    def _fixname(self, s):\n        return s.translate(self._latex_remove)\n\n    def inport_names(self, names):\n        \"\"\"\n        Set the names of block input ports.\n\n        :param names: List of port names\n        :type names: list of str\n\n        Invoked by the ``inames`` argument to the Block constructor.\n\n        The names can include LaTeX math markup.  The LaTeX version is used\n        where appropriate, but the port names are a de-LaTeXd version of the\n        given string with backslash, caret, braces and dollar signs\n        removed.\n        \"\"\"\n        self._inport_names = names\n\n        for port, name in enumerate(names):\n            fn = self._fixname(name)\n            setattr(self, fn, self[port])\n            self.portnames.append(fn)\n\n    def outport_names(self, names):\n        \"\"\"\n        Set the names of block output ports.\n\n        :param names: List of port names\n        :type names: list of str\n\n        Invoked by the ``onames`` argument to the Block constructor.\n\n        The names can include LaTeX math markup.  The LaTeX version is used\n        where appropriate, but the port names are a de-LaTeXd version of the\n        given string with backslash, caret, braces and dollar signs\n        removed.\n\n        \"\"\"\n        self._outport_names = names\n        for port, name in enumerate(names):\n            fn = self._fixname(name)\n            setattr(self, fn, self[port])\n            self.portnames.append(fn)\n\n    def state_names(self, names):\n        self._state_names = names\n\n    def sourcename(self, port):\n        \"\"\"\n        Get the name of output port driving this input port.\n\n        :param port: Input port\n        :type port: int\n        :return: Port name\n        :rtype: str\n\n        Return the name of the output port that drives the specified input\n        port. The name can be:\n\n            - a LaTeX string if provided\n            - block name with port number given in square brackets.  The block\n              name will the one optionally assigned by the user using the ``name``\n              keyword, otherwise a systematic default name.\n\n        :seealso: outport_names\n\n        \"\"\"\n\n        w = self.input_wires[port]\n        if w.name is not None:\n            return w.name\n        src = w.start.block\n        srcp = w.start.port\n        if src._outport_names is not None:\n            return src._outport_names[srcp]\n        return str(w.start)\n\n    # @property\n    # def fullname(self):\n    #     return self.blockclass + \".\" + str(self)\n\n    def reset(self):\n        if self.nin > 0:\n            self.inputs = [None] * self.nin\n        self.updated = False\n\n    def add_output_wire(self, w):\n        port = w.start.port\n        assert port < len(self.output_wires), \"port number too big\"\n        self.output_wires[port].append(w)\n\n    def add_input_wire(self, w):\n        port = w.end.port\n        assert (\n            self.input_wires[port] is None\n        ), \"attempting to connect second wire to an input\"\n        self.input_wires[port] = w\n        self.sources[port] = w.start\n\n    # def setinput(self, port, value):\n    #     \"\"\"\n    #     Receive input from a wire\n\n    #     :param self: Block to be updated\n    #     :type wire: Block\n    #     :param port: Input port to be updated\n    #     :type port: int\n    #     :param value: Input value\n    #     :type val: any\n    #     \"\"\"\n    #     # stash it away\n    #     self.inputs[port] = value\n\n    # def setinputs(self, *pos):\n    #     assert len(pos) == self.nin, 'mismatch in number of inputs'\n    #     self.reset()\n    #     for i, val in enumerate(pos):\n    #         self.inputs[i] = val\n\n    def start(self, simstate):  # begin a simulation\n        pass\n\n    def check(self):  # check validity of block parameters at start\n        assert hasattr(self, \"nin\"), f\"block {self.name} has no nin specified\"\n        assert hasattr(self, \"nout\"), f\"block {self.name} has no nout specified\"\n\n        assert (\n            self.nin > 0 or self.nout > 0\n        ), f\"block {self.name} no inputs or outputs specified\"\n        assert (\n            hasattr(self, \"initd\") and self.initd\n        ), \"Block superclass not initalized. was super().__init__ called?\"\n\n    def done(self, **kwargs):  # end of simulation\n        pass\n\n    def savefig(self, *pos, **kwargs):\n        pass\n\n\nclass SinkBlock(Block):\n    \"\"\"\n    A SinkBlock is a subclass of Block that represents a block that has inputs\n    but no outputs. Typically used to save data to a variable, file or\n    graphics.\n    \"\"\"\n\n    blockclass = \"sink\"\n\n    def __init__(self, **blockargs):\n        \"\"\"\n        Create a sink block.\n\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: sink block base class\n        :rtype: SinkBlock\n\n        This is the parent class of all sink blocks.\n        \"\"\"\n        # print('Sink constructor')\n        super().__init__(**blockargs)\n        self.nout = 0\n        self.nstates = 0\n\n    def step(self, t, inports):  # valid\n        pass\n\n\nclass SourceBlock(Block):\n    \"\"\"\n    A SourceBlock is a subclass of Block that represents a block that has outputs\n    but no inputs.  Its output is a function of parameters and time.\n    \"\"\"\n\n    blockclass = \"source\"\n\n    def __init__(self, **blockargs):\n        \"\"\"\n        Create a source block.\n\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: source block base class\n        :rtype: SourceBlock\n\n        This is the parent class of all source blocks.\n        \"\"\"\n        # print('Source constructor')\n        super().__init__(**blockargs)\n        self.nin = 0\n        self.nstates = 0\n\n\nclass TransferBlock(Block):\n    \"\"\"\n    A TransferBlock is a subclass of Block that represents a block with inputs\n    outputs and states. Typically used to describe a continuous time dynamic\n    system, either linear or nonlinear.\n    \"\"\"\n\n    blockclass = \"transfer\"\n\n    def __init__(self, nstates=1, **blockargs):\n        \"\"\"\n        Create a transfer function block.\n\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: transfer function block base class\n        :rtype: TransferBlock\n\n        This is the parent class of all transfer function blocks.\n        \"\"\"\n        # print('Transfer constructor')\n        self.nstates = nstates\n        super().__init__(**blockargs)\n\n    def reset(self):\n        super().reset()\n        self._x = self._x0\n        # return self._x\n\n    def setstate(self, x):\n        x = np.array(x)\n        self._x = x[: self.nstates]  # take as much state vector as we need\n        return x[self.nstates :]  # return the rest\n\n    def getstate0(self):\n        return self._x0\n\n    def check(self):\n        assert len(self._x0) == self.nstates, \"incorrect length for initial state\"\n        assert self.nin > 0 or self.nout > 0, \"no inputs or outputs specified\"\n\n\nclass FunctionBlock(Block):\n    \"\"\"\n    A FunctionBlock is a subclass of Block that represents a block that has inputs\n    and outputs but no state variables.  Typically used to describe operations\n    such as gain, summation or various mappings.\n    \"\"\"\n\n    blockclass = \"function\"\n\n    def __init__(self, **blockargs):\n        \"\"\"\n        Create a function block.\n\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: function block base class\n        :rtype: FunctionBlock\n\n        This is the parent class of all function blocks.\n        \"\"\"\n        # print('Function constructor')\n        super().__init__(**blockargs)\n        self.nstates = 0\n\n\nclass SubsystemBlock(Block):\n    \"\"\"\n    A SubSystem  s a subclass of Block that represents a block that has inputs\n    and outputs but no state variables.  Typically used to describe operations\n    such as gain, summation or various mappings.\n    \"\"\"\n\n    blockclass = \"subsystem\"\n\n    def __init__(self, **blockargs):\n        \"\"\"\n        Create a subsystem block.\n\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: subsystem block base class\n        :rtype: SubsystemBlock\n\n        This is the parent class of all subsystem blocks.\n        \"\"\"\n        # print('Subsystem constructor')\n        super().__init__(**blockargs)\n        self.nstates = 0\n\n\nclass ClockedBlock(Block):\n    \"\"\"\n    A ClockedBlock is a subclass of Block that represents a block with inputs\n    outputs and discrete states. Typically used to describe a discrete time dynamic\n    system, either linear or nonlinear.\n    \"\"\"\n\n    blockclass = \"clocked\"\n\n    def __init__(self, clock=None, **blockargs):\n        \"\"\"\n        Create a clocked block.\n\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: clocked block base class\n        :rtype: ClockedBlock\n\n        This is the parent class of all clocked blocks.\n        \"\"\"\n        # print('Clocked constructor')\n        super().__init__(**blockargs)\n        assert clock is not None, \"clocked block must have a clock\"\n        self._clocked = True\n        self.clock = clock\n        clock.add_block(self)\n\n    def reset(self):\n        super().reset()\n        # self._x = self._x0\n        # return self._x\n\n    def setstate(self, x):\n        self._x = x[: self.ndstates]  # take as much state vector as we need\n        # print('** set block state to ', self._x)\n        return x[self.ndstates :]  # return the rest\n\n    def getstate0(self):\n        return self._x0\n\n    def check(self):\n        assert len(self._x0) == self.ndstates, \"incorrect length for initial state\"\n\n        assert self.nin > 0 or self.nout > 0, \"no inputs or outputs specified\"\n        self._x = self._x0\n\n\nclass EventSource:\n    pass\n\n\n# c = Clock(5)\n# c1 = Clock(5, 2)\n\n# print(c, c1)\n# print(c.next(0), c1.next(0))\n\nif __name__ == \"__main__\":\n    # opt = OptionsBase(dict(foo=1, bar='hello'))\n    # print(opt.foo)\n    # print(opt.bar)\n    # opt.set(foo=3)\n    # print(opt.foo)\n\n    # from bdsim.blocks.functions import Sum\n    # print(Sum.parameters())\n\n    import bdsim\n\n    sim = bdsim.BDSim()  # create simulator\n\n    print(sim.moduledicts)\n"
  },
  {
    "path": "bdsim/graphics.py",
    "content": "import sys\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib import animation\nfrom bdsim.components import SinkBlock\n\n\nclass GraphicsBlock(SinkBlock):\n    \"\"\"\n    A GraphicsBlock is a subclass of SinkBlock that represents a block that has inputs\n    but no outputs and creates/updates a graphical display.\n    \"\"\"\n\n    blockclass = \"graphics\"\n\n    def __init__(self, movie=None, **blockargs):\n        \"\"\"\n        Create a graphical display block.\n\n        :param movie: Save animation in this file in MP4 format, defaults to None\n        :type movie: str, optional\n        :param blockargs: |BlockOptions|\n        :type blockargs: dict\n        :return: transfer function block base class\n        :rtype: TransferBlock\n\n        This is the parent class of all graphic display blocks.\n        \"\"\"\n\n        super().__init__(**blockargs)\n        self._graphics = True\n\n        self.movie = movie\n\n    def start(self, simstate):\n\n        # plt.draw()\n        # plt.show(block=False)\n        self._simstate = simstate\n        self._enabled = simstate.options.graphics\n\n        if self.movie is not None and not simstate.options.animation:\n            print(\n                \"enabling global animation option to allow movie option on block\", self\n            )\n            if not simstate.options.animation:\n                print(\"must enable animation to render a movie\")\n        if self.movie is not None:\n            try:\n                self.writer = animation.FFMpegWriter(\n                    fps=10, extra_args=[\"-vcodec\", \"libx264\"]\n                )\n                self.writer.setup(fig=self.fig, outfile=self.movie)\n                print(\"movie block\", self, \" --> \", self.movie)\n            except FileNotFoundError:\n                self.fatal(\"cannot save movie, please install ffmpeg\")\n\n    def step(self, t, inports):\n        super().step(t, inports)\n\n        # bring the figure up to date in a backend-specific way\n        if self._simstate.options.animation:\n            if self._simstate.backend == \"TkAgg\":\n                self.fig.canvas.flush_events()\n                plt.show(block=False)\n                plt.show(block=False)\n            elif self._simstate.backend == \"Qt5Agg\":\n                self.fig.canvas.flush_events()\n                self.fig.canvas.draw()\n            else:\n                self.fig.canvas.draw()\n\n        if self.movie is not None:\n            try:\n                self.writer.grab_frame()\n            except AttributeError:\n                self.fatal(\"cannot save movie, please install ffmpeg\")\n\n    def done(self, block=False):\n        if self.fig is not None:\n            self.fig.canvas.start_event_loop(0.001)\n            if self.movie is not None:\n                self.writer.finish()\n                # self.cleanup()\n            plt.show(block=block)\n\n    def savefig(self, filename=None, format=\"pdf\", **kwargs):\n        \"\"\"\n        Save the figure as an image file\n\n        :param fname: Name of file to save graphics to\n        :type fname: str\n        :param ``**kwargs``: Options passed to `savefig <https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.pyplot.savefig.html>`_\n\n        The file format is taken from the file extension and can be\n        jpeg, png or pdf.\n        \"\"\"\n        try:\n            plt.figure(self.fig.number)  # make block's figure the current one\n            if filename is None:\n                filename = self.name\n            filename += \".\" + format\n            print(\"saved {} -> {}\".format(str(self), filename))\n            plt.savefig(filename, **kwargs)  # save the current figure\n\n        except:\n            pass\n\n    def create_figure(self, state):\n        def move_figure(f, x, y):\n            \"\"\"Move figure's upper left corner to pixel (x, y)\"\"\"\n            backend = matplotlib.get_backend()\n            x = int(x) + gstate.xoffset\n            y = int(y)\n            if backend == \"TkAgg\":\n                f.canvas.manager.window.wm_geometry(\"+%d+%d\" % (x, y))\n            elif backend == \"WXAgg\":\n                f.canvas.manager.window.SetPosition((x, y))\n            else:\n                # This works for QT and GTK\n                # You can also use window.setGeometry\n                try:\n                    f.canvas.manager.window.move(x, y)\n                except AttributeError:\n                    pass  # can't do this for MacOSX\n\n        gstate = state\n        options = state.options\n\n        self.bd.runtime.DEBUG(\n            \"graphics\", \"{} matplotlib figures exist\", len(plt.get_fignums())\n        )\n\n        if gstate.fignum == 0:\n            # no figures yet created, lazy initialization\n            self.bd.runtime.DEBUG(\"graphics\", \"lazy initialization\")\n\n            if options.backend is None:\n                if sys.platform == \"darwin\":\n                    # for MacOS, use Qt5Agg if its installed\n                    # otherwise use default (MacOSX)\n                    if \"Qt5Agg\" in matplotlib.rcsetup.all_backends:\n                        try:\n                            import PyQt5\n\n                            matplotlib.use(\"Qt5Agg\")\n                            print(\n                                \"no graphics backend specified: Qt5Agg found, using\"\n                                \" instead of MacOSX\"\n                            )\n                        except:\n                            pass\n            else:\n                try:\n                    matplotlib.use(options.backend)\n                except ImportError:\n                    self.fatal(f\"can't select backend: {options.backend}\")\n\n            mpl_backend = matplotlib.get_backend()\n            gstate.backend = mpl_backend\n\n            self.bd.runtime.DEBUG(\"graphics\", \"  backend={:s}\", mpl_backend)\n\n            # split the string\n            ntiles = [int(x) for x in options.tiles.split(\"x\")]\n\n            xoffset = 0\n            if options.shape is None:\n                if mpl_backend == \"Qt5Agg\":\n                    # next line actually creates a figure if none already exist\n                    QScreen = plt.get_current_fig_manager().canvas.screen()\n                    # this is a QScreenClass object, see https://doc.qt.io/qt-5/qscreen.html#availableGeometry-prop\n                    # next line creates a figure\n                    sz = QScreen.availableSize()\n                    dpiscale = (\n                        QScreen.devicePixelRatio()\n                    )  # is 2.0 for Mac laptop screen\n                    self.bd.runtime.DEBUG(\n                        \"graphics\",\n                        \"  {} x {} @ {}dpi\",\n                        sz.width(),\n                        sz.height(),\n                        dpiscale,\n                    )\n\n                    # check for a second screen\n                    if options.altscreen:\n                        vsize = QScreen.availableVirtualGeometry().getCoords()\n                        if vsize[0] < 0:\n                            # extra monitor to the left\n                            xoffset = vsize[0]\n                        elif vsize[0] >= sz.width():\n                            # extra monitor to the right\n                            xoffset = vsize[0]\n                        self.bd.runtime.DEBUG(\n                            \"graphics\", \"  altscreen offset {}\", xoffset\n                        )\n\n                    screen_width, screen_height = sz.width(), sz.height()\n                    dpi = QScreen.physicalDotsPerInch()\n                    f = plt.gcf()\n\n                elif mpl_backend == \"TkAgg\":\n                    window = plt.get_current_fig_manager().window\n                    screen_width, screen_height = (\n                        window.winfo_screenwidth(),\n                        window.winfo_screenheight(),\n                    )\n                    dpiscale = 1\n                    self.bd.runtime.DEBUG(\n                        \"graphics\",\n                        \"  screensize: {:d} x {:d}\",\n                        screen_width,\n                        screen_height,\n                    )\n                    f = plt.gcf()\n                    dpi = f.dpi\n\n                else:\n                    # all other backends\n                    f = plt.figure()\n                    dpi = f.dpi\n                    dpiscale = 2\n                    screen_width, screen_height = f.get_size_inches() * f.dpi\n\n                # compute fig size in inches (width, height)\n                figsize = [\n                    screen_width / ntiles[1] / dpi,\n                    screen_height / ntiles[0] / dpi,\n                ]\n\n            else:\n                # shape is given explictly\n                screen_width, screen_height = [int(x) for x in options.shape.split(\"x\")]\n\n                f = plt.gcf()\n\n            f.canvas.manager.set_window_title(f\"bdsim: Figure {f.number:d}\")\n\n            # save graphics info away in state\n            gstate.figsize = figsize\n            gstate.dpi = dpi\n            gstate.screensize_pix = (screen_width, screen_height)\n            gstate.ntiles = ntiles\n            gstate.xoffset = xoffset\n\n            # resize the figure\n            f.set_dpi(gstate.dpi * dpiscale)\n            f.set_size_inches(figsize, forward=True)\n            plt.ion()\n\n        else:\n            # subsequent figures\n            f = plt.figure(figsize=gstate.figsize, dpi=gstate.dpi)\n\n        # move the figure to right place on screen\n        row = gstate.fignum // gstate.ntiles[0]\n        col = gstate.fignum % gstate.ntiles[0]\n        scale = 1.02\n        move_figure(\n            f,\n            col * gstate.figsize[0] * gstate.dpi * scale,\n            row * gstate.figsize[1] * gstate.dpi * scale,\n        )\n        gstate.fignum += 1\n\n        def onkeypress(event):\n\n            if event.key == \"x\":\n                print(\"\\nclosing all windows\")\n                plt.close(\"all\")\n            elif event.key == \"ctrl+c\":\n                print(\"\\nterminating bdsim\")\n                sys.exit(1)\n            else:\n                print(\"key pressed\", event.key)\n\n        f.canvas.mpl_connect(\"key_press_event\", onkeypress)\n\n        self.bd.runtime.DEBUG(\n            \"graphics\", \"create figure {:d} at ({:d}, {:d})\", gstate.fignum, row, col\n        )\n        return f\n"
  },
  {
    "path": "bdsim/run_realtime.py",
    "content": "import os\nfrom pathlib import Path\nimport sys\nimport importlib\nimport inspect\nfrom collections import Counter, namedtuple\nimport argparse\nimport types\nimport warnings\n\nfrom bdsim.blockdiagram import BlockDiagram\nfrom bdsim.components import OptionsBase, Block, Clock, BDStruct, Plug, clocklist\nimport copy\nimport tempfile\nimport subprocess\nimport webbrowser\n\nimport numpy as np\nimport scipy.integrate as integrate\nimport matplotlib.pyplot as plt\nimport re\nfrom colored import fg, attr\nimport math\n\nimport threading\nimport time\nimport threading\n\nfrom bdsim.run_sim import BDSim, TimeQ, blockname\n\n\n# class TimeQRT(TimeQ):\n#     \"\"\"\n#     Time-ordered queue for events\n\n#     The list comprises tuples of (time, block) to reflect an event associated\n#     with the specified block at the specified time.\n\n#     The list is not ordered, and is sorted on a pop event.\n#     \"\"\"\n\n#     def __init__(self):\n#         self.q = []\n#         self.dirty = False\n\n#         # super().__init__()  # init threading class\n\n#         self.sem = threading.Semaphore(0)\n#         self.done = False\n#         self.t = None\n\n#     # def wait(self):\n#     #     self.sem.acquire()\n#     #     # print(f'  wake at {self.t}')\n#     #     return self.t, self.clocks\n\n#     def run(self, callback):\n#         nok = 0\n#         noverrun = 0\n\n#         print('run')\n#         t0 = time.time()\n#         stop = t0\n#         tmax = 0\n#         while not self.done:\n#             t, clocks = self.pop()\n#             if t is None:\n#                 print('E', end='')\n#                 time.sleep(0.02)\n#                 continue\n#             # print('dequeue', t)\n#             stop = t0 + t\n#             ts = time.time()\n#             sleep_time = stop - ts\n#             if sleep_time > 0:\n#                 # print('sleeping for', sleep_time)\n#                 time.sleep(sleep_time)\n#                 tmax = max(tmax, time.time()-ts)\n#                 # if tmax > 0.2:\n#                 #     print(tmax, sleep_time)\n#                 print('.', end='')\n#                 nok += 1\n#             else:\n#                 # print('timer overrun')\n#                 print('x', end='')\n#                 noverrun += 1\n#             # self.t = t\n#             # self.clocks = clocks\n#             # self.sem.release()\n#             callback(t, clocks)\n\n#             sys.stdout.flush()\n\n#         print(fg('yellow'))\n#         print(f'tmax {tmax}')\n#         print(f'n ok      {nok} ({nok/(nok+noverrun)*100:.1f}%)')\n#         print(f'n overrun {noverrun} ({noverrun/(nok+noverrun)*100:.1f}%)')\n#         print(attr(0))\n\n#     def stop(self):\n#         self.done = True\n#         self.join()\n\n\nclass BDRealTimeState:\n\n    \"\"\"\n    :ivar x: state vector\n    :vartype x: np.ndarray\n    :ivar T: maximum simulation time (seconds)\n    :vartype T: float\n    :ivar t: current simulation time (seconds)\n    :vartype t: float\n    :ivar fignum: number of next matplotlib figure to create\n    :vartype fignum: int\n    :ivar stop: reference to block wanting to stop simulation, else None\n    :vartype stop: Block subclass\n    :ivar checkfinite: halt simulation if any wire has inf or nan\n    :vartype checkfinite: bool\n    :ivar graphics: enable graphics\n    :vartype graphics: bool\n    \"\"\"\n\n    def __init__(self):\n        self.x = None  # continuous state vector numpy.ndarray\n        self.T = None  # maximum.BlockDiagram time\n        self.t = None  # current time\n        self.fignum = 0\n        self.stop = None\n        self.checkfinite = True\n\n        self.debugger = True\n        self.t_stop = None  # time-based breakpoint\n        self.eventq = TimeQ()\n\n    def declare_event(self, block, t):\n        self.eventq.push((t, block))\n\n\nclass SimpleStats:\n    def __init__(self):\n        self._n = 0\n        self._sum = 0\n        self._sum2 = 0\n        self._max = 0\n\n    def update(self, x):\n        self._n += 1\n        self._sum += x\n        self._sum2 += x**2\n        self._max = max(self._max, x)\n\n    @property\n    def n(self):\n        return self._n\n\n    @property\n    def mean(self):\n        return self._sum / self._n\n\n    @property\n    def sdev(self):\n        return math.sqrt((self._sum2 - self._sum**2 / self._n) / (self._n - 1))\n\n    @property\n    def max(self):\n        return self._max\n\n\nclass BDRealTime(BDSim):\n    def run(\n        self,\n        bd,\n        T=5,\n        dt=None,\n        block=None,\n        checkfinite=True,\n        watch=[],\n        samples=True,\n    ):\n        \"\"\"\n        Run the block diagram\n\n        :param T: maximum integration time, defaults to 10.0\n        :type T: float, optional\n        :param dt: maximum time step\n        :type dt: float, optional\n        :param solver: integration method, defaults to ``RK45``\n        :type solver: str, optional\n        :param block: matplotlib block at end of run, default False\n        :type block: bool\n        :param checkfinite: error if inf or nan on any wire, default True\n        :type checkfinite: bool\n        :param minstepsize: minimum step length, default 1e-6\n        :type minstepsize: float\n        :param watch: list of input ports to log\n        :type watch: list\n        :param solver_args: arguments passed to ``scipy.integrate``\n        :type solver_args: dict\n        :return: time history of signals and states\n        :rtype: Sim class\n\n        Assumes that the network has been compiled.\n\n        The system is simulated from time 0 to ``T``.\n\n        The integration step time ``dt`` defaults to ``T/100`` but can be\n        specified.  Finer control can be achieved using ``max_step`` and\n        ``first_step`` parameters to the underlying integrator using the\n        ``solver_args`` parameter.\n\n        Results are returned in a class with attributes:\n\n        - ``t`` the time vector: ndarray, shape=(M,)\n        - ``x`` is the state vector: ndarray, shape=(M,N)\n        - ``xnames`` is a list of the names of the states corresponding to columns of `x`, eg. \"plant.x0\",\n            defined for the block using the ``snames`` argument\n        - ``yN`` for a watched input where N is the index of the port mentioned in the ``watch`` argument\n        - ``ynames`` is a list of the names of the input ports being watched, same order as in ``watch`` argument\n\n        If there are no dynamic elements in the diagram, ie. no states, then ``x`` and ``xnames`` are not\n        present.\n\n        The ``watch`` argument is a list of one or more input ports whose value during simulation\n        will be recorded.  The elements of the list can be:\n            - a ``Block`` reference, which is interpretted as input port 0\n            - a ``Plug`` reference, ie. a block with an index or attribute\n            - a string of the form \"block[i]\" which is port i of the block named block.\n\n        The debug string comprises single letter flags:\n\n                - 'p' debug network value propagation\n                - 's' debug state vector\n                - 'd' debug state derivative\n\n        .. note:: Simulation stops if the step time falls below ``minsteplength``\n            which typically indicates that the solver is struggling with a very\n            harsh non-linearity.\n        \"\"\"\n\n        assert bd.compiled, \"Network has not been compiled\"\n\n        state = BDRealTimeState()\n        self.state = state\n        self.bd = bd\n\n        state.T = T\n        state.dt = dt\n        state.options = self.options\n\n        # process the watchlist\n        #  elements can be:\n        #   - block or Plug reference\n        #   - str in the form BLOCKNAME[PORT]\n        watchlist = []\n        watchnamelist = []\n        re_block = re.compile(r\"(?P<name>[^[]+)(\\[(?P<port>[0-9]+)\\])\")\n        for w in watch:\n            if isinstance(w, str):\n                # a name was given, with optional port number\n                m = re_block.match(w)\n                if m is None:\n                    raise ValueError(\"watch block[port] not found: \" + w)\n                name = m.group(\"name\")\n                port = int(m.group(\"port\"))\n                b = bd.blocknames[name]\n                plug = b[port]\n            elif isinstance(w, Block):\n                # a block was given, defaults to port 0\n                plug = w[0]\n            elif isinstance(w, Plug):\n                # a plug was given\n                plug = w\n            watchlist.append(plug)\n            watchnamelist.append(str(plug))\n        state.watchlist = watchlist\n        state.watchnamelist = watchnamelist\n\n        # for clock in bd.clocklist:\n        #     clock.start(state)\n\n        # tell all blocks we're starting a BlockDiagram\n        bd.start(state)\n\n        state.tlist = []\n        state.xlist = []\n        state.plist = [[] for p in state.watchlist]\n\n        print(\"run\")\n        nok = 0\n        decimate = 0\n        noverrun = 0\n        self.running = True\n        stats = SimpleStats()\n        t0 = time.time()\n        t = 0\n\n        while self.running:\n            # evaluate the block diagram\n            te_0 = time.time()\n            bd.schedule_evaluate([], t)\n\n            # record the ports on the watchlist\n            for i, p in enumerate(state.watchlist):\n                b = p.block\n                output = b.output(t, b.inputs, b._x)[p.port]\n                state.plist[i].append(output)\n\n            state.tlist.append(t)\n\n            # check execution time for this sample step\n            te_1 = time.time()\n            dte = te_1 - te_0\n            stats.update(dte)  # compute stats on time to execute the block diagram\n            if samples:\n                if dte > dt:\n                    print(\"x\", end=\"\")  # overrun\n                else:\n                    print(\".\", end=\"\")\n                sys.stdout.flush()\n\n            if dte > dt:\n                noverrun += 1\n            else:\n                nok += 1\n\n            # check whether to continue, and pause till next sample time\n            tnow = time.time() - t0\n            if tnow > T:\n                break\n\n            t += dt  # time of next sample\n\n            t_sleep = t - tnow\n            if t_sleep < 0:  # be tolerant to a sample overrun\n                t_sleep = 0\n            time.sleep(t_sleep)  # sleep till next tick\n\n        # save buffered data in a Struct\n        out = BDStruct(name=\"results\")\n        out.t = np.array(state.tlist)\n        # out.x = np.array(state.xlist)\n        # out.xnames = bd.statenames\n\n        # save the watchlist into variables named y0, y1 etc.\n        for i, p in enumerate(watchlist):\n            out[\"y\" + str(i)] = np.array(state.plist[i])\n        out.ynames = watchnamelist\n\n        if noverrun > 0:\n            print(fg(\"red\"))\n        else:\n            print(fg(\"yellow\"))\n        print(\"run time performance:\")\n        print(f\"  overrun    {noverrun} / {nok} ({noverrun/(nok+noverrun)*100:.1f}%)\")\n        print(f\"  t_max      {stats.max*1000:.1f} ms\")\n        print(f\"  t_mean     {stats.mean*1000:.1f} ms\")\n        print(f\"  t_sdev     {stats.sdev*1000:.1f} ms\")\n        print(f\"  t_max / dt {stats.max/dt*100:.1f}%\")\n        print(attr(0))\n\n        return out\n\n        # assert bd.compiled, \"Network has not been compiled\"\n\n        # state = BDRealTimeState()\n        # self.state = state\n\n        # # process the watchlist\n        # #  elements can be:\n        # #   - block or Plug reference\n        # #   - str in the form BLOCKNAME[PORT]\n        # watchlist = []\n        # watchnamelist = []\n        # re_block = re.compile(r\"(?P<name>[^[]+)(\\[(?P<port>[0-9]+)\\])\")\n        # for w in watch:\n        #     if isinstance(w, str):\n        #         # a name was given, with optional port number\n        #         m = re_block.match(w)\n        #         if m is None:\n        #             raise ValueError(\"watch block[port] not found: \" + w)\n        #         name = m.group(\"name\")\n        #         port = int(m.group(\"port\"))\n        #         b = bd.blocknames[name]\n        #         plug = b[port]\n        #     elif isinstance(w, Block):\n        #         # a block was given, defaults to port 0\n        #         plug = w[0]\n        #     elif isinstance(w, Plug):\n        #         # a plug was given\n        #         plug = w\n        #     watchlist.append(plug)\n        #     watchnamelist.append(str(plug))\n        # state.watchlist = watchlist\n        # state.watchnamelist = watchnamelist\n\n        # for clock in bd.clocklist:\n        #     clock.start(state)\n\n        # state.tlist = []\n        # state.xlist = []\n        # state.plist = [[] for p in state.watchlist]\n\n        # print(\"run\")\n        # t0 = time.time()\n        # stop = t0\n        # tmax = 0\n        # nok = 0\n        # n = 0\n        # tsum = 0\n        # tsum2 = 0\n        # tmax = 0\n        # noverrun = 0\n        # self.running = True\n        # while self.running:\n        #     tnext, sources = self.state.eventq.pop()\n\n        #     if tnext is None:\n        #         print(\"E\", end=\"\")\n        #         time.sleep(0.02)\n        #         continue\n\n        #     if tnext > T:\n        #         break\n\n        #     # print('dequeue', t)\n        #     stop = t0 + tnext\n        #     ts = time.time()\n        #     sleep_time = stop - ts\n        #     if sleep_time > 0:\n        #         # print('sleeping for', sleep_time)\n        #         time.sleep(sleep_time)\n        #         tmax = max(tmax, time.time() - ts)\n        #         # if tmax > 0.2:\n        #         #     print(tmax, sleep_time)\n        #         print(\".\", end=\"\")\n        #         nok += 1\n        #     else:\n        #         # print('timer overrun')\n        #         print(\"x\", end=\"\")\n        #         noverrun += 1\n\n        #     # self.t = t\n        #     # self.clocks = clocks\n        #     # self.sem.release()\n\n        #     # evaluate the block diagram\n        #     te_0 = time.time()\n        #     bd.evaluate_plan([], tnext)\n        #     te_1 = time.time()\n\n        #     dt = te_1 - te_0\n        #     n += 1\n        #     tsum += dt\n        #     tsum2 += dt * dt\n        #     tmax = max(tmax, dt)\n\n        #     # visit all the blocks and clocks that have an event now\n        #     for source in sources:\n        #         # if isinstance(source, Clock):\n        #         #     # clock ticked, save its state\n        #         #     clock.savestate(tnext)\n        #         source.next_event(self.state)\n\n        #     # visit all the blocks and clocks that have an event now\n        #     for source in sources:\n        #         if isinstance(source, Clock):\n        #             # clock ticked, save its state\n        #             clock.savestate(tnext)\n        #             clock.next_event(self.state)\n\n        #             # get the new state\n        #             clock._x = clock.getstate()\n\n        #     # stash the results\n        #     state.tlist.append(tnext)\n\n        #     # record the ports on the watchlist\n        #     for i, p in enumerate(state.watchlist):\n        #         state.plist[i].append(p.block.output(tnext)[p.port])\n\n        #     sys.stdout.flush()\n\n        # # save buffered data in a Struct\n        # out = BDStruct(name=\"results\")\n        # # out.t = np.array(state.tlist)\n        # # out.x = np.array(state.xlist)\n        # # out.xnames = bd.statenames\n\n        # # save clocked states\n        # for c in bd.clocklist:\n        #     name = c.name.replace(\".\", \"\")\n        #     clockdata = BDStruct(name)\n        #     clockdata.t = np.array(c.t)\n        #     clockdata.x = np.array(c.x)\n        #     out.add(name, clockdata)\n\n        # # save the watchlist into variables named y0, y1 etc.\n        # for i, p in enumerate(watchlist):\n        #     out[\"y\" + str(i)] = np.array(state.plist[i])\n        # out.ynames = watchnamelist\n\n        # print(fg(\"yellow\"))\n        # print(f\"tmax {tmax}\")\n        # print(f\"n ok      {nok} ({nok/(nok+noverrun)*100:.1f}%)\")\n        # print(f\"n overrun {noverrun} ({noverrun/(nok+noverrun)*100:.1f}%)\")\n        # print(f\"t mean {tsum/n*1000:.1f} ms\")\n        # print(f\"t sdev {math.sqrt((tsum2 - tsum**2/n)/(n-1)*1000):.1f} ms\")\n        # print(f\"t max {tmax*1000:.1f} ms\")\n        # print(attr(0))\n\n        # return out\n        # self.state.eventq.start()\n\n        # n = 0\n        # tsum = 0\n        # tsum2 = 0\n        # tmax = 0\n\n        # while True:\n        #     t, clocks = self.state.eventq.wait()\n        #     # print('run wakes up', t, clocks)\n        #     state.t = t\n\n        #     if t > T:\n        #         break\n\n        #     # evaluate the block diagram\n        #     t0 = time.time()\n        #     bd.evaluate_plan([], t)\n        #     t1 = time.time()\n\n        #     # visit all the blocks and clocks that have an event now\n        #     for clock in clocks:\n        #         # if isinstance(source, Clock):\n        #         #     # clock ticked, save its state\n        #         #     clock.savestate(tnext)\n        #         clock.next_event(self.state)\n\n        #     # update some stats about block diagram execution time\n        #     dt = t1 - t0\n        #     n += 1\n        #     tsum += dt\n        #     tsum2 += dt*dt\n        #     tmax = max(tmax, dt)\n\n        # self.state.eventq.stop()\n\n        # print(fg('yellow'))\n        # print(f't mean {tsum/n*1000:.1f} ms')\n        # print(f't sdev {math.sqrt((tsum2 - tsum**2/n)/(n-1)*1000):.1f} ms')\n        # print(f't max {tmax*1000:.1f} ms')\n        # print(attr(0))\n"
  },
  {
    "path": "bdsim/run_sim.py",
    "content": "import os\nfrom pathlib import Path\nimport sys\nimport importlib\nimport traceback as tb\nimport inspect\nfrom collections import Counter, namedtuple\nimport argparse\nimport types\nimport warnings\nimport time\n\nfrom bdsim.blockdiagram import BlockDiagram\nfrom bdsim.components import OptionsBase, Block, Clock, BDStruct, Plug, clocklist\nimport spatialmath.base as smb\nimport tempfile\nimport subprocess\nimport webbrowser\nimport traceback\n\nimport numpy as np\nimport scipy.integrate as integrate\nimport matplotlib.pyplot as plt\nimport re\nfrom colored import fg, attr\n\ntry:\n    from progress.bar import FillingCirclesBar\n\n    _FillingCirclesBar = True\nexcept ImportError:\n    _FillingCirclesBar = False\n\n\nclass Progress:\n    # print a progress bar\n    # https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console\n    @staticmethod\n    def printProgressBar(\n        fraction, prefix=\"\", suffix=\"\", decimals=1, length=50, fill=\"█\", printEnd=\"\\r\"\n    ):\n        percent = (\"{0:.\" + str(decimals) + \"f}\").format(fraction * 100)\n        filledLength = int(length * fraction)\n        bar = fill * filledLength + \"-\" * (length - filledLength)\n        print(f\"\\r{prefix} |{bar}| {percent}% {suffix}\", end=printEnd)\n\n    def __init__(self, enable=True):\n        self.enable = enable\n        self.length = 60\n        if not enable:\n            return\n\n    def start(self, T):\n        self.T = T\n\n        if not self.enable:\n            return\n\n        if _FillingCirclesBar:\n            self.bar = FillingCirclesBar(\n                \"bdsim\", max=100, suffix=\"%(percent).1f%% - %(eta)ds\"\n            )\n        else:\n            self.printProgressBar(\n                0, prefix=\"Progress:\", suffix=\"complete\", length=self.length\n            )\n\n    def end(self):\n        \"\"\"\n        Clean up progress bar\n        \"\"\"\n        if not self.enable:\n            return\n\n        if _FillingCirclesBar:\n            self.bar.finish()\n        else:\n            print(\"\\r\" + \" \" * (self.length + 20) + \"\\r\")\n\n    def update(self, t):\n        \"\"\"\n        Update progress bar\n\n        :param t: current simulation time, defaults to None\n        :type t: float, optional\n\n        Update progress bar as a percentage of the maximum simulation time,\n        given as an argument to ``run``.\n\n        :seealso: :meth:`run` :meth:`progress_done`\n        \"\"\"\n        if not self.enable:\n            return\n\n        if _FillingCirclesBar:\n            self.bar.goto(round(t / self.T * 100))\n        else:\n            self.printProgressBar(\n                t / self.T, prefix=\"Progress:\", suffix=\"complete\", length=self.length\n            )\n\n\nclass TimeQ:\n    \"\"\"\n    Time-ordered queue for events\n\n    The list comprises tuples of (time, block) to reflect an event associated\n    with the specified block at the specified time.\n\n    The list is not ordered, and is sorted on a pop event.\n    \"\"\"\n\n    def __init__(self):\n        self.q = []\n        self.dirty = False\n\n    def __len__(self):\n        \"\"\"\n        Length of time-ordered queue\n\n        :return: number of items in the queue\n        :rtype: int\n        \"\"\"\n        return len(self.q)\n\n    def __str__(self):\n        \"\"\"\n        String representation of time-ordered queue\n\n        :return: show length and first item\n        :rtype: str\n        \"\"\"\n        if len(self) == 0:\n            return f\"TimeQ: len={len(self)}\"\n        else:\n            return f\"TimeQ: len={len(self)}, first out {self.q[0]}\"\n\n    def __repr__(self):\n        events = []\n        for t in self.q:\n            events.append(str(t))\n        return \"\\n\".join(events)\n\n    def push(self, value):\n        \"\"\"\n        Push value onto time-ordered queue\n\n        :param value: tuple (time, block)\n        :type value: tuple\n\n        Push a block and a time onto the queue.\n        \"\"\"\n        self.q.append(value)\n        self.dirty = True\n\n    def pop(self, dt=0):\n        \"\"\"\n        Pop nearest items from the time-ordered queue\n\n        :param dt: time window, defaults to 0\n        :type dt: float, optional\n        :return: time of first block in queue and a list of blocks within the time window\n        :rtype: float, list\n\n        The next block is popped from the queue and all blocks in the time\n        window, that occur no more than ``dt`` later, are also popped.\n        \"\"\"\n        if len(self) == 0:\n            return None, []\n\n        if self.dirty:\n            self.q.sort(key=lambda x: x[0])\n            self.dirty = False\n\n        qfirst = self.q.pop(0)\n        t = qfirst[0]\n        blocks = [qfirst[1]]\n        while len(self.q) > 0 and self.q[0][0] < (t + dt):\n            blocks.append(self.q.pop(0)[1])\n        return t, blocks\n\n    def pop_until(self, t):\n        \"\"\"\n        Pop nearest items from time-ordered queue\n\n        :param t: time\n        :type t: float\n        :return: list of blocks remaining sorted by receding time\n        :rtype: list\n\n        Pops all items with time less than or equal to ``t``.\n        \"\"\"\n        if len(self) == 0:\n            return []\n\n        if self.dirty:\n            self.q.sort(key=lambda x: x[0])\n            self.dirty = False\n\n        i = 0\n        while True:\n            if self.q[i][0] > t:\n                out = self.q[:i]\n                self.q = self.q[i:]\n                return out\n            i += 1\n\n\n# convert class name to BLOCK name\n# strip underscores and capitalize\ndef blockname(name):\n    return name.upper()\n\n\nclass BDSimState:\n    \"\"\"\n    :ivar x: state vector\n    :vartype x: np.ndarray\n    :ivar T: maximum simulation time (seconds)\n    :vartype T: float\n    :ivar t: current simulation time (seconds)\n    :vartype t: float\n    :ivar fignum: number of next matplotlib figure to create\n    :vartype fignum: int\n    :ivar stop: reference to block wanting to stop simulation, else None\n    :vartype stop: Block subclass\n    :ivar checkfinite: halt simulation if any wire has inf or nan\n    :vartype checkfinite: bool\n    :ivar graphics: enable graphics\n    :vartype graphics: bool\n    \"\"\"\n\n    def __init__(self):\n        self.x = None  # continuous state vector numpy.ndarray\n        self.T = None  # maximum.BlockDiagram time\n        self.t = None  # current time\n        self.fignum = 0\n        self.stop = None\n        self.checkfinite = True\n\n        self.debugger = True\n        self.t_stop = None  # time-based breakpoint\n        self.eventq = TimeQ()\n\n    def declare_event(self, block, t):\n        self.eventq.push((t, block))\n\n\nclass BDSim:\n    _blocklibrary = None\n\n    def __init__(self, banner=True, packages=None, load=True, toolboxes=True, **kwargs):\n        \"\"\"\n        :param banner: display docstring banner, defaults to True\n        :type banner: bool, optional\n        :param packages: colon-separated list of folders to search for blocks\n        :type packages: str\n        :param load: dynamically load blocks from libraries, defaults to True\n        :type load: bool,optional\n        :param sysargs: process options from sys.argv, defaults to True\n        :type sysargs: bool, optional\n        :param graphics: enable graphics, defaults to True\n        :type graphics: bool, optional\n        :param animation: enable animation, defaults to False\n        :type animation: bool, optional\n        :param progress: enable progress bar, defaults to True\n        :type progress: bool, optional\n        :param debug: debug options, defaults to None\n        :type debug: str, optional\n        :param backend: matplotlib backend, defaults to 'Qt5Agg''\n        :type backend: str, optional\n        :param tiles: figure tile layout on monitor, defaults to '3x4'\n        :type tiles: str, optional\n        :raises ImportError: syntax error in block\n        :return: parent object for blockdiagram simulation\n        :rtype: BDSim\n\n        If ``sysargs`` is True, process command line arguments and passed\n        options.  Command line arguments have precedence.\n\n        ===================  =========  ========  ===========================================\n        Command line switch  Argument   Default   Behaviour\n        ===================  =========  ========  ===========================================\n        --graphics, +g       graphics   True      enable graphical display\n        --animation, +a      animation  True      update graphics at each time step\n        --hold, +h           hold       True      hold graphics in done()\n        --no-graphics, -g    graphics   True      disable graphical display\n        --no-animation, -a   animation  True      don't update graphics at each time step\n        --no-hold, -H        hold       True      do not hold graphics in done()\n        --no-progress, -p    progress   True      do not display simulation progress bar\n        --backend BE         backend    'Qt5Agg'  matplotlib backend\n        --tiles RxC, -t RxC  tiles      '3x4'     arrangement of figure tiles on the display\n        --shape WxH          shape      None      window size, default matplotlib size\n        --altscreen, +A,     altscreen  True      display plots on second monitor\n        --no-altscreen, -A   altscreen  True      do not display plots on second monitor\n        --debug F, -d F      debug      ''        debug flag string\n        --simtime T[,dt]     simtime    (10,)     simulation time\n        --verbose, -v        verbose    False     be verbose\n        --quiet, -q          quiet      False     suppress reports\n        -o                   outfile    None      output pickled simulation results to bd.out\n        --out OUTFILE        outfile    None      file to save pickled simulation results\n        --set P, -s P        setparam   []        override block parameter using ``P=block:param=value``\n        --global G           setglob    []        override global parameter using ``G=var=value``\n        ===================  =========  ========  ===========================================\n\n        .. note:: ``animation`` and ``graphics`` options are coupled.  If\n            ``graphics=False``, all graphics is suppressed.  If\n            ``graphics=True`` then graphics are shown and the behaviour depends\n            on ``animation``.  ``animation=False`` shows graphs at the end of\n            the simulation, while ``animation=True` will animate the graphs\n            during simulation.\n\n        :seealso: :meth:`set_globals()`\n        \"\"\"\n\n        self.packages = packages\n\n        # process command line and overall options\n        self.options = Options(**kwargs)\n\n        # print docstring as a startup banner\n        if banner and not self.options.quiet:\n            calling_frame = inspect.currentframe().f_back\n            try:\n                doc = calling_frame.f_locals[\"__doc__\"]\n                if doc is not None:\n                    for line in doc.strip().split(\"\\n\"):\n                        print(\"* \" + line)\n            except KeyError:\n                pass\n\n        # load modules from the blocks folder\n        if BDSim._blocklibrary is None and load:\n            BDSim._blocklibrary = self.load_blocks(\n                self.options.verbose, toolboxes=toolboxes\n            )\n        if self.options.blocks:\n            self.blocks()\n\n    def blockinfo(self, block=None):\n        \"\"\"Return info about all blocks\n\n        :param block: name of block to return info for, otherwise list of info for all\n        :type block: str, optional\n        :returns: parameters of blocks\n        :rtype: dict or list of dicts\n\n        Detailed metadata about a block is obtained by introspection and parsing the block's docstring.\n\n        ==========   =====================================================\n        Key          Description\n        ==========   =====================================================\n        path         Path to the folder containing block definition\n        classname    Name of class\n        url          URL of online documentation\n        class        Reference to the class\n        module       Name of the module  package.blocks.module\n        package      Name of the package, eg. bdsim, roboticstoolbox\n        params       Dict of (type, descrip), indexed by parameter name\n        inputs       List of names of block inputs\n        outputs      List of names of block outputs\n        nin          Number of inputs, -1 if variable\n        nout         Number of outputs, -1 if variable\n        blockclass   Block class, eg. source, sink etc.\n        ==========   =====================================================\n\n        \"\"\"\n        if block is None:\n            return self._blocklibrary\n        else:\n            return self._blocklibrary[block]\n\n    def __str__(self):\n        \"\"\"\n        String representation of simulation\n\n        :return: single line summary of simulation environment\n        :rtype: str\n        \"\"\"\n        s = f\"BDSim: {len(self._blocklibrary)} blocks in library\\n\"\n        return s\n\n    def __repr__(self):\n        s = (\n            f\"Block diagram simulation runtime, {len(self._blocklibrary)} blocks\"\n            \" imported to library.\\n\"\n        )\n        s += \"simulation options:\\n\"\n        for k, v in self.state.options.items():\n            s += \"  {:s}: {}\\n\".format(k, v)\n        return s\n\n    def run(\n        self,\n        bd,\n        T=5,\n        dt=None,\n        solver=\"RK45\",\n        solver_args={},\n        debug=\"\",\n        block=None,\n        checkfinite=True,\n        minstepsize=1e-12,\n        watch=[],\n    ):\n        \"\"\"\n        Run the block diagram\n\n        :param T: maximum integration time, defaults to 10.0\n        :type T: float, optional\n        :param dt: maximum time step\n        :type dt: float, optional\n        :param solver: integration method, defaults to ``RK45``\n        :type solver: str, optional\n        :param block: matplotlib block at end of run, default False\n        :type block: bool\n        :param checkfinite: error if inf or nan on any wire, default True\n        :type checkfinite: bool\n        :param minstepsize: minimum step length, default 1e-6\n        :type minstepsize: float\n        :param watch: list of input ports to log\n        :type watch: list\n        :param solver_args: arguments passed to ``scipy.integrate``\n        :type solver_args: dict\n        :return: time history of signals and states\n        :rtype: Sim class\n\n        Assumes that the network has been compiled.\n\n        The system is simulated from time 0 to ``T``.\n\n        The integration step time ``dt`` defaults to ``T/100`` but can be\n        specified.  Finer control can be achieved using ``max_step`` and\n        ``first_step`` parameters to the underlying integrator using the\n        ``solver_args`` parameter.\n\n        Results are returned in a class with attributes:\n\n        - ``t`` the time vector: ndarray, shape=(M,)\n        - ``x`` is the state vector: ndarray, shape=(M,N)\n        - ``xnames`` is a list of the names of the states corresponding to columns of `x`, eg. \"plant.x0\",\n            defined for the block using the ``snames`` argument\n        - ``yN`` for a watched input where N is the index of the port mentioned in the ``watch`` argument\n        - ``ynames`` is a list of the names of the input ports being watched, same order as in ``watch`` argument\n\n        If there are no dynamic elements in the diagram, ie. no states, then ``x`` and ``xnames`` are not\n        present.\n\n        The ``watch`` argument is a list of one or more input ports whose value during simulation\n        will be recorded.  The elements of the list can be:\n            - a ``Block`` reference, which is interpretted as input port 0\n            - a ``Plug`` reference, ie. a block with an index or attribute\n            - a string of the form \"block[i]\" which is port i of the block named block.\n\n        The debug string comprises single letter flags:\n\n                - 'p' debug network value propagation\n                - 's' debug state vector\n                - 'd' debug state derivative\n\n        .. note:: Simulation stops if the step time falls below ``minsteplength``\n            which typically indicates that the solver is struggling with a very\n            harsh non-linearity.\n        \"\"\"\n\n        assert bd.compiled, \"Network has not been compiled\"\n\n        # get simulation time\n        #  --simtime=T  or --simtime=T,dt\n        if self.options.simtime is not None:\n            try:\n                default_times = eval(self.options.simtime)\n                if isinstance(default_times, (int, float)):\n                    T = default_times\n                elif isinstance(default_times, tuple):\n                    T, dt = default_times\n                else:\n                    raise ValueError(\n                        \"bad simtime option passed \" + self.options.simtime\n                    )\n            except:\n                raise ValueError(\"bad simtime option passed \" + self.options.simtime)\n\n        # final default values\n        # T = T or 5\n        # dt = dt or 0.01\n\n        simstate = BDSimState()\n        self.simstate = simstate\n        simstate.T = T\n\n        if dt is None and not \"max_step\" in solver_args:\n            dt = T / 100\n        simstate.dt = dt\n        simstate.count = 0\n        simstate.bdtime = 0.0\n        simstate.gtime = 0.0  # last graphics update\n        simstate.solver = solver\n        simstate.solver_args = solver_args\n        simstate.minstepsize = minstepsize\n        simstate.stop = None  # allow any block to stop.BlockDiagram by setting this to the block's name\n        simstate.checkfinite = checkfinite\n        # state.options = copy.copy(self.options)\n        simstate.options = self.options\n        self.bd = bd\n        simstate.t_stop = None\n        if debug:\n            # append debug flags\n            if debug not in simstate.options.debug:\n                simstate.options.debug += debug\n\n        # turn off progress bar if any debug options are given\n        if len(simstate.options.debug) > 0:\n            self.options.progress = False\n        if block is not None:\n            self.options.hold = block\n\n        # process the watchlist\n        #  elements can be:\n        #   - block or Plug reference\n        #   - str in the form BLOCKNAME[PORT]\n        watchlist = []\n        watchnamelist = []\n        re_block = re.compile(r\"(?P<name>[^[]+)(\\[(?P<port>[0-9]+)\\])?\")\n        for w in watch:\n            if isinstance(w, str):\n                # a name was given, with optional port number\n                m = re_block.match(w)\n                if m is None:\n                    raise ValueError(\"watch block[port] not found: \" + w)\n                name = m.group(\"name\")\n\n                # get optional port number\n                port = m.group(\"port\")\n                if port is None:\n                    port = 0\n                else:\n                    port = int(port)\n\n                b = bd.blocknames[name]\n                plug = b[port]\n            elif isinstance(w, Block):\n                # a block was given, defaults to port 0\n                plug = w[0]\n            elif isinstance(w, Plug):\n                # a plug was given\n                plug = w\n            watchlist.append(plug)\n            watchnamelist.append(str(plug))\n        simstate.watchlist = watchlist\n        simstate.watchnamelist = watchnamelist\n\n        x0 = bd.getstate0()\n        if not self.options.quiet:\n            print(fg(\"yellow\"))\n            print(f\">>> Start simulation: T = {T}, dt = {dt}\")\n            print(f\"  Continuous state variables: {bd.nstates}\")\n            print(\"     x0 = \", x0)\n\n            print(f\"  Discrete state variables:   {bd.ndstates}\")\n\n        # get the number of discrete states from all clocks\n        ndstates = 0\n        for clock in bd.clocklist:\n            nds = 0\n            for b in clock.blocklist:\n                nds += b.ndstates\n            ndstates += nds\n            if not self.options.quiet:\n                print(f\"    {clock.name}: x0 = \", clock.getstate0())\n\n        if not self.options.quiet:\n            print(attr(0))\n\n        # update block parameters given on command line\n        self.update_parameters(bd)\n\n        # tell all blocks we're starting a BlockDiagram\n        self.bd.start(simstate)\n\n        # initialize list of time and states\n        simstate.tlist = []\n        simstate.xlist = []\n        simstate.plist = [[] for p in simstate.watchlist]\n\n        self.progress = Progress(enable=self.options.progress)\n        self.progress.start(T)\n\n        if len(simstate.eventq) == 0:\n            # no simulation events, solve it in one go\n            self.run_interval(bd, 0, T, x0, simstate=simstate)\n            nintervals = 1\n        else:\n            # we have simulation events, solve it in chunks\n            simstate.declare_event(None, T)  # add an event at end of simulation\n\n            # ignore all the events at zero\n            tprev = 0\n            simstate.eventq.pop_until(tprev)\n\n            # get the state vector\n            x = x0\n\n            nintervals = 0\n            while True:\n                # get next event from the queue and the list of blocks or\n                # clocks at that time\n                tnext, sources = simstate.eventq.pop(dt=1e-6)\n                if tnext is None:\n                    break\n                # run system until next event time\n                x = self.run_interval(bd, tprev, tnext, x, simstate=simstate)\n                nintervals += 1\n\n                # visit all the blocks and clocks that have an event now\n                for source in sources:\n                    if isinstance(source, Clock):\n                        # clock ticked, save its state\n                        source.savestate(tnext)\n                        source.next_event(self.simstate)\n\n                        # get the new state\n                        source._x = source.getstate(tnext)\n                tprev = tnext\n\n                # are we done?\n                if simstate.t is not None and simstate.t >= T:\n                    break\n\n        # finished integration\n\n        self.progress.end()  # cleanup the progress bar\n\n        # print some info about the integration\n        if not self.options.quiet:\n            print(fg(\"yellow\"))\n            print(\"<<< Simulation complete\")\n            print(f\"  block diagram evaluations: {simstate.count}\")\n            print(\n                \"  block diagram exec time:  \"\n                f\" {simstate.bdtime / simstate.count * 1000.0:.3f} ms\"\n            )\n            print(f\"  time steps:                {len(simstate.tlist)}\")\n            print(f\"  integration intervals:     {nintervals}\")\n            print(attr(0))\n\n        # save buffered data in a Struct\n        out = BDStruct(name=\"results\")\n        out.t = np.array(simstate.tlist)\n        out.x = np.array(simstate.xlist)\n        out.xnames = bd.statenames\n\n        # save clocked states\n        for c in bd.clocklist:\n            name = c.name.replace(\".\", \"\")\n            clockdata = BDStruct(name)\n            clockdata.t = np.array(c.t)\n            clockdata.x = np.array(c.x)\n            out.add(name, clockdata)\n\n        # save the watchlist into variables named y0, y1 etc.\n        for i, p in enumerate(watchlist):\n            out[\"y\" + str(i)] = np.array(simstate.plist[i])\n        out.ynames = watchnamelist\n\n        # the command line options -o or --out saves results as a pickle file\n        #  -o defaults to bd.out\n        #  --out FILE allows the filename to be specified\n        #\n        # we can visualize the output file by\n        #\n        #   % python -mpickle bd.out\n        #   t      = ndarray:float64 (123,)\n        #   x      = ndarray:float64 (123, 1)\n        #   xnames = ['plantx0'] (list)\n        #   ynames = [] (list)\n\n        if self.options.outfile is not None:\n            out.dump(self.options.outfile)\n\n            if not self.options.quiet:\n                print(\"simulation results pickled --> \", self.options.outfile)\n\n        # pause until all graphics blocks close\n\n        if self.options.graphics and self.options.hold:\n            self.done(self.bd, block=self.options.hold)\n        return out\n\n    def update_parameters(self, bd):\n        \"\"\"\n        Set value of parameters according to command line arguments\n\n        Command line arguments of the form:\n\n            ``-s block:param=value``\n            ``--set block:param=value``\n\n        are stored as list items in ``options.setparam``\n\n        ``block`` can be either:\n\n        - the block's name as a string, either user assigned or bdsim assigned\n        - the block ``id`` as displayed by the ``report`` method\n\n        ``param`` is the name of the parameter used in the constructor\n\n        ``value`` is the new value of the variable\n        \"\"\"\n\n        re_set = re.compile(r\"(?P<block>[\\w\\.]+):(?P<param>[\\w]+)=(?P<value>.*)\")\n        for s in self.options.setparam:\n            m = re_set.match(s)\n            if m is None:\n                raise ValueError(\"bad set parameter: \" + s)\n\n            # get block reference\n            blockname = m[\"block\"]\n            try:\n                blockname = int(blockname)\n            except ValueError:\n                pass\n            block = bd[blockname]\n\n            param = m[\"param\"]\n            try:\n                prev_value = getattr(block, param)\n            except ValueError:\n                raise ValueError(f\"block {block.name} has no parameter '{param}'\")\n\n            # get the parameter\n            value = m[\"value\"]\n            new_value = None\n\n            try:\n                if \";\" in value:\n                    new_value = smb.str2array(value)\n                else:\n                    try:\n                        new_value = int(value)\n                    except ValueError:\n                        new_value = float(value)\n            except ValueError:\n                raise ValueError(\"cannot parse value \" + value)\n\n            # change the value\n            setattr(block, param, new_value)\n            print(\n                f\"changed value of {block.name}:{param} from {prev_value} ->\"\n                f\" {new_value}\"\n            )\n\n    def run_interval(self, bd, t0, T, x0, simstate=None):\n        \"\"\"\n        Integrate system over interval\n\n        :param bd: the system blockdiagram\n        :type bd: BlockDiagram\n        :param t0: initial time\n        :type t0: float\n        :param tf: final time\n        :type tf: float\n        :param x0: initial state vector\n        :type x0: ndarray(n)\n        :param simstate: simulation state object\n        :type simstate: SimState\n        :return: final state vector xf\n        :rtype: ndarray(n)\n\n        The system is integrated from from ``x0`` to ``xf`` over the interval ``t0`` to ``tf``.\n\n        \"\"\"\n        try:\n            if bd.nstates > 0:\n                # system has continuous states, solve it using numerical integration\n                # print('initial state x0 = ', x0)\n\n                # block diagram contains states, solve it using numerical integration\n\n                scipy_integrator = integrate.__dict__[\n                    simstate.solver\n                ]  # get user specified integrator\n\n                def ydot(t, y):\n                    simstate.t = t\n                    simstate.count += 1\n                    t0 = time.time()\n                    yd = bd.schedule_evaluate(y, t, sinks=False, simstate=simstate)\n                    t1 = time.time()\n                    simstate.bdtime += t1 - t0\n                    return yd\n\n                if simstate.dt is not None:\n                    simstate.solver_args[\"max_step\"] = simstate.dt\n\n                # print(f\"run interval: from {t0} to {t0+T}, args={state.solver_args}, x0={x0}\")\n                integrator = scipy_integrator(\n                    ydot, t0=t0, y0=x0, t_bound=T, **simstate.solver_args\n                )\n\n                # integrate\n                while integrator.status == \"running\":\n                    # step the integrator, calls _deriv and evaluate block diagram multiple times\n                    message = integrator.step()\n\n                    if integrator.status == \"failed\":\n                        print(\n                            fg(\"red\")\n                            + f\"\\nintegration completed with failed status: {message}\"\n                            + attr(0)\n                        )\n                        break\n\n                    # stash the results\n                    simstate.t = integrator.t\n                    simstate.tlist.append(integrator.t)\n                    simstate.xlist.append(integrator.y)\n\n                    # record the ports on the watchlist\n                    for i, p in enumerate(simstate.watchlist):\n                        b = p.block\n                        out = b.output(integrator.t, b.inputs, b._x)[p.port]\n                        simstate.plist[i].append(out)\n\n                    # update all blocks that need to know\n                    if (integrator.t - simstate.gtime) > (simstate.T / 200):\n                        bd.step(integrator.t)\n                        simstate.gtime = integrator.t\n                    # bd.step(integrator.t)\n\n                    self.progress.update(simstate.t)  # update the progress bar\n\n                    if integrator.status == \"finished\":\n                        break\n\n                    # has any block called a stop?\n                    if simstate.stop is not None:\n                        print(\n                            fg(\"red\") + f\"\\n--- stop requested at t={simstate.t:.4f} by\"\n                            f\" {simstate.stop}\" + attr(0)\n                        )\n                        break\n\n                    if (\n                        simstate.minstepsize is not None\n                        and integrator.step_size < simstate.minstepsize\n                    ):\n                        print(\n                            fg(\"red\") + \"\\n--- stopping on minimum step size at\"\n                            f\" t={simstate.t:.4f} with last stepsize\"\n                            f\" {integrator.step_size:g}\" + attr(0)\n                        )\n                        break\n\n                    if \"i\" in simstate.options.debug:\n                        bd._debugger(simstate, integrator)\n\n                return integrator.y  # return final state vector\n\n            elif len(clocklist) == 0:\n                # block diagram has no continuous or discrete states\n\n                assert simstate.dt is not None, \"if no states must specify dt\"\n\n                for t in np.arange(t0, T, simstate.dt):  # step through the time range\n                    # evaluate the block diagram\n                    simstate.t = t\n\n                    simstate.count += 1\n                    t0 = time.time()\n                    bd.schedule_evaluate([], t)\n                    t1 = time.time()\n                    simstate.bdtime += t1 - t0\n\n                    # stash the results\n                    simstate.tlist.append(t)\n\n                    # record the ports on the watchlist\n                    for i, p in enumerate(simstate.watchlist):\n                        b = p.block\n                        out = b.output(integrator.t, b.inputs, b._x)[p.port]\n                        simstate.plist[i].append(out)\n\n                    # update all blocks that need to know\n                    bd.step(t)\n\n                    self.progress.update(t)  # update the progress bar\n\n                    # has any block called a stop?\n                    if simstate.stop is not None:\n                        print(\n                            fg(\"red\") + f\"\\n--- stop requested at t={simstate.t:.4f} by\"\n                            f\" {simstate.stop}\" + attr(0)\n                        )\n                        break\n\n                    if \"i\" in simstate.options.debug:\n                        bd._debugger(simstate, integrator)\n\n            else:\n                # block diagram has no continuous states\n                t = t0\n                simstate.t = t\n                # evaluate the block diagram\n\n                simstate.count += 1\n                t0 = time.time()\n                bd.schedule_evaluate([], t)\n                t1 = time.time()\n                simstate.bdtime += t1 - t0\n\n                # stash the results\n                simstate.tlist.append(t)\n\n                # record the ports on the watchlist\n                for i, p in enumerate(simstate.watchlist):\n                    b = p.block\n                    out = b.output(integrator.t, b.inputs, b._x)[p.port]\n                    simstate.plist[i].append(out)\n\n                # update all blocks that need to know\n                if (t - simstate.gtime) > (simstate.T / 200):\n                    bd.step(t)\n                    simstate.gtime = t\n                # bd.step(t)\n\n                self.progress.update(simstate.t)  # update the progress bar\n\n                # has any block called a stop?\n                if simstate.stop is not None:\n                    print(\n                        fg(\"red\") + f\"\\n--- stop requested at t={simstate.t:.4f} by\"\n                        f\" {simstate.stop}\" + attr(0)\n                    )\n\n                if \"i\" in simstate.options.debug:\n                    bd._debugger(simstate)\n\n        except RuntimeError as err:\n            # bad things happens, print a message and return no result\n            print(\"unrecoverable error in evaluation: \", err)\n            raise\n\n    def blockdiagram(self, name=\"main\") -> BlockDiagram:\n        \"\"\"\n        Instantiate a new block diagram object.\n\n        :param name: diagram name, defaults to 'main'\n        :type name: str, optional\n        :return: parent object for blockdiagram\n        :rtype: BlockDiagram\n\n        This object describes the connectivity of a set of blocks and wires.\n\n        It is an instantiation of the ``BlockDiagram`` class with a factory\n        method for every dynamically loaded block which returns\n        an instance of the block.  These factory methods have names\n        which are all upper case, for example, the method ``.GAIN`` invokes\n        the constructor for the ``Gain`` class.\n\n        :seealso: :func:`BlockDiagram`\n        \"\"\"\n\n        # instantiate a new blockdiagram\n        bd = BlockDiagram(name=name)\n\n        def new_method(cls, bd):\n            # return a wrapper for the block constructor that automatically\n            # adds the block to the diagram's blocklist\n            def block_init_wrapper(self, *args, **kwargs):\n                block = cls(*args, bd=bd, **kwargs)  # call __init__ on the block\n                return block\n\n            # return a function that invokes the class constructor\n            f = block_init_wrapper\n\n            # move the __init__ docstring to the class to allow BLOCK.__doc__\n            f.__doc__ = cls.__init__.__doc__\n\n            return f\n\n        # bind the block constructors as new methods on this instance\n        self.blockdict = {}\n        for blockname, info in self._blocklibrary.items():\n            # create a function to invoke the block's constructor\n            f = new_method(info[\"class\"], bd)\n\n            # set a bound version of this function as an attribute of the instance\n            # method = types.MethodType(new_method, bd)\n            # setattr(bd, block.name, method)\n            setattr(bd, blockname, f.__get__(self))\n\n        # add a clone of the options\n        # bd.options = copy.copy(self.options)\n        bd.runtime = self\n\n        return bd\n\n    def DEBUG(self, debug, fmt, *args):\n        if debug[0] in self.options.debug:\n            print(f\"DEBUG.{debug:s}: \" + fmt.format(*args))\n\n    def done(self, bd, block=False):\n        if self.options.hold:\n            block = self.options.hold\n\n        try:\n            plt.show(block=block)\n        except KeyboardInterrupt:\n            print(\"bdsim: closing all windows\")\n            plt.close(\"all\")\n            # sys.exit(1)  # not sure why we have this\n            return\n        bd.done()\n        plt.close(\"all\")\n        plt.pause(0.5)  # let the event handler do its work\n\n    def closefigs(self):\n        for i in range(self.simstate.fignum):\n            print(\"close\", i + 1)\n            plt.close(i + 1)\n            plt.pause(0.1)\n        self.simstate.fignum = 0  # reset figure counter\n\n    def savefig(self, block, filename=None, format=\"pdf\", **kwargs):\n        block.savefig(filename=filename, format=format, **kwargs)\n\n    def savefigs(self, bd, format=\"pdf\", **kwargs):\n        from bdsim.graphics import GraphicsBlock\n\n        for b in bd.blocklist:\n            if isinstance(b, GraphicsBlock):\n                b.savefig(filename=b.name, format=format, **kwargs)\n\n    def showgraph(self, bd, **kwargs):\n        # create the temporary dotfile\n        dotfile = tempfile.TemporaryFile(mode=\"w\")\n        bd.dotfile(dotfile, **kwargs)\n\n        # rewind the dot file, create PDF file in the filesystem, run dot\n        dotfile.seek(0)\n        pdffile = tempfile.NamedTemporaryFile(suffix=\".pdf\", delete=False)\n        subprocess.run(\"dot -Tpdf\", shell=True, stdin=dotfile, stdout=pdffile)\n\n        # open the PDF file in browser (hopefully portable), then cleanup\n        webbrowser.open(f\"file://{pdffile.name}\")\n        os.remove(pdffile.name)\n\n    def fatal(self, message, retval=1):\n        \"\"\"\n        Fatal simulation error\n\n        :param message: Error message\n        :type message: str\n        :param retval: system return value (*nix only) defaults to 1\n        :type retval: int, optional\n\n        Display the error message then terminate the process.  For operating\n        systems that support it, return an integer code.\n        \"\"\"\n        # TODO print text in some color\n        print(message)\n        sys.exit(retval)\n\n    def load_blocks(self, verbose=True, toolboxes=True):\n        \"\"\"\n        Dynamically load all block definitions.\n\n        :raises ImportError: module could not be imported\n        :return: dictionary of block metadata\n        :rtype: dict of dict\n\n        Reads blocks from .py files found in bdsim/bdsim/blocks, folders\n        given by colon separated list in envariable BDSIMPATH, and the\n        command line option ``packages``.\n\n        The result is a dict indexed by the upper-case block name with elements:\n        - ``path`` to the folder holding the Python file defining the block\n        - ``classname``\n        - ``blockname``, upper case version of ``classname``\n        - ``url`` of online documentation for the block\n        - ``package`` containing the block\n        - `doc` is the docstring from the class constructor\n        \"\"\"\n\n        def parse_docstring(ds):\n            # this should have two versions: sphinx, numpy doc styles\n            import re\n            from collections import OrderedDict\n\n            re_isfield = re.compile(r\"\\s*:[a-zA-Zα-ωΑ-Ω0-9_ ]+:\")\n            re_field = re.compile(\n                r\"^\\s*:(?P<field>[a-zA-Z]+)(?:\"\n                r\" +(?P<var>[a-zA-Zα-ωΑ-Ω0-9_]+))?:(?P<body>.+)$\"\n            )\n\n            # a-zA-Zα-ωΑ-Ω0-9_\n            def indent(s):\n                return len(s) - len(s.lstrip())\n\n            fieldnames = (\"param\", \"type\", \"input\", \"output\")\n            excludevars = (\"kwargs\", \"inputs\")\n\n            # parse out all lines of the form:\n            #\n            #  :field var: body\n            # or\n            #  :field var: body with a very long description that\n            #       carries over to another line or two\n            fieldlines = []\n            for para in ds.split(\"\\n\\n\"):\n                # print(para)\n                # print('--')\n\n                indent_prev = None\n                infield = False\n\n                for line in para.split(\"\\n\"):\n                    if len(line) == 0:\n                        continue\n                    if indent_prev is None:\n                        indent_prev = indent(line)\n                    if re_isfield.match(line) is not None:\n                        fieldlines.append(line.lstrip())\n                        infield = True\n                    if indent(line) > indent_prev and infield:\n                        fieldlines[-1] += \" \" + line.lstrip()\n                    if indent(line) == indent_prev:\n                        infield = False\n\n            # fieldlines is a list of lines of the form\n            #\n            #   :field var: body\n            #\n            # where extension lines have been concatenated\n\n            # create a dict of dicts\n            #\n            #   dict[field][var] -> body\n            dict = OrderedDict()\n\n            for line in fieldlines:\n                m = re_field.match(line)\n                if m is not None:\n                    field, var, body = m.groups()\n                    if var in excludevars or field not in fieldnames:\n                        continue\n                    if field not in dict:\n                        dict[field] = {var: body}\n                    else:\n                        dict[field][var] = body\n                    dict[m.group(\"field\")]\n\n            # now connect pairs of lines of the form\n            #\n            # :param X: param description\n            # :type X: type description\n            #\n            # params[X] = (type description, param description)\n            params = {}\n            if \"param\" in dict:\n                for var, descrip in dict[\"param\"].items():\n                    typ = dict[\"type\"].get(var, None)\n                    params[var] = (typ, descrip)\n\n            return params\n\n        block = namedtuple(\"block\", \"name, cls, path\")\n\n        if toolboxes:\n            packages = [\n                \"bdsim\",\n                \"roboticstoolbox\",\n                \"machinevisiontoolbox\",\n            ]\n        else:\n            packages = [\"bdsim\"]\n        env = os.getenv(\"BDSIMPATH\")\n        if env is not None:\n            packages += env.split(\":\")\n        if self.packages is not None:\n            packages += self.packages.split(\":\")\n\n        blocks = {}\n        moduledicts = {}\n        for package in packages:\n            try:\n                spec = importlib.util.find_spec(\".blocks\", package=package)\n            except ModuleNotFoundError as err:\n                print(\n                    f\"package {package} not loaded: not found, not a proper package, no blocks module\"\n                )\n                continue\n\n            if spec is None:\n                print(f\"package {package} not found or has no blocks module\")\n                continue\n\n            try:\n                pkg = spec.loader.load_module()\n            except Exception as err:\n                print(f\"package {package} contains a compile error\")\n                exc = sys.exception()\n                print(fg(\"red\"))\n                tb.print_exception(exc, limit=-4)\n                print(attr(0))\n                continue\n            # except ImportError:\n            #     print(f\"package {package} load error, continuing\")\n            #     import textwrap\n\n            #     print(textwrap.indent(traceback.format_exc(), \"    \"))\n            #     continue\n\n            moduledict = {}\n\n            for name, value in pkg.__dict__.items():\n                # check if it's a valid block class\n                if not inspect.isclass(value):\n                    continue\n                if Block not in inspect.getmro(value):\n                    continue\n                if name.endswith(\"Block\"):\n                    continue\n\n                if value.blockclass in (\"source\", \"transfer\", \"function\"):\n                    # must have an output function\n                    valid = (\n                        hasattr(value, \"output\")\n                        and callable(value.output)\n                        and len(inspect.signature(value.output).parameters) == 4\n                    )\n                    if not valid:\n                        print(\n                            \"block {:s} has missing/improper output method\".format(\n                                value.__name__\n                            )\n                        )\n                        continue\n\n                if value.blockclass == \"sink\":\n                    # must have a step function with at least one\n                    # parameter: step(self [,state])\n                    valid = (\n                        hasattr(value, \"step\")\n                        and callable(value.step)\n                        and len(inspect.signature(value.step).parameters) == 3\n                    )\n                    if not valid:\n                        print(\n                            \"block {:s} has missing/improper step method\".format(\n                                value.__name__\n                            )\n                        )\n                        continue\n\n                # add it to the dict of blocks indexed by module\n                if value.__module__ in moduledict:\n                    moduledict[value.__module__].append(name)\n                else:\n                    moduledict[value.__module__] = [name]\n\n                # create a dict for the block with metadata\n                block_info = {}\n                block_info[\"path\"] = (\n                    pkg.__path__\n                )  # path to folder holding block definition\n                block_info[\"classname\"] = name\n                block_info[\"blockname\"] = blockname(name)\n\n                try:\n                    block_info[\"url\"] = (\n                        pkg.__dict__[\"url\"] + \"#\" + block.__module__ + \".\" + name\n                    )\n                except KeyError:\n                    block_info[\"url\"] = None\n\n                block_info[\"class\"] = value\n                block_info[\"module\"] = value.__module__\n                block_info[\"package\"] = package\n\n                # get the docstring from the class and the constructor\n                ds = \"\"\n                if value.__doc__ is not None:\n                    ds += value.__doc__\n                if value.__init__.__doc__ is not None:\n                    ds += value.__init__.__doc__\n                if ds is None:\n                    raise ValueError(\"block has no docstring\")\n                block_info[\"doc\"] = ds\n                param_dict = parse_docstring(ds)\n                block_info[\"params\"] = param_dict\n\n                # now add all the other stuff we know about the block\n                block_info[\"inputs\"] = param_dict.get(\"input\")\n                block_info[\"outputs\"] = param_dict.get(\"output\")\n\n                block_info[\"nin\"] = value.nin\n                block_info[\"nout\"] = value.nout\n                block_info[\"blockclass\"] = value.__base__.__name__.lower().replace(\n                    \"block\", \"\"\n                )\n\n                blocks[blockname(name)] = block_info\n\n            moduledicts[package] = moduledict\n\n        self.moduledicts = moduledicts\n        return blocks\n\n    def blocks(self):\n        \"\"\"\n        List all loaded blocks.\n\n        Example::\n\n            73  blocks loaded\n            bdsim.blocks.functions..................: Sum Prod Gain Clip Function Interpolate\n            bdsim.blocks.sources....................: Constant Time WaveForm Piecewise Step Ramp\n            bdsim.blocks.sinks......................: Print Stop Null Watch\n            bdsim.blocks.transfers..................: Integrator PoseIntegrator LTI_SS LTI_SISO\n            bdsim.blocks.discrete...................: ZOH DIntegrator DPoseIntegrator\n            bdsim.blocks.linalg.....................: Inverse Transpose Norm Flatten Slice2 Slice1 Det Cond\n            bdsim.blocks.displays...................: Scope ScopeXY ScopeXY1\n            bdsim.blocks.connections................: Item Dict Mux DeMux Index SubSystem InPort OutPort\n            roboticstoolbox.blocks.arm..............: FKine IKine Jacobian Tr2Delta Delta2Tr Point2Tr TR2T FDyn IDyn Gravload\n            ........................................: Inertia Inertia_X FDyn_X ArmPlot Traj JTraj LSPB CTraj CirclePath\n            roboticstoolbox.blocks.mobile...........: Bicycle Unicycle DiffSteer VehiclePlot\n            roboticstoolbox.blocks.uav..............: MultiRotor MultiRotorMixer MultiRotorPlot\n            machinevisiontoolbox.blocks.camera......: Camera Visjac_p EstPose_p ImagePlane\n        \"\"\"\n\n        def dots(s, n=40):\n            return s + \".\" * (n - len(s))\n\n        print(len(self._blocklibrary), \" blocks loaded\")\n        for pkg, dict in self.moduledicts.items():\n            for k, v in dict.items():\n                s = \"\"\n                once = False\n                while len(v) > 0:\n                    n = v.pop(0) + \" \"\n                    if len(s + n) < 80:\n                        s += n\n                        continue\n                    else:\n                        # line will be too long\n                        if not once:\n                            print(f\"{dots(k)}: {s}\")\n                            once = True\n                        else:\n                            print(f\"{dots('')}: {s}\")\n                        s = \"\"\n                if len(s) > 0:\n                    if once:\n                        print(f\"{dots('')}: {s}\")\n                    else:\n                        print(f\"{dots(k)}: {s}\")\n\n    def set_options(self, **options):\n        self.options.set(**options)\n        warnings.warn(\"use sim.options.OPT=VALUE instead\", DeprecationWarning)\n\n    def set_globals(self, globs):\n        \"\"\"\n        Set globals as specified by command line\n\n        :param globs: global variables\n        :type globs: dict\n\n        The command line option ``--global var=value`` can be used to request the change\n        of global variables.  However, actually changing them requires explicit code\n        support in the user's program after the ``BDSim`` constructor.\n\n        Example::\n\n            sim.set_globals(globals())\n\n        Messages are displayed by defaulting, indicating which variables are changed,\n        and their old and new values.\n        \"\"\"\n        # handle the globals\n        for s in self.options.setglob:\n            var, value = s.split(\"=\")\n\n            new_value = eval(value)\n            print(f\"changed value of global {var} from {globs[var]} -> {new_value}\")\n            globs[var] = new_value\n\n    def report(self, bd, type=\"summary\", **kwargs):\n        \"\"\"Print block diagram report\n\n        :param bd: the block diagram to be reported\n        :type bd: :class:`BlockDiagram`\n        :param type: report type, one of: \"summary\" (default), \"lists\", \"schedule\"\n        :type type: str, optional\n        :param style: table style, one of: ansi (default), markdown, latex\n        :type style: str\n\n        Single method wrapper for various block diagram reports.  Obeys the ``-q``\n        option to suppress all reports at runtime.\n\n        :seealso: :meth:`BlockDiagram.report_summary` :meth:`BlockDiagram.report_lists` :meth:`BlockDiagram.report_schedule`\n        \"\"\"\n        if self.options.quiet:\n            return\n\n        if type == \"lists\":\n            bd.report_lists(**kwargs)\n        elif type == \"summary\":\n            bd.report_summary(**kwargs)\n        elif type == \"schedule\":\n            bd.report_schedule(**kwargs)\n\n\nclass Options(OptionsBase):\n    def __init__(self, sysargs=True, **options):\n        default_options = {\n            \"backend\": None,\n            \"tiles\": \"3x4\",\n            \"graphics\": True,\n            \"animation\": False,\n            \"hold\": True,\n            \"shape\": None,\n            \"altscreen\": True,\n            \"progress\": True,\n            \"verbose\": False,\n            \"debug\": \"\",\n            \"simtime\": None,\n            \"blocks\": False,\n            \"outfile\": None,\n            \"quiet\": False,\n            \"setparam\": [],\n            \"setglob\": [],\n        }\n\n        # modify defaults according to envariable BDSIM which is comma/semicolon\n        # separated list of key=value pairs\n        # eg. setenv BDSIM graphics=True,hold=True\n        env = os.getenv(\"BDSIM\")\n        if env is not None:\n            for key_value in env.split(\",;\"):\n                # for each key=value pair\n                key, value = [s.strip() for s in key_value.split(\"=\")]\n                # attempt an eval, resolves True, False\n                try:\n                    value = eval(value)\n                except SyntaxError:\n                    pass\n                try:\n                    default_options[key] = value\n                except KeyError:\n                    print(\"envariable BDSIM, unknown option\", key)\n\n        if sysargs:\n            # command line arguments and graphics\n            parser = argparse.ArgumentParser(\n                prefix_chars=\"-+\",\n                formatter_class=argparse.ArgumentDefaultsHelpFormatter,\n                description=\"Block diagram simulation framework\",\n                epilog=(\n                    \"set defaults using environment variable BDSIM as a single string\"\n                    \" containing command line options\"\n                ),\n            )\n            parser.add_argument(\n                \"--backend\",\n                \"-b\",\n                type=str,\n                metavar=\"BACKEND\",\n                help=\"matplotlib backend to choose\",\n            )\n            parser.add_argument(\n                \"--tiles\",\n                \"-t\",\n                type=str,\n                metavar=\"ROWSxCOLS\",\n                help=\"window tiling as NxM\",\n            )\n            parser.add_argument(\n                \"--shape\",\n                type=str,\n                metavar=\"WIDTHxHEIGHT\",\n                help=\"window size as WxH, defaults to matplotlib default\",\n            )\n            parser.add_argument(\n                \"--blocks\",\n                action=\"store_const\",\n                const=True,\n                default=False,\n                dest=\"blocks\",\n                help=\"Display blocks at startup\",\n            )\n\n            parser.add_argument(\n                \"-g\",\n                \"--no-graphics\",\n                action=\"store_const\",\n                const=False,\n                dest=\"graphics\",\n                help=\"disable graphic display, also does --no-animation\",\n            )\n            parser.add_argument(\n                \"+g\",\n                \"--graphics\",\n                action=\"store_const\",\n                const=True,\n                dest=\"graphics\",\n                help=\"enable graphic display\",\n            )\n\n            parser.add_argument(\n                \"-a\",\n                \"--no-animation\",\n                action=\"store_const\",\n                const=False,\n                dest=\"animation\",\n                help=\"do not animate graphics\",\n            )\n            parser.add_argument(\n                \"+a\",\n                \"--animation\",\n                action=\"store_const\",\n                const=True,\n                dest=\"animation\",\n                help=\"animate graphics, also does ++graphics\",\n            )\n\n            parser.add_argument(\n                \"-H\",\n                \"--no-hold\",\n                action=\"store_const\",\n                const=False,\n                dest=\"hold\",\n                help=\"do not hold graphics in done()\",\n            )\n            parser.add_argument(\n                \"+H\",\n                \"--hold\",\n                action=\"store_const\",\n                const=True,\n                dest=\"hold\",\n                help=\"hold graphics in done()\",\n            )\n\n            parser.add_argument(\n                \"+A\",\n                \"--altscreen\",\n                action=\"store_const\",\n                const=True,\n                dest=\"altscreen\",\n                help=\"display plots on second monitor\",\n            )\n            parser.add_argument(\n                \"-A\",\n                \"--no-altscreen\",\n                action=\"store_const\",\n                const=False,\n                dest=\"altscreen\",\n                help=\"do not display plots on second monitor\",\n            )\n\n            parser.add_argument(\n                \"--no-progress\",\n                \"-p\",\n                action=\"store_const\",\n                const=False,\n                dest=\"progress\",\n                help=\"animate graphics\",\n            )\n            parser.add_argument(\n                \"--verbose\", \"-v\", action=\"store_const\", const=True, help=\"debug flags\"\n            )\n            parser.add_argument(\n                \"--debug\",\n                \"-d\",\n                type=str,\n                metavar=\"[psd]\",\n                help=\"debug flags: p/ropagate, s/tate, d/eriv, i/nteractive\",\n            )\n            parser.add_argument(\n                \"--simtime\", \"-S\", type=str, help=\"simulation time: T or T,dt\"\n            )\n            parser.add_argument(\n                \"--quiet\",\n                \"-q\",\n                action=\"store_const\",\n                const=True,\n                help=\"suppress reports\",\n            )\n            parser.add_argument(\n                \"-o\",\n                action=\"store_const\",\n                const=\"bd.out\",\n                dest=\"outfile\",\n                help=\"output pickled simulation results to bd.out\",\n            )\n            parser.add_argument(\n                \"--out\",\n                type=str,\n                dest=\"outfile\",\n                help=\"file to save pickled simulation results\",\n            )\n            parser.add_argument(\n                \"--set\",\n                \"-s\",\n                dest=\"setparam\",\n                action=\"append\",\n                type=str,\n                help=\"override block parameter using block:param=value\",\n            )\n            parser.add_argument(\n                \"--global\",\n                dest=\"setglob\",\n                action=\"append\",\n                type=str,\n                help=\"override global parameter using var=value\",\n            )\n\n            args, unknownargs = parser.parse_known_args()\n            cmdline_options = vars(args)  # get args as a dictionary\n            # keep only the options that are not None, ie. those that were\n            # explicitly set on the command line\n            cmdline_options = {\n                option: value\n                for option, value in cmdline_options.items()\n                if value is not None\n            }\n\n            if \"graphics\" in cmdline_options:\n                # -g or +g present\n                if not cmdline_options[\"graphics\"]:\n                    # -g then disable animation\n                    cmdline_options[\"animation\"] = False\n            elif \"animation\" in cmdline_options and cmdline_options[\"animation\"]:\n                # +a present\n                cmdline_options[\"graphics\"] = True\n        else:\n            cmdline_options = dict()  # empty dictionary\n\n        super().__init__(readonly=cmdline_options, args=default_options)\n\n        # now handle the passed options\n        self.set(**options)\n\n        if self.verbose:\n            print(self)\n\n        self._argv = unknownargs  # save non-bdsim arguments\n\n    def sanity(self, options):\n        # ensure graphics is enabled if animation is requested\n        # ensure animation is disabled if graphics is disabled\n        if \"graphics\" in options and \"animation\" in options:\n            if options[\"animation\"] and not options[\"graphics\"]:\n                raise ValueError(\"cannot enable animation but disable graphics\")\n        elif \"graphics\" in options and not options[\"graphics\"]:\n            options[\"animation\"] = False\n        elif \"animation\" in options and options[\"animation\"]:\n            options[\"graphics\"] = True\n\n        return options\n"
  },
  {
    "path": "bdsim/tk_editor/bdeditor.py",
    "content": "#!/usr/bin/env python3\nimport sys\nimport os\nimport string\nimport time\nimport tkinter as tk\nfrom screeninfo import get_monitors\nfrom tkinter import ttk\n\nfrom edit import Editor\nimport bdsim\n\n# eventually from a config file\nappearance = {\n    \"block:width\": 100,\n    \"block:height\": 60,\n    \"block:bg\": \"white\",\n    \"block:outline\": \"black\",\n    \"block:font\": (\"Helvetica\", 12),\n}\n\n\ndef center_on_monitor(window, monitor_index, width, height):\n    \"\"\"\n    Centers a Tkinter window on a specific monitor.\n\n    Args:\n        window: The Tkinter instance (root or Toplevel).\n        monitor_index: Index of the monitor (0 = Primary).\n        width: Desired width of the window.\n        height: Desired height of the window.\n    \"\"\"\n    try:\n        monitors = get_monitors()\n\n        # Safety check: if index is too high, default to primary (0)\n        if monitor_index >= len(monitors):\n            monitor_index = 0\n\n        target_monitor = monitors[monitor_index]\n\n        # 1. Calculate the center position relative to the monitor\n        # (Monitor Width - Window Width) / 2\n        x_offset = (target_monitor.width - width) // 2\n        y_offset = (target_monitor.height - height) // 2\n\n        # 2. Add the monitor's absolute global position\n        final_x = target_monitor.x + x_offset\n        final_y = target_monitor.y - y_offset\n\n        # 3. Apply geometry: \"WidthxHeight+X+Y\"\n        window.geometry(f\"{width}x{height}+{final_x}+{final_y}\")\n\n    except Exception as e:\n        print(f\"Error centering window: {e}\")\n        # Fallback: just set size and let OS decide position\n        window.geometry(f\"{width}x{height}\")\n\n\n# def pairwise(iterable):\n#     \"s -> (s0,s1), (s1,s2), (s2, s3), ...\"\n#     a, b = tee(iterable)\n#     next(b, None)\n#     return zip(a, b)\n\n\ndef init_diagram(editor):\n    b1 = editor.add_block(1, 1, (100, 100), image_path=\"Icons/integrator.png\")\n    b2 = editor.add_block(0, 1, (200, 100))\n    b3 = editor.add_block(3, 1, (300, 100))\n    b4 = editor.add_block(2, 3, (400, 100))\n    editor.add_wire(\"block4.out0\", \"block3.in0\")\n\n    # print(ed.coords(b4.item))\n    # print(ed.bbox(b4.item))\n    # print(canvas.bbox(b4.id))\n    # canvas.create_rectangle(canvas.bbox(b4.id), outline=\"black\", fill=\"\")\n\n\ndef create_ui(root, blockmenu):\n    center_on_monitor(\n        root, 1, 1200, 600\n    )  # set geometry to 800x600 centered on monitor 1\n\n    root.title(\"bdsim editor\")\n\n    # Mac-specific app name setting\n    try:\n        root.tk.call(\"tk\", \"appname\", \"BDSim Editor\")\n    except:\n        try:\n            root.wm_class(\"BDSim Editor\", \"BDSim Editor\")\n        except:\n            pass  # Not supported\n\n    # ---------------------------------------------------------------------\n    # App task bar\n\n    menubar = tk.Menu(root)\n    root.config(menu=menubar)\n\n    # File menu\n    file_menu = tk.Menu(menubar, tearoff=0)\n    menubar.add_cascade(label=\"File\", menu=file_menu)\n    file_menu.add_command(\n        label=\"New\", accelerator=\"Cmd+N\", command=lambda: print(\"New\")\n    )\n    file_menu.add_command(\n        label=\"Open...\", accelerator=\"Cmd+O\", command=lambda: print(\"Open\")\n    )\n    file_menu.add_separator()\n    file_menu.add_command(\n        label=\"Save\", accelerator=\"Cmd+S\", command=lambda: print(\"Save\")\n    )\n    file_menu.add_command(\n        label=\"Save As...\", accelerator=\"Shift+Cmd+S\", command=lambda: print(\"Save As\")\n    )\n    file_menu.add_separator()\n    file_menu.add_command(\n        label=\"Close\", accelerator=\"Cmd+W\", command=lambda: root.quit()\n    )\n\n    # Edit menu\n    edit_menu = tk.Menu(menubar, tearoff=0)\n    menubar.add_cascade(label=\"Edit\", menu=edit_menu)\n    edit_menu.add_command(\n        label=\"Undo\", accelerator=\"Cmd+Z\", command=lambda: print(\"Undo\")\n    )\n    edit_menu.add_command(\n        label=\"Redo\", accelerator=\"Shift+Cmd+Z\", command=lambda: print(\"Redo\")\n    )\n    edit_menu.add_separator()\n    edit_menu.add_command(\n        label=\"Cut\", accelerator=\"Cmd+X\", command=lambda: print(\"Cut\")\n    )\n    edit_menu.add_command(\n        label=\"Copy\", accelerator=\"Cmd+C\", command=lambda: print(\"Copy\")\n    )\n    edit_menu.add_command(\n        label=\"Paste\", accelerator=\"Cmd+V\", command=lambda: print(\"Paste\")\n    )\n    edit_menu.add_separator()\n    edit_menu.add_command(\n        label=\"Select All\", accelerator=\"Cmd+A\", command=lambda: print(\"Select All\")\n    )\n\n    # Block menu\n    block_menu = tk.Menu(menubar, tearoff=0)\n    menubar.add_cascade(label=\"Block\", menu=block_menu)\n    block_menu.add_command(label=\"Add Block\", command=lambda: print(\"Add Block\"))\n    block_menu.add_command(label=\"Delete Block\", command=lambda: print(\"Delete Block\"))\n    block_menu.add_separator()\n    block_menu.add_command(label=\"Connect Blocks\", command=lambda: print(\"Connect\"))\n\n    # View menu\n    view_menu = tk.Menu(menubar, tearoff=0)\n    menubar.add_cascade(label=\"View\", menu=view_menu)\n    view_menu.add_command(\n        label=\"Zoom In\", accelerator=\"Cmd+=\", command=lambda: print(\"Zoom In\")\n    )\n    view_menu.add_command(\n        label=\"Zoom Out\", accelerator=\"Cmd+-\", command=lambda: print(\"Zoom Out\")\n    )\n    view_menu.add_command(\n        label=\"Actual Size\", accelerator=\"Cmd+0\", command=lambda: print(\"Actual Size\")\n    )\n    view_menu.add_separator()\n    view_menu.add_command(label=\"Show Grid\", command=lambda: print(\"Toggle Grid\"))\n\n    # Help menu\n    help_menu = tk.Menu(menubar, tearoff=0)\n    menubar.add_cascade(label=\"Help\", menu=help_menu)\n    help_menu.add_command(label=\"About BDSim Editor\", command=lambda: print(\"About\"))\n    help_menu.add_command(label=\"Documentation\", command=lambda: print(\"Docs\"))\n\n    # ---------------------------------------------------------------------\n    # Top toolbar across the window\n\n    toolbar = ttk.Frame(root, padding=(4, 2))\n    toolbar.pack(side=tk.TOP, fill=tk.X)\n\n    btn_new = ttk.Button(toolbar, text=\"New\", command=lambda: print(\"New\"))\n    btn_open = ttk.Button(toolbar, text=\"Open\", command=lambda: print(\"Open\"))\n    btn_save = ttk.Button(toolbar, text=\"Save\", command=lambda: print(\"Save\"))\n    btn_add = ttk.Button(toolbar, text=\"Add Block\", command=lambda: print(\"Add block\"))\n    btn_zoom_in = ttk.Button(toolbar, text=\"Zoom +\", command=lambda: print(\"Zoom in\"))\n    btn_zoom_out = ttk.Button(toolbar, text=\"Zoom -\", command=lambda: print(\"Zoom out\"))\n\n    btn_new.pack(side=tk.LEFT, padx=2)\n    btn_open.pack(side=tk.LEFT, padx=2)\n    btn_save.pack(side=tk.LEFT, padx=2)\n    ttk.Separator(toolbar, orient=tk.VERTICAL).pack(side=tk.LEFT, fill=tk.Y, padx=6)\n    btn_add.pack(side=tk.LEFT, padx=2)\n    ttk.Separator(toolbar, orient=tk.VERTICAL).pack(side=tk.LEFT, fill=tk.Y, padx=6)\n    btn_zoom_in.pack(side=tk.LEFT, padx=2)\n    btn_zoom_out.pack(side=tk.LEFT, padx=2)\n\n    # ---------------------------------------------------------------------\n    # Main PanedWindow with left Treeview and right Editor canvas\n\n    panes = ttk.Panedwindow(root, orient=tk.HORIZONTAL)\n    panes.pack(fill=\"both\", expand=True)\n\n    left = ttk.Frame(panes, width=100)\n    right = ttk.Frame(panes)\n\n    panes.add(left, weight=0)\n    panes.add(right, weight=4)\n\n    # --------------- Treeview in left pane\n    tree_frame = ttk.Frame(left)\n    tree_frame.pack(fill=\"both\", expand=True, padx=5, pady=5)\n\n    tree_scroll = ttk.Scrollbar(tree_frame, orient=\"vertical\")\n    tree = ttk.Treeview(tree_frame, yscrollcommand=tree_scroll.set, show=\"tree\")\n    tree_scroll.config(command=tree.yview)\n    tree_scroll.pack(side=\"right\", fill=\"y\")\n    tree.pack(side=\"left\", fill=\"both\", expand=False)\n\n    # populate the tree from blockmenu\n    if blockmenu:\n        for cat, items in blockmenu.items():\n            parent = tree.insert(\"\", \"end\", text=cat, open=True)\n            for it in items:\n                tree.insert(parent, \"end\", text=it)\n                # collapse tree categories at startup\n                for iid in tree.get_children():\n                    tree.item(iid, open=False)\n\n    # Convenience helpers\n    def get_selected_block():\n        sel = tree.selection()\n        if not sel:\n            return None\n        iid = sel[0]\n        # return block name only for leaf items\n        if tree.parent(iid):\n            return tree.item(iid, \"text\")\n        return None\n\n    # --------------- Canvas in right pane\n    canvas = Editor(\n        right,\n        bg=\"white\",\n        height=500,\n        width=1000,\n        relief=tk.RIDGE,\n        background=\"white\",\n        borderwidth=1,\n    )\n    canvas.pack(fill=\"both\", expand=True, padx=5, pady=5)\n\n    # Double-click on tree item to add block to canvas\n    def tree_click(event):\n        print(\"Tree double-click\")\n        block = get_selected_block()\n        if block:  # is a leaf item\n            tree._last_activated_block = block\n            canvas.event_generate(\"<<NewBlockActivated>>\", when=\"tail\", data=tree)\n\n    tree.bind(\"<Double-1>\", tree_click)\n\n    return canvas\n\n\ndef get_blocks():\n    sim = bdsim.BDSim()  # create simulator\n\n    blockmenu = {}\n    for block, info in sim._blocklibrary.items():\n        cls = info[\"blockclass\"].capitalize()\n        if cls in blockmenu:\n            blockmenu[cls].append(block)\n        else:\n            blockmenu[cls] = [block]\n\n    return blockmenu\n\n\nif __name__ == \"__main__\":\n    root = tk.Tk()\n    # block_menu = get_blocks()\n    block_menu = None\n    canvas = create_ui(root, block_menu)\n    init_diagram(canvas)\n    root.mainloop()\n"
  },
  {
    "path": "bdsim/tk_editor/edit.py",
    "content": "import tkinter as tk\nimport numpy as np\nimport re\nfrom itertools import tee, pairwise\nfrom PIL import Image, ImageTk\n\n# from sklearn import tree\n\nverbose_events = True\n\nblockdict = {}\nwirelist = []\n\n\nclass Block:\n    blockWidth = 50  # block width\n    blockHeight = 100  # block height\n    a = 20  # distance from top/bottom\n    b = 5  # half width of output\n    portSize = 10  # size of port square\n    portSep = 15\n    blocknum = 0  # block index: 1, 2, ...\n\n    def __init__(self, pos, nin, nout):\n        self.nin = nin  # number of input ports\n        self.nout = nout  # number of output ports\n        self.pos = pos  # position of top-left corner on canvas\n        self.tag = None\n        self.inpos = []\n        self.outpos = []\n        self.item_id = None  # canvas item id\n        self.flipped = False\n        Block.blocknum += 1\n        self.name = f\"block{Block.blocknum}\"\n\n    def port_y(self, i, n):\n        if n == 0:\n            return None\n        else:\n            return self.pos[1] + self.blockHeight / 2 - ((n - 1) / 2 - i) * self.portSep\n\n\nclass Wire:\n    wirenum = 0\n\n    def __init__(self, start: tuple[Block, int], end: tuple[Block, int]):\n        self.start = start\n        self.end = end\n        self.item_id = None  # canvas item id\n        Wire.wirenum += 1\n\n    def start_coord(self):\n        block, port = self.start\n        return block.outpos[port]\n\n    def end_coord(self):\n        block, port = self.end\n        return block.inpos[port]\n\n\nclass Editor(tk.Canvas):\n    \"\"\"\n    Represents a graphical block element for a block diagram editor.\n\n    The GBlock class is responsible for creating and managing the visual representation\n    of a block with configurable input and output ports. The block is drawn as a polygon\n    on a canvas, with triangles on the right side for outputs and squares on the left side for inputs.\n    The positions of input and output ports are calculated and stored for later use.\n\n    Attributes:\n        W (int): Width of the block.\n        H (int): Height of the block.\n        a (int): Vertical margin from the top and bottom edges.\n        b (int): Half-width of the output triangle and input square.\n        _inpos (list): List of input port positions relative to the block.\n        _outpos (list): List of output port positions relative to the block.\n        outline (list): List of points defining the block's outline polygon.\n        id (int): Canvas object ID for the block polygon.\n\n    Args:\n        nin (int): Number of input ports.\n        nout (int): Number of output ports.\n        pos (tuple): (x, y) position of the block's top-left corner on the canvas.\n        fill (str, optional): Fill color for the block. Defaults to \"red\".\n        **kwargs: Additional keyword arguments passed to the canvas.create_polygon method.\n\n    Methods:\n        flip():\n            Flips the block horizontally on the canvas.\n\n        inpos(i):\n            Returns the absolute position of the i-th input port.\n\n        outpos(i):\n            Returns the absolute position of the i-th output port.\n    \"\"\"\n\n    _inpos = []\n    _outpos = []\n    _iports = []\n    _oports = []\n\n    active_output = None\n\n    def event_print(self, event_name, event):\n        if verbose_events:\n            print(f\"!! {event_name}, {event}, ({self.itemcget(tk.CURRENT, 'tags')})\")\n\n    def gridlines(canvas, line_distance):\n        canvas.root.update()\n        print(canvas.winfo_width())\n        canvas_width = 1000\n        canvas_height = 500\n        # vertical lines at an interval of \"line_distance\" pixel\n        for x in range(line_distance, canvas_width, line_distance):\n            canvas.create_line(x, 0, x, canvas_height, fill=\"#f0f0f0\")\n        # horizontal lines at an interval of \"line_distance\" pixel\n        for y in range(line_distance, canvas_height, line_distance):\n            canvas.create_line(0, y, canvas_width, y, fill=\"#f0f0f0\")\n\n    def get_active_block(self):\n        return self.blockdict[self.gettags(tk.CURRENT)[0]]\n\n    def ortho_line(\n        self, start: tuple[int, int], end: tuple[int, int], tag=[], **kwargs\n    ) -> tuple[tuple[float, float], ...]:\n        if start[0] < end[0]:\n            if start[1] == end[1]:\n                return (start, end)\n            else:\n                xmid = (start[0] + end[0]) // 2\n                return (\n                    start,\n                    (xmid, start[1]),\n                    (xmid, end[1]),\n                    end,\n                )\n        else:\n            # line has to go backwards\n            L = 20\n            H = 100\n            if end[1] < start[1]:\n                # new block above\n                y = end[1] - H\n            else:\n                y = end[1] + H\n            return (\n                start,\n                (start[0] + L, start[1]),\n                (start[0] + L, y),\n                (end[0] - L, y),\n                (end[0] - L, end[1]),\n                end,\n            )\n\n    def draw_ortho_line(\n        self,\n        start: tuple[int, int],\n        end: tuple[int, int],\n        width: int = 2,\n        tag=[],\n        **kwargs,\n    ) -> None:\n        coords = self.ortho_line(start, end)\n\n        l = self.create_line(\n            *[coord for point in coords for coord in point],\n            arrow=tk.LAST,\n            tags=tag,\n            width=width,\n            **kwargs,\n        )\n        print(\"ortholine\", self.gettags(l))\n        print(\"line id\", l)\n        re_wire = re.compile(r\"(block\\d+).out(\\d+)\\>(block\\d+).in(\\d+)\")\n\n    re_wire = re.compile(r\"(block\\d+).out(\\d+)\\>(block\\d+).in(\\d+)\")\n\n    def parse_io(self, s):\n        m = self.re_wire.match(s)\n        from_block = m.group(1)\n        from_port = int(m.group(2))\n        to_block = m.group(3)\n        to_port = int(m.group(4))\n        print(from_block, from_port, to_block, to_port)\n        return from_block, from_port, to_block, to_port\n\n    def redraw_wires(self, obj_id):\n        # pass\n        print(\"redraw_wires\", obj_id)\n        print(\"redraw_wires\", self.gettags(obj_id))\n        block = self.gettags(obj_id)[0]\n        ids = self.find_withtag(f\"wire&&{block}\")\n        print(\"wires to redraw:\", ids)\n        re_wire = re.compile(r\"(block\\d+).out(\\d+)\\>(block\\d+).in(\\d+)\")\n        for id in ids:\n            tags = self.gettags(id)\n            print(\"wire tags:\", tags)\n            m = re_wire.match(tags[3])\n            from_block = m.group(1)\n            from_port = int(m.group(2))\n            to_block = m.group(3)\n            to_port = int(m.group(4))\n            print(from_block, from_port, to_block, to_port)\n            self.delete(id)\n\n            self.draw_ortho_line(\n                self.blockdict[from_block].outpos[from_port],\n                self.blockdict[to_block].inpos[to_port],\n                tag=tags,\n            )\n\n    def add_block(\n        self,\n        nin: int,\n        nout: int,\n        pos: tuple[int, int],\n        image_path: str = None,\n        fill: str = \"white\",\n        outline: str = \"black\",\n        **kwargs,\n    ) -> None:\n        \"\"\"\n        Initialize a block object with specified input/output ports and position.\n\n        Args:\n            nin (int): Number of input ports.\n            nout (int): Number of output ports.\n            pos (tuple): (x, y) position of the block on the canvas.\n            image_path (str, optional): Path to PNG image to display in block.\n            fill (str, optional): Fill color for the block. Defaults to \"red\".\n            **kwargs: Additional keyword arguments passed to the canvas.create_polygon method.\n        \"\"\"\n\n        block = Block(pos, nin, nout)\n        blockdict[block.name] = block\n\n        # draw the block\n        block.item_id = self.create_rectangle(\n            pos[0],\n            pos[1],\n            pos[0] + block.blockWidth,\n            pos[1] + block.blockHeight,\n            fill=fill,\n            outline=outline,\n            tags=(block.name, \"block\"),\n            **kwargs,\n        )\n\n        # Add image if provided\n        if image_path:\n            try:\n                # Load and resize image to fit inside block\n                img = Image.open(image_path)\n                img_width = block.blockWidth - 10  # 5px margin on each side\n                img = img.resize(\n                    (img_width, img.height * img_width // img.width),\n                    Image.Resampling.BICUBIC,\n                )\n                photo = ImageTk.PhotoImage(img)\n\n                # Create image centered in block\n                img_id = self.create_image(\n                    pos[0] + block.blockWidth // 2,\n                    pos[1] + block.blockHeight // 2,\n                    image=photo,\n                    anchor=tk.CENTER,\n                    tags=(block.name, \"block\", \"image\"),\n                )\n\n                # Keep reference to prevent garbage collection\n                self._images.append(photo)\n                block.image_id = img_id\n\n            except Exception as e:\n                print(f\"Error loading image {image_path}: {e}\")\n\n        # draw the input ports\n        for i in range(nin):\n            x = block.pos[0]\n            y = block.port_y(i, block.nin)\n            item = self.create_rectangle(\n                x,\n                y - block.portSize / 2,\n                x - block.portSize / 2,\n                y + block.portSize / 2,\n                fill=\"blue\",\n                tags=(block.name, f\"{block.name}.in{i}\", \"inport\", \"moveable\"),\n            )\n            block.inpos.append((x - block.portSize / 2, y))\n\n        # draw the output ports\n        for i in range(nout):\n            x = block.pos[0] + block.blockWidth\n            y = block.port_y(i, block.nout)\n            item = self.create_polygon(\n                x,\n                y - block.portSize / 2,\n                x,\n                y + block.portSize / 2,\n                x + block.portSize,\n                y,\n                fill=\"black\",\n                tags=(block.name, f\"{block.name}.out{i}\", \"outport\", \"moveable\"),\n            )\n            block.outpos.append((x + block.portSize, y))\n\n        # draw the block name\n        self.create_text(\n            pos[0] + block.blockWidth / 2,\n            pos[1] + block.blockHeight * 1.1,\n            text=block.name,\n            tags=(block.name, \"label\"),\n        )\n        return block\n\n    def flip(self):\n        # Flip the block horizontally by reflecting its coordinates\n        for i, port in enumerate(self._iports):\n            coords = canvas.coords(port)\n            x0, y0, x1, y1, x2, y2 = coords\n            x0 = self.blockWidth - x0\n            x1 = self.blockWidth - x1\n            x2 = self.blockWidth - x2\n            canvas.coords(port, x0, y0, x1, y1, x2, y2)\n            self._inpos[i] = (x2, y0)\n\n        for i, port in enumerate(self._oports):\n            coords = canvas.coords(port)\n            x0, y0, x1, y1, x2, y2 = coords\n            x0 = self.blockWidth - x0\n            x1 = self.blockWidth - x1\n            x2 = self.blockWidth - x2\n            canvas.coords(port, x0, y0, x1, y1, x2, y2)\n            self._outpos[i] = (x2, y0)\n\n    def add_wire(self, from_name, to_name):\n        print(\n            \"Connect\",\n            from_name,\n            \"to\",\n            to_name,\n        )\n\n        re_block = re.compile(r\"(block\\d+)\\.(?:in|out)(\\d+)\")\n        m = re_block.match(from_name)\n        from_block = m.group(1)\n        from_port = int(m.group(2))\n\n        m = re_block.match(to_name)\n        to_block = m.group(1)\n        to_port = int(m.group(2))\n        print(from_block, from_port, to_block, to_port)\n\n        b1 = blockdict[from_block]\n        b2 = blockdict[to_block]\n\n        # ortho_line(b1.outpos(0), b2.inpos(0))\n        print(b1.outpos[from_port])\n        print(b2.inpos[to_port])\n        self.draw_ortho_line(\n            b1.outpos[from_port],\n            b2.inpos[to_port],\n            tag=[\n                \"wire\",\n                from_block,\n                to_block,\n                f\"{from_name}>{to_name}\",\n            ],\n        )\n\n    def inpos(self, i):\n        # Return the absolute position of the i-th input port\n        coords = canvas.coords(self.tag)\n        return (self._inpos[i][0] + coords[0], self._inpos[i][1] + coords[1])\n\n    def outpos(self, i):\n        # Return the absolute position of the i-th output port\n        coords = canvas.coords(self.tag)\n        return (self._outpos[i][0] + coords[0], self._outpos[i][1] + coords[1])\n\n    # see http://www.bitflipper.ca/Documentation/dnd_barebones.txt\n\n    def current_item_id(self) -> int:\n        # return the id of the current item\n        id = self.find_withtag(\"current\")[0]\n        return id\n\n    def current_item_tag(self) -> str:\n        # return the first tag of the current item\n        id = self.find_withtag(\"current\")[0]\n        tag = self.gettags(id)[0]\n        return tag\n\n    # ------------ block body events -----------------\n\n    # mouse button down, start drag\n    def block_down(self, event):\n        self.event_print(\"block_down\", event)\n\n        self.loc = 1\n        self.dragged = 0\n        widget = event.widget\n        self.x, self.y = widget.canvasx(event.x), widget.canvasy(event.y)\n        if \"image\" in self.gettags(tk.CURRENT):\n            self.color = None\n        else:\n            self.color = widget.itemcget(tk.CURRENT, \"fill\")\n        event.widget.bind(\"<Motion>\", self.block_motion)\n        self.dx = 0\n        self.dy = 0\n\n    # mouse is dragging\n    def block_motion(self, event):\n        self.root.config(cursor=\"fleur\")\n        widget = event.widget\n        widget.itemconfigure(tk.CURRENT, fill=\"white\", outline=\"grey\", dash=(5, 5))\n        x, y = widget.canvasx(event.x), widget.canvasy(event.y)\n        dx = x - self.x\n        dy = y - self.y\n        self.x = x\n        self.y = y\n        self.dx += dx\n        self.dy += dy\n        if verbose_events:\n            print(self.active_block)\n        # move all elements tagged with this block's tag\n        event.widget.move(self.active_block, dx, dy)\n\n    # mouse button released\n    def block_up(self, event):\n        self.event_print(\"block_up\", event)\n\n        self.root.config(cursor=\"\")\n        widget = event.widget\n        widget.unbind(\"<Motion>\")\n        if self.color:\n            self.itemconfigure(tk.CURRENT, fill=self.color, dash=())\n        # if self.loc:  # is button released in same widget as pressed?\n        #     self.block_up(event)\n        # else:\n        #     self.dragged = event.time\n\n        block = blockdict[self.gettags(tk.CURRENT)[0]]\n        for i in range(block.nin):\n            block.inpos[i] = (\n                block.inpos[i][0] + self.dx,\n                block.inpos[i][1] + self.dy,\n            )\n        for i in range(block.nout):\n            block.outpos[i] = (\n                block.outpos[i][0] + self.dx,\n                block.outpos[i][1] + self.dy,\n            )\n        self.redraw_wires(self.current_item_id())\n\n    def block_enter(self, event):\n        self.event_print(\"block_enter\", event)\n        block_name = self.current_item_tag()\n\n        # need the id of the block, not the image\n        id = blockdict[block_name].item_id\n        # print(\"  block enter\", block_name)\n        self.itemconfigure(id, outline=\"blue\", width=2)\n        self.loc = 1\n        self.active_id = id  # item id of the block rectangle\n        self.active_block_name = block_name\n        if self.dragged == event.time:\n            self.up(event)\n        self.focus_set()\n\n    def block_leave(self, event):\n        self.event_print(\"block_leave\", event)\n        self.itemconfigure(self.active_id, outline=\"black\", width=1)\n        self.loc = 0\n\n    # ------------ output port events -----------------\n    def outport_down(self, event):\n        selected = self.current_item_id()\n        if self.active_output == selected:\n            # cancelation of selection\n            self.itemconfig(selected, fill=\"black\", outline=\"\")\n            self.active_output = None\n        elif self.active_output is not None:\n            # change selection\n            self.itemconfig(self.active_output, fill=\"black\", outline=\"\")\n            self.itemconfig(selected, fill=\"yellow\", outline=\"black\", width=1)\n            self.active_output = selected\n        else:\n            # new selection\n            self.active_output = selected\n            self.itemconfig(selected, fill=\"yellow\", outline=\"black\", width=1)\n\n        if verbose_events:\n            print(\"outport down\", selected, self.active_output)\n\n    def outport_up(self, event):\n        pass\n        # self.itemconfig(tk.CURRENT, fill=\"black\", outline=\"\")\n\n    def outport_enter(self, event):\n        selected = self.current_item_id()\n        if verbose_events:\n            print(\"outport enter\", selected, self.active_output)\n        self.itemconfig(tk.CURRENT, outline=\"red\", width=2)\n\n    def outport_leave(self, event):\n        if verbose_events:\n            print(\"outport leave\", self.current_item_id(), self.active_output)\n        if self.current_item_id() != self.active_output:\n            self.itemconfig(tk.CURRENT, outline=\"\")\n\n    # ------------ input port events -----------------\n    def inport_down(self, event):\n        # create a wire if an output port is active\n        if self.active_output:\n            self.itemconfig(self.active_output, fill=\"black\", outline=\"\")\n            from_block = self.gettags(self.active_output)\n            to_block = self.gettags(self.current_item_id())\n            if verbose_events:\n                print(\"inport down\", from_block, to_block)\n            self.active_output = None\n\n            self.add_wire(from_block[1], to_block[1])\n\n    def inport_up(self, event):\n        pass\n        # self.itemconfig(tk.CURRENT, fill=\"black\", outline=\"\")\n\n    def inport_enter(self, event):\n        self.itemconfig(tk.CURRENT, outline=\"red\", width=2)\n\n    def inport_leave(self, event):\n        self.itemconfig(tk.CURRENT, outline=\"\")\n\n    # ------------ wire events -----------------\n    def wire_motion(self, event):\n        self.event_print(\"wire_motion\", event)\n\n        self.root.config(cursor=\"fleur\")\n        widget = event.widget\n        # widget.itemconfigure(tk.CURRENT, fill=\"white\", outline=\"grey\", dash=(5, 5))\n        x, y = widget.canvasx(event.x), widget.canvasy(event.y)\n\n        id = self.current_item_id()\n        print(\"wire id:\", id)\n        # idx=0, x1, y1\n        # x0, y0, x1 y1, x2 y2\n        coords = self.coords(id)\n        print(\"old coords:\", coords)\n        print(self.idx, self.isvertical)\n        if self.isvertical:\n            # change x coordinates\n            coords[2 * self.idx] = x\n            coords[2 * self.idx + 2] = x\n        else:\n            # change y coordinates\n            coords[2 * self.idx + 1] = y\n            coords[2 * self.idx + 3] = y\n        print(\"new coords:\", coords)\n        self.coords(id, *coords)\n        # self.x = x\n        # self.y = y\n        # self.dx += dx\n        # self.dy += dy\n        # if verbose_events:\n        #     print(self.active)\n        # event.widget.move(self.active, dx, dy)\n\n    def wire_down(self, event):\n        self.event_print(\"wire_down\", event)\n\n        for tag in self.gettags(tk.CURRENT):\n            if \">\" in tag:\n                wiretag = tag\n                blocks = tag.split(\">\")\n                print(\"wire tag:\", blocks[0], \"-->\", blocks[1])\n\n        from_block, from_port, to_block, to_port = self.parse_io(wiretag)\n        coords = self.ortho_line(\n            blockdict[from_block].outpos[from_port],\n            blockdict[to_block].inpos[to_port],\n        )\n        print(event.x, event.y)\n        print(coords)\n\n        if len(coords) == 2:\n            # straight line\n            pass\n        elif len(coords) == 3:\n            # dogleg forward line\n            pass\n        else:\n            # backward line\n            for i, (start, end) in enumerate(pairwise(coords[1:-1])):\n                if is_close_numpy((event.x, event.y), start, end, tolerance=5):\n                    print(\"close to segment\", start, end)\n\n                    self.dragged = 0\n                    widget = event.widget\n                    self.x, self.y = widget.canvasx(event.x), widget.canvasy(event.y)\n                    # self.color = widget.itemcget(tk.CURRENT, \"fill\")\n                    event.widget.bind(\"<Motion>\", self.wire_motion)\n                    self.dx = 0\n                    self.dy = 0\n                    self.idx = i + 1\n                    self.isvertical = (i & 1) == 0  # is vertical segment\n\n            pass\n\n    def wire_up(self, event):\n        self.event_print(\"wire_up\", event)\n        self.root.config(cursor=\"\")\n        widget = event.widget\n        widget.unbind(\"<Motion>\")\n\n    def wire_enter(self, event):\n        self.event_print(\"wire_enter\", event)\n        self.itemconfig(tk.CURRENT, width=3)\n\n    def wire_leave(self, event):\n        self.event_print(\"wire_leave\", event)\n        self.itemconfig(tk.CURRENT, width=1)\n\n    def wire_delete(self, event):\n        self.event_print(\"wire delete\", event)\n        self.delete(self.current_item_id())\n\n    # ------------ UI events -----------------\n    def new_block(event):\n        self.event_print(\"new block\", event)\n        tree = getattr(event, \"data\", None)\n        block = getattr(tree, \"_last_activated_block\", None)\n        if block:\n            print(\"Activated block:\", block)\n\n    # ------------ keyboard events -----------------\n\n    # \"x\" to list all items\n    def list_items(self, event):\n        print(\"list items\")\n        for item in self.find_withtag(\"block\"):\n            print(\n                \"item\",\n                item,\n                self.gettags(item),\n                self.coords(item),\n            )\n        for item in self.find_withtag(\"wire\"):\n            print(\n                \"item\",\n                item,\n                self.gettags(item),\n                self.coords(item),\n            )\n\n    # \"q\" to quit\n    def quit(self, event):\n        self.list_items(event)\n        self.root.quit()\n\n    def flip(self, event):\n        print(\"flip\")\n        b4.flip()\n\n    def __init__(self, parent, **kwargs):\n        # Initialize the Canvas\n        super().__init__(\n            parent,\n            **kwargs,\n        )\n\n        self._images = []  # keep references to icon images\n        self.root = self.winfo_toplevel()\n\n        self.gridlines(20)\n        self.pack()\n\n        self.loc = self.dragged = 0\n\n        self.tag_bind(\"block\", \"<ButtonPress-1>\", self.block_down)\n        self.tag_bind(\"block\", \"<ButtonRelease-1>\", self.block_up)\n        self.tag_bind(\"block\", \"<Enter>\", self.block_enter)\n        self.tag_bind(\"block\", \"<Leave>\", self.block_leave)\n        self.bind(\"<Key-f>\", self.flip)\n\n        self.tag_bind(\"image\", \"<ButtonPress-1>\", self.block_down)\n        self.tag_bind(\"image\", \"<ButtonRelease-1>\", self.block_up)\n        self.tag_bind(\"image\", \"<Enter>\", self.block_enter)\n        self.tag_bind(\"image\", \"<Leave>\", self.block_leave)\n        self.bind(\"<Key-f>\", self.flip)\n\n        self.tag_bind(\"outport\", \"<ButtonPress-1>\", self.outport_down)\n        self.tag_bind(\"outport\", \"<ButtonRelease-1>\", self.outport_up)\n        self.tag_bind(\"outport\", \"<Enter>\", self.outport_enter)\n        self.tag_bind(\"outport\", \"<Leave>\", self.outport_leave)\n\n        self.tag_bind(\"inport\", \"<ButtonPress-1>\", self.inport_down)\n        self.tag_bind(\"inport\", \"<ButtonRelease-1>\", self.inport_up)\n        self.tag_bind(\"inport\", \"<Enter>\", self.inport_enter)\n        self.tag_bind(\"inport\", \"<Leave>\", self.inport_leave)\n\n        self.tag_bind(\"wire\", \"<ButtonPress-1>\", self.wire_down)\n        self.tag_bind(\"wire\", \"<ButtonRelease-1>\", self.wire_up)\n        self.tag_bind(\"wire\", \"<Delete>\", self.wire_delete)\n        self.tag_bind(\"wire\", \"<Enter>\", self.wire_enter)\n        self.tag_bind(\"wire\", \"<Leave>\", self.wire_leave)\n\n        self.bind(\"<<NewBlockActivated>>\", self.new_block)\n\n        self.bind(\"x\", self.list_items)\n        self.bind(\"q\", self.quit)\n\n\ndef is_close_numpy(point, start, end, tolerance):\n    p = np.array(point)\n    a = np.array(start)\n    b = np.array(end)\n\n    # Vector AB\n    ab = b - a\n\n    # Squared length of AB\n    len_sq = np.sum(ab**2)\n\n    if len_sq == 0:\n        return np.linalg.norm(p - a) <= tolerance\n\n    # Project point onto line, clamped between 0 and 1\n    t = np.dot(p - a, ab) / len_sq\n    t = np.clip(t, 0, 1)\n\n    # Find closest point on segment\n    closest = a + t * ab\n\n    # Check distance\n    return np.linalg.norm(p - closest) <= tolerance\n"
  },
  {
    "path": "bdsim/tk_editor/editor.py",
    "content": "import tkinter as tk\n\n# init tk\nroot = tk.Tk()\nroot.title(\"bdsim\")\n\n# create  widget\ncanvas = tk.Canvas(root, bg=\"white\", height=500, width=1000)\ncanvas.pack()\n\n# draw arcs\ncoord = 10, 10, 300, 300\n# arc = canvas.create_arc(coord, start=0, extent=150, fill=\"red\")\n# arv2 = canvas.create_arc(coord, start=150, extent=215, fill=\"green\")\n\n\ndef grid(canvas, line_distance):\n    root.update()\n    print(canvas.winfo_width())\n    canvas_width = 1000\n    canvas_height = 500\n    # vertical lines at an interval of \"line_distance\" pixel\n    for x in range(line_distance, canvas_width, line_distance):\n        canvas.create_line(x, 0, x, canvas_height, fill=\"#f0f0f0\")\n    # horizontal lines at an interval of \"line_distance\" pixel\n    for y in range(line_distance, canvas_height, line_distance):\n        canvas.create_line(0, y, canvas_width, y, fill=\"#f0f0f0\")\n\n\ngrid(canvas, 20)\n\n\ndef draw_block(nin, nout, pos):\n    W = 50\n    H = 100\n    a = 20  # distance from top/bottm\n    b = 5  # half width of output\n\n    D = H - 2 * a\n\n    # draw top edge\n    p = [(0, 0), (W, 0)]\n\n    # draw right side with triangles\n    if nout == 1:\n        y = H / 2\n        p.extend([(W, y - b), (W + b, y), (W, y + b)])\n    else:\n        d = D / (nout - 1)\n        for k in range(0, nout):\n            y = a + k * d\n            p.extend([(W, y - b), (W + b, y), (W, y + b)])\n\n    # draw bottom edge\n    p.extend([(W, H), (0, H)])\n\n    # draw left side with squares\n    if nout == 1:\n        y = H / 2\n        p.extend([(0, y + b), (-b, y + b), (-b, y - b), (0, y - b)])\n    else:\n        d = D / (nout - 1)\n        for k in range(0, nout):\n            y = a + k * d\n            p.extend([(0, y + b), (-b, y + b), (-b, y - b), (0, y - b)])\n    print(p)\n\n    x0 = 100\n    y0 = 200\n    pp = [(x[0] + pos[0], x[1] + pos[1]) for x in p]\n    b1 = canvas.create_polygon(pp, fill=\"red\", tags=\"box\")\n\n\ndraw_block(1, 1, (100, 100))\ndraw_block(0, 1, (200, 100))\ndraw_block(3, 1, (300, 100))\ndraw_block(2, 3, (400, 100))\n\n# add to window and show\n\nroot.mainloop()\n"
  },
  {
    "path": "bdsim/tk_editor/editor2.py",
    "content": "import sys\nimport os\nimport string\nimport time\nimport tkinter as tk\n\nfrom itertools import tee\n\n\ndef pairwise(iterable):\n    \"s -> (s0,s1), (s1,s2), (s2, s3), ...\"\n    a, b = tee(iterable)\n    next(b, None)\n    return zip(a, b)\n\n\n# A Python example of drag and drop functionality within a single Tk widget.\n# The trick is in the bindings and event handler functions.\n# Tom Vrankar twv at ici.net\n\n# empirical events between dropee and target, as determined from Tk 8.0\n# down.\n# leave.\n# up, leave, enter.\ndef ortho_line(start, end, width=2, **kwargs):\n    if start[0] < end[0]:\n        if start[1] == end[1]:\n            canvas.create_line(start, end, tag=\"wire\", **kwargs)\n        else:\n            xmid = (start[0] + end[0]) / 2.0\n            canvas.create_line(\n                start,\n                (xmid, start[1]),\n                (xmid, end[1]),\n                end,\n                tag=\"wire\",\n                width=width,\n                **kwargs,\n            )\n    else:\n        # line has to go backwards\n        L = 20\n        H = 100\n        if end[1] < start[1]:\n            # new block above\n            y = end[1] - H\n        else:\n            y = end[1] + H\n        canvas.create_line(\n            start,\n            (start[0] + L, start[1]),\n            (start[0] + L, y),\n            (end[0] - L, y),\n            (end[0] - L, end[1]),\n            end,\n            tag=\"wire\",\n            **kwargs,\n        )\n\n\ndef redraw_wires():\n    canvas.delete(\"wire\")\n    ortho_line(b3.outpos(0), b4.inpos(0))\n\n\nclass CanvasDnD(tk.Frame):\n    def __init__(self, master, canvas):\n        self.master = master\n        self.loc = self.dragged = 0\n        tk.Frame.__init__(self, master)\n\n        canvas.tag_bind(\"DnD\", \"<ButtonPress-1>\", self.down)\n        canvas.tag_bind(\"DnD\", \"<ButtonRelease-1>\", self.chkup)\n        canvas.tag_bind(\"DnD\", \"<Enter>\", self.enter)\n        canvas.tag_bind(\"DnD\", \"<Leave>\", self.leave)\n        canvas.bind(\"<Key-f>\", self.flip)\n\n    # mouse button down, start drag\n    def down(self, event):\n        self.loc = 1\n        self.dragged = 0\n        cnv = event.widget\n        self.x, self.y = cnv.canvasx(event.x), cnv.canvasy(event.y)\n        self.color = cnv.itemcget(tk.CURRENT, \"fill\")\n        event.widget.bind(\"<Motion>\", self.motion)\n\n    # mouse is dragging\n    def motion(self, event):\n        root.config(cursor=\"exchange\")\n        cnv = event.widget\n        cnv.itemconfigure(tk.CURRENT, fill=\"white\", outline=\"grey\", dash=(5, 5))\n        x, y = cnv.canvasx(event.x), cnv.canvasy(event.y)\n        dx = x - self.x\n        dy = y - self.y\n        self.x = x\n        self.y = y\n        # got = event.widget.coords(tk.CURRENT, x, y)\n        event.widget.move(tk.CURRENT, dx, dy)\n\n    def leave(self, event):\n        print(\"leave\")\n        canvas.itemconfigure(tk.CURRENT, outline=\"\")\n        self.loc = 0\n\n    def enter(self, event):\n        print(\"enter\", event)\n        canvas.itemconfigure(tk.CURRENT, outline=\"darkred\", width=2)\n        self.loc = 1\n        if self.dragged == event.time:\n            self.up(event)\n        canvas.focus_set()\n\n    # mouse button released\n    def chkup(self, event):\n        event.widget.unbind(\"<Motion>\")\n        root.config(cursor=\"\")\n        self.target = event.widget.find_withtag(tk.CURRENT)\n        event.widget.itemconfigure(tk.CURRENT, fill=self.color, dash=())\n        if self.loc:  # is button released in same widget as pressed?\n            self.up(event)\n        else:\n            self.dragged = event.time\n        redraw_wires()\n\n    def up(self, event):\n        event.widget.unbind(\"<Motion>\")\n        if self.target == event.widget.find_withtag(tk.CURRENT):\n            pass\n            # print(\"Select %s\" % event.widget.itemcget(tk.CURRENT, \"text\"))\n        else:\n            event.widget.itemconfigure(tk.CURRENT, fill=\"blue\")\n            self.master.update()\n            time.sleep(0.1)\n            # print(\"%s Drag-N-Dropped onto %s\"\n            #       % (event.widget.itemcget(self.target, \"text\"),\n            #          event.widget.itemcget(tk.CURRENT, \"text\")))\n            event.widget.itemconfigure(tk.CURRENT, fill=self.defaultcolor)\n\n    def flip(self, event):\n        print(\"flip\")\n        b4.flip()\n\n\nroot = tk.Tk()\nroot.title(\"bdsim editor\")\n\n# create  widget\ncanvas = tk.Canvas(\n    root,\n    bg=\"white\",\n    height=500,\n    width=1000,\n    relief=tk.RIDGE,\n    background=\"white\",\n    borderwidth=1,\n)\ncanvas.pack()\n\n\ndef grid(canvas, line_distance):\n    root.update()\n    print(canvas.winfo_width())\n    canvas_width = 1000\n    canvas_height = 500\n    # vertical lines at an interval of \"line_distance\" pixel\n    for x in range(line_distance, canvas_width, line_distance):\n        canvas.create_line(x, 0, x, canvas_height, fill=\"#f0f0f0\")\n    # horizontal lines at an interval of \"line_distance\" pixel\n    for y in range(line_distance, canvas_height, line_distance):\n        canvas.create_line(0, y, canvas_width, y, fill=\"#f0f0f0\")\n\n\ngrid(canvas, 20)\n\n\nclass GBlock:\n    W = 50\n    H = 100\n    a = 20  # distance from top/bottm\n    b = 5  # half width of output\n\n    def __init__(self, nin, nout, pos, fill=\"red\", **kwargs):\n\n        D = self.H - 2 * self.a\n\n        inpos = []\n        outpos = []\n\n        # draw top edge\n        p = [(0, 0), (self.W, 0)]\n\n        # draw right side with triangles\n        if nout == 1:\n            y = self.H / 2\n            p.extend([(self.W, y - self.b), (self.W + self.b, y), (self.W, y + self.b)])\n            outpos.append((self.W + self.b, y))\n        else:\n            d = D / (nout - 1)\n            for k in range(0, nout):\n                y = self.a + k * d\n                p.extend(\n                    [(self.W, y - self.b), (self.W + self.b, y), (self.W, y + self.b)]\n                )\n                outpos.append((self.W + self.b, y))\n\n        # draw bottom edge\n        p.extend([(self.W, self.H), (0, self.H)])\n\n        # draw left side with squares\n        if nout == 1:\n            y = self.H / 2\n            p.extend(\n                [\n                    (0, y + self.b),\n                    (-self.b, y + self.b),\n                    (-self.b, y - self.b),\n                    (0, y - self.b),\n                ]\n            )\n            inpos.append((-self.b, y))\n        else:\n            d = D / (nout - 1)\n            for k in range(0, nout):\n                y = self.H - self.a - k * d\n                p.extend(\n                    [\n                        (0, y + self.b),\n                        (-self.b, y + self.b),\n                        (-self.b, y - self.b),\n                        (0, y - self.b),\n                    ]\n                )\n                inpos.append((-self.b, y))\n\n        self._inpos = inpos\n        self._outpos = outpos\n\n        self.outline = p\n        pp = [(x[0] + pos[0], x[1] + pos[1]) for x in p]\n        self.id = canvas.create_polygon(pp, fill=fill, tags=\"DnD\", **kwargs)\n\n    def flip(self):\n        outline = canvas.coords(self.id)\n        print(outline)\n        A = 2 * (outline[0] + 25)\n        flipped = []\n        for x, y in pairwise(outline):\n            flipped.extend([A - x, y])\n        print(flipped)\n        canvas.coords(self.id, flippedgit)\n\n    def inpos(self, i):\n        pos = canvas.coords(self.id)\n        return (pos[0] + self._inpos[i][0], pos[1] + self._inpos[i][1])\n\n    def outpos(self, i):\n        pos = canvas.coords(self.id)\n        return (pos[0] + self._outpos[i][0], pos[1] + self._outpos[i][1])\n\n\nGBlock(1, 1, (100, 100))\nGBlock(0, 1, (200, 100))\nb3 = GBlock(3, 1, (300, 100))\nb4 = GBlock(2, 3, (400, 100))\n\n# print(canvas.bbox(b4.id))\n# canvas.create_rectangle(canvas.bbox(b4.id), outline=\"black\", fill=\"\")\n\nprint(canvas.coords(b4.id))\nprint(canvas.bbox(b4.id))\n\n\nCanvasDnD(root, canvas)\nroot.mainloop()\n"
  },
  {
    "path": "docs/Makefile",
    "content": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line, and also\n# from the environment for the first two.\nSPHINXOPTS    ?=\nSPHINXBUILD   ?= sphinx-build\nSOURCEDIR     = source\nBUILDDIR      = build\n\n# Put it first so that \"make\" without argument is like \"make help\".\nhelp:\n\t@$(SPHINXBUILD) -M help \"$(SOURCEDIR)\" \"$(BUILDDIR)\" $(SPHINXOPTS) $(O)\n\nopen:\n\topen build/html/index.html\n\n.PHONY: help Makefile\n\n# Catch-all target: route all unknown targets to Sphinx using the new\n# \"make mode\" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).\n%: Makefile\n\t@$(SPHINXBUILD) -M $@ \"$(SOURCEDIR)\" \"$(BUILDDIR)\" $(SPHINXOPTS) $(O)\n"
  },
  {
    "path": "docs/make.bat",
    "content": "@ECHO OFF\r\n\r\npushd %~dp0\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\nset SOURCEDIR=source\r\nset BUILDDIR=build\r\n\r\nif \"%1\" == \"\" goto help\r\n\r\n%SPHINXBUILD% >NUL 2>NUL\r\nif errorlevel 9009 (\r\n\techo.\r\n\techo.The 'sphinx-build' command was not found. Make sure you have Sphinx\r\n\techo.installed, then set the SPHINXBUILD environment variable to point\r\n\techo.to the full path of the 'sphinx-build' executable. Alternatively you\r\n\techo.may add the Sphinx directory to PATH.\r\n\techo.\r\n\techo.If you don't have Sphinx installed, grab it from\r\n\techo.http://sphinx-doc.org/\r\n\texit /b 1\r\n)\r\n\r\n%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%\r\ngoto end\r\n\r\n:help\r\n%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%\r\n\r\n:end\r\npopd\r\n"
  },
  {
    "path": "docs/source/bdsim.blocks.rst",
    "content": ".. _Block library:\n\n*************\nBlock library\n*************\n\n.. include:: <isonum.txt>\n\nThe block diagrams comprise blocks which belong to one of a number of different categories. These come from\nthe package ``bdsim.blocks``, ``roboticstoolbox.blocks``, ``machinevisiontoolbox.blocks``.\n\nIcons, if shown to the left of the black header bar, are as used with `bdedit <https://github.com/petercorke/bdsim/tree/master/bdsim/bdedit>`_.\n\n.. inheritance-diagram:: bdsim.components.SourceBlock bdsim.components.SinkBlock bdsim.graphics.GraphicsBlock bdsim.components.FunctionBlock bdsim.components.TransferBlock bdsim.components.SubsystemBlock\n\n\nSource blocks\n=============\n\n.. automodule:: bdsim.blocks.sources\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\nSink blocks\n===========\n\n.. automodule:: bdsim.blocks.sinks\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\nDisplay blocks\n==============\n\n.. automodule:: bdsim.blocks.displays\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\nFunction blocks\n===============\n\nFunctions\n---------\n\n.. automodule:: bdsim.blocks.functions\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\n\nLinear algebra\n--------------\n\n.. automodule:: bdsim.blocks.linalg\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\nSpatial math\n------------\n\n.. automodule:: bdsim.blocks.spatial\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\n\nConnection blocks\n=================\n\n.. automodule:: bdsim.blocks.connections\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\nDynamics\n========\n\nContinuous-time blocks\n----------------------\n\n.. automodule:: bdsim.blocks.transfers\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\nDiscrete-time blocks\n--------------------\n\n.. automodule:: bdsim.blocks.discrete\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\n\nExternal Toolbox blocksets\n==========================\n\nThese blocks are defined within external Toolboxes or packages.\n\n\nRobot blocks\n------------\n\nThese blocks are defined within the Robotics Toolbox for Python.\n\nArm robots\n^^^^^^^^^^\n\n.. automodule:: roboticstoolbox.blocks.arm\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\nMobile robots\n^^^^^^^^^^^^^\n\n.. automodule:: roboticstoolbox.blocks.mobile\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\nMulti rotor flying robots\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. automodule:: roboticstoolbox.blocks.uav\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\nVision blocks\n-------------\n\nThese blocks are defined within the Machine Vision Toolbox for Python.\n\n.. automodule:: machinevisiontoolbox.blocks\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\n"
  },
  {
    "path": "docs/source/bdsim.rst",
    "content": "Overview\n========\n\n\nGetting started\n---------------\n\nWe first sketch the dynamic system we want to simulate as a block diagram, for example this simple first-order system\n\n.. image:: ../../figs/bd1-sketch.png\n   :width: 800\n\nwhich we can express concisely with `bdsim` as (see `bdsim/examples/eg1.py <https://github.com/petercorke/bdsim/blob/master/examples/eg1.py>`_)\n\n.. code-block:: python\n   :linenos:\n\n   import bdsim\n\n   sim = bdsim.BDSim()  # create simulator\n   bd = sim.blockdiagram()  # create an empty block diagram\n\n   # define the blocks\n   demand = bd.STEP(T=1, name='demand')\n   sum = bd.SUM('+-')\n   gain = bd.GAIN(10)\n   plant = bd.LTI_SISO(0.5, [2, 1], name='plant')\n   scope = bd.SCOPE(styles=['k', 'r--'], movie='eg1.mp4')\n\n   # connect the blocks\n   bd.connect(demand, sum[0], scope[1])\n   bd.connect(sum, gain)\n   bd.connect(gain, plant)\n   bd.connect(plant, sum[1], scope[0])\n\n   bd.compile()   # check the diagram\n   bd.report()    # list all blocks and wires\n\n   out = sim.run(bd, 5)  # simulate for 5s\n\n   print(out)\n\n   # sim.savefig(scope, 'scope0') # save scope figure as scope0.pdf\n   sim.done(bd, block=True)  # keep figures open on screen\n\nwhich is just 16 lines of executable code.\n\nThe red block annotations on the hand-drawn diagram are used as the names of the variables holding references to the block instance. The blocks can also have user-assigned names, see lines 8 and 11, which are used in diagnostics and as labels in plots.\n\nAfter the blocks are created their input and output ports need to be connected. In `bdsim` all wires are point to point, a *one-to-many* connection is implemented by *many* wires,\nfor example::\n\n   bd.connect(source, dest1, dest2, ...)\n\ncreates individual wires from `source` -> `dest1`, `source` -> `dest2` and so on.\nPorts are designated using Python indexing notation, for example `block[2]` is port 2 (the third port) of `block`.  Whether it is an input or output port depends on context.\nIn the example above an index on the first argument refers to an output port, while on the second (or subsequent) arguments it refers to an input port.  If a block has only a single input or output port then no index is required, 0 is assumed.\n\nA group of ports can be denoted using slice notation, for example::\n\n   bd.connect(source[2:5], dest[3:6)\n\nwill connect ``source[2]`` -> ``dest[3]``, ``source[3]`` -> ``dest[4]``, ``source[4]`` -> ``dest[5]``.\nThe number of wires in each slice must be consistent.  You could even do a cross over by connecting ``source[2:5]`` to ``dest[6:3:-1]``.\n\nLine 20 assembles all the blocks and wires, instantiates subsystems, checks connectivity to create a flat wire list, and then builds the dataflow execution plan.\n\nLine 21 generates a report, in tabular form, showing a summary of the block diagram:\n\n.. code-block::\n\n   Blocks::\n\n   ┌───┬─────────┬─────┬──────┬────────┬─────────┬───────┐\n   │id │    name │ nin │ nout │ nstate │ ndstate │ type  │\n   ├───┼─────────┼─────┼──────┼────────┼─────────┼───────┤\n   │ 0 │  demand │   0 │    1 │      0 │       0 │ step  │\n   │ 1 │   sum.0 │   2 │    1 │      0 │       0 │ sum   │\n   │ 2 │  gain.0 │   1 │    1 │      0 │       0 │ gain  │\n   │ 3 │   plant │   1 │    1 │      1 │       0 │ LTI   │\n   │ 4 │ scope.0 │   2 │    0 │      0 │       0 │ scope │\n   └───┴─────────┴─────┴──────┴────────┴─────────┴───────┘\n\n   Wires::\n\n   ┌───┬──────┬──────┬──────────────────────────┬─────────┐\n   │id │ from │  to  │       description        │  type   │\n   ├───┼──────┼──────┼──────────────────────────┼─────────┤\n   │ 0 │ 0[0] │ 1[0] │ demand[0] --> sum.0[0]   │ int     │\n   │ 1 │ 0[0] │ 4[1] │ demand[0] --> scope.0[1] │ int     │\n   │ 2 │ 3[0] │ 1[1] │ plant[0] --> sum.0[1]    │ float64 │\n   │ 3 │ 1[0] │ 2[0] │ sum.0[0] --> gain.0[0]   │ float64 │\n   │ 4 │ 2[0] │ 3[0] │ gain.0[0] --> plant[0]   │ float64 │\n   │ 5 │ 3[0] │ 4[0] │ plant[0] --> scope.0[0]  │ float64 │\n   └───┴──────┴──────┴──────────────────────────┴─────────┘\n\n\n.. image:: ../../figs/Figure_1.png\n   :width: 600\n\nThe simulation results are returned in a simple container object::\n\n   >>> out\n   results:\n   t           | ndarray (67,)\n   x           | ndarray (67, 1)\n   xnames      | list              \n\nwhere\n\n- `t` the time vector: ndarray, shape=(M,)\n- `x` is the state vector: ndarray, shape=(M,N), one row per timestep\n- `xnames` is a list of the names of the states corresponding to columns of `x`, eg. \"plant.x0\"\n\nTo record additional simulation variables we \"watch\" them. This can be specified by\nwiring the signal to a WATCH block, or more conveniently by an additional option to\n``run``::\n\n   out = sim.run(bd, 5, watch=[plant,demand])  # simulate for 5s\n\nand now the result ``out`` has additional elements::\n\n   >>> out\n   results:\n   t           | ndarray (67,)\n   x           | ndarray (67, 1)\n   xnames      | list        \n   y0          | ndarray (67,)\n   y1          | ndarray (67,)\n   ynames      | list   \n\nwhere\n\n- `y0` is the time history of the first watched signal\n- `y1` is the time history of the second watched signal\n- `ynames` is a list of the names of the states corresponding to columns of `x`, eg. \"plant[0]\"\n\nLine 27 saves the content of the scope to be saved in the file called `scope0.pdf`.\n\nLine 28 blocks the script until all figure windows are closed, or the script is killed with SIGINT.\n\nLine 29 saves the scope graphics as a PDF file.\n\nLine 30 blocks until the last figure is dismissed.\n\nA list of available blocks can be obtained by::\n\n   >>> sim.blocks()\n      73  blocks loaded\n      bdsim.blocks.functions..................: Sum Prod Gain Clip Function Interpolate \n      bdsim.blocks.sources....................: Constant Time WaveForm Piecewise Step Ramp \n      bdsim.blocks.sinks......................: Print Stop Null Watch \n      bdsim.blocks.transfers..................: Integrator PoseIntegrator LTI_SS LTI_SISO \n      bdsim.blocks.discrete...................: ZOH DIntegrator DPoseIntegrator \n      bdsim.blocks.linalg.....................: Inverse Transpose Norm Flatten Slice2 Slice1 Det Cond \n      bdsim.blocks.displays...................: Scope ScopeXY ScopeXY1 \n      bdsim.blocks.connections................: Item Dict Mux DeMux Index SubSystem InPort OutPort \n      roboticstoolbox.blocks.arm..............: FKine IKine Jacobian Tr2Delta Delta2Tr Point2Tr TR2T FDyn IDyn Gravload \n      ........................................: Inertia Inertia_X FDyn_X ArmPlot Traj JTraj LSPB CTraj CirclePath \n      roboticstoolbox.blocks.mobile...........: Bicycle Unicycle DiffSteer VehiclePlot \n      roboticstoolbox.blocks.uav..............: MultiRotor MultiRotorMixer MultiRotorPlot \n      machinevisiontoolbox.blocks.camera......: Camera Visjac_p EstPose_p ImagePlane \n\nMore details can be found at:\n\n- `Wiki page <https://github.com/petercorke/bdsim/wiki>`_\n   - `Adding blocks <https://github.com/petercorke/bdsim/wiki/Adding-blocks>`_\n   - `Connecting blocks <https://github.com/petercorke/bdsim/wiki/Connecting-blocks>`_\n   - `Running the simulation <https://github.com/petercorke/bdsim/wiki/Running>`_\n- :ref:`Block library`\n\nUsing operator overloading\n--------------------------\n\nWiring, and some simple arithmetic blocks like GAIN, SUM and PROD can be implicitly generated by overloaded Python operators.  This strikes a nice balance between block diagram coding and Pythonic programming.\n\n.. code-block:: python\n   :linenos:\n\n   import bdsim\n\n   sim = bdsim.BDSim()  # create simulator\n   bd = sim.blockdiagram()  # create an empty block diagram\n\n   # define the blocks\n   demand = bd.STEP(T=1, name='demand')\n   plant = bd.LTI_SISO(0.5, [2, 1], name='plant')\n   scope = bd.SCOPE(styles=['k', 'r--'], movie='eg1.mp4')\n\n   # connect the blocks\n   scope[0] = plant\n   scope[1] = demand\n   plant[0] = 10 * (demand - plant)\n\n   bd.compile()   # check the diagram\n   bd.report()    # list all blocks and wires\n\n   out = sim.run(bd, 5)  # simulate for 5s\n   # out = sim.run(bd, 5 watch=[plant,demand])  # simulate for 5s\n   print(out)\n\n   # sim.savefig(scope, 'scope0') # save scope figure as scope0.pdf\n   sim.done(bd, block=True)  # keep figures open on screen\n\nThis requires fewer lines of code and the code is more readable. \nImportantly, it results in in *exactly the same* block diagram in terms of blocks and wires::\n\n\n   ┌───┬──────┬──────┬──────────────────────────────┬─────────┐\n   │id │ from │  to  │         description          │  type   │\n   ├───┼──────┼──────┼──────────────────────────────┼─────────┤\n   │ 0 │ 1[0] │ 2[0] │ plant[0] --> scope.0[0]      │ float64 │\n   │ 1 │ 0[0] │ 2[1] │ demand[0] --> scope.0[1]     │ int     │\n   │ 2 │ 0[0] │ 3[0] │ demand[0] --> _sum.0[0]      │ int     │\n   │ 3 │ 1[0] │ 3[1] │ plant[0] --> _sum.0[1]       │ float64 │\n   │ 4 │ 3[0] │ 4[0] │ _sum.0[0] --> _gain.0(10)[0] │ float64 │\n   │ 5 │ 4[0] │ 1[0] │ _gain.0(10)[0] --> plant[0]  │ float64 │\n   └───┴──────┴──────┴──────────────────────────────┴─────────┘\n\nThe implicitly created blocks have names prefixed with an underscore."
  },
  {
    "path": "docs/source/conf.py",
    "content": "# bdsim\n# Configuration file for the Sphinx documentation builder.\n#\n# This file only contains a selection of the most common options. For a full\n# list see the documentation:\n# https://www.sphinx-doc.org/en/master/usage/configuration.html\n\n# -- Path setup --------------------------------------------------------------\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#\nimport os\nimport sys\n\n# sys.path.insert(0, os.path.abspath('.'))\n# defined relative to configuration directory which is where this file conf.py lives\nsys.path.append(os.path.abspath(\"exts\"))\n\n\n# -- Project information -----------------------------------------------------\n\nproject = \"Block diagram simulation\"\ncopyright = \"2020-, Peter Corke.\"\nauthor = \"Peter Corke\"\n\ntry:\n    import bdsim\n\n    version = bdsim.__version__\nexcept AttributeError:\n    import re\n\n    with open(\"../../pyproject.toml\", \"r\") as f:\n        m = re.compile(r'version\\s*=\\s*\"([0-9\\.]+)\"').search(f.read())\n        version = m[1]\n\n# -- General configuration ---------------------------------------------------\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    \"sphinx.ext.autodoc\",\n    \"sphinx.ext.todo\",\n    \"sphinx.ext.viewcode\",\n    \"sphinx.ext.mathjax\",\n    \"matplotlib.sphinxext.plot_directive\",\n    \"sphinx.ext.coverage\",\n    \"sphinx.ext.intersphinx\",\n    \"sphinx.ext.inheritance_diagram\",\n    \"sphinx_autodoc_typehints\",\n    \"sphinx_favicon\",\n    \"blockname\",\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = [\"_templates\"]\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This pattern also affects html_static_path and html_extra_path.\nexclude_patterns = [\"test_*\"]\n\n# -- Options for HTML output -------------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = \"alabaster\"\nhtml_show_sourcelink = True\n\nhtml_theme = \"sphinx_rtd_theme\"\n# html_theme = 'alabaster'\n# html_theme = 'pyramid'\n# html_theme = 'sphinxdoc'\n\ngithub_url = \"https://github.com/petercorke/bdsim\"\n\nhtml_theme_options = {\n    \"github_host\": \"gitlab.com\",\n    \"github_user\": \"petercorke\",\n    \"github_repo\": \"bdsim\",\n    \"display_github\": True,\n    \"github_version\": \"HEAD\",\n    \"logo_only\": False,\n    \"display_version\": True,\n    \"prev_next_buttons_location\": \"both\",\n    \"analytics_id\": \"G-11Q6WJM565\",\n}\n\nhtml_logo = \"../../figs/BDSimLogo_NoBackgnd@2x.png\"\nhtml_last_updated_fmt = \"%d-%b-%Y\"\nautoclass_content = \"class\"\nhtml_show_sourcelink = True\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\n# html_static_path = ['_static']\n\nrst_epilog = \"\"\"\n.. role:: raw-html(raw)\n   :format: html\n.. |BlockOptions| replace:: :raw-html:`<a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a>`\n\"\"\"\n# -------- RVC maths notation -------------------------------------------------------#\n\n# see https://stackoverflow.com/questions/9728292/creating-latex-math-macros-within-sphinx\nmathjax3_config = {\n    \"tex\": {\n        \"macros\": {\n            # RVC Math notation\n            #  - not possible to do the if/then/else approach\n            #  - subset only\n            \"presup\": [r\"\\,{}^{\\scriptscriptstyle #1}\\!\", 1],\n            # groups\n            \"SE\": [r\"\\mathbf{SE}(#1)\", 1],\n            \"SO\": [r\"\\mathbf{SO}(#1)\", 1],\n            \"se\": [r\"\\mathbf{se}(#1)\", 1],\n            \"so\": [r\"\\mathbf{so}(#1)\", 1],\n            # vectors\n            \"vec\": [r\"\\boldsymbol{#1}\", 1],\n            \"dvec\": [r\"\\dot{\\boldsymbol{#1}}\", 1],\n            \"ddvec\": [r\"\\ddot{\\boldsymbol{#1}}\", 1],\n            \"fvec\": [r\"\\presup{#1}\\boldsymbol{#2}\", 2],\n            \"fdvec\": [r\"\\presup{#1}\\dot{\\boldsymbol{#2}}\", 2],\n            \"fddvec\": [r\"\\presup{#1}\\ddot{\\boldsymbol{#2}}\", 2],\n            \"norm\": [r\"\\Vert #1 \\Vert\", 1],\n            # matrices\n            \"mat\": [r\"\\mathbf{#1}\", 1],\n            \"dmat\": [r\"\\dot{\\mathbf{#1}}\", 1],\n            \"fmat\": [r\"\\presup{#1}\\mathbf{#2}\", 2],\n            # skew matrices\n            \"sk\": [r\"\\left[#1\\right]\", 1],\n            \"skx\": [r\"\\left[#1\\right]_{\\times}\", 1],\n            \"vex\": [r\"\\vee\\left( #1\\right)\", 1],\n            \"vexx\": [r\"\\vee_{\\times}\\left( #1\\right)\", 1],\n            # quaternions\n            \"q\": r\"\\mathring{q}\",\n            \"fq\": [r\"\\presup{#1}\\mathring{q}\", 1],\n        }\n    }\n}\n\n# -------- Options favicon -------------------------------------------------------#\n\nhtml_static_path = [\"_static\"]\n# create favicons online using https://favicon.io/favicon-converter/\nfavicons = [\n    {\n        \"rel\": \"icon\",\n        \"sizes\": \"16x16\",\n        \"static-file\": \"favicon-16x16.png\",\n        \"type\": \"image/png\",\n    },\n    {\n        \"rel\": \"icon\",\n        \"sizes\": \"32x32\",\n        \"static-file\": \"favicon-32x32.png\",\n        \"type\": \"image/png\",\n    },\n    {\n        \"rel\": \"apple-touch-icon\",\n        \"sizes\": \"180x180\",\n        \"static-file\": \"apple-touch-icon.png\",\n        \"type\": \"image/png\",\n    },\n    {\n        \"rel\": \"android-chrome\",\n        \"sizes\": \"192x192\",\n        \"static-file\": \"android-chrome-192x192.png \",\n        \"type\": \"image/png\",\n    },\n    {\n        \"rel\": \"android-chrome\",\n        \"sizes\": \"512x512\",\n        \"static-file\": \"android-chrome-512x512.png \",\n        \"type\": \"image/png\",\n    },\n]\n\n# -------- Options InterSphinx -------------------------------------------------------#\n\nintersphinx_mapping = {\n    \"python\": (\"https://docs.python.org/3\", None),\n    \"numpy\": (\"http://docs.scipy.org/doc/numpy/\", None),\n    \"scipy\": (\"http://docs.scipy.org/doc/scipy/reference/\", None),\n    \"matplotlib\": (\"http://matplotlib.sourceforge.net/\", None),\n    \"spatialmath\": (\"https://petercorke.github.io/spatialmath-python/\", None),\n}\n"
  },
  {
    "path": "docs/source/exts/blockname.py",
    "content": "from docutils import nodes\n\n# from docutils.parsers.rst import Directive\n\n\ndef block_name(name, rawtext, text, lineno, inliner, options={}, content=[]):\n\n    # name: The local name of the interpreted role, the role name actually used in the document.\n    # rawtext: A string containing the enitre interpreted text input, including the role and markup. Return it as a problematic node linked to a system message if a problem is encountered.\n    # text: The interpreted text content.\n    # lineno: The line number where the interpreted text begins.\n    # inliner: The docutils.parsers.rst.states.Inliner object that called role_fn. It contains the several attributes useful for error reporting and document tree access.\n    # options: A dictionary of directive options for customization (from the \"role\" directive), to be interpreted by the role function. Used for additional attributes for the generated elements and other functionality.\n    # content: A list of strings, the directive content for customization (from the \"role\" directive). To be interpreted by the role function.\n\n    html = \"\"\"\n    <table width=\"100%\">\n    \t<col style=\"width:75%\">\n        <col style=\"width:5%;\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    {0}\n    </p>\n    </td>\n    <td></td>\n    <td>\n    <img src=\"{1}\" width=80 height=80 style=\"border:2px solid black; border-radius:10px; padding: 4px\">\n    </td>\n    </tr>\n    </table>\n    \"\"\"\n\n    # this is the path to the icons within the github repo\n    path = (\n        \"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/\"\n        + text.lower()\n        + \".png\"\n    )\n    html_node = nodes.raw(text=html.format(text, path), format=\"html\")\n    return [html_node], []\n\n\ndef setup(app):\n    app.add_role(\"blockname\", block_name)\n    return {\n        \"version\": \"0.1\",\n        \"parallel_read_safe\": True,\n        \"parallel_write_safe\": True,\n    }\n"
  },
  {
    "path": "docs/source/index.rst",
    "content": ".. Spatial Maths package documentation master file, created by\n   sphinx-quickstart on Sun Apr 12 15:50:23 2020.\n   You can adapt this file completely to your liking, but it should at least\n   contain the root `toctree` directive.\n\nBlock diagrams for Python\n=========================\n\n.. raw:: html\n\n   <table>\n   <tr>\n   <td>\n   <img width=350 src=\"https://github.com/petercorke/bdsim/raw/master/figs/bd1-sketch.png\">\n   </td>\n   <td style=\"padding-left: 20px;\">\n   <pre style=\"font-size:10px;\">\n   # define the blocks\n   demand = bd.STEP(T=1, name='demand')\n   sum = bd.SUM('+-')\n   gain = bd.GAIN(10)\n   plant = bd.LTI_SISO(0.5, [2, 1])\n   scope = bd.SCOPE(styles=['k', 'r--'])\n\n   # connect the blocks\n   bd.connect(demand, sum[0], scope[1])\n   bd.connect(plant, sum[1])\n   bd.connect(sum, gain)\n   bd.connect(gain, plant)\n   bd.connect(plant, scope[0])\n   </pre>\n   </td>\n   </tr>\n   </table>\n\nThis Python package enables modelling and simulation of dynamic systems\nconceptualized in block diagram form, but represented in terms of Python class\nand method calls.\n\nUnlike Simulink® or LabView®, we write Python code rather than drawing boxes and\nwires.  Wires can communicate any Python type such as scalars, strings, lists,\ndictionaries, numpy arrays, other objects, and even functions.\n\n    \n.. toctree::\n   :maxdepth: 2\n   :caption: Code documentation:\n\n   bdsim\n   bdsim.blocks\n   internals\n\n"
  },
  {
    "path": "docs/source/internals.rst",
    "content": "Supporting classes\n******************\n\n\n.. inheritance-diagram:: bdsim.components\n\n\nBDSim class\n===========\n\nThis class describes the run-time environment for executing a block diagram.\n\n.. autoclass:: bdsim.BDSim\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n.. autoclass:: bdsim.Struct\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n.. autoclass:: bdsim.BDSimState\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\nBlockDiagram class\n==================\n\nThis class describes a block diagram, a collection of blocks and wires that\ncan be \"executed\".\n\n.. autoclass:: bdsim.BlockDiagram\n   :members:\n   :undoc-members:\n   :show-inheritance:\n\nComponents\n==========\n\n\nWire\n----\n\n.. autoclass:: bdsim.Wire\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :exclude-members: __dict__, __weakref__, __array_ufunc__, __module__\n\nPlug\n----\n\n.. autoclass:: bdsim.Plug\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members:\n   :exclude-members: __dict__, __weakref__, __array_ufunc__, __module__\n\nBlocks\n------\n\n.. autoclass:: bdsim.Block\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n   :exclude-members: __dict__, __weakref__, __array_ufunc__, __module__\n\nSource block\n^^^^^^^^^^^^\n\n.. autoclass:: bdsim.SourceBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nSink block\n^^^^^^^^^^\n\n.. autoclass:: bdsim.SinkBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nFunction block\n^^^^^^^^^^^^^^\n\n.. autoclass:: bdsim.FunctionBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nTransfer function block\n^^^^^^^^^^^^^^^^^^^^^^^\n\n.. autoclass:: bdsim.TransferBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nSubsystem block\n^^^^^^^^^^^^^^^\n\n.. autoclass:: bdsim.SubsystemBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nGraphics block\n^^^^^^^^^^^^^^\n\n.. autoclass:: bdsim.GraphicsBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\n\nDiscrete-time systems\n---------------------\n\n.. autoclass:: bdsim.ClockedBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n.. autoclass:: bdsim.Clock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n.. autoclass:: bdsim.PriorityQ\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n"
  },
  {
    "path": "docs/source/modules.rst",
    "content": "bdsim\n=====\n\n.. toctree::\n   :maxdepth: 4\n\n   bdsim\n"
  },
  {
    "path": "docs-aside/.buildinfo",
    "content": "# Sphinx build info version 1\n# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.\nconfig: d73274dfd5f8b4473dacef6a99ded73b\ntags: 645f666f9bcd5a90fca523b33c5a78b7\n"
  },
  {
    "path": "docs-aside/.nojekyll",
    "content": ""
  },
  {
    "path": "docs-aside/_modules/bdsim/bdsim.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.bdsim &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../\" src=\"../../_static/documentation_options.js\"></script>\n        <script src=\"../../_static/jquery.js\"></script>\n        <script src=\"../../_static/underscore.js\"></script>\n        <script src=\"../../_static/doctools.js\"></script>\n        <script src=\"../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.bdsim</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.bdsim</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"kn\">import</span> <span class=\"nn\">os</span>\n<span class=\"kn\">from</span> <span class=\"nn\">pathlib</span> <span class=\"kn\">import</span> <span class=\"n\">Path</span>\n<span class=\"kn\">import</span> <span class=\"nn\">sys</span>\n<span class=\"kn\">import</span> <span class=\"nn\">importlib</span>\n<span class=\"kn\">import</span> <span class=\"nn\">inspect</span>\n<span class=\"kn\">from</span> <span class=\"nn\">collections</span> <span class=\"kn\">import</span> <span class=\"n\">Counter</span><span class=\"p\">,</span> <span class=\"n\">namedtuple</span>\n<span class=\"kn\">from</span> <span class=\"nn\">typing</span> <span class=\"kn\">import</span> <span class=\"n\">NamedTuple</span>\n<span class=\"kn\">import</span> <span class=\"nn\">argparse</span>\n<span class=\"kn\">import</span> <span class=\"nn\">types</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"o\">*</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.blockdiagram</span> <span class=\"kn\">import</span> <span class=\"n\">BlockDiagram</span>\n<span class=\"kn\">import</span> <span class=\"nn\">copy</span>\n<span class=\"kn\">import</span> <span class=\"nn\">tempfile</span>\n<span class=\"kn\">import</span> <span class=\"nn\">subprocess</span>\n<span class=\"kn\">import</span> <span class=\"nn\">webbrowser</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">import</span> <span class=\"nn\">scipy.integrate</span> <span class=\"k\">as</span> <span class=\"nn\">integrate</span>\n<span class=\"kn\">import</span> <span class=\"nn\">re</span>\n<span class=\"kn\">from</span> <span class=\"nn\">colored</span> <span class=\"kn\">import</span> <span class=\"n\">fg</span><span class=\"p\">,</span> <span class=\"n\">attr</span>\n\n\n<span class=\"n\">block</span> <span class=\"o\">=</span> <span class=\"n\">namedtuple</span><span class=\"p\">(</span><span class=\"s1\">&#39;block&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;name, cls, path&#39;</span><span class=\"p\">)</span>\n\n<span class=\"c1\"># convert class name to BLOCK name</span>\n<span class=\"c1\"># strip underscores and capitalize</span>\n<span class=\"k\">def</span> <span class=\"nf\">blockname</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">):</span>\n    <span class=\"k\">return</span> <span class=\"n\">name</span><span class=\"o\">.</span><span class=\"n\">upper</span><span class=\"p\">()</span>\n\n\n<span class=\"c1\"># print a progress bar</span>\n<span class=\"c1\"># https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console</span>\n<span class=\"k\">def</span> <span class=\"nf\">printProgressBar</span> <span class=\"p\">(</span><span class=\"n\">fraction</span><span class=\"p\">,</span> <span class=\"n\">prefix</span><span class=\"o\">=</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">,</span> <span class=\"n\">suffix</span><span class=\"o\">=</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">,</span> <span class=\"n\">decimals</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">length</span><span class=\"o\">=</span><span class=\"mi\">50</span><span class=\"p\">,</span> <span class=\"n\">fill</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;█&#39;</span><span class=\"p\">,</span> <span class=\"n\">printEnd</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;</span><span class=\"se\">\\r</span><span class=\"s2\">&quot;</span><span class=\"p\">):</span>\n\n    <span class=\"n\">percent</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s2\">&quot;{0:.&quot;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">decimals</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;f}&quot;</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">fraction</span> <span class=\"o\">*</span> <span class=\"mi\">100</span><span class=\"p\">)</span>\n    <span class=\"n\">filledLength</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">length</span> <span class=\"o\">*</span> <span class=\"n\">fraction</span><span class=\"p\">)</span>\n    <span class=\"n\">bar</span> <span class=\"o\">=</span> <span class=\"n\">fill</span> <span class=\"o\">*</span> <span class=\"n\">filledLength</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;-&#39;</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">length</span> <span class=\"o\">-</span> <span class=\"n\">filledLength</span><span class=\"p\">)</span>\n    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s1\">&#39;</span><span class=\"se\">\\r</span><span class=\"si\">{</span><span class=\"n\">prefix</span><span class=\"si\">}</span><span class=\"s1\"> |</span><span class=\"si\">{</span><span class=\"n\">bar</span><span class=\"si\">}</span><span class=\"s1\">| </span><span class=\"si\">{</span><span class=\"n\">percent</span><span class=\"si\">}</span><span class=\"s1\">% </span><span class=\"si\">{</span><span class=\"n\">suffix</span><span class=\"si\">}</span><span class=\"s1\">&#39;</span><span class=\"p\">,</span> <span class=\"n\">end</span> <span class=\"o\">=</span> <span class=\"n\">printEnd</span><span class=\"p\">)</span>\n\n\n<div class=\"viewcode-block\" id=\"BDSimState\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSimState\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">BDSimState</span><span class=\"p\">:</span>\n\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :ivar x: state vector</span>\n<span class=\"sd\">    :vartype x: np.ndarray</span>\n<span class=\"sd\">    :ivar T: maximum simulation time (seconds)</span>\n<span class=\"sd\">    :vartype T: float</span>\n<span class=\"sd\">    :ivar t: current simulation time (seconds)</span>\n<span class=\"sd\">    :vartype t: float</span>\n<span class=\"sd\">    :ivar fignum: number of next matplotlib figure to create</span>\n<span class=\"sd\">    :vartype fignum: int</span>\n<span class=\"sd\">    :ivar stop: reference to block wanting to stop simulation, else None</span>\n<span class=\"sd\">    :vartype stop: Block subclass</span>\n<span class=\"sd\">    :ivar checkfinite: halt simulation if any wire has inf or nan</span>\n<span class=\"sd\">    :vartype checkfinite: bool</span>\n<span class=\"sd\">    :ivar graphics: enable graphics</span>\n<span class=\"sd\">    :vartype graphics: bool</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    \n\n<div class=\"viewcode-block\" id=\"BDSimState.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSimState.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>           <span class=\"c1\"># continuous state vector numpy.ndarray</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>           <span class=\"c1\"># maximum.BlockDiagram time</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>           <span class=\"c1\"># current time</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fignum</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">checkfinite</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">debugger</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t_stop</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>  <span class=\"c1\"># time-based breakpoint</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">eventq</span> <span class=\"o\">=</span> <span class=\"n\">PriorityQ</span><span class=\"p\">()</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSimState.declare_event\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSimState.declare_event\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">declare_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">eventq</span><span class=\"o\">.</span><span class=\"n\">push</span><span class=\"p\">((</span><span class=\"n\">t</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"p\">))</span></div></div>\n\n<div class=\"viewcode-block\" id=\"BDSim\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">BDSim</span><span class=\"p\">:</span>\n\n    <span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n    <span class=\"n\">_blocklibrary</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n\n<div class=\"viewcode-block\" id=\"BDSim.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">packages</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param sysargs: process options from sys.argv, defaults to True</span>\n<span class=\"sd\">        :type sysargs: bool, optional</span>\n<span class=\"sd\">        :param graphics: enable graphics, defaults to True</span>\n<span class=\"sd\">        :type graphics: bool, optional</span>\n<span class=\"sd\">        :param animation: enable animation, defaults to False</span>\n<span class=\"sd\">        :type animation: bool, optional</span>\n<span class=\"sd\">        :param progress: enable progress bar, defaults to True</span>\n<span class=\"sd\">        :type progress: bool, optional</span>\n<span class=\"sd\">        :param debug: debug options, defaults to None</span>\n<span class=\"sd\">        :type debug: str, optional</span>\n<span class=\"sd\">        :param backend: matplotlib backend, defaults to &#39;Qt5Agg&#39;&#39;</span>\n<span class=\"sd\">        :type backend: str, optional</span>\n<span class=\"sd\">        :param tiles: figure tile layout on monitor, defaults to &#39;3x4&#39;</span>\n<span class=\"sd\">        :type tiles: str, optional</span>\n<span class=\"sd\">        :raises ImportError: syntax error in block</span>\n<span class=\"sd\">        :return: parent object for blockdiagram simulation</span>\n<span class=\"sd\">        :rtype: BDSim</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        If ``sysargs`` is True, process command line arguments and passed</span>\n<span class=\"sd\">        options.  Command line arguments have precedence.</span>\n\n<span class=\"sd\">        ===================  =========  ========  ===========================================</span>\n<span class=\"sd\">        Command line switch  Argument   Default   Behaviour</span>\n<span class=\"sd\">        ===================  =========  ========  ===========================================</span>\n<span class=\"sd\">        ++nographics, +g     graphics   True      enable graphical display</span>\n<span class=\"sd\">        ++animation, +a      animation  True      update graphics at each time step</span>\n<span class=\"sd\">        --nographics, -g     graphics   True      disable graphical display</span>\n<span class=\"sd\">        --animation, -a      animation  True      don&#39;t update graphics at each time step</span>\n<span class=\"sd\">        --noprogress, -p     progress   True      do not display simulation progress bar</span>\n<span class=\"sd\">        --backend BE         backend    &#39;Qt5Agg&#39;  matplotlib backend</span>\n<span class=\"sd\">        --tiles RxC, -t RxC  tiles      &#39;3x4&#39;     arrangement of figure tiles on the display</span>\n<span class=\"sd\">        --shape WxH          shape      None      window size, default matplotlib size</span>\n<span class=\"sd\">        --altscreen          altscreen  True      use secondary monitor if it exists</span>\n<span class=\"sd\">        --verbose, -v        verbose    False     be verbose</span>\n<span class=\"sd\">        --debug F, -d F      debug      &#39;&#39;        debug flag string</span>\n<span class=\"sd\">        ===================  =========  ========  ===========================================</span>\n\n<span class=\"sd\">        .. note:: ``animation`` and ``graphics`` options are coupled.  If </span>\n<span class=\"sd\">            ``graphics=False``, all graphics is suppressed.  If</span>\n<span class=\"sd\">            ``graphics=True`` then graphics are shown and the behaviour depends</span>\n<span class=\"sd\">            on ``animation``.  ``animation=False`` shows graphs at the end of</span>\n<span class=\"sd\">            the simulation, while ``animation=True` will animate the graphs</span>\n<span class=\"sd\">            during simulation.</span>\n\n<span class=\"sd\">        :seealso: :meth:`set_options`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">packages</span> <span class=\"o\">=</span> <span class=\"n\">packages</span>\n\n        <span class=\"c1\"># process command line and overall options</span>\n        <span class=\"k\">if</span> <span class=\"n\">BDSim</span><span class=\"o\">.</span><span class=\"n\">options</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">BDSim</span><span class=\"o\">.</span><span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">get_options</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># load modules from the blocks folder</span>\n        <span class=\"k\">if</span> <span class=\"n\">BDSim</span><span class=\"o\">.</span><span class=\"n\">_blocklibrary</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">BDSim</span><span class=\"o\">.</span><span class=\"n\">_blocklibrary</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">load_blocks</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">verbose</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__str__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        String representation of simulation</span>\n\n<span class=\"sd\">        :return: single line summary of simulation environment</span>\n<span class=\"sd\">        :rtype: str</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;BDSim: </span><span class=\"si\">{</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_blocklibrary</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\"> blocks in library</span><span class=\"se\">\\n</span><span class=\"s2\">&quot;</span>\n        <span class=\"k\">return</span> <span class=\"n\">s</span>\n        \n    \n    <span class=\"k\">def</span> <span class=\"fm\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"s1\">&#39;  </span><span class=\"si\">{:s}</span><span class=\"s1\">: </span><span class=\"si\">{}</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"n\">s</span>\n\n<div class=\"viewcode-block\" id=\"BDSim.progress\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.progress\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">progress</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Update progress bar</span>\n\n<span class=\"sd\">        :param t: current simulation time, defaults to None</span>\n<span class=\"sd\">        :type t: float, optional</span>\n\n<span class=\"sd\">        Update progress bar as a percentage of the maximum simulation time,</span>\n<span class=\"sd\">        given as an argument to ``run``.</span>\n\n<span class=\"sd\">        :seealso: :meth:`run` :meth:`progress_done`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">progress</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">t</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span>\n            <span class=\"n\">printProgressBar</span><span class=\"p\">(</span><span class=\"n\">t</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"n\">prefix</span><span class=\"o\">=</span><span class=\"s1\">&#39;Progress:&#39;</span><span class=\"p\">,</span> <span class=\"n\">suffix</span><span class=\"o\">=</span><span class=\"s1\">&#39;complete&#39;</span><span class=\"p\">,</span> <span class=\"n\">length</span><span class=\"o\">=</span><span class=\"mi\">60</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.progress_done\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.progress_done\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">progress_done</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Clean up progress bar</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">progress</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\r</span><span class=\"s1\">&#39;</span> <span class=\"o\">+</span> <span class=\"s1\">&#39; &#39;</span><span class=\"o\">*</span> <span class=\"mi\">90</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;</span><span class=\"se\">\\r</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.run\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.run\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">run</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"o\">=</span><span class=\"mf\">10.0</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"o\">=</span><span class=\"mf\">0.1</span><span class=\"p\">,</span> <span class=\"n\">solver</span><span class=\"o\">=</span><span class=\"s1\">&#39;RK45&#39;</span><span class=\"p\">,</span> <span class=\"n\">solver_args</span><span class=\"o\">=</span><span class=\"p\">{},</span> <span class=\"n\">debug</span><span class=\"o\">=</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">,</span>\n            <span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">checkfinite</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">minstepsize</span><span class=\"o\">=</span><span class=\"mf\">1e-12</span><span class=\"p\">,</span> <span class=\"n\">watch</span><span class=\"o\">=</span><span class=\"p\">[],</span>\n            <span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Run the block diagram</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :param T: maximum integration time, defaults to 10.0</span>\n<span class=\"sd\">        :type T: float, optional</span>\n<span class=\"sd\">        :param dt: maximum time step, defaults to 0.1</span>\n<span class=\"sd\">        :type dt: float, optional</span>\n<span class=\"sd\">        :param solver: integration method, defaults to ``RK45``</span>\n<span class=\"sd\">        :type solver: str, optional</span>\n<span class=\"sd\">        :param block: matplotlib block at end of run, default False</span>\n<span class=\"sd\">        :type block: bool</span>\n<span class=\"sd\">        :param checkfinite: error if inf or nan on any wire, default True</span>\n<span class=\"sd\">        :type checkfinite: bool</span>\n<span class=\"sd\">        :param minstepsize: minimum step length, default 1e-6</span>\n<span class=\"sd\">        :type minstepsize: float</span>\n<span class=\"sd\">        :param watch: list of input ports to log</span>\n<span class=\"sd\">        :type watch: list</span>\n<span class=\"sd\">        :param solver_args: arguments passed to ``scipy.integrate``</span>\n<span class=\"sd\">        :type solver_args: dict</span>\n<span class=\"sd\">        :return: time history of signals and states</span>\n<span class=\"sd\">        :rtype: Sim class</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Assumes that the network has been compiled.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Results are returned in a class with attributes:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        - ``t`` the time vector: ndarray, shape=(M,)</span>\n<span class=\"sd\">        - ``x`` is the state vector: ndarray, shape=(M,N)</span>\n<span class=\"sd\">        - ``xnames`` is a list of the names of the states corresponding to columns of `x`, eg. &quot;plant.x0&quot;,</span>\n<span class=\"sd\">            defined for the block using the ``snames`` argument</span>\n<span class=\"sd\">        - ``yN`` for a watched input where N is the index of the port mentioned in the ``watch`` argument</span>\n<span class=\"sd\">        - ``ynames`` is a list of the names of the input ports being watched, same order as in ``watch`` argument</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        If there are no dynamic elements in the diagram, ie. no states, then ``x`` and ``xnames`` are not</span>\n<span class=\"sd\">        present.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The ``watch`` argument is a list of one or more input ports whose value during simulation</span>\n<span class=\"sd\">        will be recorded.  The elements of the list can be:</span>\n<span class=\"sd\">            - a ``Block`` reference, which is interpretted as input port 0</span>\n<span class=\"sd\">            - a ``Plug`` reference, ie. a block with an index or attribute</span>\n<span class=\"sd\">            - a string of the form &quot;block[i]&quot; which is port i of the block named block.</span>\n\n<span class=\"sd\">        The debug string comprises single letter flags:</span>\n<span class=\"sd\">                </span>\n<span class=\"sd\">                - &#39;p&#39; debug network value propagation</span>\n<span class=\"sd\">                - &#39;s&#39; debug state vector</span>\n<span class=\"sd\">                - &#39;d&#39; debug state derivative </span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        .. note:: Simulation stops if the step time falls below ``minsteplength``</span>\n<span class=\"sd\">            which typically indicates that the solver is struggling with a very</span>\n<span class=\"sd\">            harsh non-linearity.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        \n        <span class=\"k\">assert</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">compiled</span><span class=\"p\">,</span> <span class=\"s1\">&#39;Network has not been compiled&#39;</span>\n\n        <span class=\"n\">state</span> <span class=\"o\">=</span> <span class=\"n\">BDSimState</span><span class=\"p\">()</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span> <span class=\"o\">=</span> <span class=\"n\">state</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">T</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">dt</span> <span class=\"o\">=</span> <span class=\"n\">dt</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">count</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">solver</span> <span class=\"o\">=</span> <span class=\"n\">solver</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">solver_args</span> <span class=\"o\">=</span> <span class=\"n\">solver_args</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">minstepsize</span> <span class=\"o\">=</span> <span class=\"n\">minstepsize</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"kc\">None</span> <span class=\"c1\"># allow any block to stop.BlockDiagram by setting this to the block&#39;s name</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">checkfinite</span> <span class=\"o\">=</span> <span class=\"n\">checkfinite</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"n\">copy</span><span class=\"o\">.</span><span class=\"n\">copy</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"n\">bd</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t_stop</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"k\">if</span> <span class=\"n\">debug</span><span class=\"p\">:</span>\n            <span class=\"c1\"># append debug flags</span>\n            <span class=\"k\">if</span> <span class=\"n\">debug</span> <span class=\"ow\">not</span> <span class=\"ow\">in</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">debug</span><span class=\"p\">:</span>\n                <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">debug</span> <span class=\"o\">+=</span> <span class=\"n\">debug</span>\n        \n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">debug</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">progress</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n\n        <span class=\"c1\"># process the watchlist</span>\n        <span class=\"c1\">#  elements can be:</span>\n        <span class=\"c1\">#   - block or Plug reference</span>\n        <span class=\"c1\">#   - str in the form BLOCKNAME[PORT]</span>\n        <span class=\"n\">watchlist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"n\">watchnamelist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"n\">re_block</span> <span class=\"o\">=</span> <span class=\"n\">re</span><span class=\"o\">.</span><span class=\"n\">compile</span><span class=\"p\">(</span><span class=\"sa\">r</span><span class=\"s1\">&#39;(?P&lt;name&gt;[^[]+)(\\[(?P&lt;port&gt;[0-9]+)\\])&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"n\">watch</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">):</span>\n                <span class=\"c1\"># a name was given, with optional port number</span>\n                <span class=\"n\">m</span> <span class=\"o\">=</span> <span class=\"n\">re_block</span><span class=\"o\">.</span><span class=\"n\">match</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">)</span>\n                <span class=\"k\">if</span> <span class=\"n\">m</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;watch block[port] not found: &#39;</span> <span class=\"o\">+</span> <span class=\"n\">w</span><span class=\"p\">)</span>\n                <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"n\">m</span><span class=\"o\">.</span><span class=\"n\">group</span><span class=\"p\">(</span><span class=\"s1\">&#39;name&#39;</span><span class=\"p\">)</span>\n                <span class=\"n\">port</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">m</span><span class=\"o\">.</span><span class=\"n\">group</span><span class=\"p\">(</span><span class=\"s1\">&#39;port&#39;</span><span class=\"p\">))</span>\n                <span class=\"n\">b</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">blocknames</span><span class=\"p\">[</span><span class=\"n\">name</span><span class=\"p\">]</span>\n                <span class=\"n\">plug</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">]</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">,</span> <span class=\"n\">Block</span><span class=\"p\">):</span>\n                <span class=\"c1\"># a block was given, defaults to port 0</span>\n                <span class=\"n\">plug</span> <span class=\"o\">=</span> <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">,</span> <span class=\"n\">Plug</span><span class=\"p\">):</span>\n                <span class=\"c1\"># a plug was given</span>\n                <span class=\"n\">plug</span> <span class=\"o\">=</span> <span class=\"n\">w</span>\n            <span class=\"n\">watchlist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">plug</span><span class=\"p\">)</span>\n            <span class=\"n\">watchnamelist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">plug</span><span class=\"p\">))</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">watchlist</span> <span class=\"o\">=</span> <span class=\"n\">watchlist</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">watchnamelist</span> <span class=\"o\">=</span> <span class=\"n\">watchnamelist</span>\n\n        <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">getstate0</span><span class=\"p\">()</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;initial state  x0 = &#39;</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># get the number of discrete states from all clocks</span>\n        <span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"k\">for</span> <span class=\"n\">clock</span> <span class=\"ow\">in</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">clocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">nds</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n            <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n                <span class=\"n\">nds</span> <span class=\"o\">+=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">ndstates</span>\n            <span class=\"n\">ndstates</span> <span class=\"o\">+=</span> <span class=\"n\">nds</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"s1\">&#39;initial dstate x0 = &#39;</span><span class=\"p\">,</span> <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">getstate</span><span class=\"p\">())</span>\n\n        <span class=\"c1\"># tell all blocks we&#39;re starting a BlockDiagram</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">graphics</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># initialize list of time and states</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">tlist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">xlist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">plist</span> <span class=\"o\">=</span> <span class=\"p\">[[]</span> <span class=\"k\">for</span> <span class=\"n\">p</span> <span class=\"ow\">in</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">watchlist</span><span class=\"p\">]</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">progress</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">eventq</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"c1\"># no simulation events, solve it in one go</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">run_interval</span><span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">)</span>\n            <span class=\"n\">nintervals</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"c1\"># we have simulation events, solve it in chunks</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">declare_event</span><span class=\"p\">(</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"p\">)</span>  <span class=\"c1\"># add an event at end of simulation</span>\n\n            <span class=\"c1\"># ignore all the events at zero</span>\n            <span class=\"n\">tprev</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">eventq</span><span class=\"o\">.</span><span class=\"n\">pop_until</span><span class=\"p\">(</span><span class=\"n\">tprev</span><span class=\"p\">)</span>\n\n            <span class=\"c1\"># get the state vector</span>\n            <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n            \n            <span class=\"n\">nintervals</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n            <span class=\"k\">while</span> <span class=\"kc\">True</span><span class=\"p\">:</span>\n                <span class=\"c1\"># get next event from the queue and the list of blocks or</span>\n                <span class=\"c1\"># clocks at that time</span>\n                <span class=\"n\">tnext</span><span class=\"p\">,</span> <span class=\"n\">sources</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">eventq</span><span class=\"o\">.</span><span class=\"n\">pop</span><span class=\"p\">(</span><span class=\"n\">dt</span><span class=\"o\">=</span><span class=\"mf\">1e-6</span><span class=\"p\">)</span>\n\n                <span class=\"c1\"># run system until next event time</span>\n                <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">run_interval</span><span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"n\">tprev</span><span class=\"p\">,</span> <span class=\"n\">tnext</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">)</span>\n                <span class=\"n\">nintervals</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n\n                <span class=\"c1\"># visit all the blocks and clocks that have an event now</span>\n                <span class=\"k\">for</span> <span class=\"n\">source</span> <span class=\"ow\">in</span> <span class=\"n\">sources</span><span class=\"p\">:</span>\n                    <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">source</span><span class=\"p\">,</span> <span class=\"n\">Clock</span><span class=\"p\">):</span>\n                        <span class=\"c1\"># clock ticked, save its state</span>\n                        <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">savestate</span><span class=\"p\">(</span><span class=\"n\">tnext</span><span class=\"p\">)</span>\n                        <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">next_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"p\">)</span>\n\n                        <span class=\"c1\"># get the new state</span>\n                        <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">=</span> <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">getstate</span><span class=\"p\">()</span>\n                <span class=\"n\">tprev</span> <span class=\"o\">=</span> <span class=\"n\">tnext</span>\n\n                <span class=\"c1\"># are we done?</span>\n                <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span> <span class=\"ow\">and</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">&gt;=</span> <span class=\"n\">T</span><span class=\"p\">:</span>\n                    <span class=\"k\">break</span>\n\n        <span class=\"c1\"># finished integration</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">progress_done</span><span class=\"p\">()</span>  <span class=\"c1\"># cleanup the progress bar</span>\n\n        <span class=\"c1\"># print some info about the integration</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">fg</span><span class=\"p\">(</span><span class=\"s1\">&#39;yellow&#39;</span><span class=\"p\">))</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;integrator steps:      </span><span class=\"si\">{</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">count</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;time steps:            </span><span class=\"si\">{</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">tlist</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;integration intervals: </span><span class=\"si\">{</span><span class=\"n\">nintervals</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">attr</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n\n        <span class=\"c1\"># save buffered data in a Struct</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">Struct</span><span class=\"p\">(</span><span class=\"s1\">&#39;results&#39;</span><span class=\"p\">)</span>\n        <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">tlist</span><span class=\"p\">)</span>\n        <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">xlist</span><span class=\"p\">)</span>\n        <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">xnames</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">statenames</span>\n\n        <span class=\"c1\"># save clocked states</span>\n        <span class=\"k\">for</span> <span class=\"n\">c</span> <span class=\"ow\">in</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">clocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"n\">c</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"o\">.</span><span class=\"n\">replace</span><span class=\"p\">(</span><span class=\"s1\">&#39;.&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">clockdata</span> <span class=\"o\">=</span> <span class=\"n\">Struct</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">)</span>\n            <span class=\"n\">clockdata</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">c</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"p\">)</span>\n            <span class=\"n\">clockdata</span><span class=\"o\">.</span><span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">c</span><span class=\"o\">.</span><span class=\"n\">x</span><span class=\"p\">)</span>\n            <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">add</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">clockdata</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># save the watchlist into variables named y0, y1 etc.</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"n\">p</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">watchlist</span><span class=\"p\">):</span>\n            <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;y&#39;</span><span class=\"o\">+</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">i</span><span class=\"p\">)]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">plist</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span>\n        <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">ynames</span> <span class=\"o\">=</span> <span class=\"n\">watchnamelist</span>\n\n        <span class=\"c1\"># pause until all graphics blocks close</span>\n        <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">done</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">=</span><span class=\"n\">block</span><span class=\"p\">)</span>\n\n        <span class=\"k\">return</span> <span class=\"n\">out</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.done\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.done\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">done</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">done</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">graphics</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span></div>\n        \n<div class=\"viewcode-block\" id=\"BDSim.run_interval\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.run_interval\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">run_interval</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"n\">t0</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Integrate system over interval</span>\n\n<span class=\"sd\">        :param bd: the system blockdiagram </span>\n<span class=\"sd\">        :type bd: BlockDiagram</span>\n<span class=\"sd\">        :param t0: initial time</span>\n<span class=\"sd\">        :type t0: float</span>\n<span class=\"sd\">        :param tf: final time</span>\n<span class=\"sd\">        :type tf: float</span>\n<span class=\"sd\">        :param x0: initial state vector</span>\n<span class=\"sd\">        :type x0: ndarray(n)</span>\n<span class=\"sd\">        :param simstate: simulation state object</span>\n<span class=\"sd\">        :type simstate: SimState</span>\n<span class=\"sd\">        :return: final state vector xf</span>\n<span class=\"sd\">        :rtype: ndarray(n)</span>\n\n<span class=\"sd\">        The system is integrated from from ``x0`` to ``xf`` over the interval ``t0`` to ``tf``.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">try</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"c1\"># system has continuous states, solve it using numerical integration</span>\n                <span class=\"c1\"># print(&#39;initial state x0 = &#39;, x0)</span>\n\n                <span class=\"c1\"># block diagram contains states, solve it using numerical integration</span>\n\n                <span class=\"n\">scipy_integrator</span> <span class=\"o\">=</span> <span class=\"n\">integrate</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"p\">[</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">solver</span><span class=\"p\">]</span>  <span class=\"c1\"># get user specified integrator</span>\n\n                <span class=\"k\">def</span> <span class=\"nf\">ydot</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">):</span>\n                    <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"n\">t</span>\n                    <span class=\"k\">return</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">evaluate_plan</span><span class=\"p\">(</span><span class=\"n\">y</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">)</span>\n\n                <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">dt</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">solver_args</span><span class=\"p\">[</span><span class=\"s1\">&#39;max_step&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">dt</span>\n                <span class=\"n\">integrator</span> <span class=\"o\">=</span> <span class=\"n\">scipy_integrator</span><span class=\"p\">(</span><span class=\"n\">ydot</span><span class=\"p\">,</span>\n                    <span class=\"n\">t0</span><span class=\"o\">=</span><span class=\"n\">t0</span><span class=\"p\">,</span> <span class=\"n\">y0</span><span class=\"o\">=</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">t_bound</span><span class=\"o\">=</span><span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">solver_args</span><span class=\"p\">)</span>\n\n                <span class=\"c1\"># integrate</span>\n                <span class=\"k\">while</span> <span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">status</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;running&#39;</span><span class=\"p\">:</span>\n\n                    <span class=\"c1\"># step the integrator, calls _deriv and evaluate block diagram multiple times</span>\n                    <span class=\"n\">message</span> <span class=\"o\">=</span> <span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">()</span>\n\n                    <span class=\"k\">if</span> <span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">status</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;failed&#39;</span><span class=\"p\">:</span>\n                        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">fg</span><span class=\"p\">(</span><span class=\"s1\">&#39;red&#39;</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"se\">\\n</span><span class=\"s2\">integration completed with failed status: </span><span class=\"si\">{</span><span class=\"n\">message</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span> <span class=\"o\">+</span> <span class=\"n\">attr</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n                        <span class=\"k\">break</span>\n\n                    <span class=\"c1\"># stash the results</span>\n                    <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">tlist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"p\">)</span>\n                    <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">xlist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">y</span><span class=\"p\">)</span>\n                    \n                    <span class=\"c1\"># record the ports on the watchlist</span>\n                    <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"n\">p</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">watchlist</span><span class=\"p\">):</span>\n                        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">plist</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">(</span><span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"p\">)[</span><span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">])</span>\n                    \n                    <span class=\"c1\"># # update all blocks that need to know</span>\n                    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"p\">)</span>\n\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">progress</span><span class=\"p\">()</span>  <span class=\"c1\"># update the progress bar</span>\n\n                    <span class=\"k\">if</span> <span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">status</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;finished&#39;</span><span class=\"p\">:</span>\n                        <span class=\"k\">break</span>\n\n                    <span class=\"c1\"># has any block called a stop?</span>\n                    <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">stop</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">fg</span><span class=\"p\">(</span><span class=\"s1\">&#39;red&#39;</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"se\">\\n</span><span class=\"s2\">--- stop requested at t=</span><span class=\"si\">{</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"si\">:</span><span class=\"s2\">.4f</span><span class=\"si\">}</span><span class=\"s2\"> by </span><span class=\"si\">{</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">stop</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span> <span class=\"o\">+</span> <span class=\"n\">attr</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n                        <span class=\"k\">break</span>\n\n                    <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">minstepsize</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span> <span class=\"ow\">and</span> <span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">step_size</span> <span class=\"o\">&lt;</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">minstepsize</span><span class=\"p\">:</span>\n                        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">fg</span><span class=\"p\">(</span><span class=\"s1\">&#39;red&#39;</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"se\">\\n</span><span class=\"s2\">--- stopping on minimum step size at t=</span><span class=\"si\">{</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"si\">:</span><span class=\"s2\">.4f</span><span class=\"si\">}</span><span class=\"s2\"> with last stepsize </span><span class=\"si\">{</span><span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">step_size</span><span class=\"si\">:</span><span class=\"s2\">g</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span> <span class=\"o\">+</span> <span class=\"n\">attr</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n                        <span class=\"k\">break</span>\n\n                    <span class=\"k\">if</span> <span class=\"s1\">&#39;i&#39;</span> <span class=\"ow\">in</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">debug</span><span class=\"p\">:</span>\n                        <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">_debugger</span><span class=\"p\">(</span><span class=\"n\">integrator</span><span class=\"p\">)</span>\n\n                <span class=\"k\">return</span> <span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">y</span>  <span class=\"c1\"># return final state vector</span>\n\n            <span class=\"k\">elif</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">clocklist</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"c1\"># block diagram has no continuous or discrete states</span>\n    \n                <span class=\"k\">for</span> <span class=\"n\">t</span> <span class=\"ow\">in</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">arange</span><span class=\"p\">(</span><span class=\"n\">t0</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">dt</span><span class=\"p\">):</span>  <span class=\"c1\"># step through the time range</span>\n                    <span class=\"c1\"># evaluate the block diagram</span>\n                    <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"n\">t</span>\n                    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">evaluate_plan</span><span class=\"p\">([],</span> <span class=\"n\">t</span><span class=\"p\">)</span>\n\n                    <span class=\"c1\"># stash the results</span>\n                    <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">tlist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)</span>\n                    \n                    <span class=\"c1\"># record the ports on the watchlist</span>\n                    <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"n\">p</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">watchlist</span><span class=\"p\">):</span>\n                        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">plist</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)[</span><span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">])</span>\n\n                    <span class=\"c1\"># update all blocks that need to know</span>\n                    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">)</span>\n\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">progress</span><span class=\"p\">()</span>  <span class=\"c1\"># update the progress bar</span>\n\n                        \n                    <span class=\"c1\"># has any block called a stop?</span>\n                    <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">stop</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">fg</span><span class=\"p\">(</span><span class=\"s1\">&#39;red&#39;</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"se\">\\n</span><span class=\"s2\">--- stop requested at t=</span><span class=\"si\">{</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"si\">:</span><span class=\"s2\">.4f</span><span class=\"si\">}</span><span class=\"s2\"> by </span><span class=\"si\">{</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">stop</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span> <span class=\"o\">+</span> <span class=\"n\">attr</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n                        <span class=\"k\">break</span>\n\n                    <span class=\"k\">if</span> <span class=\"s1\">&#39;i&#39;</span> <span class=\"ow\">in</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">debug</span><span class=\"p\">:</span>\n                        <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">_debugger</span><span class=\"p\">(</span><span class=\"n\">integrator</span><span class=\"p\">)</span>\n\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"c1\"># block diagram has no continuous states</span>\n                <span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"n\">t0</span>\n                <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"n\">t</span>\n                <span class=\"c1\"># evaluate the block diagram</span>\n                <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">evaluate_plan</span><span class=\"p\">([],</span> <span class=\"n\">t</span><span class=\"p\">)</span>\n\n                <span class=\"c1\"># stash the results</span>\n                <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">tlist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)</span>\n                \n                <span class=\"c1\"># record the ports on the watchlist</span>\n                <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"n\">p</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">watchlist</span><span class=\"p\">):</span>\n                    <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">plist</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)[</span><span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">])</span>\n\n                <span class=\"c1\"># update all blocks that need to know</span>\n                <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">)</span>\n\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">progress</span><span class=\"p\">()</span>  <span class=\"c1\"># update the progress bar</span>\n\n                <span class=\"c1\"># has any block called a stop?</span>\n                <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">stop</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">fg</span><span class=\"p\">(</span><span class=\"s1\">&#39;red&#39;</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"se\">\\n</span><span class=\"s2\">--- stop requested at t=</span><span class=\"si\">{</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">simstate</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"si\">:</span><span class=\"s2\">.4f</span><span class=\"si\">}</span><span class=\"s2\"> by </span><span class=\"si\">{</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">simstate</span><span class=\"o\">.</span><span class=\"n\">stop</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span> <span class=\"o\">+</span> <span class=\"n\">attr</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n\n                <span class=\"k\">if</span> <span class=\"s1\">&#39;i&#39;</span> <span class=\"ow\">in</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">debug</span><span class=\"p\">:</span>\n                    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">_debugger</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">)</span>\n\n                \n        <span class=\"k\">except</span> <span class=\"ne\">RuntimeError</span> <span class=\"k\">as</span> <span class=\"n\">err</span><span class=\"p\">:</span>\n            <span class=\"c1\"># bad things happens, print a message and return no result</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;unrecoverable error in evaluation: &#39;</span><span class=\"p\">,</span> <span class=\"n\">err</span><span class=\"p\">)</span>\n            <span class=\"k\">raise</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.blockdiagram\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.blockdiagram\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">blockdiagram</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;main&#39;</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Instantiate a new block diagram object.</span>\n\n<span class=\"sd\">        :param name: diagram name, defaults to &#39;main&#39;</span>\n<span class=\"sd\">        :type name: str, optional</span>\n<span class=\"sd\">        :return: parent object for blockdiagram</span>\n<span class=\"sd\">        :rtype: BlockDiagram</span>\n\n<span class=\"sd\">        This object describes the connectivity of a set of blocks and wires.</span>\n\n<span class=\"sd\">        It is an instantiation of the ``BlockDiagram`` class with a factory</span>\n<span class=\"sd\">        method for every dynamically loaded block which returns</span>\n<span class=\"sd\">        an instance of the block.  These factory methods have names</span>\n<span class=\"sd\">        which are all upper case, for example, the method ``.GAIN`` invokes</span>\n<span class=\"sd\">        the constructor for the ``Gain`` class.</span>\n\n<span class=\"sd\">        :seealso: :func:`BlockDiagram`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        \n        <span class=\"c1\"># instantiate a new blockdiagram</span>\n        <span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"n\">BlockDiagram</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span>\n\n        <span class=\"k\">def</span> <span class=\"nf\">new_method</span><span class=\"p\">(</span><span class=\"bp\">cls</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"p\">):</span>\n\n            <span class=\"c1\"># return a wrapper for the block constructor that automatically</span>\n            <span class=\"c1\"># adds the block to the diagram&#39;s blocklist</span>\n            <span class=\"k\">def</span> <span class=\"nf\">block_init_wrapper</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n\n                <span class=\"n\">block</span> <span class=\"o\">=</span> <span class=\"bp\">cls</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>  <span class=\"c1\"># call __init__ on the block</span>\n                <span class=\"k\">return</span> <span class=\"n\">block</span>\n            \n            <span class=\"c1\"># return a function that invokes the class constructor</span>\n            <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"n\">block_init_wrapper</span>\n\n            <span class=\"c1\"># move the __init__ docstring to the class to allow BLOCK.__doc__</span>\n            <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"vm\">__doc__</span> <span class=\"o\">=</span> <span class=\"bp\">cls</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"o\">.</span><span class=\"vm\">__doc__</span>  \n\n            <span class=\"k\">return</span> <span class=\"n\">f</span>\n        \n        <span class=\"c1\"># bind the block constructors as new methods on this instance</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blockdict</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n        <span class=\"k\">for</span> <span class=\"n\">blockname</span><span class=\"p\">,</span> <span class=\"n\">info</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_blocklibrary</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"c1\"># create a function to invoke the block&#39;s constructor</span>\n            <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"n\">new_method</span><span class=\"p\">(</span><span class=\"n\">info</span><span class=\"p\">[</span><span class=\"s1\">&#39;class&#39;</span><span class=\"p\">],</span> <span class=\"n\">bd</span><span class=\"p\">)</span>\n            \n            <span class=\"c1\"># set a bound version of this function as an attribute of the instance</span>\n            <span class=\"c1\"># method = types.MethodType(new_method, bd)</span>\n            <span class=\"c1\"># setattr(bd, block.name, method)</span>\n            <span class=\"nb\">setattr</span><span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"n\">blockname</span><span class=\"p\">,</span> <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"fm\">__get__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">))</span>\n\n        <span class=\"c1\"># add a clone of the options</span>\n        <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"n\">copy</span><span class=\"o\">.</span><span class=\"n\">copy</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"p\">)</span>\n\n        <span class=\"k\">return</span> <span class=\"n\">bd</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.closefigs\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.closefigs\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">closefigs</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">simstate</span><span class=\"o\">.</span><span class=\"n\">fignum</span><span class=\"p\">):</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;close&#39;</span><span class=\"p\">,</span> <span class=\"n\">i</span><span class=\"o\">+</span><span class=\"mi\">1</span><span class=\"p\">)</span>\n            <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">close</span><span class=\"p\">(</span><span class=\"n\">i</span><span class=\"o\">+</span><span class=\"mi\">1</span><span class=\"p\">)</span>\n            <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">pause</span><span class=\"p\">(</span><span class=\"mf\">0.1</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">simstate</span><span class=\"o\">.</span><span class=\"n\">fignum</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>  <span class=\"c1\"># reset figure counter</span></div>\n            \n<div class=\"viewcode-block\" id=\"BDSim.savefig\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.savefig\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">savefig</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"p\">,</span> <span class=\"n\">filename</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"nb\">format</span><span class=\"o\">=</span><span class=\"s1\">&#39;pdf&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">savefig</span><span class=\"p\">(</span><span class=\"n\">filename</span><span class=\"o\">=</span><span class=\"n\">filename</span><span class=\"p\">,</span> <span class=\"nb\">format</span><span class=\"o\">=</span><span class=\"nb\">format</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.savefigs\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.savefigs\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">savefigs</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"nb\">format</span><span class=\"o\">=</span><span class=\"s1\">&#39;pdf&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"kn\">from</span> <span class=\"nn\">bdsim.graphics</span> <span class=\"kn\">import</span> <span class=\"n\">GraphicsBlock</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">,</span> <span class=\"n\">GraphicsBlock</span><span class=\"p\">):</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">savefig</span><span class=\"p\">(</span><span class=\"n\">filename</span><span class=\"o\">=</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"nb\">format</span><span class=\"o\">=</span><span class=\"nb\">format</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.showgraph\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.showgraph\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">showgraph</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"c1\"># create the temporary dotfile</span>\n        <span class=\"n\">dotfile</span> <span class=\"o\">=</span> <span class=\"n\">tempfile</span><span class=\"o\">.</span><span class=\"n\">TemporaryFile</span><span class=\"p\">(</span><span class=\"n\">mode</span><span class=\"o\">=</span><span class=\"s2\">&quot;w&quot;</span><span class=\"p\">)</span>\n        <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">dotfile</span><span class=\"p\">(</span><span class=\"n\">dotfile</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># rewind the dot file, create PDF file in the filesystem, run dot</span>\n        <span class=\"n\">dotfile</span><span class=\"o\">.</span><span class=\"n\">seek</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">)</span>\n        <span class=\"n\">pdffile</span> <span class=\"o\">=</span> <span class=\"n\">tempfile</span><span class=\"o\">.</span><span class=\"n\">NamedTemporaryFile</span><span class=\"p\">(</span><span class=\"n\">suffix</span><span class=\"o\">=</span><span class=\"s2\">&quot;.pdf&quot;</span><span class=\"p\">,</span> <span class=\"n\">delete</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\n        <span class=\"n\">subprocess</span><span class=\"o\">.</span><span class=\"n\">run</span><span class=\"p\">(</span><span class=\"s2\">&quot;dot -Tpdf&quot;</span><span class=\"p\">,</span> <span class=\"n\">shell</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">stdin</span><span class=\"o\">=</span><span class=\"n\">dotfile</span><span class=\"p\">,</span> <span class=\"n\">stdout</span><span class=\"o\">=</span><span class=\"n\">pdffile</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># open the PDF file in browser (hopefully portable), then cleanup</span>\n        <span class=\"n\">webbrowser</span><span class=\"o\">.</span><span class=\"n\">open</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;file://</span><span class=\"si\">{</span><span class=\"n\">pdffile</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n        <span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">remove</span><span class=\"p\">(</span><span class=\"n\">pdffile</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.load_blocks\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.load_blocks\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">load_blocks</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">verbose</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Dynamically load all block definitions.</span>\n\n<span class=\"sd\">        :raises ImportError: module could not be imported</span>\n<span class=\"sd\">        :return: dictionary of block metadata</span>\n<span class=\"sd\">        :rtype: dict of dict</span>\n\n<span class=\"sd\">        Reads blocks from .py files found in bdsim/bdsim/blocks, folders</span>\n<span class=\"sd\">        given by colon separated list in envariable BDSIMPATH, and the </span>\n<span class=\"sd\">        command line option ``packages``.</span>\n\n<span class=\"sd\">        The result is a dict indexed by the upper-case block name with elements:</span>\n<span class=\"sd\">        - ``path`` to the folder holding the Python file defining the block</span>\n<span class=\"sd\">        - ``classname``</span>\n<span class=\"sd\">        - ``blockname``, upper case version of ``classname``</span>\n<span class=\"sd\">        - ``url`` of online documentation for the block</span>\n<span class=\"sd\">        - ``package`` containing the block</span>\n<span class=\"sd\">        - `doc` is the docstring from the class constructor</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        \n        <span class=\"n\">packages</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"s1\">&#39;bdsim&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;roboticstoolbox&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;machinevisiontoolbox&#39;</span><span class=\"p\">]</span>\n        <span class=\"n\">env</span> <span class=\"o\">=</span> <span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">getenv</span><span class=\"p\">(</span><span class=\"s1\">&#39;BDSIMPATH&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">env</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">packages</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">env</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">packages</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">packages</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">packages</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">(</span><span class=\"s1\">&#39;:&#39;</span><span class=\"p\">))</span>\n\n        <span class=\"n\">blocks</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n        <span class=\"n\">moduledicts</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n        <span class=\"k\">for</span> <span class=\"n\">package</span> <span class=\"ow\">in</span> <span class=\"n\">packages</span><span class=\"p\">:</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">spec</span> <span class=\"o\">=</span> <span class=\"n\">importlib</span><span class=\"o\">.</span><span class=\"n\">util</span><span class=\"o\">.</span><span class=\"n\">find_spec</span><span class=\"p\">(</span><span class=\"s1\">&#39;.blocks&#39;</span><span class=\"p\">,</span> <span class=\"n\">package</span><span class=\"o\">=</span><span class=\"n\">package</span><span class=\"p\">)</span>\n                <span class=\"k\">if</span> <span class=\"n\">spec</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;package </span><span class=\"si\">{</span><span class=\"n\">package</span><span class=\"si\">}</span><span class=\"s2\"> has no blocks module&quot;</span><span class=\"p\">)</span>\n                    <span class=\"k\">continue</span>\n                <span class=\"n\">pkg</span> <span class=\"o\">=</span> <span class=\"n\">spec</span><span class=\"o\">.</span><span class=\"n\">loader</span><span class=\"o\">.</span><span class=\"n\">load_module</span><span class=\"p\">()</span>\n            <span class=\"k\">except</span> <span class=\"ne\">ModuleNotFoundError</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;package </span><span class=\"si\">{</span><span class=\"n\">package</span><span class=\"si\">}</span><span class=\"s2\"> not found&quot;</span><span class=\"p\">)</span>\n                <span class=\"k\">continue</span>\n\n            <span class=\"n\">moduledict</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n\n            <span class=\"k\">for</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">value</span> <span class=\"ow\">in</span> <span class=\"n\">pkg</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n                <span class=\"c1\"># check if it&#39;s a valid block class</span>\n                <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">inspect</span><span class=\"o\">.</span><span class=\"n\">isclass</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">):</span>\n                    <span class=\"k\">continue</span>\n                <span class=\"k\">if</span> <span class=\"n\">inspect</span><span class=\"o\">.</span><span class=\"n\">getmro</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)[</span><span class=\"o\">-</span><span class=\"mi\">2</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"vm\">__name__</span> <span class=\"o\">!=</span> <span class=\"s1\">&#39;Block&#39;</span><span class=\"p\">:</span>\n                    <span class=\"k\">continue</span>\n                <span class=\"k\">if</span> <span class=\"n\">name</span><span class=\"o\">.</span><span class=\"n\">endswith</span><span class=\"p\">(</span><span class=\"s1\">&#39;Block&#39;</span><span class=\"p\">):</span>\n                    <span class=\"k\">continue</span>\n\n                <span class=\"k\">if</span> <span class=\"n\">value</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"ow\">in</span> <span class=\"p\">(</span><span class=\"s1\">&#39;source&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;function&#39;</span><span class=\"p\">):</span>\n                    <span class=\"c1\"># must have an output function</span>\n                    <span class=\"n\">valid</span> <span class=\"o\">=</span> <span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"s1\">&#39;output&#39;</span><span class=\"p\">)</span> <span class=\"ow\">and</span> \\\n                            <span class=\"n\">callable</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">)</span> <span class=\"ow\">and</span> \\\n                            <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">inspect</span><span class=\"o\">.</span><span class=\"n\">signature</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parameters</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">2</span>\n                    <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">valid</span><span class=\"p\">:</span>\n                        <span class=\"k\">raise</span> <span class=\"ne\">ImportError</span><span class=\"p\">(</span><span class=\"s1\">&#39;class </span><span class=\"si\">{:s}</span><span class=\"s1\"> has missing/improper output method&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)))</span>\n                    \n                <span class=\"k\">if</span> <span class=\"n\">value</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;sink&#39;</span><span class=\"p\">:</span>\n                    <span class=\"c1\"># must have a step function with at least one</span>\n                    <span class=\"c1\"># parameter: step(self [,state])</span>\n                    <span class=\"n\">valid</span> <span class=\"o\">=</span> <span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"s1\">&#39;step&#39;</span><span class=\"p\">)</span> <span class=\"ow\">and</span> \\\n                            <span class=\"n\">callable</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">)</span> <span class=\"ow\">and</span> \\\n                            <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">inspect</span><span class=\"o\">.</span><span class=\"n\">signature</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parameters</span><span class=\"p\">)</span> <span class=\"o\">&gt;=</span> <span class=\"mi\">1</span>\n                    <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">valid</span><span class=\"p\">:</span>\n                        <span class=\"k\">raise</span> <span class=\"ne\">ImportError</span><span class=\"p\">(</span><span class=\"s1\">&#39;class </span><span class=\"si\">{:s}</span><span class=\"s1\"> has missing/improper step method&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)))</span>\n\n\n                <span class=\"c1\"># add it to the dict of blocks indexed by module</span>\n                <span class=\"k\">if</span> <span class=\"n\">value</span><span class=\"o\">.</span><span class=\"vm\">__module__</span> <span class=\"ow\">in</span> <span class=\"n\">moduledict</span><span class=\"p\">:</span>\n                    <span class=\"n\">moduledict</span><span class=\"p\">[</span><span class=\"n\">value</span><span class=\"o\">.</span><span class=\"vm\">__module__</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">)</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"n\">moduledict</span><span class=\"p\">[</span><span class=\"n\">value</span><span class=\"o\">.</span><span class=\"vm\">__module__</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">name</span><span class=\"p\">]</span>\n\n                <span class=\"c1\"># create a dict for the block with metadata</span>\n                <span class=\"n\">block_info</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n                <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;path&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">pkg</span><span class=\"o\">.</span><span class=\"n\">__path__</span>  <span class=\"c1\"># path to folder holding block definition</span>\n                <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;classname&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">name</span>\n                <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;blockname&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">blockname</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">)</span>\n\n                <span class=\"k\">try</span><span class=\"p\">:</span>\n                    <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;url&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">pkg</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"p\">[</span><span class=\"s1\">&#39;url&#39;</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;#&quot;</span> \\\n                            <span class=\"o\">+</span> <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"vm\">__module__</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;.&quot;</span> <span class=\"o\">+</span> <span class=\"n\">name</span>\n                <span class=\"k\">except</span> <span class=\"ne\">KeyError</span><span class=\"p\">:</span>\n                    <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;url&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n                    \n                <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;class&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">value</span>\n                <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;module&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">value</span><span class=\"o\">.</span><span class=\"vm\">__module__</span>\n                <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;package&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">package</span>\n                <span class=\"n\">block_info</span><span class=\"p\">[</span><span class=\"s1\">&#39;doc&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"o\">.</span><span class=\"vm\">__doc__</span> <span class=\"c1\">#inspect.getdoc(block)</span>\n                <span class=\"n\">blocks</span><span class=\"p\">[</span><span class=\"n\">blockname</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">)]</span> <span class=\"o\">=</span> <span class=\"n\">block_info</span>\n\n            <span class=\"n\">moduledicts</span><span class=\"p\">[</span><span class=\"n\">package</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">moduledict</span>\n            \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">moduledicts</span> <span class=\"o\">=</span> <span class=\"n\">moduledicts</span>\n        <span class=\"k\">return</span> <span class=\"n\">blocks</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.blocks\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.blocks\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">blocks</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        List all loaded blocks.</span>\n\n<span class=\"sd\">        Example::</span>\n\n<span class=\"sd\">            73  blocks loaded</span>\n<span class=\"sd\">            bdsim.blocks.functions..................: Sum Prod Gain Clip Function Interpolate </span>\n<span class=\"sd\">            bdsim.blocks.sources....................: Constant Time WaveForm Piecewise Step Ramp </span>\n<span class=\"sd\">            bdsim.blocks.sinks......................: Print Stop Null Watch </span>\n<span class=\"sd\">            bdsim.blocks.transfers..................: Integrator PoseIntegrator LTI_SS LTI_SISO </span>\n<span class=\"sd\">            bdsim.blocks.discrete...................: ZOH DIntegrator DPoseIntegrator </span>\n<span class=\"sd\">            bdsim.blocks.linalg.....................: Inverse Transpose Norm Flatten Slice2 Slice1 Det Cond </span>\n<span class=\"sd\">            bdsim.blocks.displays...................: Scope ScopeXY ScopeXY1 </span>\n<span class=\"sd\">            bdsim.blocks.connections................: Item Dict Mux DeMux Index SubSystem InPort OutPort </span>\n<span class=\"sd\">            roboticstoolbox.blocks.arm..............: FKine IKine Jacobian Tr2Delta Delta2Tr Point2Tr TR2T FDyn IDyn Gravload </span>\n<span class=\"sd\">            ........................................: Inertia Inertia_X FDyn_X ArmPlot Traj JTraj LSPB CTraj CirclePath </span>\n<span class=\"sd\">            roboticstoolbox.blocks.mobile...........: Bicycle Unicycle DiffSteer VehiclePlot </span>\n<span class=\"sd\">            roboticstoolbox.blocks.uav..............: MultiRotor MultiRotorMixer MultiRotorPlot </span>\n<span class=\"sd\">            machinevisiontoolbox.blocks.camera......: Camera Visjac_p EstPose_p ImagePlane </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">def</span> <span class=\"nf\">dots</span><span class=\"p\">(</span><span class=\"n\">s</span><span class=\"p\">,</span> <span class=\"n\">n</span><span class=\"o\">=</span><span class=\"mi\">40</span><span class=\"p\">):</span>\n            <span class=\"k\">return</span> <span class=\"n\">s</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;.&#39;</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">n</span> <span class=\"o\">-</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">s</span><span class=\"p\">))</span>\n\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_blocklibrary</span><span class=\"p\">),</span> <span class=\"s1\">&#39; blocks loaded&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">pkg</span><span class=\"p\">,</span> <span class=\"nb\">dict</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">moduledicts</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"k\">for</span> <span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"nb\">dict</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n                <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;&#39;</span>\n                <span class=\"n\">once</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n                <span class=\"k\">while</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                    <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"n\">v</span><span class=\"o\">.</span><span class=\"n\">pop</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"s1\">&#39; &#39;</span>\n                    <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">s</span> <span class=\"o\">+</span> <span class=\"n\">n</span><span class=\"p\">)</span> <span class=\"o\">&lt;</span> <span class=\"mi\">80</span><span class=\"p\">:</span>\n                        <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"n\">n</span>\n                        <span class=\"k\">continue</span>\n                    <span class=\"k\">else</span><span class=\"p\">:</span>\n                        <span class=\"c1\"># line will be too long</span>\n                        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">once</span><span class=\"p\">:</span>\n                            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"si\">{</span><span class=\"n\">dots</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\">: </span><span class=\"si\">{</span><span class=\"n\">s</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n                            <span class=\"n\">once</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                        <span class=\"k\">else</span><span class=\"p\">:</span>\n                            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"si\">{</span><span class=\"n\">dots</span><span class=\"p\">(</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\">: </span><span class=\"si\">{</span><span class=\"n\">s</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n                        <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;&#39;</span>\n                <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">s</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                    <span class=\"k\">if</span> <span class=\"n\">once</span><span class=\"p\">:</span>\n                        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"si\">{</span><span class=\"n\">dots</span><span class=\"p\">(</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\">: </span><span class=\"si\">{</span><span class=\"n\">s</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n                    <span class=\"k\">else</span><span class=\"p\">:</span>\n                        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"si\">{</span><span class=\"n\">dots</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\">: </span><span class=\"si\">{</span><span class=\"n\">s</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span></div>\n<div class=\"viewcode-block\" id=\"BDSim.set_options\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.set_options\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">set_options</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">options</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Set simulation options at run time</span>\n\n<span class=\"sd\">        The options are the same as those for the constructor.</span>\n\n<span class=\"sd\">        Example::</span>\n\n<span class=\"sd\">                sim = bdsim.BDsim()</span>\n<span class=\"sd\">                sim.set_options(graphics=False)</span>\n\n<span class=\"sd\">        :seealso: :meth:`__init__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"c1\"># TODO:</span>\n        <span class=\"c1\"># --no-animation -a</span>\n        <span class=\"c1\"># --animation +a</span>\n        <span class=\"c1\"># --no-altscreen -A</span>\n        <span class=\"c1\"># --altscreen  +A</span>\n        <span class=\"k\">for</span> <span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">value</span> <span class=\"ow\">in</span> <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"n\">key</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">value</span>\n\n        <span class=\"c1\"># animation and graphics options are coupled</span>\n        <span class=\"c1\">#</span>\n        <span class=\"c1\">#  graphics False, no graphics at all</span>\n        <span class=\"c1\">#  graphics True, animation False, show graphs at end of run</span>\n        <span class=\"c1\">#  graphics True, animation True, animate graphs during the run</span>\n        <span class=\"k\">if</span> <span class=\"s1\">&#39;animation&#39;</span> <span class=\"ow\">in</span> <span class=\"n\">options</span> <span class=\"ow\">and</span> <span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;animation&#39;</span><span class=\"p\">]:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">graphics</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n        <span class=\"k\">if</span> <span class=\"s1\">&#39;graphics&#39;</span> <span class=\"ow\">in</span> <span class=\"n\">options</span> <span class=\"ow\">and</span> <span class=\"ow\">not</span> <span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;graphics&#39;</span><span class=\"p\">]:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">animation</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></div>\n\n<div class=\"viewcode-block\" id=\"BDSim.get_options\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.BDSim.get_options\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">get_options</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">sysargs</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"c1\"># option priority (high to low):</span>\n        <span class=\"c1\">#  - command line</span>\n        <span class=\"c1\">#  - argument to BDSim()</span>\n        <span class=\"c1\">#  - defaults</span>\n        <span class=\"c1\"># all switches and their default values</span>\n        <span class=\"n\">defaults</span> <span class=\"o\">=</span> <span class=\"p\">{</span>\n            <span class=\"s1\">&#39;backend&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;Qt5Agg&#39;</span><span class=\"p\">,</span>  <span class=\"c1\"># &#39;TkAgg&#39;,</span>\n            <span class=\"s1\">&#39;tiles&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;3x4&#39;</span><span class=\"p\">,</span>\n            <span class=\"s1\">&#39;graphics&#39;</span><span class=\"p\">:</span> <span class=\"kc\">True</span><span class=\"p\">,</span>\n            <span class=\"s1\">&#39;animation&#39;</span><span class=\"p\">:</span> <span class=\"kc\">False</span><span class=\"p\">,</span>\n            <span class=\"s1\">&#39;shape&#39;</span><span class=\"p\">:</span> <span class=\"kc\">None</span><span class=\"p\">,</span>\n            <span class=\"s1\">&#39;altscreen&#39;</span><span class=\"p\">:</span> <span class=\"kc\">True</span><span class=\"p\">,</span>\n            <span class=\"s1\">&#39;progress&#39;</span><span class=\"p\">:</span> <span class=\"kc\">True</span><span class=\"p\">,</span>\n            <span class=\"s1\">&#39;verbose&#39;</span><span class=\"p\">:</span> <span class=\"kc\">False</span><span class=\"p\">,</span>\n            <span class=\"s1\">&#39;debug&#39;</span><span class=\"p\">:</span> <span class=\"s1\">&#39;&#39;</span>\n            <span class=\"p\">}</span>\n        \n        <span class=\"c1\"># any passed kwargs can override the defaults</span>\n        <span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"p\">{</span><span class=\"o\">**</span><span class=\"n\">defaults</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">}</span> <span class=\"c1\"># second argument has precedence</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">sysargs</span><span class=\"p\">:</span>\n            <span class=\"c1\"># command line arguments and graphics</span>\n            <span class=\"n\">parser</span> <span class=\"o\">=</span> <span class=\"n\">argparse</span><span class=\"o\">.</span><span class=\"n\">ArgumentParser</span><span class=\"p\">(</span>\n                <span class=\"n\">prefix_chars</span><span class=\"o\">=</span><span class=\"s1\">&#39;-+&#39;</span><span class=\"p\">,</span>\n                    <span class=\"n\">formatter_class</span><span class=\"o\">=</span><span class=\"n\">argparse</span><span class=\"o\">.</span><span class=\"n\">ArgumentDefaultsHelpFormatter</span>\n                    <span class=\"p\">)</span>\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;--backend&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;-b&#39;</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"o\">=</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">metavar</span><span class=\"o\">=</span><span class=\"s1\">&#39;BACKEND&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;backend&#39;</span><span class=\"p\">],</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;matplotlib backend to choose&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;--tiles&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;-t&#39;</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"o\">=</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">metavar</span><span class=\"o\">=</span><span class=\"s1\">&#39;ROWSxCOLS&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;tiles&#39;</span><span class=\"p\">],</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;window tiling as NxM&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;--shape&#39;</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"o\">=</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">metavar</span><span class=\"o\">=</span><span class=\"s1\">&#39;WIDTHxHEIGHT&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;shape&#39;</span><span class=\"p\">],</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;window size as WxH, defaults to matplotlib default&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;-g&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;--no-graphics&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;graphics&#39;</span><span class=\"p\">],</span> \n                <span class=\"n\">action</span><span class=\"o\">=</span><span class=\"s1\">&#39;store_const&#39;</span><span class=\"p\">,</span> <span class=\"n\">const</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">dest</span><span class=\"o\">=</span><span class=\"s1\">&#39;graphics&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;disable graphic display, also does --no-animation&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;+g&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;--graphics&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;graphics&#39;</span><span class=\"p\">],</span> \n                <span class=\"n\">action</span><span class=\"o\">=</span><span class=\"s1\">&#39;store_const&#39;</span><span class=\"p\">,</span> <span class=\"n\">const</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">dest</span><span class=\"o\">=</span><span class=\"s1\">&#39;graphics&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;enable graphic display&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;-a&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;--no-animation&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;animation&#39;</span><span class=\"p\">],</span> \n                <span class=\"n\">action</span><span class=\"o\">=</span><span class=\"s1\">&#39;store_const&#39;</span><span class=\"p\">,</span> <span class=\"n\">const</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">dest</span><span class=\"o\">=</span><span class=\"s1\">&#39;animation&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;do not animate graphics&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;+a&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;--animation&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;animation&#39;</span><span class=\"p\">],</span> \n                <span class=\"n\">action</span><span class=\"o\">=</span><span class=\"s1\">&#39;store_const&#39;</span><span class=\"p\">,</span> <span class=\"n\">const</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">dest</span><span class=\"o\">=</span><span class=\"s1\">&#39;animation&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;animate graphics, also does ++graphics&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;+A&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;--altscreen&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;altscreen&#39;</span><span class=\"p\">],</span> \n                <span class=\"n\">action</span><span class=\"o\">=</span><span class=\"s1\">&#39;store_const&#39;</span><span class=\"p\">,</span> <span class=\"n\">const</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">dest</span><span class=\"o\">=</span><span class=\"s1\">&#39;altscreen&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;display plots on second monitor&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;-A&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;--no-altscreen&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;altscreen&#39;</span><span class=\"p\">],</span> \n                <span class=\"n\">action</span><span class=\"o\">=</span><span class=\"s1\">&#39;store_const&#39;</span><span class=\"p\">,</span> <span class=\"n\">const</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">dest</span><span class=\"o\">=</span><span class=\"s1\">&#39;altscreen&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;do not display plots on second monitor&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;--noprogress&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;-p&#39;</span><span class=\"p\">,</span> \n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;progress&#39;</span><span class=\"p\">],</span>\n                <span class=\"n\">action</span><span class=\"o\">=</span><span class=\"s1\">&#39;store_const&#39;</span><span class=\"p\">,</span> <span class=\"n\">const</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">dest</span><span class=\"o\">=</span><span class=\"s1\">&#39;progress&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;animate graphics&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;--verbose&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;-v&#39;</span><span class=\"p\">,</span> \n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;verbose&#39;</span><span class=\"p\">],</span>\n                <span class=\"n\">action</span><span class=\"o\">=</span><span class=\"s1\">&#39;store_const&#39;</span><span class=\"p\">,</span> <span class=\"n\">const</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;debug flags&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">add_argument</span><span class=\"p\">(</span><span class=\"s1\">&#39;--debug&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;-d&#39;</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"o\">=</span><span class=\"nb\">str</span><span class=\"p\">,</span> <span class=\"n\">metavar</span><span class=\"o\">=</span><span class=\"s1\">&#39;[psd]&#39;</span><span class=\"p\">,</span>\n                <span class=\"n\">default</span><span class=\"o\">=</span><span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;debug&#39;</span><span class=\"p\">],</span>\n                <span class=\"n\">help</span><span class=\"o\">=</span><span class=\"s1\">&#39;debug flags: p/ropagate, s/tate, d/eriv, i/nteractive&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"n\">unknown</span> <span class=\"o\">=</span> <span class=\"n\">parser</span><span class=\"o\">.</span><span class=\"n\">parse_known_args</span><span class=\"p\">()</span>\n            <span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"nb\">vars</span><span class=\"p\">(</span><span class=\"n\">args</span><span class=\"p\">)</span>  <span class=\"c1\"># get args as a dictionary</span>\n\n        <span class=\"c1\"># print(options)</span>\n        <span class=\"c1\"># ensure graphics is enabled if animation is requested</span>\n        <span class=\"k\">if</span> <span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;animation&#39;</span><span class=\"p\">]:</span>\n            <span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;graphics&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">options</span><span class=\"p\">[</span><span class=\"s1\">&#39;verbose&#39;</span><span class=\"p\">]:</span>\n            <span class=\"k\">for</span> <span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"si\">{:10s}</span><span class=\"s1\">: </span><span class=\"si\">{:}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span><span class=\"p\">))</span>\n        \n        <span class=\"c1\"># stash these away</span>\n        <span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"n\">Struct</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">options</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;Options&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"k\">return</span> <span class=\"n\">options</span></div></div>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blockdiagram.html",
    "content": "\n\n<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\">\n  \n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  \n  <title>bdsim.blockdiagram &mdash; Block diagram simulation 0.7 documentation</title>\n  \n\n  \n  <link rel=\"stylesheet\" href=\"../../_static/css/theme.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"../../_static/pygments.css\" type=\"text/css\" />\n  <link rel=\"stylesheet\" href=\"../../_static/graphviz.css\" type=\"text/css\" />\n\n  \n  \n  \n  \n\n  \n  <!--[if lt IE 9]>\n    <script src=\"../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  \n    \n      <script type=\"text/javascript\" id=\"documentation_options\" data-url_root=\"../../\" src=\"../../_static/documentation_options.js\"></script>\n        <script src=\"../../_static/jquery.js\"></script>\n        <script src=\"../../_static/underscore.js\"></script>\n        <script src=\"../../_static/doctools.js\"></script>\n        <script src=\"../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    \n    <script type=\"text/javascript\" src=\"../../_static/js/theme.js\"></script>\n\n    \n    <link rel=\"index\" title=\"Index\" href=\"../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\">\n\n   \n  <div class=\"wy-grid-for-nav\">\n    \n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n          \n\n          \n            <a href=\"../../index.html\" class=\"icon icon-home\" alt=\"Documentation Home\"> Block diagram simulation\n          \n\n          \n            \n            <img src=\"../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          \n          </a>\n\n          \n            \n            \n          \n\n          \n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n\n          \n        </div>\n\n        \n        <div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"main navigation\">\n          \n            \n            \n              \n            \n            \n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../bdsim.html\">bdsim overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../internals.html\">Supporting classes</a></li>\n</ul>\n\n            \n          \n        </div>\n        \n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\">\n\n      \n      <nav class=\"wy-nav-top\" aria-label=\"top navigation\">\n        \n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../index.html\">Block diagram simulation</a>\n        \n      </nav>\n\n\n      <div class=\"wy-nav-content\">\n        \n        <div class=\"rst-content\">\n        \n          \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<div role=\"navigation\" aria-label=\"breadcrumbs navigation\">\n\n  <ul class=\"wy-breadcrumbs\">\n    \n      <li><a href=\"../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n        \n          <li><a href=\"../index.html\">Module code</a> &raquo;</li>\n        \n      <li>bdsim.blockdiagram</li>\n    \n    \n      <li class=\"wy-breadcrumbs-aside\">\n        \n      </li>\n    \n  </ul>\n\n  \n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n            \n  <h1>Source code for bdsim.blockdiagram</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"ch\">#!/usr/bin/env python3</span>\n<span class=\"c1\"># -*- coding: utf-8 -*-</span>\n<span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Created on Mon May 18 21:43:18 2020</span>\n\n<span class=\"sd\">@author: corkep</span>\n<span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"kn\">import</span> <span class=\"nn\">os</span>\n<span class=\"kn\">from</span> <span class=\"nn\">pathlib</span> <span class=\"kn\">import</span> <span class=\"n\">Path</span>\n<span class=\"kn\">import</span> <span class=\"nn\">sys</span>\n<span class=\"kn\">import</span> <span class=\"nn\">importlib</span>\n<span class=\"kn\">import</span> <span class=\"nn\">inspect</span>\n<span class=\"kn\">import</span> <span class=\"nn\">traceback</span>\n<span class=\"kn\">from</span> <span class=\"nn\">collections</span> <span class=\"kn\">import</span> <span class=\"n\">Counter</span><span class=\"p\">,</span> <span class=\"n\">namedtuple</span>\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">from</span> <span class=\"nn\">colored</span> <span class=\"kn\">import</span> <span class=\"n\">fg</span><span class=\"p\">,</span> <span class=\"n\">attr</span>\n\n\n<span class=\"kn\">from</span> <span class=\"nn\">ansitable</span> <span class=\"kn\">import</span> <span class=\"n\">ANSITable</span><span class=\"p\">,</span> <span class=\"n\">Column</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"o\">*</span>\n\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------- #    </span>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">BlockDiagram</span><span class=\"p\">:</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    Block diagram class.  This object is the parent of all blocks and wires in </span>\n<span class=\"sd\">    the system.</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    :ivar wirelist: all wires in the diagram</span>\n<span class=\"sd\">    :vartype wirelist: list of Wire instances</span>\n<span class=\"sd\">    :ivar blocklist: all blocks in the diagram</span>\n<span class=\"sd\">    :vartype blocklist: list of Block subclass instances</span>\n<span class=\"sd\">    :ivar x: state vector</span>\n<span class=\"sd\">    :vartype x: np.ndarray</span>\n<span class=\"sd\">    :ivar compiled: diagram has successfully compiled</span>\n<span class=\"sd\">    :vartype compiled: bool</span>\n<span class=\"sd\">    :ivar blockcounter: unique counter for each block type</span>\n<span class=\"sd\">    :vartype blockcounter: collections.Counter</span>\n<span class=\"sd\">    :ivar blockdict: index of all blocks by category</span>\n<span class=\"sd\">    :vartype blockdict: dict of lists</span>\n<span class=\"sd\">    :ivar name: name of this diagram</span>\n<span class=\"sd\">    :vartype name: str</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    \n    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;main&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>      <span class=\"c1\"># list of all wires</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>     <span class=\"c1\"># list of all blocks</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clocklist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>     <span class=\"c1\"># list of all clock sources</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">compiled</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>   <span class=\"c1\"># network has been compiled</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blockcounter</span> <span class=\"o\">=</span> <span class=\"n\">Counter</span><span class=\"p\">()</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"n\">name</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_issubsystem</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocknames</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">n_auto_const</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">n_auto_gain</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        \n    <span class=\"k\">def</span> <span class=\"fm\">__getitem__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocknames</span><span class=\"p\">[</span><span class=\"n\">b</span><span class=\"p\">]</span>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__len__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">)</span>\n\n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">issubsystem</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_issubsystem</span>\n    \n<div class=\"viewcode-block\" id=\"BlockDiagram.clock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.clock\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">clock</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"n\">clock</span> <span class=\"o\">=</span> <span class=\"n\">Clock</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n        <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clocklist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">clock</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"n\">clock</span></div>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.add_block\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.add_block\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">add_block</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocknames</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;block </span><span class=\"si\">{}</span><span class=\"s1\"> already added&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">))</span>\n        <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">i</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blockcounter</span><span class=\"p\">[</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">type</span><span class=\"p\">]</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blockcounter</span><span class=\"p\">[</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">type</span><span class=\"p\">]</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n            <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;</span><span class=\"si\">{:s}</span><span class=\"s2\">.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">type</span><span class=\"p\">,</span> <span class=\"n\">i</span><span class=\"p\">)</span>\n        <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"p\">)</span>  <span class=\"c1\"># add to the list of available blocks</span>\n        <span class=\"k\">if</span> <span class=\"n\">block</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocknames</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">Warning</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;block name </span><span class=\"si\">{</span><span class=\"n\">block</span><span class=\"si\">}</span><span class=\"s2\"> is not unique&quot;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocknames</span><span class=\"p\">[</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">block</span></div>\n        \n<div class=\"viewcode-block\" id=\"BlockDiagram.add_wire\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.add_wire\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">add_wire</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">wire</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">wire</span><span class=\"o\">.</span><span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"p\">)</span>\n        <span class=\"n\">wire</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"n\">name</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">wire</span><span class=\"p\">)</span></div>\n    \n    <span class=\"k\">def</span> <span class=\"fm\">__str__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"s1\">&#39;BlockDiagram: </span><span class=\"si\">{:s}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">)</span>\n    \n    <span class=\"k\">def</span> <span class=\"fm\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"s2\">&quot; with </span><span class=\"si\">{:d}</span><span class=\"s2\"> blocks and </span><span class=\"si\">{:d}</span><span class=\"s2\"> wires&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">),</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"p\">))</span>\n        <span class=\"c1\"># for block in self.blocklist:</span>\n        <span class=\"c1\">#     s += str(block) + &quot;\\n&quot;</span>\n        <span class=\"c1\"># s += &quot;\\n&quot;</span>\n        <span class=\"c1\"># for wire in self.wirelist:</span>\n        <span class=\"c1\">#     s += str(wire) + &quot;\\n&quot;</span>\n        <span class=\"c1\"># return s.lstrip(&quot;\\n&quot;)</span>\n        \n<div class=\"viewcode-block\" id=\"BlockDiagram.ls\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.ls\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">ls</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">for</span> <span class=\"n\">k</span><span class=\"p\">,</span><span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blockdict</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"si\">{:12s}</span><span class=\"s1\">: &#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">),</span> <span class=\"s1\">&#39;, &#39;</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">))</span></div>\n    \n<div class=\"viewcode-block\" id=\"BlockDiagram.connect\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.connect\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">connect</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">start</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">ends</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        \n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        TODO:</span>\n<span class=\"sd\">            s.connect(out[3], in1[2], in2[3])  # one to many</span>\n<span class=\"sd\">            block[1] = SigGen()  # use setitem</span>\n<span class=\"sd\">            block[1] = SumJunction(block2[3], block3[4]) * Gain(value=2)</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n                        \n        <span class=\"c1\"># convert to default plug on port 0 if need be</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">start</span><span class=\"p\">,</span> <span class=\"n\">Block</span><span class=\"p\">):</span>\n            <span class=\"n\">start</span> <span class=\"o\">=</span> <span class=\"n\">Plug</span><span class=\"p\">(</span><span class=\"n\">start</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">)</span>\n        <span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;start&#39;</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">end</span> <span class=\"ow\">in</span> <span class=\"n\">ends</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">end</span><span class=\"p\">,</span> <span class=\"n\">Block</span><span class=\"p\">):</span>\n                <span class=\"n\">end</span> <span class=\"o\">=</span> <span class=\"n\">Plug</span><span class=\"p\">(</span><span class=\"n\">end</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">)</span>\n            <span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;end&#39;</span>\n                    \n            <span class=\"k\">if</span> <span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">isslice</span> <span class=\"ow\">and</span> <span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">isslice</span><span class=\"p\">:</span>\n                <span class=\"c1\"># we have a bundle of signals</span>\n                                \n                <span class=\"k\">assert</span> <span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">width</span> <span class=\"o\">==</span> <span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">width</span><span class=\"p\">,</span> <span class=\"s1\">&#39;slice wires must have same width&#39;</span>\n                \n                <span class=\"k\">for</span> <span class=\"p\">(</span><span class=\"n\">s</span><span class=\"p\">,</span><span class=\"n\">e</span><span class=\"p\">)</span> <span class=\"ow\">in</span> <span class=\"nb\">zip</span><span class=\"p\">(</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">portlist</span><span class=\"p\">,</span> <span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">portlist</span><span class=\"p\">):</span>\n                    <span class=\"n\">wire</span> <span class=\"o\">=</span> <span class=\"n\">Wire</span><span class=\"p\">(</span> <span class=\"n\">Plug</span><span class=\"p\">(</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"p\">,</span> <span class=\"n\">s</span><span class=\"p\">,</span> <span class=\"s1\">&#39;start&#39;</span><span class=\"p\">),</span> <span class=\"n\">Plug</span><span class=\"p\">(</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"p\">,</span> <span class=\"n\">e</span><span class=\"p\">,</span> <span class=\"s1\">&#39;end&#39;</span><span class=\"p\">),</span> <span class=\"n\">name</span><span class=\"p\">)</span>\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_wire</span><span class=\"p\">(</span><span class=\"n\">wire</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">isslice</span> <span class=\"ow\">and</span> <span class=\"ow\">not</span> <span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">isslice</span><span class=\"p\">:</span>\n                <span class=\"c1\"># bundle going to a block</span>\n                <span class=\"k\">assert</span> <span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">width</span> <span class=\"o\">==</span> <span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"s2\">&quot;bundle width doesn&#39;t match number of input ports&quot;</span>\n                <span class=\"k\">for</span> <span class=\"n\">inport</span><span class=\"p\">,</span><span class=\"n\">outport</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">portlist</span><span class=\"p\">):</span>\n                    <span class=\"n\">wire</span> <span class=\"o\">=</span> <span class=\"n\">Wire</span><span class=\"p\">(</span> <span class=\"n\">Plug</span><span class=\"p\">(</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"p\">,</span> <span class=\"n\">outport</span><span class=\"p\">,</span> <span class=\"s1\">&#39;start&#39;</span><span class=\"p\">),</span> <span class=\"n\">Plug</span><span class=\"p\">(</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"p\">,</span> <span class=\"n\">inport</span><span class=\"p\">,</span> <span class=\"s1\">&#39;end&#39;</span><span class=\"p\">),</span> <span class=\"n\">name</span><span class=\"p\">)</span>\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_wire</span><span class=\"p\">(</span><span class=\"n\">wire</span><span class=\"p\">)</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">wire</span> <span class=\"o\">=</span> <span class=\"n\">Wire</span><span class=\"p\">(</span><span class=\"n\">start</span><span class=\"p\">,</span> <span class=\"n\">end</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">)</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_wire</span><span class=\"p\">(</span><span class=\"n\">wire</span><span class=\"p\">)</span></div>\n        \n    <span class=\"c1\"># ---------------------------------------------------------------------- #</span>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.compile\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.compile\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">compile</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">subsystem</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">doimport</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">evaluate</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">report</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">verbose</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Compile the block diagram</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :param subsystem: importing a subsystems, defaults to False</span>\n<span class=\"sd\">        :type subsystem: bool, optional</span>\n<span class=\"sd\">        :param doimport: import subsystems, defaults to True</span>\n<span class=\"sd\">        :type doimport: bool, optional</span>\n<span class=\"sd\">        :raises RuntimeError: various block diagram errors</span>\n<span class=\"sd\">        :return: Compile status</span>\n<span class=\"sd\">        :rtype: bool</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Performs a number of operations:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            - Check sanity of block parameters</span>\n<span class=\"sd\">            - Recursively clone and import subsystems</span>\n<span class=\"sd\">            - Check for loops without dynamics</span>\n<span class=\"sd\">            - Check for inputs driven by more than one wire</span>\n<span class=\"sd\">            - Check for unconnected inputs and outputs</span>\n<span class=\"sd\">            - Link all output ports to outgoing wires</span>\n<span class=\"sd\">            - Link all input ports to incoming wires</span>\n<span class=\"sd\">            - Evaluate all blocks in the network</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        \n        <span class=\"c1\"># name the elements</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nblocks</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nwires</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"p\">)</span>\n\n        <span class=\"n\">error</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">statenames</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">dstatenames</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocknames</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n        \n        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">subsystem</span> <span class=\"ow\">and</span> <span class=\"n\">verbose</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\n</span><span class=\"s1\">Compiling:&#39;</span><span class=\"p\">)</span>\n        \n        <span class=\"c1\"># process all subsystem imports</span>\n        <span class=\"c1\"># ssblocks = [b for b in self.blocklist if b.type == &#39;subsystem&#39;]</span>\n        <span class=\"c1\"># for b in ssblocks:</span>\n        <span class=\"c1\">#     print(&#39;  importing subsystem&#39;, b.name)</span>\n        <span class=\"c1\">#     if b.ssvar is not None:</span>\n        <span class=\"c1\">#         print(&#39;-- Wiring in subsystem&#39;, b, &#39;from module local variable &#39;, b.ssvar)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_subsystem_import</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"kc\">None</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># check that wires all point to valid blocks</span>\n        <span class=\"k\">for</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span> <span class=\"ow\">not</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;wire </span><span class=\"si\">{</span><span class=\"n\">w</span><span class=\"si\">}</span><span class=\"s2\"> starts at unreferenced block </span><span class=\"si\">{</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span> <span class=\"ow\">not</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;wire </span><span class=\"si\">{</span><span class=\"n\">w</span><span class=\"si\">}</span><span class=\"s2\"> ends at unreferenced block </span><span class=\"si\">{</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># run block specific checks</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">check</span><span class=\"p\">()</span>\n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;block failed check &#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">))</span>\n\n        <span class=\"c1\"># build a dictionary of all block names</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocknames</span><span class=\"p\">[</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">b</span>\n        \n        <span class=\"c1\"># visit all stateful blocks</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">+=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span>\n                <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_state_names</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_state_names</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s1\">&#39;number of state names not consistent with number of states&#39;</span>\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">statenames</span><span class=\"o\">.</span><span class=\"n\">extend</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_state_names</span><span class=\"p\">)</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"c1\"># create default state names</span>\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">statenames</span><span class=\"o\">.</span><span class=\"n\">extend</span><span class=\"p\">([</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;x&#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">i</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)])</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;clocked&#39;</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">+=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">ndstates</span>\n                <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_state_names</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_state_names</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s1\">&#39;number of state names not consistent with number of states&#39;</span>\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">dstatenames</span><span class=\"o\">.</span><span class=\"n\">extend</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_state_names</span><span class=\"p\">)</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"c1\"># create default state names</span>\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">statenames</span><span class=\"o\">.</span><span class=\"n\">extend</span><span class=\"p\">([</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;X&#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">i</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)])</span>\n\n        <span class=\"c1\"># initialize lists of input and output ports</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">outports</span> <span class=\"o\">=</span> <span class=\"p\">[[]</span> <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nout</span><span class=\"p\">)]</span>\n            <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">inports</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kc\">None</span> <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nin</span><span class=\"p\">)]</span>\n            <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_parents</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kc\">None</span> <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nin</span><span class=\"p\">)]</span>\n        \n        <span class=\"c1\"># connect the source and destination blocks to each wire</span>\n        <span class=\"k\">for</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"p\">:</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">add_outport</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">)</span>\n                <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">add_inport</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">)</span>\n\n                <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">_parents</span><span class=\"p\">[</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span>\n\n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;error connecting wire &#39;</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">fullname</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;: &#39;</span><span class=\"p\">,</span> <span class=\"n\">sys</span><span class=\"o\">.</span><span class=\"n\">exc_info</span><span class=\"p\">()[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n                <span class=\"n\">error</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n            \n        <span class=\"c1\"># check connections every block </span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"c1\"># check all inputs are connected</span>\n            <span class=\"k\">for</span> <span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"n\">connection</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">inports</span><span class=\"p\">):</span>\n                <span class=\"k\">if</span> <span class=\"n\">connection</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  ERROR: [</span><span class=\"si\">{:s}</span><span class=\"s1\">] input </span><span class=\"si\">{:d}</span><span class=\"s1\"> is not connected&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">),</span> <span class=\"n\">port</span><span class=\"p\">))</span>\n                    <span class=\"n\">error</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n                    \n            <span class=\"c1\"># check all outputs are connected</span>\n            <span class=\"k\">for</span> <span class=\"n\">port</span><span class=\"p\">,</span><span class=\"n\">connections</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">outports</span><span class=\"p\">):</span>\n                <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">connections</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  INFORMATION: [</span><span class=\"si\">{:s}</span><span class=\"s1\">] output </span><span class=\"si\">{:d}</span><span class=\"s1\"> is not connected&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">),</span> <span class=\"n\">port</span><span class=\"p\">))</span>\n                    \n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_inport_names</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_inport_names</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"s1\">&#39;incorrect number of input names given: &#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_outport_names</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_outport_names</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nout</span><span class=\"p\">,</span> <span class=\"s1\">&#39;incorrect number of output names given: &#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_state_names</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_state_names</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s1\">&#39;incorrect number of state names given: &#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)</span>\n                    \n        <span class=\"c1\"># check for cycles of function blocks</span>\n        <span class=\"k\">def</span> <span class=\"nf\">_DFS</span><span class=\"p\">(</span><span class=\"n\">path</span><span class=\"p\">):</span>\n            <span class=\"n\">start</span> <span class=\"o\">=</span> <span class=\"n\">path</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n            <span class=\"n\">tail</span> <span class=\"o\">=</span> <span class=\"n\">path</span><span class=\"p\">[</span><span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n            <span class=\"k\">for</span> <span class=\"n\">outgoing</span> <span class=\"ow\">in</span> <span class=\"n\">tail</span><span class=\"o\">.</span><span class=\"n\">outports</span><span class=\"p\">:</span>\n                <span class=\"c1\"># for every port on this block</span>\n                <span class=\"k\">for</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"n\">outgoing</span><span class=\"p\">:</span>\n                    <span class=\"n\">dest</span> <span class=\"o\">=</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span>\n                    <span class=\"k\">if</span> <span class=\"n\">dest</span> <span class=\"o\">==</span> <span class=\"n\">start</span><span class=\"p\">:</span>\n                        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  ERROR: cycle found: &#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39; - &#39;</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">([</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"n\">path</span> <span class=\"o\">+</span> <span class=\"p\">[</span><span class=\"n\">dest</span><span class=\"p\">]]))</span>\n                        <span class=\"k\">return</span> <span class=\"kc\">True</span>\n                    <span class=\"k\">if</span> <span class=\"n\">dest</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;function&#39;</span><span class=\"p\">:</span>\n                        <span class=\"k\">return</span> <span class=\"n\">_DFS</span><span class=\"p\">(</span><span class=\"n\">path</span> <span class=\"o\">+</span> <span class=\"p\">[</span><span class=\"n\">dest</span><span class=\"p\">])</span> <span class=\"c1\"># recurse</span>\n            <span class=\"k\">return</span> <span class=\"kc\">False</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;function&#39;</span><span class=\"p\">:</span>\n                <span class=\"c1\"># do depth first search looking for a cycle</span>\n                <span class=\"k\">if</span> <span class=\"n\">_DFS</span><span class=\"p\">([</span><span class=\"n\">b</span><span class=\"p\">]):</span>\n                    <span class=\"n\">error</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">error</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">subsystem</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;could not compile system&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># create the execution plan/schedule</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">execution_plan</span><span class=\"p\">()</span>\n\n        <span class=\"c1\">## evaluate the network once to check out wire types</span>\n        <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">getstate0</span><span class=\"p\">()</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">clock</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">=</span> <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">getstate0</span><span class=\"p\">()</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">report</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">report</span><span class=\"p\">()</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">plan_print</span><span class=\"p\">()</span>\n\n        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">subsystem</span> <span class=\"ow\">and</span> <span class=\"n\">evaluate</span><span class=\"p\">:</span>\n            <span class=\"c1\"># run all the blocks for one step </span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">evaluate_plan</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"mf\">0.0</span><span class=\"p\">,</span> <span class=\"n\">sinks</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\n            <span class=\"k\">except</span> <span class=\"ne\">RuntimeError</span> <span class=\"k\">as</span> <span class=\"n\">err</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\n</span><span class=\"s1\">From compile: unrecoverable error in value propagation:&#39;</span><span class=\"p\">,</span> <span class=\"n\">err</span><span class=\"p\">)</span>\n                <span class=\"n\">traceback</span><span class=\"o\">.</span><span class=\"n\">print_exc</span><span class=\"p\">(</span><span class=\"n\">file</span><span class=\"o\">=</span><span class=\"n\">sys</span><span class=\"o\">.</span><span class=\"n\">stderr</span><span class=\"p\">)</span>\n                <span class=\"n\">error</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n            \n        <span class=\"k\">if</span> <span class=\"n\">error</span><span class=\"p\">:</span>\n            <span class=\"c1\"># show report if there was an error</span>\n            <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">report</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">report</span><span class=\"p\">()</span>\n            <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">subsystem</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;could not compile system&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">compiled</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n        \n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">compiled</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">_subsystem_import</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"n\">sspath</span><span class=\"p\">):</span>\n        \n        <span class=\"n\">blocks</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"n\">wires</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">wirelist</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"c1\"># rename the block to include subsystem path</span>\n            <span class=\"k\">if</span> <span class=\"n\">sspath</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"n\">sspath</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;/&#39;</span> <span class=\"o\">+</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span>\n            \n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;subsystem&#39;</span><span class=\"p\">:</span>\n                <span class=\"c1\"># deal with a subsystem</span>\n                <span class=\"c1\">#  - recurse to import it</span>\n                <span class=\"c1\">#  - add its blocks and wires to the set</span>\n                <span class=\"n\">ssb</span><span class=\"p\">,</span> <span class=\"n\">ssw</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_subsystem_import</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">subsystem</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">)</span>\n                <span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">extend</span><span class=\"p\">(</span><span class=\"n\">ssb</span><span class=\"p\">)</span>\n                <span class=\"n\">wires</span><span class=\"o\">.</span><span class=\"n\">extend</span><span class=\"p\">(</span><span class=\"n\">ssw</span><span class=\"p\">)</span>\n\n                <span class=\"c1\"># INPORT/OUTPORT blocks now become simple pass throughs</span>\n                <span class=\"c1\"># same number of inputs and outputs</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">inport</span><span class=\"o\">.</span><span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">inport</span><span class=\"o\">.</span><span class=\"n\">nout</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">outport</span><span class=\"o\">.</span><span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">outport</span><span class=\"o\">.</span><span class=\"n\">nin</span>\n\n                <span class=\"c1\"># modify the wiring, keep the INPORT/OUTPORT blocks but lose</span>\n                <span class=\"c1\"># the SUBSYSTEM blocks</span>\n                <span class=\"k\">for</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"p\">:</span>\n                    <span class=\"c1\"># for all wires at this level, find those that connect</span>\n                    <span class=\"c1\"># to the subsystem and tweak them</span>\n                    <span class=\"k\">if</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span> <span class=\"o\">==</span> <span class=\"n\">b</span><span class=\"p\">:</span>\n                        <span class=\"c1\"># SS output</span>\n                        <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">outport</span>\n                    <span class=\"k\">if</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span> <span class=\"o\">==</span> <span class=\"n\">b</span><span class=\"p\">:</span>\n                        <span class=\"c1\"># SS input</span>\n                        <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">inport</span>\n\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"c1\"># not a subsystem, just add the block to the list</span>\n                <span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># systematically renumber all blocks and wires</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">blocks</span><span class=\"p\">):</span>\n            <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"n\">i</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">wires</span><span class=\"p\">):</span>\n            <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"n\">i</span>\n        <span class=\"k\">return</span> <span class=\"n\">blocks</span><span class=\"p\">,</span> <span class=\"n\">wires</span>\n\n\n    \n    <span class=\"c1\"># ---------------------------------------------------------------------- #</span>\n    \n<div class=\"viewcode-block\" id=\"BlockDiagram.evaluate_plan\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.evaluate_plan\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">evaluate_plan</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">,</span> <span class=\"n\">checkfinite</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">debuglist</span><span class=\"o\">=</span><span class=\"p\">[],</span> <span class=\"n\">sinks</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Evaluate all blocks in the network</span>\n\n<span class=\"sd\">        :param x: state :type x: numpy.ndarray :param t: current time :type t:</span>\n<span class=\"sd\">        float :param checkfinite: check for Inf or Nan values in block outputs</span>\n<span class=\"sd\">        :type checkfinite: bool :return: state derivative :rtype: numpy.ndarray</span>\n\n<span class=\"sd\">        Performs the following steps:</span>\n\n<span class=\"sd\">        1. Partition the state vector ``x`` to all stateful blocks</span>\n<span class=\"sd\">        2. Execute the blocks in the order given by the ``plan``. The block</span>\n<span class=\"sd\">           outputs are &quot;sent&quot; to their connected inputs.</span>\n\n<span class=\"sd\">        Sink blocks are not executed here, but after completion their inputs</span>\n<span class=\"sd\">        will all be valid.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"c1\"># TODO: don&#39;t copy outputs to inputs of next block, have inputs</span>\n        <span class=\"c1\"># pull the value from connected inputs</span>\n\n        <span class=\"k\">try</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"n\">t</span>\n        <span class=\"k\">except</span><span class=\"p\">:</span>\n            <span class=\"k\">pass</span>\n\n        <span class=\"c1\"># TODO: this is super expensive because the string formatting</span>\n        <span class=\"c1\">#  happens regardless of whether debugging is on</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">DEBUG</span><span class=\"p\">(</span><span class=\"s1\">&#39;state&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; t=</span><span class=\"si\">{}</span><span class=\"s1\">, x=</span><span class=\"si\">{}</span><span class=\"s1\"> &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&#39;</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">)</span>\n        \n        <span class=\"c1\"># reset all the blocks ready for the evalation</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">reset</span><span class=\"p\">()</span>\n        \n        <span class=\"c1\"># split the state vector to stateful blocks</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">:</span>\n                <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">setstate</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># split the discrete state vector to clocked blocks</span>\n        <span class=\"k\">for</span> <span class=\"n\">clock</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">setstate</span><span class=\"p\">()</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">DEBUG</span><span class=\"p\">(</span><span class=\"s1\">&#39;propagate&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;t=</span><span class=\"si\">{:.3f}</span><span class=\"s1\">&#39;</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">)</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">sequence</span><span class=\"p\">,</span> <span class=\"n\">group</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">plan</span><span class=\"p\">):</span>\n\n            <span class=\"c1\"># self.DEBUG(&#39;propagate&#39;, &#39;---- sequence = &#39;, sequence)</span>\n\n            <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"n\">group</span><span class=\"p\">:</span>\n                <span class=\"c1\"># ask the block for output, check for errors</span>\n                <span class=\"k\">try</span><span class=\"p\">:</span>\n                    <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)</span>\n                <span class=\"k\">except</span> <span class=\"ne\">Exception</span> <span class=\"k\">as</span> <span class=\"n\">err</span><span class=\"p\">:</span>\n                    <span class=\"c1\"># output method failed, report it</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;--Error at t=</span><span class=\"si\">{:f}</span><span class=\"s1\"> when computing output of block </span><span class=\"si\">{:s}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)))</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  </span><span class=\"si\">{}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">err</span><span class=\"p\">))</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  inputs were: &#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">)</span>\n                    <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  state was: &#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">)</span>\n                    <span class=\"n\">traceback</span><span class=\"o\">.</span><span class=\"n\">print_exc</span><span class=\"p\">(</span><span class=\"n\">file</span><span class=\"o\">=</span><span class=\"n\">sys</span><span class=\"o\">.</span><span class=\"n\">stderr</span><span class=\"p\">)</span>\n\n                    <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span> <span class=\"kn\">from</span> <span class=\"bp\">None</span>\n\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">DEBUG</span><span class=\"p\">(</span><span class=\"s1\">&#39;propagate&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;block </span><span class=\"si\">{:s}</span><span class=\"s1\">: output = </span><span class=\"si\">{}</span><span class=\"s1\">&#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"p\">,</span> <span class=\"n\">out</span><span class=\"p\">)</span>\n\n                <span class=\"c1\"># check that output is a list of correct length</span>\n                <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">tuple</span><span class=\"p\">,</span> <span class=\"nb\">list</span><span class=\"p\">)):</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">AssertionError</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;block </span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"si\">}</span><span class=\"s2\"> output </span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"si\">}</span><span class=\"s2\"> must be a list: </span><span class=\"si\">{</span><span class=\"nb\">type</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n                <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nout</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">AssertionError</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;block </span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"si\">}</span><span class=\"s2\"> output </span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"si\">}</span><span class=\"s2\"> has incorrect length: </span><span class=\"si\">{</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\"> instead of </span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nout</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n\n                <span class=\"c1\"># TODO check output validity once at the start</span>\n                \n                <span class=\"c1\"># check it has no nan or inf values</span>\n                <span class=\"k\">if</span> <span class=\"n\">checkfinite</span> <span class=\"ow\">and</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">))</span> <span class=\"ow\">and</span> <span class=\"ow\">not</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">isfinite</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">any</span><span class=\"p\">():</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;block </span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"si\">}</span><span class=\"s2\"> output contains NaN&quot;</span><span class=\"p\">)</span>\n\n                <span class=\"c1\"># send block outputs to all downstream connected blocks</span>\n                <span class=\"k\">for</span> <span class=\"p\">(</span><span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"n\">outwires</span><span class=\"p\">)</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">outports</span><span class=\"p\">):</span> <span class=\"c1\"># every port</span>\n                    <span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">]</span>\n                    <span class=\"k\">for</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"n\">outwires</span><span class=\"p\">:</span>     <span class=\"c1\"># every wire</span>\n                        \n                        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">DEBUG</span><span class=\"p\">(</span><span class=\"s1\">&#39;propagate&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;  [</span><span class=\"si\">{}</span><span class=\"s1\">] = </span><span class=\"si\">{}</span><span class=\"s1\"> --&gt;  </span><span class=\"si\">{}</span><span class=\"s1\">[</span><span class=\"si\">{}</span><span class=\"s1\">]&#39;</span><span class=\"p\">,</span> <span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">)</span>\n\n                        <span class=\"c1\"># send value to wire</span>\n                        <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">send</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)</span>\n\n                        <span class=\"c1\"># TODO send return status no longer needed</span>\n                        <span class=\"c1\"># TODO use common error handler in all cases above</span>\n\n        <span class=\"c1\"># gather the derivative</span>\n        <span class=\"n\">YD</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">deriv</span><span class=\"p\">()</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">DEBUG</span><span class=\"p\">(</span><span class=\"s1\">&#39;deriv&#39;</span><span class=\"p\">,</span> <span class=\"n\">YD</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"n\">YD</span></div>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.execution_plan\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.execution_plan\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">execution_plan</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create execution plan</span>\n\n<span class=\"sd\">        The plan is saved in the attribute ``plan`` and is a list</span>\n<span class=\"sd\">        ``[L0, L1, ... LN]`` where each ``Li`` is a list of blocks.  The blocks</span>\n<span class=\"sd\">        in the lists are executed sequentially, ie. all the blocks in ``L0``</span>\n<span class=\"sd\">        then all the blocks in ``L1`` etc.</span>\n\n<span class=\"sd\">        The plan ensures that the inputs of all blocks in ``Li`` have been</span>\n<span class=\"sd\">        previously computed.</span>\n\n<span class=\"sd\">        .. note::</span>\n<span class=\"sd\">            - The plan is essentially a dataflow graph. </span>\n<span class=\"sd\">            - The blocks in list ``Li`` could potentially be executed in</span>\n<span class=\"sd\">              parallel.</span>\n<span class=\"sd\">            - Constant blocks and stateful blocks are all executed in ``L0``</span>\n<span class=\"sd\">            - The block attribute ``_sequence`` is ``i`` and indicates its</span>\n<span class=\"sd\">              execution order</span>\n\n<span class=\"sd\">        :seealso: :func:`plan_print`, :func:`plan_dotfile`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"n\">plan</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"n\">group</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_sequence</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"ow\">in</span> <span class=\"p\">(</span><span class=\"s1\">&#39;source&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;clocked&#39;</span><span class=\"p\">):</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_sequence</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n                <span class=\"n\">group</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)</span>\n        <span class=\"n\">plan</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">group</span><span class=\"p\">)</span>\n        <span class=\"n\">sequence</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">plan</span><span class=\"p\">)</span>\n\n        <span class=\"k\">while</span> <span class=\"kc\">True</span><span class=\"p\">:</span>\n            <span class=\"n\">group</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n            <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_sequence</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"k\">continue</span>  <span class=\"c1\"># already has a sequence assigned</span>\n                \n                <span class=\"k\">if</span> <span class=\"nb\">all</span><span class=\"p\">([</span><span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">_sequence</span> <span class=\"o\">&lt;</span> <span class=\"n\">sequence</span> <span class=\"k\">if</span> <span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">_sequence</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span> <span class=\"k\">else</span> <span class=\"kc\">False</span> <span class=\"k\">for</span> <span class=\"n\">p</span> <span class=\"ow\">in</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_parents</span><span class=\"p\">]):</span>\n                    <span class=\"n\">group</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)</span>\n\n            <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"n\">group</span><span class=\"o\">.</span><span class=\"n\">copy</span><span class=\"p\">():</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_sequence</span> <span class=\"o\">=</span> <span class=\"n\">sequence</span>\n                <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"ow\">in</span> <span class=\"p\">(</span><span class=\"s1\">&#39;sink&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;graphics&#39;</span><span class=\"p\">):</span>\n                    <span class=\"n\">group</span><span class=\"o\">.</span><span class=\"n\">remove</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">group</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"k\">break</span>\n            <span class=\"n\">plan</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">group</span><span class=\"p\">)</span>\n            <span class=\"n\">sequence</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">plan</span> <span class=\"o\">=</span> <span class=\"n\">plan</span></div>\n    \n<div class=\"viewcode-block\" id=\"BlockDiagram.plan_print\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.plan_print\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">plan_print</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Display execution plan in tabular form</span>\n\n<span class=\"sd\">        :seealso: :func:`execution_plan`, :func:`plan_dotfile`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"n\">table</span> <span class=\"o\">=</span> <span class=\"n\">ANSITable</span><span class=\"p\">(</span>\n            <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;Sequence&quot;</span><span class=\"p\">),</span>\n            <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;Blocks&quot;</span><span class=\"p\">,</span> <span class=\"n\">colalign</span><span class=\"o\">=</span><span class=\"s1\">&#39;&lt;&#39;</span><span class=\"p\">,</span> <span class=\"n\">headalign</span><span class=\"o\">=</span><span class=\"s1\">&#39;^&#39;</span><span class=\"p\">),</span>\n            <span class=\"n\">border</span><span class=\"o\">=</span><span class=\"s1\">&#39;thin&#39;</span>\n        <span class=\"p\">)</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">sequence</span><span class=\"p\">,</span> <span class=\"n\">group</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">plan</span><span class=\"p\">):</span>\n            <span class=\"n\">table</span><span class=\"o\">.</span><span class=\"n\">row</span><span class=\"p\">(</span><span class=\"n\">sequence</span><span class=\"p\">,</span> <span class=\"s1\">&#39;, &#39;</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">([</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"n\">group</span><span class=\"p\">]))</span>\n        \n        <span class=\"n\">table</span><span class=\"o\">.</span><span class=\"n\">print</span><span class=\"p\">()</span></div>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.plan_dotfile\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.plan_dotfile\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">plan_dotfile</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">filename</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Write a GraphViz dot file representing the execution schedule</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :param file: Name of file to write to</span>\n<span class=\"sd\">        :type file: str</span>\n\n<span class=\"sd\">        The file can be processed using neato or dot::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            % dot -Tpng -o out.png dotfile.dot</span>\n\n<span class=\"sd\">        Display execution plan as a dataflow graph.</span>\n\n<span class=\"sd\">        :seealso: :func:`execution_plan`, :func:`plan_print`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">filename</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">):</span>\n            <span class=\"n\">file</span> <span class=\"o\">=</span> <span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">filename</span><span class=\"p\">,</span> <span class=\"s1\">&#39;w&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">file</span> <span class=\"o\">=</span> <span class=\"n\">filename</span>\n            \n        <span class=\"n\">header</span> <span class=\"o\">=</span> <span class=\"sa\">r</span><span class=\"s2\">&quot;&quot;&quot;digraph G {</span>\n\n<span class=\"s2\">    graph [splines=ortho, rankdir=LR, splines=spline]</span>\n<span class=\"s2\">    node [shape=box]</span>\n<span class=\"s2\">    </span>\n<span class=\"s2\">    &quot;&quot;&quot;</span>\n        <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"n\">header</span><span class=\"p\">)</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">sequence</span><span class=\"p\">,</span> <span class=\"n\">group</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">plan</span><span class=\"p\">):</span>\n            <span class=\"c1\"># for each execution group, place the blocks in a subgraph</span>\n            <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\t</span><span class=\"s1\">subgraph step</span><span class=\"si\">{:d}</span><span class=\"s1\"> {{</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">sequence</span><span class=\"p\">))</span>\n            <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\t\\t</span><span class=\"s1\">rank=same;</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"n\">group</span><span class=\"p\">:</span>\n                <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\t\\t</span><span class=\"s1\">&quot;</span><span class=\"si\">{:s}</span><span class=\"s1\">&quot;</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">))</span>\n\n            <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\t</span><span class=\"s1\">}</span><span class=\"se\">\\n\\n</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># connect them to their parents, except if a transfer block</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">:</span>\n                <span class=\"k\">for</span> <span class=\"n\">p</span> <span class=\"ow\">in</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_parents</span><span class=\"p\">:</span>\n                    <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\t</span><span class=\"s1\">&quot;</span><span class=\"si\">{:s}</span><span class=\"s1\">&quot; -&gt; &quot;</span><span class=\"si\">{:s}</span><span class=\"s1\">&quot;</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">p</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">))</span>\n\n        <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;}</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span></div>\n\n    <span class=\"c1\"># ---------------------------------------------------------------------- #</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">_debugger</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">integrator</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t_stop</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span> <span class=\"ow\">and</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">&lt;</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t_stop</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span>\n\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t_stop</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">while</span> <span class=\"kc\">True</span><span class=\"p\">:</span>\n            <span class=\"n\">cmd</span> <span class=\"o\">=</span> <span class=\"nb\">input</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;(bdsim, t=</span><span class=\"si\">{</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"si\">:</span><span class=\"s2\">.4f</span><span class=\"si\">}</span><span class=\"s2\">) &quot;</span><span class=\"p\">)</span>\n\n            <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">cmd</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"k\">continue</span>\n\n            <span class=\"k\">if</span> <span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;p&#39;</span><span class=\"p\">:</span>\n                <span class=\"c1\"># print variables</span>\n                <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">cmd</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n                    <span class=\"nb\">id</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">:])</span>\n                    <span class=\"n\">b</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">[</span><span class=\"nb\">id</span><span class=\"p\">]</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"p\">))</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n                        <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nout</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"p\">))</span>\n            <span class=\"k\">elif</span> <span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;i&#39;</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">status</span><span class=\"p\">,</span> <span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">step_size</span><span class=\"p\">,</span> <span class=\"n\">integrator</span><span class=\"o\">.</span><span class=\"n\">nfev</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;s&#39;</span><span class=\"p\">:</span>\n                <span class=\"c1\"># step</span>\n                <span class=\"k\">break</span>\n            <span class=\"k\">elif</span> <span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;c&#39;</span><span class=\"p\">:</span>\n                <span class=\"c1\"># continue</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">debug_stop</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t_stop</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n                <span class=\"k\">break</span>\n            <span class=\"k\">elif</span> <span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;t&#39;</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t_stop</span> <span class=\"o\">=</span> <span class=\"nb\">float</span><span class=\"p\">(</span><span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">:])</span>\n                <span class=\"k\">break</span>\n            <span class=\"k\">elif</span> <span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;q&#39;</span><span class=\"p\">:</span>\n                <span class=\"n\">sys</span><span class=\"o\">.</span><span class=\"n\">exit</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"n\">cmd</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"ow\">in</span> <span class=\"s1\">&#39;h?&#39;</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;p    print all outputs&quot;</span><span class=\"p\">)</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;pI   print block id I output&quot;</span><span class=\"p\">)</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;i    print integrator status&quot;</span><span class=\"p\">)</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;s    single step&quot;</span><span class=\"p\">)</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;c    continue&quot;</span><span class=\"p\">)</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;tT   stop at or after time T&quot;</span><span class=\"p\">)</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;q    quit&quot;</span><span class=\"p\">)</span>\n\n    <span class=\"c1\"># ---------------------------------------------------------------------- #</span>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.report\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.report\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">report</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Print a tabular report about the block diagram</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># print all the blocks</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\n</span><span class=\"s1\">Blocks::</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span>\n        <span class=\"n\">table</span> <span class=\"o\">=</span> <span class=\"n\">ANSITable</span><span class=\"p\">(</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;id&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;name&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;nin&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;nout&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;nstate&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;ndstate&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;type&quot;</span><span class=\"p\">,</span> <span class=\"n\">headalign</span><span class=\"o\">=</span><span class=\"s2\">&quot;^&quot;</span><span class=\"p\">,</span> <span class=\"n\">colalign</span><span class=\"o\">=</span><span class=\"s2\">&quot;&lt;&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">border</span><span class=\"o\">=</span><span class=\"s2\">&quot;thin&quot;</span>\n            <span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">table</span><span class=\"o\">.</span><span class=\"n\">row</span><span class=\"p\">(</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">),</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nout</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">ndstates</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span><span class=\"p\">)</span>\n        <span class=\"n\">table</span><span class=\"o\">.</span><span class=\"n\">print</span><span class=\"p\">()</span>\n        \n        <span class=\"c1\"># print all the wires</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\n</span><span class=\"s1\">Wires::</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span>\n        <span class=\"n\">table</span> <span class=\"o\">=</span> <span class=\"n\">ANSITable</span><span class=\"p\">(</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;id&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;from&quot;</span><span class=\"p\">,</span> <span class=\"n\">headalign</span><span class=\"o\">=</span><span class=\"s2\">&quot;^&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;to&quot;</span><span class=\"p\">,</span> <span class=\"n\">headalign</span><span class=\"o\">=</span><span class=\"s2\">&quot;^&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;description&quot;</span><span class=\"p\">,</span> <span class=\"n\">headalign</span><span class=\"o\">=</span><span class=\"s2\">&quot;^&quot;</span><span class=\"p\">,</span> <span class=\"n\">colalign</span><span class=\"o\">=</span><span class=\"s2\">&quot;&lt;&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;type&quot;</span><span class=\"p\">,</span> <span class=\"n\">headalign</span><span class=\"o\">=</span><span class=\"s2\">&quot;^&quot;</span><span class=\"p\">,</span> <span class=\"n\">colalign</span><span class=\"o\">=</span><span class=\"s2\">&quot;&lt;&quot;</span><span class=\"p\">),</span>\n                <span class=\"n\">border</span><span class=\"o\">=</span><span class=\"s2\">&quot;thin&quot;</span>\n            <span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"p\">:</span>\n            <span class=\"n\">start</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;</span><span class=\"si\">{:d}</span><span class=\"s2\">[</span><span class=\"si\">{:d}</span><span class=\"s2\">]&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">)</span>\n            <span class=\"n\">end</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;</span><span class=\"si\">{:d}</span><span class=\"s2\">[</span><span class=\"si\">{:d}</span><span class=\"s2\">]&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">)</span>\n            \n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">]</span>\n                <span class=\"n\">typ</span> <span class=\"o\">=</span> <span class=\"nb\">type</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"vm\">__name__</span>\n                <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n                    <span class=\"n\">typ</span> <span class=\"o\">+=</span> <span class=\"s1\">&#39; </span><span class=\"si\">{:s}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">))</span>\n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"n\">typ</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;??&#39;</span>\n            <span class=\"n\">table</span><span class=\"o\">.</span><span class=\"n\">row</span><span class=\"p\">(</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"n\">start</span><span class=\"p\">,</span> <span class=\"n\">end</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">fullname</span><span class=\"p\">,</span> <span class=\"n\">typ</span><span class=\"p\">)</span>\n        <span class=\"n\">table</span><span class=\"o\">.</span><span class=\"n\">print</span><span class=\"p\">()</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clocklist</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"c1\"># print all the clocked blocks</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\n</span><span class=\"s1\">Clocked blocks::</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span>\n            <span class=\"n\">table</span> <span class=\"o\">=</span> <span class=\"n\">ANSITable</span><span class=\"p\">(</span>\n                    <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;id&quot;</span><span class=\"p\">),</span>\n                    <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;block&quot;</span><span class=\"p\">),</span>\n                    <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;clock&quot;</span><span class=\"p\">),</span>\n                    <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;period&quot;</span><span class=\"p\">),</span>\n                    <span class=\"n\">Column</span><span class=\"p\">(</span><span class=\"s2\">&quot;offset&quot;</span><span class=\"p\">),</span>\n                    <span class=\"n\">border</span><span class=\"o\">=</span><span class=\"s2\">&quot;thin&quot;</span>\n                <span class=\"p\">)</span>\n            <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;clocked&#39;</span><span class=\"p\">:</span>\n                    <span class=\"n\">c</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">clock</span>\n                    <span class=\"n\">table</span><span class=\"o\">.</span><span class=\"n\">row</span><span class=\"p\">(</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">id</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"p\">),</span> <span class=\"n\">c</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">c</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"n\">c</span><span class=\"o\">.</span><span class=\"n\">offset</span><span class=\"p\">)</span>\n            <span class=\"n\">table</span><span class=\"o\">.</span><span class=\"n\">print</span><span class=\"p\">()</span>\n\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\n</span><span class=\"s1\">Continuous state variables: </span><span class=\"si\">{:d}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">))</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span>  <span class=\"s1\">&#39;Discrete state variables:   </span><span class=\"si\">{:d}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span><span class=\"p\">))</span>\n        \n        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">compiled</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;** System has not been compiled, or had a compile time error&#39;</span><span class=\"p\">)</span></div>\n\n    <span class=\"c1\"># ---------------------------------------------------------------------- #</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">_error_handler</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">where</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"p\">):</span>\n        <span class=\"c1\"># called from except clause</span>\n\n        <span class=\"kn\">import</span> <span class=\"nn\">traceback</span>\n        <span class=\"kn\">import</span> <span class=\"nn\">types</span>\n\n        <span class=\"n\">t</span><span class=\"p\">,</span> <span class=\"n\">v</span><span class=\"p\">,</span> <span class=\"n\">tb</span> <span class=\"o\">=</span> <span class=\"n\">sys</span><span class=\"o\">.</span><span class=\"n\">exc_info</span><span class=\"p\">()</span>  <span class=\"c1\"># get the exception</span>\n\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">fg</span><span class=\"p\">(</span><span class=\"s1\">&#39;red&#39;</span><span class=\"p\">))</span>  <span class=\"c1\"># red text</span>\n\n        <span class=\"c1\"># print the traceback</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;[</span><span class=\"si\">{</span><span class=\"n\">where</span><span class=\"si\">}</span><span class=\"s2\">]: exception </span><span class=\"si\">{</span><span class=\"n\">t</span><span class=\"o\">.</span><span class=\"vm\">__name__</span><span class=\"si\">}</span><span class=\"s2\"> occurred in </span><span class=\"si\">{</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">type</span><span class=\"si\">}</span><span class=\"s2\"> block </span><span class=\"si\">{</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\">  &quot;</span><span class=\"p\">)</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;  </span><span class=\"si\">{</span><span class=\"n\">v</span><span class=\"si\">}</span><span class=\"se\">\\n</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n        <span class=\"n\">traceback</span><span class=\"o\">.</span><span class=\"n\">print_tb</span><span class=\"p\">(</span><span class=\"n\">tb</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># print all block inputs</span>\n        <span class=\"nb\">print</span><span class=\"p\">()</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">nin</span><span class=\"p\">):</span>\n            <span class=\"nb\">input</span> <span class=\"o\">=</span> <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;input </span><span class=\"si\">{</span><span class=\"n\">i</span><span class=\"si\">}</span><span class=\"s2\"> from </span><span class=\"si\">{</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">inports</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\"> [</span><span class=\"si\">{</span><span class=\"nb\">input</span><span class=\"o\">.</span><span class=\"vm\">__class__</span><span class=\"o\">.</span><span class=\"vm\">__name__</span><span class=\"si\">}</span><span class=\"s2\">]&quot;</span><span class=\"p\">)</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  &#39;</span><span class=\"p\">,</span> <span class=\"nb\">input</span><span class=\"p\">)</span>\n\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">attr</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">))</span>  <span class=\"c1\"># default text</span>\n\n        <span class=\"c1\"># traceback = err[2]</span>\n        <span class=\"c1\"># back_frame = traceback.tb_frame.f_back</span>\n\n        <span class=\"c1\"># back_tb = types.TracebackType(tb_next=None,</span>\n        <span class=\"c1\">#                           tb_frame=back_frame,</span>\n        <span class=\"c1\">#                           tb_lasti=back_frame.f_lasti,</span>\n        <span class=\"c1\">#                           tb_lineno=back_frame.f_lineno)</span>\n        <span class=\"c1\"># raise RuntimeError(&#39;Fatal failure&#39;).with_traceback(back_tb)</span>\n        <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;Fatal failure&#39;</span><span class=\"p\">)</span> <span class=\"kn\">from</span> <span class=\"bp\">None</span>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.getstate0\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.getstate0\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">getstate0</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"c1\"># get the state from each stateful block</span>\n        <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([])</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">:</span>\n                    <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">getstate0</span><span class=\"p\">()]</span>\n                <span class=\"c1\">#print(&#39;x0&#39;, x0)</span>\n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_error_handler</span><span class=\"p\">(</span><span class=\"s1\">&#39;getstate0&#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"n\">x0</span></div>\n                        \n<div class=\"viewcode-block\" id=\"BlockDiagram.reset\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.reset\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">reset</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Reset conditions within every active block.  Most importantly, all</span>\n<span class=\"sd\">        inputs are marked as unknown.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Invokes the `reset` method on all blocks.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">reset</span><span class=\"p\">()</span>     \n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_error_handler</span><span class=\"p\">(</span><span class=\"s1\">&#39;reset&#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.step\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.step\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">step</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Step all blocks</span>\n\n<span class=\"sd\">        :param state: simulation state, defaults to None</span>\n<span class=\"sd\">        :type state: SimState, optional</span>\n<span class=\"sd\">        :param graphics: graphics enabled, defaults to False</span>\n<span class=\"sd\">        :type graphics: bool, optional</span>\n\n<span class=\"sd\">        Tell all blocks to take action on new inputs by invoking their</span>\n<span class=\"sd\">        ``step`` method and passing the ``state`` object.  Used to save</span>\n<span class=\"sd\">        results to a figure or file</span>\n\n<span class=\"sd\">        .. note:: </span>\n<span class=\"sd\">            - if ``graphics`` is False, Graphics blocks are not called</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"c1\"># TODO could be done by output method, even if no outputs</span>\n        \n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">graphics</span> <span class=\"ow\">and</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">isgraphics</span><span class=\"p\">:</span>\n                <span class=\"k\">try</span><span class=\"p\">:</span>\n                    <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">)</span>\n                    <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">count</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n                <span class=\"k\">except</span><span class=\"p\">:</span>\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_error_handler</span><span class=\"p\">(</span><span class=\"s1\">&#39;step&#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.deriv\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.deriv\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Harvest derivatives from all blocks .</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"n\">YD</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([])</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">:</span>\n                <span class=\"k\">try</span><span class=\"p\">:</span>\n                    <span class=\"n\">yd</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">deriv</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">flatten</span><span class=\"p\">()</span>\n                    <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">yd</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n                        <span class=\"k\">raise</span> <span class=\"ne\">AssertionError</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;deriv: block </span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"si\">}</span><span class=\"s2\"> did not return ndarray&quot;</span><span class=\"p\">)</span>\n                    <span class=\"k\">if</span> <span class=\"n\">yd</span><span class=\"o\">.</span><span class=\"n\">ndim</span> <span class=\"o\">!=</span> <span class=\"mi\">1</span> <span class=\"ow\">or</span> <span class=\"n\">yd</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">!=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">:</span>\n                        <span class=\"k\">raise</span> <span class=\"ne\">AssertionError</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;deriv: block </span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"si\">}</span><span class=\"s2\"> returns wrong shape </span><span class=\"si\">{</span><span class=\"n\">yd</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"si\">}</span><span class=\"s2\">, should be (</span><span class=\"si\">{</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"si\">}</span><span class=\"s2\">,)&quot;</span><span class=\"p\">)</span>\n                    <span class=\"n\">YD</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">YD</span><span class=\"p\">,</span> <span class=\"n\">yd</span><span class=\"p\">]</span>\n                <span class=\"k\">except</span><span class=\"p\">:</span>\n                    <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_error_handler</span><span class=\"p\">(</span><span class=\"s1\">&#39;deriv&#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"p\">)</span>                    \n        <span class=\"k\">return</span> <span class=\"n\">YD</span></div>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.start\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.start\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Start all blocks</span>\n\n<span class=\"sd\">        :param state: simulation state, defaults to None</span>\n<span class=\"sd\">        :type state: SimState, optional</span>\n<span class=\"sd\">        :param graphics: graphics enabled, defaults to False</span>\n<span class=\"sd\">        :type graphics: bool, optional</span>\n\n<span class=\"sd\">        Inform all blocks that BlockDiagram execution is about to start by</span>\n<span class=\"sd\">        invoking their ``start`` method and passing the ``state`` object.  Used</span>\n<span class=\"sd\">        to open files, create figures etc.</span>\n\n<span class=\"sd\">        .. note:: if ``graphics`` is False, Graphics blocks are not called </span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        \n        <span class=\"k\">for</span> <span class=\"n\">c</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">c</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_error_handler</span><span class=\"p\">(</span><span class=\"s1\">&#39;start clock&#39;</span><span class=\"p\">,</span> <span class=\"n\">c</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># safe wrapper for block starting, does error handling</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">isgraphics</span> <span class=\"ow\">and</span> <span class=\"ow\">not</span> <span class=\"n\">graphics</span><span class=\"p\">:</span>\n                <span class=\"k\">continue</span>\n            <span class=\"c1\"># print(&#39;starting block&#39;, b)</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_error_handler</span><span class=\"p\">(</span><span class=\"s1\">&#39;block.start&#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"p\">)</span></div>\n                \n<div class=\"viewcode-block\" id=\"BlockDiagram.initialstate\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.initialstate\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">initialstate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"ow\">in</span> <span class=\"p\">(</span><span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;clocked&#39;</span><span class=\"p\">):</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">_x0</span></div>\n\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.done\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.done\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">done</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">graphics</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Finishup all blocks</span>\n\n<span class=\"sd\">        :param state: simulation state, defaults to None</span>\n<span class=\"sd\">        :type state: SimState, optional</span>\n<span class=\"sd\">        :param graphics: graphics enabled, defaults to False</span>\n<span class=\"sd\">        :type graphics: bool, optional</span>\n\n<span class=\"sd\">        Inform all blocks that BlockDiagram execution is complete by invoking their</span>\n<span class=\"sd\">        ``done`` method and passing options.  Used</span>\n<span class=\"sd\">        to close files, display figures etc.</span>\n\n<span class=\"sd\">        .. note:: if ``graphics`` is False, Graphics blocks are not called </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">isgraphics</span> <span class=\"ow\">and</span> <span class=\"ow\">not</span> <span class=\"n\">graphics</span><span class=\"p\">:</span>\n                <span class=\"k\">continue</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">done</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_error_handler</span><span class=\"p\">(</span><span class=\"s1\">&#39;block.done&#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"p\">)</span></div>\n        \n<div class=\"viewcode-block\" id=\"BlockDiagram.dotfile\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.dotfile\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">dotfile</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">filename</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Write a GraphViz dot file representing the network.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :param file: Name of file to write to</span>\n<span class=\"sd\">        :type file: str</span>\n\n<span class=\"sd\">        The file can be processed using neato or dot::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            % dot -Tpng -o out.png dotfile.dot</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">filename</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">):</span>\n            <span class=\"n\">file</span> <span class=\"o\">=</span> <span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">filename</span><span class=\"p\">,</span> <span class=\"s1\">&#39;w&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">file</span> <span class=\"o\">=</span> <span class=\"n\">filename</span>\n            \n        <span class=\"n\">header</span> <span class=\"o\">=</span> <span class=\"sa\">r</span><span class=\"s2\">&quot;&quot;&quot;digraph G {</span>\n\n<span class=\"s2\">    graph [splines=ortho, rankdir=LR]</span>\n<span class=\"s2\">    node [shape=box]</span>\n<span class=\"s2\">    </span>\n<span class=\"s2\">    &quot;&quot;&quot;</span>\n        <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"n\">header</span><span class=\"p\">)</span>\n        <span class=\"c1\"># add the blocks</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;source&quot;</span><span class=\"p\">:</span>\n                <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s2\">&quot;shape=box3d&quot;</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;sink&quot;</span><span class=\"p\">:</span>\n                <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s2\">&quot;shape=folder&quot;</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;function&quot;</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;gain&#39;</span><span class=\"p\">:</span>\n                    <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s2\">&quot;shape=triangle&quot;</span><span class=\"p\">)</span>\n                    <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s2\">&quot;orientation=-90&quot;</span><span class=\"p\">)</span>\n                    <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s1\">&#39;label=&quot;</span><span class=\"si\">{:g}</span><span class=\"s1\">&quot;&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">gain</span><span class=\"p\">))</span>\n                <span class=\"k\">elif</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;sum&#39;</span><span class=\"p\">:</span>\n                    <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s2\">&quot;shape=point&quot;</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;transfer&#39;</span><span class=\"p\">:</span>\n                <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s2\">&quot;shape=component&quot;</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">pos</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s1\">&#39;pos=&quot;</span><span class=\"si\">{:g}</span><span class=\"s1\">,</span><span class=\"si\">{:g}</span><span class=\"s1\">!&quot;&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">pos</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">pos</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]))</span>\n            <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s1\">&#39;xlabel=&lt;&lt;BR/&gt;&lt;FONT POINT-SIZE=&quot;8&quot; COLOR=&quot;blue&quot;&gt;</span><span class=\"si\">{:s}</span><span class=\"s1\">&lt;/FONT&gt;&gt;&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span><span class=\"p\">))</span>\n            <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\t</span><span class=\"s1\">&quot;</span><span class=\"si\">{:s}</span><span class=\"s1\">&quot; [</span><span class=\"si\">{:s}</span><span class=\"s1\">]</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"s1\">&#39;, &#39;</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">options</span><span class=\"p\">)))</span>\n        \n        <span class=\"c1\"># add the wires</span>\n        <span class=\"k\">for</span> <span class=\"n\">w</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wirelist</span><span class=\"p\">:</span>\n            <span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n            <span class=\"c1\">#options.append(&#39;xlabel=&quot;{:s}&quot;&#39;.format(w.name))</span>\n            <span class=\"k\">if</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;sum&#39;</span><span class=\"p\">:</span>\n                <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"s1\">&#39;headlabel=&quot;</span><span class=\"si\">{:s}</span><span class=\"s1\"> &quot;&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">signs</span><span class=\"p\">[</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">]))</span>\n            <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;</span><span class=\"se\">\\t</span><span class=\"s1\">&quot;</span><span class=\"si\">{:s}</span><span class=\"s1\">&quot; -&gt; &quot;</span><span class=\"si\">{:s}</span><span class=\"s1\">&quot; [</span><span class=\"si\">{:s}</span><span class=\"s1\">]</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"s1\">&#39;, &#39;</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">options</span><span class=\"p\">)))</span>\n\n        <span class=\"n\">file</span><span class=\"o\">.</span><span class=\"n\">write</span><span class=\"p\">(</span><span class=\"s1\">&#39;}</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"p\">)</span></div>\n            \n<div class=\"viewcode-block\" id=\"BlockDiagram.blockvalues\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.blockvalues\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">blockvalues</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;Block </span><span class=\"si\">{:s}</span><span class=\"s1\">:&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">))</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  inputs:  &#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">)</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  outputs: &#39;</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">))</span></div>\n\n<div class=\"viewcode-block\" id=\"BlockDiagram.DEBUG\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.blockdiagram.BlockDiagram.DEBUG\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">DEBUG</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">debug</span><span class=\"p\">,</span> <span class=\"n\">fmt</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"n\">debug</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">debug</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;DEBUG.</span><span class=\"si\">{:s}</span><span class=\"s1\">: &#39;</span> <span class=\"o\">+</span> <span class=\"n\">fmt</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">))</span></div></div>\n            \n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">import</span> <span class=\"nn\">bdsim</span>\n    <span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">BlockDiagram</span><span class=\"p\">()</span>\n\n    <span class=\"c1\"># define the blocks</span>\n    <span class=\"n\">demand</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">STEP</span><span class=\"p\">(</span><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">pos</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span><span class=\"mi\">0</span><span class=\"p\">),</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;demand&#39;</span><span class=\"p\">)</span>\n    <span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;+-&#39;</span><span class=\"p\">,</span> <span class=\"n\">pos</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n    <span class=\"n\">gain</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">GAIN</span><span class=\"p\">(</span><span class=\"mi\">10</span><span class=\"p\">,</span> <span class=\"n\">pos</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"mf\">1.5</span><span class=\"p\">,</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n    <span class=\"n\">plant</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">LTI_SISO</span><span class=\"p\">(</span><span class=\"mf\">0.5</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;plant&#39;</span><span class=\"p\">,</span> <span class=\"n\">pos</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n    <span class=\"c1\">#scope = bd.SCOPE(pos=(4,0), styles=[{&#39;color&#39;: &#39;blue&#39;}, {&#39;color&#39;: &#39;red&#39;, &#39;linestyle&#39;: &#39;--&#39;})</span>\n    <span class=\"n\">scope</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SCOPE</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">styles</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;k&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;r--&#39;</span><span class=\"p\">],</span> <span class=\"n\">pos</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"mi\">4</span><span class=\"p\">,</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n\n    <span class=\"c1\"># connect the blocks</span>\n    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">demand</span><span class=\"p\">,</span> <span class=\"nb\">sum</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"n\">scope</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">plant</span><span class=\"p\">,</span> <span class=\"nb\">sum</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"nb\">sum</span><span class=\"p\">,</span> <span class=\"n\">gain</span><span class=\"p\">)</span>\n    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">gain</span><span class=\"p\">,</span> <span class=\"n\">plant</span><span class=\"p\">)</span>\n    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">plant</span><span class=\"p\">,</span> <span class=\"n\">scope</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n\n    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">compile</span><span class=\"p\">()</span>   <span class=\"c1\"># check the diagram</span>\n    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">report</span><span class=\"p\">()</span>    <span class=\"c1\"># list all blocks and wires</span>\n    <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">run</span><span class=\"p\">(</span><span class=\"mi\">5</span><span class=\"p\">,</span> <span class=\"n\">debug</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">)</span>\n\n    \n    <span class=\"c1\"># from pathlib import Path</span>\n\n    <span class=\"c1\"># exec(open(Path(__file__).parent.absolute() / &quot;test_blockdiagram.py&quot;).read())</span>\n\n</pre></div>\n\n           </div>\n           \n          </div>\n          <footer>\n  \n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>\n        \n        &copy; Copyright 2020, Peter Corke\n      <span class=\"lastupdated\">\n        Last updated on 29-Dec-2021.\n      </span>\n\n    </p>\n  </div>\n    \n    \n    \n    Built with <a href=\"http://sphinx-doc.org/\">Sphinx</a> using a\n    \n    <a href=\"https://github.com/rtfd/sphinx_rtd_theme\">theme</a>\n    \n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>. \n\n</footer>\n\n        </div>\n      </div>\n\n    </section>\n\n  </div>\n  \n\n  <script type=\"text/javascript\">\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n\n  \n  \n    \n    <!-- Theme Analytics -->\n    <script>\n    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n    ga('create', 'G-11Q6WJM565', 'auto');\n    ga('send', 'pageview');\n    </script>\n\n    \n   \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blocks/connections.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.blocks.connections &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.blocks.connections</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.blocks.connections</h1><div class=\"highlight\"><pre>\n<span></span>\n<span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Connection blocks are in two categories:</span>\n\n<span class=\"sd\">1. Signal manipulation:</span>\n<span class=\"sd\">    - have inputs and outputs</span>\n<span class=\"sd\">    - have no state variables</span>\n<span class=\"sd\">    - are a subclass of ``FunctionBlock`` |rarr| ``Block``</span>\n<span class=\"sd\">2. Subsystem support</span>\n<span class=\"sd\">    - have inputs or outputs</span>\n<span class=\"sd\">    - have no state variables</span>\n<span class=\"sd\">    - are a subclass of ``SubsysytemBlock`` |rarr| ``Block``</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"c1\"># The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">importlib.util</span>\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">import</span> <span class=\"nn\">copy</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">bdsim</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">SubsystemBlock</span><span class=\"p\">,</span> <span class=\"n\">SourceBlock</span><span class=\"p\">,</span> <span class=\"n\">SinkBlock</span><span class=\"p\">,</span> <span class=\"n\">FunctionBlock</span>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Item\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.Item\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Item</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`ITEM`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | dict       | any     |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Item.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.Item.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">item</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Selector item from a dictionary signal.</span>\n\n<span class=\"sd\">        :param item: name of dictionary item</span>\n<span class=\"sd\">        :type item: str</span>\n<span class=\"sd\">        :param kwargs: |BlockOptions|</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :return: An ITEM block</span>\n<span class=\"sd\">        :rtype: Item instance</span>\n\n<span class=\"sd\">        For a dictionary type input signal, select one item as the output signal.</span>\n<span class=\"sd\">        For example::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            ITEM(&#39;xd&#39;)</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        selects the ``xd`` item from the dictionary signal input to the block.</span>\n\n<span class=\"sd\">        A dictionary signal can serve a similar purpose to a &quot;bus&quot; in Simulink(R).</span>\n\n<span class=\"sd\">        This is somewhat like a demultiplexer :class:`DeMux` but allows for</span>\n<span class=\"sd\">        named heterogeneous data.</span>\n\n<span class=\"sd\">        :seealso: :class:`Dict`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">item</span> <span class=\"o\">=</span> <span class=\"n\">item</span></div>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># TODO, handle inputs that are vectors themselves</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"nb\">dict</span><span class=\"p\">),</span> <span class=\"s1\">&#39;Input signal must be a dict&#39;</span>\n        <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">item</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"s1\">&#39;Item is not in input dict&#39;</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">item</span><span class=\"p\">]]</span></div>\n\n<div class=\"viewcode-block\" id=\"Dict\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.Dict\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Dict</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`DICT`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | N          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | any        | dict    |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Dict.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.Dict.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">item</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a dictionary signal.</span>\n\n<span class=\"sd\">        :param keys: list of dictionary keys</span>\n<span class=\"sd\">        :type keys: list</span>\n<span class=\"sd\">        :param kwargs: |BlockOptions|</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :return: A DICT block</span>\n<span class=\"sd\">        :rtype: Dict instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Inputs are assigned to a dictionary signal, using the corresponding </span>\n<span class=\"sd\">        names from ``keys``.</span>\n<span class=\"sd\">        For example::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            DICT([&#39;x&#39;, &#39;xd&#39;, &#39;xdd&#39;])</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        expects three inputs and assigns them to dictionary items ``x``, ``xd``, ``xdd`` of</span>\n<span class=\"sd\">        the output dictionary respectively.</span>\n\n<span class=\"sd\">        A dictionary signal can serve a similar purpose to a &quot;bus&quot; in Simulink(R).</span>\n\n<span class=\"sd\">        This is somewhat like a multiplexer :class:`Mux` but allows for</span>\n<span class=\"sd\">        named heterogeneous data.</span>\n\n<span class=\"sd\">        :seealso: :class:`Item` :class:`Mux`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">item</span> <span class=\"o\">=</span> <span class=\"n\">item</span></div>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># TODO, handle inputs that are vectors themselves</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"nb\">dict</span><span class=\"p\">),</span> <span class=\"s1\">&#39;Input signal must be a dict&#39;</span>\n        <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">item</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"s1\">&#39;Item is not in signal dict&#39;</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">item</span><span class=\"p\">]]</span></div>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Mux\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.Mux\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Mux</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`MUX`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | nin        | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float,     | A(M,)   |         |</span>\n<span class=\"sd\">    | A(N,)      | A(M,)   |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Mux.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.Mux.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Multiplex signals.</span>\n\n<span class=\"sd\">        :param nin: Number of input ports, defaults to 1</span>\n<span class=\"sd\">        :type nin: int, optional</span>\n<span class=\"sd\">        :param kwargs: |BlockOptions|</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :return: A MUX block</span>\n<span class=\"sd\">        :rtype: Mux instance</span>\n\n<span class=\"sd\">        This block takes a number of scalar or 1D-array signals and concatenates</span>\n<span class=\"sd\">        them into a single 1-D array signal.  For example::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            MUX(2, inputs=(func1[2], sum3))</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        multiplexes the outputs of blocks ``func1`` (port 2) and ``sum3`` into a</span>\n<span class=\"sd\">        single output vector as a 1D-array.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :seealso: :class:`Dict`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span></div>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># TODO, handle inputs that are vectors themselves</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"k\">for</span> <span class=\"nb\">input</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"nb\">bool</span><span class=\"p\">)):</span>\n                <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n                <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">extend</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"o\">.</span><span class=\"n\">flatten</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">tolist</span><span class=\"p\">())</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">)</span> <span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"DeMux\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.DeMux\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">DeMux</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`DEMUX`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | nout    | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float,     | float   |         |</span>\n<span class=\"sd\">    | A(nout,)   |         |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"DeMux.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.DeMux.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Demultiplex signals.</span>\n\n<span class=\"sd\">        :param nout: number of outputs, defaults to 1</span>\n<span class=\"sd\">        :type nout: int, optional</span>\n<span class=\"sd\">        :param kwargs: |BlockOptions|</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :return: A DEMUX block</span>\n<span class=\"sd\">        :rtype: DeMux instance</span>\n\n<span class=\"sd\">        This block has a single input port and ``nout`` output ports.  A 1D-array</span>\n<span class=\"sd\">        input signal (with ``nout`` elements) is routed element-wise to individual</span>\n<span class=\"sd\">        scalar output ports.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"n\">nout</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span></div>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># TODO, handle inputs that are vectors themselves</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span><span class=\"p\">,</span> <span class=\"s1\">&#39;Input width not equal to number of output ports&#39;</span>\n        <span class=\"k\">return</span> <span class=\"nb\">list</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Index\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.Index\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Index</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`INDEX`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Index.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.Index.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">index</span><span class=\"o\">=</span><span class=\"p\">[],</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Index an iterable signal.</span>\n\n<span class=\"sd\">        :param index: elements of input array, defaults to []</span>\n<span class=\"sd\">        :type index: list, slice or str, optional</span>\n<span class=\"sd\">        :param kwargs: |BlockOptions|</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :return: An INDEX block</span>\n<span class=\"sd\">        :rtype: Index instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The specified element(s) of the input iterable (list, string, etc.)</span>\n<span class=\"sd\">        are output.  The index can be an integer, sequence of integers, a Python slice</span>\n<span class=\"sd\">        object, or a string with Python slice notation, eg. ``&quot;::-1&quot;``.</span>\n\n<span class=\"sd\">        :seealso: :class:`Slice1` :class:`Slice2`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">index</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">):</span>\n            <span class=\"n\">args</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kc\">None</span> <span class=\"k\">if</span> <span class=\"n\">a</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;&#39;</span> <span class=\"k\">else</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">a</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">a</span> <span class=\"ow\">in</span> <span class=\"n\">index</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">(</span><span class=\"s1\">&#39;:&#39;</span><span class=\"p\">)]</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span> <span class=\"o\">=</span> <span class=\"nb\">slice</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span> <span class=\"o\">=</span> <span class=\"n\">index</span></div>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]]]</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span><span class=\"p\">]]]</span></div>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"SubSystem\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.SubSystem\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">SubSystem</span><span class=\"p\">(</span><span class=\"n\">SubsystemBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`SUBSYSTEM`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">       </span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs    |  states |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | ss.in.nout | ss.out.nin | 0       |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | any        | any        |         |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"SubSystem.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.SubSystem.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">subsys</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Instantiate a subsystem.</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        :param subsys: Subsystem as either a filename or a ``BlockDiagram`` instance</span>\n<span class=\"sd\">        :type subsys: str or BlockDiagram</span>\n\n<span class=\"sd\">        :param nin: Number of input ports, defaults to 1</span>\n<span class=\"sd\">        :type nin: int, optional</span>\n<span class=\"sd\">        :param nout: Number of output ports, defaults to 1</span>\n<span class=\"sd\">        :type nout: int, optional</span>\n<span class=\"sd\">        :param kwargs: |BlockOptions|</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :raises ImportError: DESCRIPTION</span>\n<span class=\"sd\">        :raises ValueError: DESCRIPTION</span>\n<span class=\"sd\">        :return: A SUBSYSTEM block</span>\n<span class=\"sd\">        :rtype: SubSystem instance</span>\n\n<span class=\"sd\">        This block represents a subsystem in a block diagram.  The definition</span>\n<span class=\"sd\">        of the subsystem can be:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            - the name of a module which is imported and must contain only</span>\n<span class=\"sd\">              only ``BlockDiagram`` instance, or</span>\n<span class=\"sd\">            - a ``BlockDiagram`` instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The referenced block diagram must contain one or both of:</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            - one ``InPort`` block, which has outputs but no inputs. These</span>\n<span class=\"sd\">              outputs are connected to the inputs to the enclosing ``SubSystem`` block.</span>\n<span class=\"sd\">            - one ``OutPort`` block, which has inputs but no outputs. These</span>\n<span class=\"sd\">              inputs are connected to the outputs to the enclosing ``SubSystem`` block.</span>\n<span class=\"sd\">              </span>\n<span class=\"sd\">        .. note::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        - The referenced block diagram is treated like a macro and copied into </span>\n<span class=\"sd\">          the parent block diagram at compile time. The ``SubSystem``, ``InPort`` and</span>\n<span class=\"sd\">          ``OutPort`` blocks are eliminated, that is, all hierarchical structure is </span>\n<span class=\"sd\">          lost.</span>\n<span class=\"sd\">        - The same subsystem can be used multiple times, its blocks and wires</span>\n<span class=\"sd\">           will be cloned.  Subsystems can also include subsystems.</span>\n<span class=\"sd\">        - The number of input and output ports is not specified, they are computed</span>\n<span class=\"sd\">          from the number of ports on the ``InPort`` and ``OutPort`` blocks within the</span>\n<span class=\"sd\">          subsystem.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n        \n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">subsys</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">):</span>\n            <span class=\"c1\"># attempt to import the file</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">module</span> <span class=\"o\">=</span> <span class=\"n\">importlib</span><span class=\"o\">.</span><span class=\"n\">import_module</span><span class=\"p\">(</span><span class=\"n\">subsys</span><span class=\"p\">,</span> <span class=\"n\">package</span><span class=\"o\">=</span><span class=\"s1\">&#39;.&#39;</span><span class=\"p\">)</span>\n            <span class=\"k\">except</span> <span class=\"ne\">SyntaxError</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;-- syntax error in block definiton: &#39;</span> <span class=\"o\">+</span> <span class=\"n\">subsys</span><span class=\"p\">)</span>\n            <span class=\"k\">except</span> <span class=\"ne\">ModuleNotFoundError</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;-- module not found &#39;</span><span class=\"p\">,</span> <span class=\"n\">subsys</span><span class=\"p\">)</span>\n            <span class=\"c1\"># get all the bdsim.BlockDiagram instances</span>\n            <span class=\"n\">simvars</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">name</span> <span class=\"k\">for</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">ref</span> <span class=\"ow\">in</span> <span class=\"n\">module</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">()</span> <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">ref</span><span class=\"p\">,</span> <span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">BlockDiagram</span><span class=\"p\">)]</span>\n            <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">simvars</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">ImportError</span><span class=\"p\">(</span><span class=\"s1\">&#39;no bdsim.Simulation instances in imported module&#39;</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">simvars</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">ImportError</span><span class=\"p\">(</span><span class=\"s1\">&#39;multiple bdsim.Simulation instances in imported module&#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">simvars</span><span class=\"p\">))</span>\n            <span class=\"n\">subsys</span> <span class=\"o\">=</span> <span class=\"n\">module</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"p\">[</span><span class=\"n\">simvars</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]]</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ssvar</span> <span class=\"o\">=</span> <span class=\"n\">simvars</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">subsys</span><span class=\"p\">,</span> <span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">BlockDiagram</span><span class=\"p\">):</span>\n            <span class=\"c1\"># use an in-memory digram</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ssvar</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;argument must be filename or BlockDiagram instance&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># check if valid input and output ports</span>\n        <span class=\"n\">ninp</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"n\">noutp</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"n\">subsys</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;inport&#39;</span><span class=\"p\">:</span>\n                <span class=\"n\">ninp</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n            <span class=\"k\">elif</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;outport&#39;</span><span class=\"p\">:</span>\n                <span class=\"n\">noutp</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        \n        <span class=\"k\">if</span> <span class=\"n\">ninp</span> <span class=\"o\">&gt;</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;subsystem cannot have more than one INPORT block&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">noutp</span> <span class=\"o\">&gt;</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;subsystem cannot have more than one OUTPORT block&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">ninp</span> <span class=\"o\">+</span> <span class=\"n\">noutp</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;subsystem cannot have zero INPORT or OUTPORT blocks&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># it&#39;s valid, make a deep copy</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">subsystem</span> <span class=\"o\">=</span> <span class=\"n\">copy</span><span class=\"o\">.</span><span class=\"n\">deepcopy</span><span class=\"p\">(</span><span class=\"n\">subsys</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># get references to the input and output port blocks</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">subsystem</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;inport&#39;</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport</span> <span class=\"o\">=</span> <span class=\"n\">b</span>\n            <span class=\"k\">elif</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;outport&#39;</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport</span> <span class=\"o\">=</span> <span class=\"n\">b</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ssname</span> <span class=\"o\">=</span> <span class=\"n\">subsys</span><span class=\"o\">.</span><span class=\"n\">name</span></div></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"InPort\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.InPort\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">InPort</span><span class=\"p\">(</span><span class=\"n\">SubsystemBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`INPORT`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 0          | nout    | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    |            | any     |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"InPort.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.InPort.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Input ports for a subsystem.</span>\n\n<span class=\"sd\">        :param nout: Number of output ports, defaults to 1</span>\n<span class=\"sd\">        :type nout: int, optional</span>\n<span class=\"sd\">        :param kwargs: |BlockOptions|</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :return: An INPORT block</span>\n<span class=\"sd\">        :rtype: InPort instance</span>\n\n<span class=\"sd\">        This block connects a subsystem to a parent block diagram.  Inputs to the</span>\n<span class=\"sd\">        parent-level ``SubSystem`` block appear as the outputs of this block.</span>\n\n<span class=\"sd\">        .. note:: Only one ``INPORT`` block can appear in a block diagram but it</span>\n<span class=\"sd\">            can have multiple ports.  This is different to Simulink(R) which </span>\n<span class=\"sd\">            would require multiple single-port input blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"n\">nout</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># signal feed through</span>\n\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"OutPort\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.OutPort\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">OutPort</span><span class=\"p\">(</span><span class=\"n\">SubsystemBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`OUTPORT`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | nin        | 0       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | any        |         |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n\n<div class=\"viewcode-block\" id=\"OutPort.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.connections.OutPort.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Output ports for a subsystem.</span>\n\n<span class=\"sd\">        :param nin: Number of input ports, defaults to 1</span>\n<span class=\"sd\">        :type nin: int, optional</span>\n<span class=\"sd\">        :param kwargs: |BlockOptions|</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :return: A OUTPORT block</span>\n<span class=\"sd\">        :rtype: OutPort instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        This block connects a subsystem to a parent block diagram.  The the </span>\n<span class=\"sd\">        inputs of this block become the outputs of the parent-level ``SubSystem``</span>\n<span class=\"sd\">        block.</span>\n\n<span class=\"sd\">        .. note:: Only one ``OUTPORT`` block can appear in a block diagram but it</span>\n<span class=\"sd\">            can have multiple ports.  This is different to Simulink(R) which </span>\n<span class=\"sd\">            would require multiple single-port output blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># signal feed through</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span></div>\n\n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">import</span> <span class=\"nn\">pathlib</span>\n    <span class=\"kn\">import</span> <span class=\"nn\">os.path</span>\n\n    <span class=\"n\">exec</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">(</span><span class=\"vm\">__file__</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">absolute</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;test_connections.py&quot;</span><span class=\"p\">))</span><span class=\"o\">.</span><span class=\"n\">read</span><span class=\"p\">())</span>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blocks/discrete.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.blocks.discrete &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.blocks.discrete</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.blocks.discrete</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Transfer blocks:</span>\n\n<span class=\"sd\">- have inputs and outputs</span>\n<span class=\"sd\">- have state variables</span>\n<span class=\"sd\">- are a subclass of ``TransferBlock`` |rarr| ``Block``</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">import</span> <span class=\"nn\">math</span>\n<span class=\"kn\">from</span> <span class=\"nn\">math</span> <span class=\"kn\">import</span> <span class=\"n\">sin</span><span class=\"p\">,</span> <span class=\"n\">cos</span><span class=\"p\">,</span> <span class=\"n\">atan2</span><span class=\"p\">,</span> <span class=\"n\">sqrt</span><span class=\"p\">,</span> <span class=\"n\">pi</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">import</span> <span class=\"nn\">inspect</span>\n<span class=\"kn\">from</span> <span class=\"nn\">spatialmath</span> <span class=\"kn\">import</span> <span class=\"n\">base</span><span class=\"p\">,</span> <span class=\"n\">Twist3</span><span class=\"p\">,</span> <span class=\"n\">SE3</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">ClockedBlock</span>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ </span>\n\n\n<div class=\"viewcode-block\" id=\"ZOH\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.ZOH\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">ZOH</span><span class=\"p\">(</span><span class=\"n\">ClockedBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`ZOH`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | N       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float,     | float,  |         | </span>\n<span class=\"sd\">    | A(N,)      | A(N,)   |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"ZOH.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.ZOH.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">clock</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Zero-order hold.</span>\n\n<span class=\"sd\">        :param clock: clock source</span>\n<span class=\"sd\">        :type clock: Clock</span>\n<span class=\"sd\">        :param x0: Initial value of the hold, defaults to 0</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a ZOH block</span>\n<span class=\"sd\">        :rtype: Integrator instance</span>\n\n<span class=\"sd\">        Output is the input at the previous clock time.  The state can be a scalar or a</span>\n<span class=\"sd\">        vector, this is given by the type of ``x0``.</span>\n\n<span class=\"sd\">        .. note:: If input is not a scalar, ``x0`` must have the shape of the</span>\n<span class=\"sd\">            input signal.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;sampler&#39;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">clock</span><span class=\"o\">=</span><span class=\"n\">clock</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span></div>\n        <span class=\"c1\"># print(&#39;nstates&#39;, self.nstates)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># print(&#39;* output, x is &#39;, self._x)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">]</span>\n\n<div class=\"viewcode-block\" id=\"ZOH.next\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.ZOH.next\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">next</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">xnext</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"n\">xnext</span></div></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ </span>\n\n<div class=\"viewcode-block\" id=\"DIntegrator\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.DIntegrator\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">DIntegrator</span><span class=\"p\">(</span><span class=\"n\">ClockedBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`DINTEGRATOR`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | N       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float,     | float,  |         | </span>\n<span class=\"sd\">    | A(N,)      | A(N,)   |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"DIntegrator.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.DIntegrator.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">clock</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">gain</span><span class=\"o\">=</span><span class=\"mf\">1.0</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=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Discrete-time integrator.</span>\n\n<span class=\"sd\">        :param clock: clock source</span>\n<span class=\"sd\">        :type clock: Clock</span>\n<span class=\"sd\">        :param x0: Initial state, defaults to 0</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param min: Minimum value of state, defaults to None</span>\n<span class=\"sd\">        :type min: float or array_like, optional</span>\n<span class=\"sd\">        :param max: Maximum value of state, defaults to None</span>\n<span class=\"sd\">        :type max: float or array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: an INTEGRATOR block</span>\n<span class=\"sd\">        :rtype: Integrator instance</span>\n\n<span class=\"sd\">        Create a discrete-time integrator block.</span>\n\n<span class=\"sd\">        Output is the time integral of the input.  The state can be a scalar or a</span>\n<span class=\"sd\">        vector, this is given by the type of ``x0``.</span>\n\n<span class=\"sd\">        The minimum and maximum values can be:</span>\n\n<span class=\"sd\">            - a scalar, in which case the same value applies to every element of </span>\n<span class=\"sd\">              the state vector, or</span>\n<span class=\"sd\">            - a vector, of the same shape as ``x0`` that applies elementwise to</span>\n<span class=\"sd\">              the state.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">clock</span><span class=\"o\">=</span><span class=\"n\">clock</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">)):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n            <span class=\"k\">if</span> <span class=\"nb\">min</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"nb\">min</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span>\n            <span class=\"k\">if</span> <span class=\"nb\">max</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"nb\">max</span> <span class=\"o\">=</span> <span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span>\n                \n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n                <span class=\"k\">if</span> <span class=\"n\">x0</span><span class=\"o\">.</span><span class=\"n\">ndim</span> <span class=\"o\">&gt;</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;state must be a 1D vector&#39;</span><span class=\"p\">)</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span>\n\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"n\">x0</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n            <span class=\"k\">if</span> <span class=\"nb\">min</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"nb\">min</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"nb\">min</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;minimum bound length must match x0&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"k\">if</span> <span class=\"nb\">max</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"nb\">max</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"nb\">max</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;maximum bound length must match x0&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">x0</span><span class=\"p\">]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">min</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"nb\">min</span><span class=\"p\">]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">max</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"nb\">max</span><span class=\"p\">]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gain</span> <span class=\"o\">=</span> <span class=\"n\">gain</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">]</span>\n\n<div class=\"viewcode-block\" id=\"DIntegrator.next\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.DIntegrator.next\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">next</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">xnext</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gain</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">*</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n        <span class=\"k\">return</span> <span class=\"n\">xnext</span></div></div>\n\n<div class=\"viewcode-block\" id=\"DPoseIntegrator\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.DPoseIntegrator\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">DPoseIntegrator</span><span class=\"p\">(</span><span class=\"n\">ClockedBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`DPOSEINTEGRATOR`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 1          | 1       | N       |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | A(6,)      | SE3     |         |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;ν&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;ξ&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"DPoseIntegrator.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.DPoseIntegrator.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">clock</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Discrete-time spatial velocity integrator.</span>\n\n<span class=\"sd\">        :param clock: clock source</span>\n<span class=\"sd\">        :type clock: Clock</span>\n<span class=\"sd\">        :param x0: Initial pose, defaults to null</span>\n<span class=\"sd\">        :type x0: SE3, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: an DPOSEINTEGRATOR block</span>\n<span class=\"sd\">        :rtype: Integrator instance</span>\n\n<span class=\"sd\">        This block integrates spatial velocity over time.</span>\n<span class=\"sd\">        The block input is a spatial velocity as a 6-vector</span>\n<span class=\"sd\">        :math:`(v_x, v_y, v_z, \\omega_x, \\omega_y, \\omega_z)` and the output</span>\n<span class=\"sd\">        is pose as an ``SE3`` instance.</span>\n\n<span class=\"sd\">        .. note:: State is a velocity twist.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">clock</span><span class=\"o\">=</span><span class=\"n\">clock</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">Twist3</span><span class=\"p\">()</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">SE3</span><span class=\"p\">):</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">Twist3</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">A</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">Twist3</span><span class=\"p\">):</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span><span class=\"o\">.</span><span class=\"n\">A</span>\n        <span class=\"k\">elif</span> <span class=\"n\">isvector</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"mi\">6</span><span class=\"p\">):</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"mi\">6</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"mi\">6</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;nstates&#39;</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">Twist3</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">SE3</span><span class=\"p\">()]</span>\n\n<div class=\"viewcode-block\" id=\"DPoseIntegrator.next\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.discrete.DPoseIntegrator.next\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">next</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">T_delta</span> <span class=\"o\">=</span> <span class=\"n\">SE3</span><span class=\"o\">.</span><span class=\"n\">Delta</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">)</span>\n        <span class=\"n\">pose</span> <span class=\"o\">=</span> <span class=\"n\">Twist3</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">SE3</span><span class=\"p\">()</span> <span class=\"o\">*</span> <span class=\"n\">T_delta</span>\n        <span class=\"k\">return</span> <span class=\"n\">Twist3</span><span class=\"p\">(</span><span class=\"n\">pose</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">A</span></div></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n\n<span class=\"c1\"># @block</span>\n<span class=\"c1\"># class LTI_SS(TransferBlock):</span>\n<span class=\"c1\">#     &quot;&quot;&quot;</span>\n<span class=\"c1\">#     :blockname:`LTI_SS`</span>\n    \n<span class=\"c1\">#     .. table::</span>\n<span class=\"c1\">#        :align: left</span>\n    \n<span class=\"c1\">#        +------------+---------+---------+</span>\n<span class=\"c1\">#        | inputs     | outputs |  states |</span>\n<span class=\"c1\">#        +------------+---------+---------+</span>\n<span class=\"c1\">#        | 1          | 01      | nc      |</span>\n<span class=\"c1\">#        +------------+---------+---------+</span>\n<span class=\"c1\">#        | float,     | float,  |         | </span>\n<span class=\"c1\">#        | A(nb,)     | A(nc,)  |         |</span>\n<span class=\"c1\">#        +------------+---------+---------+</span>\n<span class=\"c1\">#     &quot;&quot;&quot;</span>\n\n<span class=\"c1\">#     def __init__(self, *inputs, A=None, B=None, C=None, x0=None, verbose=False, **blockargs):</span>\n<span class=\"c1\">#         r&quot;&quot;&quot;</span>\n<span class=\"c1\">#         :param ``*inputs``: Optional incoming connections</span>\n<span class=\"c1\">#         :type ``*inputs``: Block or Plug</span>\n<span class=\"c1\">#         :param N: numerator coefficients, defaults to 1</span>\n<span class=\"c1\">#         :type N: array_like, optional</span>\n<span class=\"c1\">#         :param D: denominator coefficients, defaults to [1, 1]</span>\n<span class=\"c1\">#         :type D: array_like, optional</span>\n<span class=\"c1\">#         :param x0: initial states, defaults to zero</span>\n<span class=\"c1\">#         :type x0: array_like, optional</span>\n<span class=\"c1\">#         :param ``**blockargs``: |BlockOptions|</span>\n<span class=\"c1\">#         :return: A SCOPE block</span>\n<span class=\"c1\">#         :rtype: LTI_SISO instance</span>\n\n<span class=\"c1\">#         Create a state-space LTI block.</span>\n\n<span class=\"c1\">#         Describes the dynamics of a single-input single-output (SISO) linear</span>\n<span class=\"c1\">#         time invariant (LTI) system described by numerator and denominator</span>\n<span class=\"c1\">#         polynomial coefficients.</span>\n\n<span class=\"c1\">#         Coefficients are given in the order from highest order to zeroth </span>\n<span class=\"c1\">#         order, ie. :math:`2s^2 - 4s +3` is ``[2, -4, 3]``.</span>\n\n<span class=\"c1\">#         Only proper transfer functions, where order of numerator is less</span>\n<span class=\"c1\">#         than denominator are allowed.</span>\n\n<span class=\"c1\">#         The order of the states in ``x0`` is consistent with controller canonical</span>\n<span class=\"c1\">#         form.</span>\n\n<span class=\"c1\">#         Examples::</span>\n\n<span class=\"c1\">#             LTI_SISO(N=[1,2], D=[2, 3, -4])</span>\n\n<span class=\"c1\">#         is the transfer function :math:`\\frac{s+2}{2s^2+3s-4}`.</span>\n<span class=\"c1\">#         &quot;&quot;&quot;</span>\n<span class=\"c1\">#         #print(&#39;in SS constructor&#39;)</span>\n<span class=\"c1\">#         self.type = &#39;LTI SS&#39;</span>\n\n<span class=\"c1\">#         assert A.shape[0] == A.shape[1], &#39;A must be square&#39;</span>\n<span class=\"c1\">#         n = A.shape[0]</span>\n<span class=\"c1\">#         if len(B.shape) == 1:</span>\n<span class=\"c1\">#             nin = 1</span>\n<span class=\"c1\">#             B = B.reshape((n, 1))</span>\n<span class=\"c1\">#         else:</span>\n<span class=\"c1\">#             nin = B.shape[1]</span>\n<span class=\"c1\">#         assert B.shape[0] == n, &#39;B must have same number of rows as A&#39;</span>\n\n<span class=\"c1\">#         if len(C.shape) == 1:</span>\n<span class=\"c1\">#             nout = 1</span>\n<span class=\"c1\">#             assert C.shape[0] == n, &#39;C must have same number of columns as A&#39;</span>\n<span class=\"c1\">#             C = C.reshape((1, n))</span>\n<span class=\"c1\">#         else:</span>\n<span class=\"c1\">#             nout = C.shape[0]</span>\n<span class=\"c1\">#             assert C.shape[1] == n, &#39;C must have same number of columns as A&#39;</span>\n\n<span class=\"c1\">#         super().__init__(nin=nin, nout=nout, inputs=inputs, **blockargs)</span>\n\n<span class=\"c1\">#         self.A = A</span>\n<span class=\"c1\">#         self.B = B</span>\n<span class=\"c1\">#         self.C = C</span>\n\n<span class=\"c1\">#         self.nstates = A.shape[0]</span>\n\n<span class=\"c1\">#         if x0 is None:</span>\n<span class=\"c1\">#             self._x0 = np.zeros((self.nstates,))</span>\n<span class=\"c1\">#         else:</span>\n<span class=\"c1\">#             self._x0 = x0</span>\n\n<span class=\"c1\">#     def output(self, t=None):</span>\n<span class=\"c1\">#         return list(self.C @ self._x)</span>\n\n<span class=\"c1\">#     def deriv(self):</span>\n<span class=\"c1\">#         return self.A @ self._x + self.B @ np.array(self.inputs)</span>\n<span class=\"c1\"># # ------------------------------------------------------------------------ #</span>\n\n\n<span class=\"c1\"># @block</span>\n<span class=\"c1\"># class LTI_SISO(LTI_SS):</span>\n<span class=\"c1\">#     &quot;&quot;&quot;</span>\n<span class=\"c1\">#     :blockname:`LTI_SISO`</span>\n    \n<span class=\"c1\">#     .. table::</span>\n<span class=\"c1\">#        :align: left</span>\n    \n<span class=\"c1\">#        +------------+---------+---------+</span>\n<span class=\"c1\">#        | inputs     | outputs |  states |</span>\n<span class=\"c1\">#        +------------+---------+---------+</span>\n<span class=\"c1\">#        | 1          | 1       | n       |</span>\n<span class=\"c1\">#        +------------+---------+---------+</span>\n<span class=\"c1\">#        | float      | float   |         | </span>\n<span class=\"c1\">#        +------------+---------+---------+</span>\n     \n<span class=\"c1\">#     &quot;&quot;&quot;</span>\n\n<span class=\"c1\">#     def __init__(self, N=1, D=[1, 1], *inputs, x0=None, verbose=False, **blockargs):</span>\n<span class=\"c1\">#         r&quot;&quot;&quot;</span>\n<span class=\"c1\">#         :param N: numerator coefficients, defaults to 1</span>\n<span class=\"c1\">#         :type N: array_like, optional</span>\n<span class=\"c1\">#         :param D: denominator coefficients, defaults to [1, 1]</span>\n<span class=\"c1\">#         :type D: array_like, optional</span>\n<span class=\"c1\">#         :param ``*inputs``: Optional incoming connections</span>\n<span class=\"c1\">#         :type ``*inputs``: Block or Plug</span>\n<span class=\"c1\">#         :param x0: initial states, defaults to zero</span>\n<span class=\"c1\">#         :type x0: array_like, optional</span>\n<span class=\"c1\">#         :param ``**blockargs``: |BlockOptions|</span>\n<span class=\"c1\">#         :return: A SCOPE block</span>\n<span class=\"c1\">#         :rtype: LTI_SISO instance</span>\n\n<span class=\"c1\">#         Create a SISO LTI block.</span>\n\n<span class=\"c1\">#         Describes the dynamics of a single-input single-output (SISO) linear</span>\n<span class=\"c1\">#         time invariant (LTI) system described by numerator and denominator</span>\n<span class=\"c1\">#         polynomial coefficients.</span>\n\n<span class=\"c1\">#         Coefficients are given in the order from highest order to zeroth </span>\n<span class=\"c1\">#         order, ie. :math:`2s^2 - 4s +3` is ``[2, -4, 3]``.</span>\n\n<span class=\"c1\">#         Only proper transfer functions, where order of numerator is less</span>\n<span class=\"c1\">#         than denominator are allowed.</span>\n\n<span class=\"c1\">#         The order of the states in ``x0`` is consistent with controller canonical</span>\n<span class=\"c1\">#         form.</span>\n\n<span class=\"c1\">#         Examples::</span>\n\n<span class=\"c1\">#             LTI_SISO(N=[1, 2], D=[2, 3, -4])</span>\n\n<span class=\"c1\">#         is the transfer function :math:`\\frac{s+2}{2s^2+3s-4}`.</span>\n<span class=\"c1\">#         &quot;&quot;&quot;</span>\n<span class=\"c1\">#         #print(&#39;in SISO constscutor&#39;)</span>\n\n<span class=\"c1\">#         if not isinstance(N, list):</span>\n<span class=\"c1\">#             N = [N]</span>\n<span class=\"c1\">#         if not isinstance(D, list):</span>\n<span class=\"c1\">#             D = [D]</span>\n<span class=\"c1\">#         self.N = N</span>\n<span class=\"c1\">#         self.D = N</span>\n<span class=\"c1\">#         n = len(D) - 1</span>\n<span class=\"c1\">#         nn = len(N)</span>\n<span class=\"c1\">#         if x0 is None:</span>\n<span class=\"c1\">#             x0 = np.zeros((n,))</span>\n<span class=\"c1\">#         assert nn &lt;= n, &#39;direct pass through is not supported&#39;</span>\n\n<span class=\"c1\">#         # convert to numpy arrays</span>\n<span class=\"c1\">#         N = np.r_[np.zeros((len(D) - len(N),)), np.array(N)]</span>\n<span class=\"c1\">#         D = np.array(D)</span>\n\n<span class=\"c1\">#         # normalize the coefficients to obtain</span>\n<span class=\"c1\">#         #</span>\n<span class=\"c1\">#         #   b_0 s^n + b_1 s^(n-1) + ... + b_n</span>\n<span class=\"c1\">#         #   ---------------------------------</span>\n<span class=\"c1\">#         #   a_0 s^n + a_1 s^(n-1) + ....+ a_n</span>\n\n<span class=\"c1\">#         # normalize so leading coefficient of denominator is one</span>\n<span class=\"c1\">#         D0 = D[0]</span>\n<span class=\"c1\">#         D = D / D0</span>\n<span class=\"c1\">#         N = N / D0</span>\n\n<span class=\"c1\">#         A = np.eye(len(D) - 1, k=1)  # control canonic (companion matrix) form</span>\n<span class=\"c1\">#         A[-1, :] = -D[1:]</span>\n\n<span class=\"c1\">#         B = np.zeros((n, 1))</span>\n<span class=\"c1\">#         B[-1] = 1</span>\n\n<span class=\"c1\">#         C = (N[1:] - N[0] * D[1:]).reshape((1, n))</span>\n\n<span class=\"c1\">#         if verbose:</span>\n<span class=\"c1\">#             print(&#39;A=&#39;, A)</span>\n<span class=\"c1\">#             print(&#39;B=&#39;, B)</span>\n<span class=\"c1\">#             print(&#39;C=&#39;, C)</span>\n\n<span class=\"c1\">#         super().__init__(A=A, B=B, C=C, x0=x0, **blockargs)</span>\n<span class=\"c1\">#         self.type = &#39;LTI&#39;</span>\n\n\n<span class=\"c1\"># if __name__ == &quot;__main__&quot;:</span>\n\n<span class=\"c1\">#     import pathlib</span>\n<span class=\"c1\">#     import os.path</span>\n\n<span class=\"c1\">#     exec(open(os.path.join(pathlib.Path(</span>\n<span class=\"c1\">#         __file__).parent.absolute(), &quot;test_transfers.py&quot;)).read())</span>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blocks/functions.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.blocks.functions &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.blocks.functions</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.blocks.functions</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Function blocks:</span>\n\n<span class=\"sd\">- have inputs and outputs</span>\n<span class=\"sd\">- have no state variables</span>\n<span class=\"sd\">- are a subclass of ``FunctionBlock`` |rarr| ``Block``</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"c1\"># The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">import</span> <span class=\"nn\">scipy.interpolate</span>\n<span class=\"kn\">import</span> <span class=\"nn\">math</span>\n<span class=\"kn\">import</span> <span class=\"nn\">inspect</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">FunctionBlock</span>\n\n\n<span class=\"c1\"># PID</span>\n<span class=\"c1\"># product</span>\n<span class=\"c1\"># saturation</span>\n<span class=\"c1\"># transform 3D points</span>\n\n        \n<div class=\"viewcode-block\" id=\"Sum\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Sum\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Sum</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`SUM`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | len(signs) | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float,     | float,  |         | </span>\n<span class=\"sd\">    | A(N,),     | A(N,),  |         |</span>\n<span class=\"sd\">    | A(N,M)     | A(N,M)  |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    \n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Sum.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Sum.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">signs</span><span class=\"o\">=</span><span class=\"s1\">&#39;++&#39;</span><span class=\"p\">,</span> <span class=\"n\">angles</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Summing junction.</span>\n\n<span class=\"sd\">        :param signs: signs associated with input ports, accepted characters: + or -, defaults to &#39;++&#39;</span>\n<span class=\"sd\">        :type signs: str, optional</span>\n<span class=\"sd\">        :param angles: the signals are angles, wraps to [-pi,pi], defaults to False</span>\n<span class=\"sd\">        :type angles: bool, optional</span>\n<span class=\"sd\">        :param blockargs: common `Block options &lt;https://petercorke.github.io/bdsim/bdsim.html?highlight=block.__init__#bdsim.components.Block.__init__`_</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A SUM block</span>\n<span class=\"sd\">        :rtype: Sum instance</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">        Add or subtract input signals according to the `signs` string.  The</span>\n<span class=\"sd\">        number of input ports is the length of this string.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        For example::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            sum = bd.SUM(&#39;+-+&#39;)</span>\n\n<span class=\"sd\">        is a 3-input summing junction which computes port0 - port1 + port2.</span>\n\n<span class=\"sd\">        Implicit SUM blocks are created by::</span>\n\n<span class=\"sd\">            sum = block1 + block2</span>\n\n<span class=\"sd\">        which will create a summation block named &quot;_sum.N&quot;.</span>\n\n<span class=\"sd\">        .. note:: The signals must be compatible, all scalars, or all arrays </span>\n<span class=\"sd\">            of the same shape.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">signs</span><span class=\"p\">),</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">signs</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">),</span> <span class=\"s1\">&#39;first argument must be signs string&#39;</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">all</span><span class=\"p\">([</span><span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"s1\">&#39;+-&#39;</span> <span class=\"k\">for</span> <span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"n\">signs</span><span class=\"p\">]),</span> <span class=\"s1\">&#39;invalid sign&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">signs</span> <span class=\"o\">=</span> <span class=\"n\">signs</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">angles</span> <span class=\"o\">=</span> <span class=\"n\">angles</span></div>\n        \n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"nb\">input</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">):</span>\n            <span class=\"c1\"># code makes no assumption about types of inputs</span>\n            <span class=\"c1\"># NOTE: use sum = sum =/- input rather than sum +/-= input since</span>\n            <span class=\"c1\">#       these are references</span>\n            <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">signs</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;-&#39;</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"n\">i</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                    <span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"nb\">input</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"nb\">sum</span> <span class=\"o\">-</span> <span class=\"nb\">input</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"n\">i</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                    <span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"nb\">input</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"nb\">sum</span> <span class=\"o\">+</span> <span class=\"nb\">input</span>\n        \n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">angles</span><span class=\"p\">:</span>\n            <span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">mod</span><span class=\"p\">(</span><span class=\"nb\">sum</span> <span class=\"o\">+</span> <span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">pi</span><span class=\"p\">,</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">pi</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">pi</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"nb\">sum</span><span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Prod\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Prod\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Prod</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`PROD`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | len(ops)   | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float,     | float,  |         | </span>\n<span class=\"sd\">    | A(N,),     | A(N,),  |         |</span>\n<span class=\"sd\">    | A(N,M)     | A(N,M)  |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    \n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Prod.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Prod.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">ops</span><span class=\"o\">=</span><span class=\"s1\">&#39;**&#39;</span><span class=\"p\">,</span> <span class=\"n\">matrix</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Product junction.</span>\n\n<span class=\"sd\">        :param ops: operations associated with input ports, accepted characters: * or /, defaults to &#39;**&#39;</span>\n<span class=\"sd\">        :type ops: str, optional</span>\n<span class=\"sd\">        :param inputs: Optional incoming connections</span>\n<span class=\"sd\">        :type inputs: Block or Plug</span>\n<span class=\"sd\">        :param matrix: Arguments are matrices, defaults to False</span>\n<span class=\"sd\">        :type matrix: bool, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A PROD block</span>\n<span class=\"sd\">        :rtype: Prod instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Multiply or divide input signals according to the `ops` string.  The</span>\n<span class=\"sd\">        number of input ports is the length of this string.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        For example::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            prod = PROD(&#39;*/*&#39;)</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        is a 3-input product junction which computes port0 / port 1 * port2.</span>\n\n<span class=\"sd\">        Implicit PROD blocks are created by::</span>\n\n<span class=\"sd\">            sum = block1  block2</span>\n\n<span class=\"sd\">        which will create a summation block named &quot;_prod.N&quot;.</span>\n\n<span class=\"sd\">        .. note::</span>\n<span class=\"sd\">            - The inputs can be scalars or NumPy arrays.  </span>\n<span class=\"sd\">            - By default the ``*`` and ``/`` operators are used.</span>\n<span class=\"sd\">            - The option ``matrix`` will instead use ``@`` and ``@ np.linalg.inv()``.</span>\n<span class=\"sd\">              - the shapes of matrices must conform.</span>\n<span class=\"sd\">              - only square matrices are supported.</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">ops</span><span class=\"p\">),</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">ops</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">),</span> <span class=\"s1\">&#39;first argument must be signs string&#39;</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">all</span><span class=\"p\">([</span><span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"s1\">&#39;*/&#39;</span> <span class=\"k\">for</span> <span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"n\">ops</span><span class=\"p\">]),</span> <span class=\"s1\">&#39;invalid op&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ops</span> <span class=\"o\">=</span> <span class=\"n\">ops</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"n\">matrix</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"nb\">input</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span> <span class=\"n\">i</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ops</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;*&#39;</span><span class=\"p\">:</span>\n                    <span class=\"n\">prod</span> <span class=\"o\">=</span> <span class=\"nb\">input</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">matrix</span><span class=\"p\">:</span>\n                        <span class=\"n\">prod</span> <span class=\"o\">=</span> <span class=\"n\">numpy</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">)</span>\n                    <span class=\"n\">prod</span> <span class=\"o\">=</span> <span class=\"mf\">1.0</span> <span class=\"o\">/</span> <span class=\"nb\">input</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ops</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;*&#39;</span><span class=\"p\">:</span>\n                    <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">matrix</span><span class=\"p\">:</span>\n                        <span class=\"n\">prod</span> <span class=\"o\">=</span> <span class=\"n\">prod</span> <span class=\"o\">@</span> <span class=\"nb\">input</span>\n                    <span class=\"k\">else</span><span class=\"p\">:</span>\n                        <span class=\"n\">prod</span> <span class=\"o\">=</span> <span class=\"n\">prod</span> <span class=\"o\">*</span> <span class=\"nb\">input</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">matrix</span><span class=\"p\">:</span>\n                        <span class=\"n\">prod</span> <span class=\"o\">=</span> <span class=\"n\">prod</span> <span class=\"o\">@</span> <span class=\"n\">numpy</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">)</span>\n                    <span class=\"k\">else</span><span class=\"p\">:</span>\n                        <span class=\"n\">prod</span> <span class=\"o\">=</span> <span class=\"n\">prod</span> <span class=\"o\">/</span> <span class=\"nb\">input</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">prod</span><span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Gain\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Gain\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Gain</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`GAIN`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float,     | float,  |         | </span>\n<span class=\"sd\">    | A(N,),     | A(N,),  |         |</span>\n<span class=\"sd\">    | A(N,M)     | A(N,M)  |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Gain.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Gain.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">K</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">premul</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Gain block.</span>\n\n<span class=\"sd\">        :param K: The gain value, defaults to 1</span>\n<span class=\"sd\">        :type K: array_like</span>\n<span class=\"sd\">        :param premul: premultiply by constant, default is postmultiply, defaults to False</span>\n<span class=\"sd\">        :type premul: bool, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A GAIN block</span>\n<span class=\"sd\">        :rtype: Gain instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Scale the input signal. If the input is :math:`u` the output is :math:`u K`.</span>\n\n<span class=\"sd\">        Either or both the input and gain can be Numpy arrays and Numpy will</span>\n<span class=\"sd\">        compute the appropriate product :math:`u K`. </span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        If :math:`u` and ``K`` are both NumPy arrays the ``@`` operator is used</span>\n<span class=\"sd\">        and :math:`u` is postmultiplied by the gain. To premultiply by the gain, </span>\n<span class=\"sd\">        to compute :math:`K u` use the ``premul`` option.</span>\n\n<span class=\"sd\">        For example::</span>\n\n<span class=\"sd\">            gain = bd.GAIN(constant)</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">K</span>  <span class=\"o\">=</span> <span class=\"n\">K</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">premul</span> <span class=\"o\">=</span> <span class=\"n\">premul</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_param</span><span class=\"p\">(</span><span class=\"s1\">&#39;K&#39;</span><span class=\"p\">)</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"nb\">input</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        \n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">K</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n            <span class=\"c1\"># array x array case</span>\n            <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">premul</span><span class=\"p\">:</span>\n                <span class=\"c1\"># premultiply by gain</span>\n                <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">K</span> <span class=\"o\">@</span> <span class=\"nb\">input</span><span class=\"p\">]</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"c1\"># postmultiply by gain</span>\n                <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"nb\">input</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">K</span><span class=\"p\">]</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">K</span><span class=\"p\">]</span></div>\n        \n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Clip\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Clip\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Clip</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`CLIP`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float,     | float,  |         | </span>\n<span class=\"sd\">    | A(N,)      | A(N,)   |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Clip.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Clip.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"nb\">min</span><span class=\"o\">=-</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">,</span> <span class=\"nb\">max</span><span class=\"o\">=</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Signal clipping.</span>\n\n<span class=\"sd\">        :param min: Minimum value, defaults to -math.inf</span>\n<span class=\"sd\">        :type min: float or array_like, optional</span>\n<span class=\"sd\">        :param max: Maximum value, defaults to math.inf</span>\n<span class=\"sd\">        :type max: float or array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A CLIP block</span>\n<span class=\"sd\">        :rtype: Clip instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The input signal is clipped to the range from ``minimum`` to ``maximum`` inclusive.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The signal can be a 1D-array in which case each element is clipped.  The</span>\n<span class=\"sd\">        minimum and maximum values can be:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            - a scalar, in which case the same value applies to every element of </span>\n<span class=\"sd\">              the input vector , or</span>\n<span class=\"sd\">            - a 1D-array, of the same shape as the input vector that applies elementwise to</span>\n<span class=\"sd\">              the input vector.</span>\n\n<span class=\"sd\">        For example::</span>\n\n<span class=\"sd\">            clip = bd.CLIP()</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">min</span> <span class=\"o\">=</span> <span class=\"nb\">min</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">max</span> <span class=\"o\">=</span> <span class=\"nb\">max</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"nb\">input</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        \n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">clip</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">min</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">max</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"nb\">min</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">max</span><span class=\"p\">,</span> <span class=\"nb\">max</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">min</span><span class=\"p\">))</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span> <span class=\"n\">out</span> <span class=\"p\">]</span></div>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<span class=\"c1\"># TODO can have multiple outputs: pass in a tuple of functions, return a tuple</span>\n<div class=\"viewcode-block\" id=\"Function\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Function\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Function</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`FUNCTION`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | nin        | nout    | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | any        | any     |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\"> </span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Function.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Function.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">func</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">persistent</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">args</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">kwargs</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n    \n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Python function.</span>\n\n<span class=\"sd\">        :param func: A function or lambda, or list thereof, defaults to None</span>\n<span class=\"sd\">        :type func: callable or sequence of callables, optional</span>\n<span class=\"sd\">        :param nin: number of inputs, defaults to 1</span>\n<span class=\"sd\">        :type nin: int, optional</span>\n<span class=\"sd\">        :param nout: number of outputs, defaults to 1</span>\n<span class=\"sd\">        :type nout: int, optional</span>\n<span class=\"sd\">        :param persistent: pass in a reference to a dictionary instance to hold persistent state, defaults to False</span>\n<span class=\"sd\">        :type persistent: bool, optional</span>\n<span class=\"sd\">        :param args: extra positional arguments passed to the function, defaults to []</span>\n<span class=\"sd\">        :type args: list, optional</span>\n<span class=\"sd\">        :param kwargs: extra keyword arguments passed to the function, defaults to {}</span>\n<span class=\"sd\">        :type kwargs: dict, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict, optional</span>\n<span class=\"sd\">        :return: A FUNCTION block</span>\n<span class=\"sd\">        :rtype: A Function instance</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">        Inputs to the block are passed as separate arguments to the function.  </span>\n<span class=\"sd\">        Programmatic ositional or keyword arguments can also be passed to the function.</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">        A block with one output port that sums its two input ports is::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            FUNCTION(lambda u1, u2: u1+u2, nin=2)</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        A block with a function that takes two inputs and has two additional arguments::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            def myfun(u1, u2, param1, param2):</span>\n<span class=\"sd\">                pass</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            FUNCTION(myfun, nin=2, args=(p1,p2))</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        If we need access to persistent (static) data, to keep some state::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            def myfun(u1, u2, param1, param2, state):</span>\n<span class=\"sd\">                pass</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            FUNCTION(myfun, nin=2, args=(p1,p2), persistent=True)</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        where a dictionary is passed in as the last argument and which is kept from call to call.</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        A block with a function that takes two inputs and additional keyword arguments::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            def myfun(u1, u2, param1=1, param2=2, param3=3, param4=4):</span>\n<span class=\"sd\">                pass</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            FUNCTION(myfun, nin=2, kwargs=dict(param2=7, param3=8))</span>\n<span class=\"sd\">                     </span>\n<span class=\"sd\">        A block with two inputs and two outputs, the outputs are defined by two lambda</span>\n<span class=\"sd\">        functions with the same inputs::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            FUNCTION( [ lambda x, y: x_t, lambda x, y: x* y])</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        A block with two inputs and two outputs, the outputs are defined by a </span>\n<span class=\"sd\">        single function which returns a list::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            def myfun(u1, u2):</span>\n<span class=\"sd\">                return [ u1+u2, u1*u2 ]</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            FUNCTION( myfun, nin=2, nout=2)</span>\n\n<span class=\"sd\">        For example::</span>\n\n<span class=\"sd\">            func = bd.FUNCTION(myfun, args)</span>\n\n<span class=\"sd\">        If inputs are specified then connections are automatically made and</span>\n<span class=\"sd\">        are assigned to sequential input ports::</span>\n\n<span class=\"sd\">            func = bd.FUNCTION(myfun, block1, block2, args)</span>\n\n<span class=\"sd\">        is equivalent to::</span>\n\n<span class=\"sd\">            func = bd.FUNCTION(myfun, args)</span>\n<span class=\"sd\">            bd.connect(block1, func[0])</span>\n<span class=\"sd\">            bd.connect(block2, func[1])</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"n\">nout</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">args</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">args</span> <span class=\"o\">=</span> <span class=\"nb\">list</span><span class=\"p\">()</span>\n        <span class=\"k\">if</span> <span class=\"n\">kwargs</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">kwargs</span> <span class=\"o\">=</span> <span class=\"nb\">dict</span><span class=\"p\">()</span>\n            \n        <span class=\"c1\"># TODO, don&#39;t know why this happens</span>\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">args</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span> <span class=\"ow\">and</span> <span class=\"n\">args</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"p\">{}:</span>\n            <span class=\"n\">args</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">func</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">list</span><span class=\"p\">,</span> <span class=\"nb\">tuple</span><span class=\"p\">)):</span>\n            <span class=\"k\">for</span> <span class=\"n\">f</span> <span class=\"ow\">in</span> <span class=\"n\">func</span><span class=\"p\">:</span>\n                <span class=\"k\">assert</span> <span class=\"n\">callable</span><span class=\"p\">(</span><span class=\"n\">f</span><span class=\"p\">),</span> <span class=\"s1\">&#39;Function must be a callable&#39;</span>\n                <span class=\"k\">if</span> <span class=\"n\">kwargs</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                    <span class=\"c1\"># we can check the number of arguments</span>\n                    <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">inspect</span><span class=\"o\">.</span><span class=\"n\">signature</span><span class=\"p\">(</span><span class=\"n\">func</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parameters</span><span class=\"p\">)</span>\n                    <span class=\"k\">if</span> <span class=\"n\">persistent</span><span class=\"p\">:</span>\n                        <span class=\"n\">n</span> <span class=\"o\">-=</span> <span class=\"mi\">1</span>  <span class=\"c1\"># discount dict if used</span>\n                    <span class=\"k\">if</span> <span class=\"n\">nin</span> <span class=\"o\">+</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">args</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"n\">n</span><span class=\"p\">:</span>\n                        <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span>\n    <span class=\"sa\">f</span><span class=\"s2\">&quot;argument count mismatch: function has </span><span class=\"si\">{</span><span class=\"n\">n</span><span class=\"si\">}</span><span class=\"s2\"> args, dict=</span><span class=\"si\">{</span><span class=\"nb\">dict</span><span class=\"si\">}</span><span class=\"s2\">, nin=</span><span class=\"si\">{</span><span class=\"n\">nin</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span>\n                                        <span class=\"p\">)</span>\n        <span class=\"k\">elif</span> <span class=\"n\">callable</span><span class=\"p\">(</span><span class=\"n\">func</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">kwargs</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"c1\"># we can check the number of arguments</span>\n                <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">inspect</span><span class=\"o\">.</span><span class=\"n\">signature</span><span class=\"p\">(</span><span class=\"n\">func</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parameters</span><span class=\"p\">)</span>\n                <span class=\"k\">if</span> <span class=\"n\">persistent</span><span class=\"p\">:</span>\n                    <span class=\"n\">n</span> <span class=\"o\">-=</span> <span class=\"mi\">1</span>  <span class=\"c1\"># discount dict if used</span>\n                <span class=\"k\">if</span> <span class=\"n\">nin</span> <span class=\"o\">+</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">args</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"n\">n</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span>\n    <span class=\"sa\">f</span><span class=\"s2\">&quot;argument count mismatch: function has </span><span class=\"si\">{</span><span class=\"n\">n</span><span class=\"si\">}</span><span class=\"s2\"> args, dict=</span><span class=\"si\">{</span><span class=\"nb\">dict</span><span class=\"si\">}</span><span class=\"s2\">, nin=</span><span class=\"si\">{</span><span class=\"n\">nin</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span>\n                                    <span class=\"p\">)</span>\n            <span class=\"c1\"># self.nout = nout</span>\n            \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">func</span>  <span class=\"o\">=</span> <span class=\"n\">func</span>\n        <span class=\"k\">if</span> <span class=\"n\">persistent</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">userdata</span> <span class=\"o\">=</span> <span class=\"nb\">dict</span><span class=\"p\">()</span>\n            <span class=\"n\">args</span> <span class=\"o\">+=</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">userdata</span><span class=\"p\">,)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">userdata</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">args</span> <span class=\"o\">=</span> <span class=\"n\">args</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">kwargs</span> <span class=\"o\">=</span> <span class=\"n\">kwargs</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">()</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">userdata</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">userdata</span><span class=\"o\">.</span><span class=\"n\">clear</span><span class=\"p\">()</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;clearing user data&#39;</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"n\">callable</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">func</span><span class=\"p\">):</span>\n            <span class=\"c1\"># single function</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">val</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">func</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n            <span class=\"k\">except</span> <span class=\"ne\">TypeError</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;Function invocation failed, check number of arguments&#39;</span><span class=\"p\">)</span> <span class=\"kn\">from</span> <span class=\"bp\">None</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">val</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">list</span><span class=\"p\">,</span> <span class=\"nb\">tuple</span><span class=\"p\">)):</span>\n                <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">val</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;Function returns wrong number of arguments: &#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">))</span>\n                <span class=\"k\">return</span> <span class=\"n\">val</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span> <span class=\"o\">!=</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;Function returns wrong number of arguments: &#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">))</span>\n                <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">val</span><span class=\"p\">]</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"c1\"># list of functions</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n            <span class=\"k\">for</span> <span class=\"n\">f</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">func</span><span class=\"p\">:</span>\n                <span class=\"k\">try</span><span class=\"p\">:</span>\n                    <span class=\"n\">val</span> <span class=\"o\">=</span> <span class=\"n\">f</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n                <span class=\"k\">except</span> <span class=\"ne\">TypeError</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;Function invocation failed, check number of arguments&#39;</span><span class=\"p\">)</span> <span class=\"kn\">from</span> <span class=\"bp\">None</span>\n                <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">val</span><span class=\"p\">)</span>\n            <span class=\"k\">return</span> <span class=\"n\">out</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Interpolate\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Interpolate\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Interpolate</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`INTERPOLATE`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 0 or 1     | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float      | any     |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Interpolate.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.functions.Interpolate.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">xy</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">time</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">kind</span><span class=\"o\">=</span><span class=\"s1\">&#39;linear&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Interpolate signal.</span>\n\n<span class=\"sd\">        :param x: x-values of function, defaults to None</span>\n<span class=\"sd\">        :type x: array_like, shape (N,) optional</span>\n<span class=\"sd\">        :param y: y-values of function, defaults to None</span>\n<span class=\"sd\">        :type y: array_like, optional</span>\n<span class=\"sd\">        :param xy: combined x- and y-values of function, defaults to None</span>\n<span class=\"sd\">        :type xy: array_like, optional</span>\n<span class=\"sd\">        :param time: x new is simulation time, defaults to False</span>\n<span class=\"sd\">        :type time: bool, optional</span>\n<span class=\"sd\">        :param kind: interpolation method, defaults to &#39;linear&#39;</span>\n<span class=\"sd\">        :type kind: str, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: An INTERPOLATE block</span>\n<span class=\"sd\">        :rtype: An Interpolate instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Interpolate the input signal using to a piecewise function.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        A simple triangle function with domain [0,10] and range [0,1] can be</span>\n<span class=\"sd\">        defined by::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            INTERPOLATE(x=(0,5,10), y=(0,1,0))</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        We might also express this as a list of 2D-coordinats::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            INTERPOLATE(xy=[(0,0), (5,1), (10,0)])</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The data can also be expressed as Numpy arrays.  If that is the case,</span>\n<span class=\"sd\">        the interpolation function can be vector valued. ``x`` has a shape of</span>\n<span class=\"sd\">        (N,1) and ``y`` has a shape of (N,M).  Alternatively ``xy`` has a shape</span>\n<span class=\"sd\">        of (N,M+1) and the first column is the x-data.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The input to the interpolator comes from:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        - Input port 0</span>\n<span class=\"sd\">        - Simulation time, if ``time=True``.  In this case the block has no</span>\n<span class=\"sd\">          input ports and is a ``Source`` not a ``Function``.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span> <span class=\"o\">=</span> <span class=\"n\">time</span>\n        <span class=\"k\">if</span> <span class=\"n\">time</span><span class=\"p\">:</span>\n            <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;source&#39;</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">xy</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"c1\"># process separate x and y vectors</span>\n            <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span>\n            <span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">y</span><span class=\"p\">)</span>\n            <span class=\"k\">assert</span> <span class=\"n\">x</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"n\">y</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"s1\">&#39;x and y data must be same length&#39;</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"c1\"># process mixed xy data</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">xy</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">list</span><span class=\"p\">,</span> <span class=\"nb\">tuple</span><span class=\"p\">)):</span>\n                <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">_</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"k\">for</span> <span class=\"n\">_</span> <span class=\"ow\">in</span> <span class=\"n\">xy</span><span class=\"p\">]</span>\n                <span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">_</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"k\">for</span> <span class=\"n\">_</span> <span class=\"ow\">in</span> <span class=\"n\">xy</span><span class=\"p\">]</span>\n                <span class=\"c1\"># x = np.array(x).T</span>\n                <span class=\"c1\"># y = np.array(y).T</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">)</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">xy</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n                <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">xy</span><span class=\"p\">[:,</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n                <span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"n\">xy</span><span class=\"p\">[:,</span><span class=\"mi\">1</span><span class=\"p\">:]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"n\">scipy</span><span class=\"o\">.</span><span class=\"n\">interpolate</span><span class=\"o\">.</span><span class=\"n\">interp1d</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"o\">=</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"o\">=</span><span class=\"n\">y</span><span class=\"p\">,</span> <span class=\"n\">kind</span><span class=\"o\">=</span><span class=\"n\">kind</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">x</span></div>\n                \n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">&gt;=</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"s1\">&#39;interpolation not defined for t&lt;0&#39;</span>\n            <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">x</span><span class=\"p\">[</span><span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">&lt;=</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"s1\">&#39;interpolation not defined for t&gt;T&#39;</span>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span><span class=\"p\">:</span>\n            <span class=\"n\">xnew</span> <span class=\"o\">=</span> <span class=\"n\">t</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">xnew</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">f</span><span class=\"p\">(</span><span class=\"n\">xnew</span><span class=\"p\">)]</span></div>\n\n\n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">import</span> <span class=\"nn\">pathlib</span>\n    <span class=\"kn\">import</span> <span class=\"nn\">os.path</span>\n\n    <span class=\"n\">exec</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">(</span><span class=\"vm\">__file__</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">absolute</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;test_functions.py&quot;</span><span class=\"p\">))</span><span class=\"o\">.</span><span class=\"n\">read</span><span class=\"p\">())</span>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blocks/linalg.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.blocks.linalg &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.blocks.linalg</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.blocks.linalg</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Linear algebra blocks:</span>\n\n<span class=\"sd\">- have inputs and outputs</span>\n<span class=\"sd\">- have no state variables</span>\n<span class=\"sd\">- are a subclass of ``FunctionBlock`` |rarr| ``Block``</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"c1\"># The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">import</span> <span class=\"nn\">math</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">FunctionBlock</span>\n\n<div class=\"viewcode-block\" id=\"Inverse\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Inverse\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Inverse</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`INVERSE`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +----------+---------+---------+</span>\n<span class=\"sd\">    | inputs   | outputs |  states |</span>\n<span class=\"sd\">    +----------+---------+---------+</span>\n<span class=\"sd\">    | 1        | 2       | 0       |</span>\n<span class=\"sd\">    +----------+---------+---------+</span>\n<span class=\"sd\">    | A(M,N)   | A(N,M)  |         | </span>\n<span class=\"sd\">    |          | float   |         |</span>\n<span class=\"sd\">    +----------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n\n    <span class=\"n\">onames</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;inv&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;cond&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"Inverse.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Inverse.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">pinv</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Matrix inverse.</span>\n\n<span class=\"sd\">        :param pinv: force pseudo inverse, defaults to False</span>\n<span class=\"sd\">        :type pinv: bool, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: An INVERSE block</span>\n<span class=\"sd\">        :rtype: Inverse instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Compute inverse of the 2D-array input signal.  If the matrix is square</span>\n<span class=\"sd\">        the inverse is computed unless the ``pinv`` flag is True.  For a</span>\n<span class=\"sd\">        non-square matrix the pseudo-inverse is used.  The condition number is</span>\n<span class=\"sd\">        output on the second port.</span>\n\n<span class=\"sd\">        :seealso: :func:`numpy.linalg.inv` :func:`numpy.linalg.pinv` :func:`numpy.linalg.cond`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;inverse&#39;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pinv</span> <span class=\"o\">=</span> <span class=\"n\">pinv</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n\n        <span class=\"n\">mat</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">mat</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span> <span class=\"n\">mat</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">!=</span> <span class=\"n\">mat</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]:</span>\n                <span class=\"n\">pinv</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">pinv</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pinv</span>\n\n            <span class=\"k\">if</span> <span class=\"n\">pinv</span><span class=\"p\">:</span>\n                <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">pinv</span><span class=\"p\">(</span><span class=\"n\">mat</span><span class=\"p\">)</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"k\">try</span><span class=\"p\">:</span>\n                    <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"n\">mat</span><span class=\"p\">)</span>\n                <span class=\"k\">except</span> <span class=\"n\">LinAlgError</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;matrix is singular&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">cond</span><span class=\"p\">(</span><span class=\"n\">mat</span><span class=\"p\">)]</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"n\">mat</span><span class=\"p\">,</span> <span class=\"s1\">&#39;inv&#39;</span><span class=\"p\">):</span>\n            <span class=\"c1\"># ask the object to invert itself</span>\n            <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">mat</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(),</span> <span class=\"kc\">None</span><span class=\"p\">]</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;object cannot be inverted&#39;</span><span class=\"p\">)</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Transpose\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Transpose\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Transpose</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`TRANSPOSE`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | A(M,N)     | A(N,M)  |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Transpose.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Transpose.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Matrix transpose.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A TRANSPOSE block</span>\n<span class=\"sd\">        :rtype: Transpose instance</span>\n\n<span class=\"sd\">        Compute transpose of the 2D-array input signal.</span>\n\n<span class=\"sd\">        .. note::</span>\n<span class=\"sd\">            - An input 1D-array of shape (N,) is turned into a 2D-array column vector</span>\n<span class=\"sd\">              with shape (N,1).</span>\n<span class=\"sd\">            - An input 2D-array column vector of shape (N,1) becomes a 2D-array</span>\n<span class=\"sd\">             row vector with shape (1,N).</span>\n\n<span class=\"sd\">        :seealso: :func:`numpy.transpose`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;transpose&#39;</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">mat</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">ndim</span> <span class=\"o\">==</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">mat</span><span class=\"o\">.</span><span class=\"n\">reshape</span><span class=\"p\">((</span><span class=\"n\">mat</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"mi\">1</span><span class=\"p\">))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">mat</span><span class=\"o\">.</span><span class=\"n\">T</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Norm\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Norm\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Norm</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`NORM`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | A(N,)      | float   |         | </span>\n<span class=\"sd\">    | A(N,M)     |         |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Norm.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Norm.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"nb\">ord</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Array norm.</span>\n\n<span class=\"sd\">        :param axis: specifies the axis along which to compute the vector norms, defaults to None.</span>\n<span class=\"sd\">        :type axis: int, optional</span>\n<span class=\"sd\">        :param ord: Order of the norm, default to None.</span>\n<span class=\"sd\">        :type ord: int or str</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A NORM block</span>\n<span class=\"sd\">        :rtype: Norm instance</span>\n\n<span class=\"sd\">        Computes the specified norm for a 1D- or 2D-array.</span>\n\n<span class=\"sd\">        :seealso: :func:`numpy.linalg.norm`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;norm&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">args</span> <span class=\"o\">=</span> <span class=\"nb\">dict</span><span class=\"p\">(</span><span class=\"nb\">ord</span><span class=\"o\">=</span><span class=\"nb\">ord</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"n\">axis</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">vec</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">norm</span><span class=\"p\">(</span><span class=\"n\">vec</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">args</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Flatten\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Flatten\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Flatten</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`FLATTEN`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | A(N,M )    | A(NM,)  |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Flatten.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Flatten.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">order</span><span class=\"o\">=</span><span class=\"s1\">&#39;C&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Flatten a multi-dimensional array.</span>\n\n<span class=\"sd\">        :param order: flattening order, either &quot;C&quot; or &quot;F&quot;, defaults to &quot;C&quot;</span>\n<span class=\"sd\">        :type order: str</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A FLATTEN block</span>\n<span class=\"sd\">        :rtype: Flatten instance</span>\n\n<span class=\"sd\">        Flattens the incoming array in either row major (&#39;C&#39;) or column major (&#39;F&#39;) order.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :seealso: :func:`numpy.flatten`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;flatten&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">order</span> <span class=\"o\">=</span> <span class=\"n\">order</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">vec</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">vec</span><span class=\"o\">.</span><span class=\"n\">flatten</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">order</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Slice2\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Slice2\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Slice2</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`SLICE2`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | A(N,M)     | A(K,L)  |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Slice2.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Slice2.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">rows</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">cols</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Slice out subarray of 2D-array.</span>\n\n<span class=\"sd\">        :param rows: row selection, defaults to None</span>\n<span class=\"sd\">        :type rows: tuple(3) or list</span>\n<span class=\"sd\">        :param cols: column selection, defaults to None</span>\n<span class=\"sd\">        :type cols: tuple(3) or list</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A SLICE2 block</span>\n<span class=\"sd\">        :rtype: Slice2 instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Compute a 2D slice of input 2D array.</span>\n\n<span class=\"sd\">        If ``rows`` or ``cols`` is ``None`` it means all rows or columns</span>\n<span class=\"sd\">        respectively.</span>\n\n<span class=\"sd\">        If ``rows`` or ``cols`` is a list, perform NumPy fancy indexing, returning</span>\n<span class=\"sd\">        the specified rows or columns</span>\n\n<span class=\"sd\">        Example::</span>\n\n<span class=\"sd\">            SLICE2(rows=[2,3])  # return rows 2 and 3, all columns</span>\n<span class=\"sd\">            SLICE2(cols=[4,1])  # return columns 4 and 1, all rows</span>\n<span class=\"sd\">            SLICE2(rows=[2,3], cols=[4,1]) # return elements [2,4] and [3,1] as a 1D array</span>\n\n<span class=\"sd\">        If a single row or column is selected, the result will be a 1D array</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        If ``rows`` or ``cols`` is a tuple, it must have three elements.  It</span>\n<span class=\"sd\">        describes a Python slice ``(start, stop, step)`` where any element can be ``None``</span>\n\n<span class=\"sd\">            * ``start=None`` means start at first element</span>\n<span class=\"sd\">            * ``stop=None`` means finish at last element</span>\n<span class=\"sd\">            * ``step=None`` means step by one</span>\n\n<span class=\"sd\">        ``rows=None`` is equivalent to ``rows=(None, None, None)``.</span>\n\n<span class=\"sd\">        Example::</span>\n\n<span class=\"sd\">            SLICE2(rows=(None,None,2))  # return every second row</span>\n<span class=\"sd\">            SLICE2(cols=(None,None,-1)) # reverse the columns</span>\n\n<span class=\"sd\">        The list and tuple notation can be mixed, for example, one for rows</span>\n<span class=\"sd\">        and one for columns.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :seealso: :class:`Slice1` :class:`Index`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;slice2&#39;</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">rows</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">rows</span> <span class=\"o\">=</span> <span class=\"nb\">slice</span><span class=\"p\">()</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">rows</span><span class=\"p\">,</span> <span class=\"nb\">list</span><span class=\"p\">):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">rows</span> <span class=\"o\">=</span>  <span class=\"n\">rows</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">rows</span><span class=\"p\">,</span> <span class=\"nb\">tuple</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">rows</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">3</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">rows</span> <span class=\"o\">=</span> <span class=\"nb\">slice</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">rows</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;bad rows specifier&#39;</span><span class=\"p\">)</span>\n            \n        <span class=\"k\">if</span> <span class=\"n\">cols</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">cols</span> <span class=\"o\">=</span> <span class=\"nb\">slice</span><span class=\"p\">()</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">cols</span><span class=\"p\">,</span> <span class=\"nb\">list</span><span class=\"p\">):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">rows</span> <span class=\"o\">=</span>  <span class=\"n\">cols</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">cols</span><span class=\"p\">,</span> <span class=\"nb\">tuple</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">cols</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">3</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">cols</span> <span class=\"o\">=</span> <span class=\"nb\">slice</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">cols</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;bad rows specifier&#39;</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">array</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"n\">array</span><span class=\"o\">.</span><span class=\"n\">ndim</span> <span class=\"o\">!=</span> <span class=\"mi\">2</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;flatten2 block expecting 2d array&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">[</span><span class=\"n\">rows</span><span class=\"p\">,</span> <span class=\"n\">cols</span><span class=\"p\">]]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Slice1\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Slice1\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Slice1</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`SLICE1`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | A(N)       | A(M)    |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Slice1.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Slice1.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">index</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Slice out subarray of 1D-array.</span>\n\n<span class=\"sd\">        :param index: slice, defaults to None</span>\n<span class=\"sd\">        :type index: tuple(3)</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A SLICE1 block</span>\n<span class=\"sd\">        :rtype: Slice1 instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Compute a 1D slice of input 1D array.</span>\n\n<span class=\"sd\">        If ``index`` is ``None`` it means all elements.</span>\n\n<span class=\"sd\">        If ``index`` is a list, perform NumPy fancy indexing, returning</span>\n<span class=\"sd\">        the specified elements</span>\n\n<span class=\"sd\">        Example::</span>\n\n<span class=\"sd\">            SLICE1(index=[2,3]) # return elements 2 and 3 as a 1D array</span>\n<span class=\"sd\">            SLICE1(index=[2])   # return element 2 as a 1D array</span>\n<span class=\"sd\">            SLICE1(index=2)     # return element 2 as a NumPy scalar</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        If ``index`` is a tuple, it must have three elements.  It</span>\n<span class=\"sd\">        describes a Python slice ``(start, stop, step)`` where any element can be ``None``</span>\n\n<span class=\"sd\">            * ``start=None`` means start at first element</span>\n<span class=\"sd\">            * ``stop=None`` means finish at last element</span>\n<span class=\"sd\">            * ``step=None`` means step by one</span>\n\n<span class=\"sd\">        ``rows=None`` is equivalent to ``rows=(None, None, None)``.</span>\n\n<span class=\"sd\">        Example::</span>\n\n<span class=\"sd\">            SLICE1(index=(None,None,2))  # return every second element</span>\n<span class=\"sd\">            SLICE1(index=(None,None,-1)) # reverse the elements</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :seealso: :class:`Slice1`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;slice1&#39;</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">index</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span> <span class=\"o\">=</span> <span class=\"nb\">slice</span><span class=\"p\">()</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">index</span><span class=\"p\">,</span> <span class=\"nb\">list</span><span class=\"p\">):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span> <span class=\"o\">=</span>  <span class=\"n\">index</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">index</span><span class=\"p\">,</span> <span class=\"nb\">tuple</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">index</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">3</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span> <span class=\"o\">=</span> <span class=\"nb\">slice</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">index</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;bad index specifier&#39;</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">array</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"n\">array</span><span class=\"o\">.</span><span class=\"n\">ndim</span> <span class=\"o\">!=</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;flatten1 block expecting 1d array&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">array</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">index</span><span class=\"p\">]]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Det\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Det\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Det</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`DET`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | A(N,N)     | float   |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Det.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Det.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Matrix determinant</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A DET block</span>\n<span class=\"sd\">        :rtype: Det instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Compute the matrix determinant.</span>\n\n<span class=\"sd\">        :seealso: :func:`numpy.linalg.inv`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;det&#39;</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">mat</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">det</span><span class=\"p\">(</span><span class=\"n\">mat</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">mat</span><span class=\"p\">]</span></div>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Cond\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Cond\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Cond</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`COND`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | A(N,M)     | float   |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Cond.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.linalg.Cond.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Compute the matrix condition number.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A COND block</span>\n<span class=\"sd\">        :rtype: Cond instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :seealso: :func:`numpy.linalg.cond`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;cond&#39;</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">mat</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">cond</span><span class=\"p\">(</span><span class=\"n\">mat</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">mat</span><span class=\"p\">]</span></div>\n\n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">import</span> <span class=\"nn\">pathlib</span>\n    <span class=\"kn\">import</span> <span class=\"nn\">os.path</span>\n\n    <span class=\"n\">exec</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">(</span><span class=\"vm\">__file__</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">absolute</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;test_functions.py&quot;</span><span class=\"p\">))</span><span class=\"o\">.</span><span class=\"n\">read</span><span class=\"p\">())</span>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blocks/robots.html",
    "content": "\n<!DOCTYPE html>\n\n<html>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n    <title>bdsim.blocks.robots &#8212; Block diagram simulation 0.7 documentation</title>\n    <link rel=\"stylesheet\" href=\"../../../_static/alabaster.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../../_static/graphviz.css\" />\n    <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n    <script src=\"../../../_static/jquery.js\"></script>\n    <script src=\"../../../_static/underscore.js\"></script>\n    <script src=\"../../../_static/doctools.js\"></script>\n    <script src=\"../../../_static/language_data.js\"></script>\n    <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" />\n   \n  <link rel=\"stylesheet\" href=\"../../../_static/custom.css\" type=\"text/css\" />\n  \n  \n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=0.9, maximum-scale=0.9\" />\n\n  </head><body>\n  <div class=\"document\">\n    \n      <div class=\"sphinxsidebar\" role=\"navigation\" aria-label=\"main navigation\">\n        <div class=\"sphinxsidebarwrapper\">\n            <p class=\"logo\"><a href=\"../../../index.html\">\n              <img class=\"logo\" src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" alt=\"Logo\"/>\n            </a></p>\n<h1 class=\"logo\"><a href=\"../../../index.html\">Block diagram simulation</a></h1>\n\n\n\n\n\n\n<p>\n<iframe src=\"https://ghbtns.com/github-btn.html?user=petercorke&repo=bdsim&type=watch&count=true&size=large&v=2\"\n  allowtransparency=\"true\" frameborder=\"0\" scrolling=\"0\" width=\"200px\" height=\"35px\"></iframe>\n</p>\n\n\n\n\n\n<h3>Navigation</h3>\n<p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">bdsim package</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Blocks</a></li>\n</ul>\n\n<div class=\"relations\">\n<h3>Related Topics</h3>\n<ul>\n  <li><a href=\"../../../index.html\">Documentation overview</a><ul>\n  <li><a href=\"../../index.html\">Module code</a><ul>\n  </ul></li>\n  </ul></li>\n</ul>\n</div>\n<div id=\"searchbox\" style=\"display: none\" role=\"search\">\n  <h3 id=\"searchlabel\">Quick search</h3>\n    <div class=\"searchformwrapper\">\n    <form class=\"search\" action=\"../../../search.html\" method=\"get\">\n      <input type=\"text\" name=\"q\" aria-labelledby=\"searchlabel\" />\n      <input type=\"submit\" value=\"Go\" />\n    </form>\n    </div>\n</div>\n<script>$('#searchbox').show(0);</script>\n\n\n\n\n\n\n\n\n        </div>\n      </div>\n      <div class=\"documentwrapper\">\n        <div class=\"bodywrapper\">\n          \n\n          <div class=\"body\" role=\"main\">\n            \n  <h1>Source code for bdsim.blocks.robots</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Robot blocks:</span>\n<span class=\"sd\">- have inputs and outputs</span>\n<span class=\"sd\">- are a subclass of ``FunctionBlock`` |rarr| ``Block`` for kinematics and have no states</span>\n<span class=\"sd\">- are a subclass of ``TransferBlock`` |rarr| ``Block`` for dynamics and have states</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"c1\"># The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.</span>\n\n\n<span class=\"c1\"># TODO: quadrotor dyanmics and display</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">from</span> <span class=\"nn\">math</span> <span class=\"kn\">import</span> <span class=\"n\">sin</span><span class=\"p\">,</span> <span class=\"n\">cos</span><span class=\"p\">,</span> <span class=\"n\">atan2</span><span class=\"p\">,</span> <span class=\"n\">tan</span><span class=\"p\">,</span> <span class=\"n\">sqrt</span><span class=\"p\">,</span> <span class=\"n\">pi</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">import</span> <span class=\"nn\">time</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">TransferBlock</span><span class=\"p\">,</span> <span class=\"n\">block</span>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Bicycle\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.robots.Bicycle\">[docs]</a><span class=\"nd\">@block</span>\n<span class=\"k\">class</span> <span class=\"nc\">Bicycle</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`BICYCLE`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 2          | 3       | 3       |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | float      | float   |         | </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n<div class=\"viewcode-block\" id=\"Bicycle.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.robots.Bicycle.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">L</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">vlim</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">slim</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param ``*inputs``: Optional incoming connections</span>\n<span class=\"sd\">        :type ``*inputs``: Block or Plug</span>\n<span class=\"sd\">        :param x0: Inital state, defaults to 0</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param L: Wheelbase, defaults to 1</span>\n<span class=\"sd\">        :type L: float, optional</span>\n<span class=\"sd\">        :param vlim: Velocity limit, defaults to 1</span>\n<span class=\"sd\">        :type vlim: float, optional</span>\n<span class=\"sd\">        :param slim: Steering limit, defaults to 1</span>\n<span class=\"sd\">        :type slim: float, optional</span>\n<span class=\"sd\">        :param ``**kwargs``: common Block options</span>\n<span class=\"sd\">        :return: a BICYCLE block</span>\n<span class=\"sd\">        :rtype: Bicycle instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Create a vehicle model with Bicycle kinematics.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Bicycle kinematic model with state :math:`[x, y, \\theta]`.  </span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The block has two input ports:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            1. Vehicle speed (metres/sec).  The velocity limit ``vlim`` is</span>\n<span class=\"sd\">               applied to the magnitude of this input.</span>\n<span class=\"sd\">            2. Steering wheel angle (radians).  The steering limit ``slim``</span>\n<span class=\"sd\">               is applied to the magnitude of this input.</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        and three output ports:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            1. x position in the world frame (metres)</span>\n<span class=\"sd\">            2. y positon in the world frame (metres)</span>\n<span class=\"sd\">            3. heading angle with respect to the world frame (radians)</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vlim</span> <span class=\"o\">=</span> <span class=\"n\">vlim</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">slim</span> <span class=\"o\">=</span> <span class=\"n\">slim</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;bicycle&#39;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">L</span> <span class=\"o\">=</span> <span class=\"n\">L</span>\n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x0 is </span><span class=\"si\">{:d}</span><span class=\"s2\"> long, should be </span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">),</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n            \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s1\">&#39;v&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;$\\gamma$&#39;</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;y&#39;</span><span class=\"p\">,</span> <span class=\"sa\">r</span><span class=\"s1\">&#39;$\\theta$&#39;</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state_names</span><span class=\"p\">((</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;y&#39;</span><span class=\"p\">,</span> <span class=\"sa\">r</span><span class=\"s1\">&#39;$\\theta$&#39;</span><span class=\"p\">))</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">list</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">)</span>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span>\n        \n        <span class=\"c1\"># get inputs and clip them</span>\n        <span class=\"n\">v</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">v</span> <span class=\"o\">=</span> <span class=\"nb\">min</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vlim</span><span class=\"p\">,</span> <span class=\"nb\">max</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">,</span> <span class=\"o\">-</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vlim</span><span class=\"p\">))</span>\n        <span class=\"n\">gamma</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n        <span class=\"n\">gamma</span> <span class=\"o\">=</span> <span class=\"nb\">min</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">slim</span><span class=\"p\">,</span> <span class=\"nb\">max</span><span class=\"p\">(</span><span class=\"n\">gamma</span><span class=\"p\">,</span> <span class=\"o\">-</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">slim</span><span class=\"p\">))</span>\n        \n        <span class=\"n\">xd</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">v</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">v</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">v</span> <span class=\"o\">*</span> <span class=\"n\">tan</span><span class=\"p\">(</span><span class=\"n\">gamma</span><span class=\"p\">)</span><span class=\"o\">/</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">L</span> <span class=\"p\">]</span>\n        <span class=\"k\">return</span> <span class=\"n\">xd</span></div>\n    \n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Unicycle\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.robots.Unicycle\">[docs]</a><span class=\"nd\">@block</span>\n<span class=\"k\">class</span> <span class=\"nc\">Unicycle</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`UNICYCLE`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 2          | 3       | 3       |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | float      | float   |         | </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n<div class=\"viewcode-block\" id=\"Unicycle.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.robots.Unicycle.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param ``*inputs``: Optional incoming connections</span>\n<span class=\"sd\">        :type ``*inputs``: Block or Plug</span>\n<span class=\"sd\">        :param x0: Inital state, defaults to 0</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param ``*inputs``: Optional incoming connections</span>\n<span class=\"sd\">        :type ``*inputs``: Block or Plug</span>\n<span class=\"sd\">        :param ``**kwargs``: common Block options</span>\n<span class=\"sd\">        :return: a UNICYCLE block</span>\n<span class=\"sd\">        :rtype: Unicycle instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Create a vehicle model with Unicycle kinematics.</span>\n\n<span class=\"sd\">        Unicycle kinematic model with state :math:`[x, y, \\theta]`.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The block has two input ports:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            1. Vehicle speed (metres/sec).</span>\n<span class=\"sd\">            2. Angular velocity (radians/sec).</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        and three output ports:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            1. x position in the world frame (metres)</span>\n<span class=\"sd\">            2. y positon in the world frame (metres)</span>\n<span class=\"sd\">            3. heading angle with respect to the world frame (radians)</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>        \n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;unicycle&#39;</span>\n        \n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">slef</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x0 is </span><span class=\"si\">{:d}</span><span class=\"s2\"> long, should be </span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">),</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">list</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">)</span>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span>\n        <span class=\"n\">v</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">omega</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n        <span class=\"n\">xd</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">v</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">v</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">omega</span><span class=\"p\">]</span>\n        <span class=\"k\">return</span> <span class=\"n\">xd</span></div>\n    \n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"DiffSteer\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.robots.DiffSteer\">[docs]</a><span class=\"nd\">@block</span>\n<span class=\"k\">class</span> <span class=\"nc\">DiffSteer</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`DIFFSTEER`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 2          | 3       | 3       |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | float      | float   |         | </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n<div class=\"viewcode-block\" id=\"DiffSteer.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.robots.DiffSteer.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"n\">R</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">W</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param ``*inputs``: Optional incoming connections</span>\n<span class=\"sd\">        :type ``*inputs``: Block or Plug</span>\n<span class=\"sd\">        :param x0: Inital state, defaults to 0</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param R: Wheel radius, defaults to 1</span>\n<span class=\"sd\">        :type R: float, optional</span>\n<span class=\"sd\">        :param W: Wheel separation in lateral direction, defaults to 1</span>\n<span class=\"sd\">        :type R: float, optional</span>\n<span class=\"sd\">        :param ``**kwargs``: common Block options</span>\n<span class=\"sd\">        :return: a DIFFSTEER block</span>\n<span class=\"sd\">        :rtype: DifSteer instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Create a differential steer vehicle model with Unicycle kinematics, with inputs</span>\n<span class=\"sd\">        given as wheel angular velocity.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Unicycle kinematic model with state :math:`[x, y, \\theta]`.</span>\n\n<span class=\"sd\">        The block has two input ports:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            1. Left-wheel angular velocity (radians/sec).</span>\n<span class=\"sd\">            2. Right-wheel angular velocity (radians/sec).</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        and three output ports:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            1. x position in the world frame (metres)</span>\n<span class=\"sd\">            2. y positon in the world frame (metres)</span>\n<span class=\"sd\">            3. heading angle with respect to the world frame (radians)</span>\n\n<span class=\"sd\">        Note:</span>\n\n<span class=\"sd\">            - wheel velocity is defined such that if both are positive the vehicle</span>\n<span class=\"sd\">              moves forward.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;diffsteer&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">R</span> <span class=\"o\">=</span> <span class=\"n\">R</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">W</span> <span class=\"o\">=</span> <span class=\"n\">W</span>\n        \n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">slef</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x0 is </span><span class=\"si\">{:d}</span><span class=\"s2\"> long, should be </span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">),</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">list</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">)</span>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span>\n        <span class=\"n\">v</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">R</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span> <span class=\"o\">/</span> <span class=\"mi\">2</span>\n        <span class=\"n\">omega</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">W</span>\n    \n        <span class=\"n\">xd</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">v</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">v</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">omega</span><span class=\"p\">]</span>\n        <span class=\"k\">return</span> <span class=\"n\">xd</span></div>\n    \n    <span class=\"c1\"># seriallink</span>\n    <span class=\"c1\"># RNE</span>\n    <span class=\"c1\"># fkine</span>\n    <span class=\"c1\"># robot plot</span>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"MultiRotor\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.robots.MultiRotor\">[docs]</a><span class=\"nd\">@block</span>\n<span class=\"k\">class</span> <span class=\"nc\">MultiRotor</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`MULTIROTOR`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 1          | 1       | 16      |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | A(4,)      | dict    |         | </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n\n\t<span class=\"c1\"># Flyer2dynamics lovingly coded by Paul Pounds, first coded 12/4/04</span>\n\t<span class=\"c1\"># A simulation of idealised X-4 Flyer II flight dynamics.</span>\n\t<span class=\"c1\"># version 2.0 2005 modified to be compatible with latest version of Matlab</span>\n\t<span class=\"c1\"># version 3.0 2006 fixed rotation matrix problem</span>\n\t<span class=\"c1\"># version 4.0 4/2/10, fixed rotor flapping rotation matrix bug, mirroring</span>\n\t<span class=\"c1\"># version 5.0 8/8/11, simplified and restructured</span>\n\t<span class=\"c1\"># version 6.0 25/10/13, fixed rotation matrix/inverse wronskian definitions, flapping cross-product bug</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># New in version 2:</span>\n\t<span class=\"c1\">#   - Generalised rotor thrust model</span>\n\t<span class=\"c1\">#   - Rotor flapping model</span>\n\t<span class=\"c1\">#   - Frame aerodynamic drag model</span>\n\t<span class=\"c1\">#   - Frame aerodynamic surfaces model</span>\n\t<span class=\"c1\">#   - Internal motor model</span>\n\t<span class=\"c1\">#   - Much coolage</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># Version 1.3</span>\n\t<span class=\"c1\">#   - Rigid body dynamic model</span>\n\t<span class=\"c1\">#   - Rotor gyroscopic model</span>\n\t<span class=\"c1\">#   - External motor model</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># ARGUMENTS</span>\n\t<span class=\"c1\">#   u       Reference inputs                1x4</span>\n\t<span class=\"c1\">#   tele    Enable telemetry (1 or 0)       1x1</span>\n\t<span class=\"c1\">#   crash   Enable crash detection (1 or 0) 1x1</span>\n\t<span class=\"c1\">#   init    Initial conditions              1x12</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># INPUTS</span>\n\t<span class=\"c1\">#   u = [N S E W]</span>\n\t<span class=\"c1\">#   NSEW motor commands                     1x4</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># CONTINUOUS STATES</span>\n\t<span class=\"c1\">#   z      Position                         3x1   (x,y,z)</span>\n\t<span class=\"c1\">#   v      Velocity                         3x1   (xd,yd,zd)</span>\n\t<span class=\"c1\">#   n      Attitude                         3x1   (Y,P,R)</span>\n\t<span class=\"c1\">#   o      Angular velocity                 3x1   (wx,wy,wz)</span>\n\t<span class=\"c1\">#   w      Rotor angular velocity           4x1</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># Notes: z-axis downward so altitude is -z(3)</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># CONTINUOUS STATE MATRIX MAPPING</span>\n\t<span class=\"c1\">#   x = [z1 z2 z3 n1 n2 n3 z1 z2 z3 o1 o2 o3 w1 w2 w3 w4]</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># CONTINUOUS STATE EQUATIONS</span>\n\t<span class=\"c1\">#   z` = v</span>\n\t<span class=\"c1\">#   v` = g*e3 - (1/m)*T*R*e3</span>\n\t<span class=\"c1\">#   I*o` = -o X I*o + G + torq</span>\n\t<span class=\"c1\">#   R = f(n)</span>\n\t<span class=\"c1\">#   n` = inv(W)*o</span>\n\t<span class=\"c1\"># </span>\n<div class=\"viewcode-block\" id=\"MultiRotor.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.robots.MultiRotor.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">model</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"n\">groundcheck</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">speedcheck</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param model: Vehicle geometric and inertial parameters</span>\n<span class=\"sd\">        :type model: dict</span>\n<span class=\"sd\">        :param ``*inputs``: Optional incoming connections</span>\n<span class=\"sd\">        :type ``*inputs``: Block or Plug</span>\n<span class=\"sd\">        :param groundcheck: Prevent vehicle moving below ground , defaults to True</span>\n<span class=\"sd\">        :type groundcheck: bool</span>\n<span class=\"sd\">        :param speedcheck: Check for zero rotor speed, defaults to True</span>\n<span class=\"sd\">        :type speedcheck: bool</span>\n<span class=\"sd\">        :param x0: Initial state, defaults to all zeros</span>\n<span class=\"sd\">        :type x0: TYPE, optional</span>\n<span class=\"sd\">        :param ``**kwargs``: common Block options</span>\n<span class=\"sd\">        :return: a MULTIROTOR block</span>\n<span class=\"sd\">        :rtype: MultiRotor instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Create a a multi-rotor dynamic model block.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The block has one input port which is a vector of input rotor speeds</span>\n<span class=\"sd\">        in (radians/sec).  These are, looking down, clockwise from the front rotor</span>\n<span class=\"sd\">        which lies on the x-axis.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The block has one output port which is a dictionary signal with the</span>\n<span class=\"sd\">        following items:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            - ``x`` pose in the world frame as :math:`[x, y, z, \\theta_Y, \\theta_P, \\theta_R]`</span>\n<span class=\"sd\">            - ``vb`` translational velocity in the world frame (metres/sec)</span>\n<span class=\"sd\">            - ``w`` angular rates in the world frame as yaw-pitch-roll rates (radians/second)</span>\n<span class=\"sd\">            - ``a1s`` longitudinal flapping angles (radians)</span>\n<span class=\"sd\">            - ``b1s`` lateral flapping angles (radians)</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        Based on MATLAB code developed by Pauline Pounds 2004.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;quadrotor&#39;</span>\n    \n        <span class=\"k\">try</span><span class=\"p\">:</span>\n            <span class=\"n\">nrotors</span> <span class=\"o\">=</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;nrotors&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">except</span> <span class=\"ne\">KeyError</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;vehicle model does not contain nrotors&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">assert</span> <span class=\"n\">nrotors</span> <span class=\"o\">%</span> <span class=\"mi\">2</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"s1\">&#39;Must have an even number of rotors&#39;</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">12</span>\n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x0 is the wrong length&quot;</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span> <span class=\"o\">=</span> <span class=\"n\">nrotors</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span> <span class=\"o\">=</span> <span class=\"n\">model</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">groundcheck</span> <span class=\"o\">=</span> <span class=\"n\">groundcheck</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">speedcheck</span> <span class=\"o\">=</span> <span class=\"n\">speedcheck</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">))</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">):</span>\n            <span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"n\">i</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span> <span class=\"o\">*</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">pi</span>\n            <span class=\"c1\">#  Di      Rotor hub displacements (1x3)</span>\n            <span class=\"c1\"># first rotor is on the x-axis, clockwise order looking down from above</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;d&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;d&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;h&#39;</span><span class=\"p\">]]</span>\n            \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">a1s</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">b1s</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">,))</span></div>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        \n        <span class=\"n\">model</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span>    \n        \n        <span class=\"c1\"># compute output vector as a function of state vector</span>\n        <span class=\"c1\">#   z      Position                         3x1   (x,y,z)</span>\n        <span class=\"c1\">#   v      Velocity                         3x1   (xd,yd,zd)</span>\n        <span class=\"c1\">#   n      Attitude                         3x1   (Y,P,R)</span>\n        <span class=\"c1\">#   o      Angular velocity                 3x1   (Yd,Pd,Rd)</span>\n        \n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">:</span><span class=\"mi\">6</span><span class=\"p\">]</span>   <span class=\"c1\"># RPY angles</span>\n        <span class=\"n\">phi</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>         <span class=\"c1\"># yaw</span>\n        <span class=\"n\">the</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>         <span class=\"c1\"># pitch</span>\n        <span class=\"n\">psi</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span>         <span class=\"c1\"># roll</span>\n        \n        <span class=\"c1\"># rotz(phi)*roty(the)*rotx(psi)</span>\n        <span class=\"c1\">#  BBF &gt; Inertial rotation matrix</span>\n        <span class=\"n\">R</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n                <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n                <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>           <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>                                  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n            <span class=\"p\">])</span>\n        \n        <span class=\"c1\">#inverted Wronskian</span>\n        <span class=\"n\">iW</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>        <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">),</span>             <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)],</span>             \n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>        <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)],</span>\n                    <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n                <span class=\"p\">])</span> <span class=\"o\">/</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span>\n        \n        <span class=\"c1\"># return velocity in the body frame</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">:</span><span class=\"mi\">6</span><span class=\"p\">]</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;vb&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"n\">R</span><span class=\"p\">)</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">6</span><span class=\"p\">:</span><span class=\"mi\">9</span><span class=\"p\">]</span>   <span class=\"c1\"># translational velocity mapped to body frame</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;w&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">iW</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">9</span><span class=\"p\">:</span><span class=\"mi\">12</span><span class=\"p\">]</span>               <span class=\"c1\"># RPY rates mapped to body frame</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;a1s&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">a1s</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;b1s&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">b1s</span>\n    \n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n    \n        <span class=\"n\">model</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span>\n        \n        <span class=\"c1\"># Body-fixed frame references</span>\n        <span class=\"c1\">#   ei      Body fixed frame references 3x1</span>\n        <span class=\"n\">e3</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">]</span>\n        \n        <span class=\"c1\"># process inputs</span>\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;input vector wrong size&#39;</span><span class=\"p\">)</span>\n    \n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">speedcheck</span> <span class=\"ow\">and</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">any</span><span class=\"p\">(</span><span class=\"n\">w</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">):</span>\n            <span class=\"c1\"># might need to fix this, preculudes aerobatics :(</span>\n            <span class=\"c1\"># mu becomes NaN due to 0/0</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;quadrotor_dynamics: not defined for zero rotor speed&#39;</span><span class=\"p\">);</span>\n        \n        <span class=\"c1\"># EXTRACT STATES FROM X</span>\n        <span class=\"n\">z</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">:</span><span class=\"mi\">3</span><span class=\"p\">]</span>   <span class=\"c1\"># position in {W}</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">:</span><span class=\"mi\">6</span><span class=\"p\">]</span>   <span class=\"c1\"># RPY angles {W}</span>\n        <span class=\"n\">v</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">6</span><span class=\"p\">:</span><span class=\"mi\">9</span><span class=\"p\">]</span>   <span class=\"c1\"># velocity in {W}</span>\n        <span class=\"n\">o</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">9</span><span class=\"p\">:</span><span class=\"mi\">12</span><span class=\"p\">]</span>  <span class=\"c1\"># angular velocity in {W}</span>\n        \n        <span class=\"c1\"># PREPROCESS ROTATION AND WRONSKIAN MATRICIES</span>\n        <span class=\"n\">phi</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>    <span class=\"c1\"># yaw</span>\n        <span class=\"n\">the</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>    <span class=\"c1\"># pitch</span>\n        <span class=\"n\">psi</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span>    <span class=\"c1\"># roll</span>\n        \n        <span class=\"c1\"># rotz(phi)*roty(the)*rotx(psi)</span>\n        <span class=\"c1\"># BBF &gt; Inertial rotation matrix</span>\n        <span class=\"n\">R</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n            <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span><span class=\"o\">-</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span><span class=\"o\">+</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n            <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span><span class=\"o\">+</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span><span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n            <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>         <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>                            <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n            <span class=\"p\">])</span>\n        \n        <span class=\"c1\"># Manual Construction</span>\n        <span class=\"c1\">#     Q3 = [cos(phi) -sin(phi) 0;sin(phi) cos(phi) 0;0 0 1];   % RZ %Rotation mappings</span>\n        <span class=\"c1\">#     Q2 = [cos(the) 0 sin(the);0 1 0;-sin(the) 0 cos(the)];   % RY</span>\n        <span class=\"c1\">#     Q1 = [1 0 0;0 cos(psi) -sin(psi);0 sin(psi) cos(psi)];   % RX</span>\n        <span class=\"c1\">#     R = Q3*Q2*Q1    %Rotation matrix</span>\n        <span class=\"c1\">#</span>\n        <span class=\"c1\">#    RZ * RY * RX</span>\n        <span class=\"c1\"># inverted Wronskian</span>\n        <span class=\"n\">iW</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>        <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">),</span>          <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)],</span>            \n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>        <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)],</span>\n                    <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n                <span class=\"p\">])</span> <span class=\"o\">/</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span>\n    \n        <span class=\"c1\"># ROTOR MODEL</span>\n        <span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"mi\">4</span><span class=\"p\">))</span>\n        <span class=\"n\">Q</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"mi\">4</span><span class=\"p\">))</span>\n        <span class=\"n\">tau</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"mi\">4</span><span class=\"p\">))</span>\n    \n        <span class=\"n\">a1s</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">a1s</span>\n        <span class=\"n\">b1s</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">b1s</span>\n    \n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">):</span>  <span class=\"c1\"># for each rotor</span>\n    \n            <span class=\"c1\"># Relative motion</span>\n            <span class=\"n\">Vr</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">cross</span><span class=\"p\">(</span><span class=\"n\">o</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">+</span> <span class=\"n\">v</span>\n            <span class=\"n\">mu</span> <span class=\"o\">=</span> <span class=\"n\">sqrt</span><span class=\"p\">(</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sum</span><span class=\"p\">(</span><span class=\"n\">Vr</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">:</span><span class=\"mi\">2</span><span class=\"p\">]</span><span class=\"o\">**</span><span class=\"mi\">2</span><span class=\"p\">))</span> <span class=\"o\">/</span> <span class=\"p\">(</span><span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">])</span>  <span class=\"c1\"># Magnitude of mu, planar components</span>\n            <span class=\"n\">lc</span> <span class=\"o\">=</span> <span class=\"n\">Vr</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"p\">(</span><span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">])</span>                     <span class=\"c1\"># Non-dimensionalised normal inflow</span>\n            <span class=\"n\">li</span> <span class=\"o\">=</span> <span class=\"n\">mu</span>                                                  <span class=\"c1\"># Non-dimensionalised induced velocity approximation</span>\n            <span class=\"n\">alphas</span> <span class=\"o\">=</span> <span class=\"n\">atan2</span><span class=\"p\">(</span><span class=\"n\">lc</span><span class=\"p\">,</span> <span class=\"n\">mu</span><span class=\"p\">)</span>\n            <span class=\"n\">j</span> <span class=\"o\">=</span> <span class=\"n\">atan2</span><span class=\"p\">(</span><span class=\"n\">Vr</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"n\">Vr</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>                                  <span class=\"c1\"># Sideslip azimuth relative to e1 (zero over nose)</span>\n            <span class=\"n\">J</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">j</span><span class=\"p\">),</span> <span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">j</span><span class=\"p\">)],</span>\n                    <span class=\"p\">[</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">j</span><span class=\"p\">),</span>  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">j</span><span class=\"p\">)]</span>\n                <span class=\"p\">])</span>                                                   <span class=\"c1\"># BBF &gt; mu sideslip rotation matrix</span>\n            \n            <span class=\"c1\"># Flapping</span>\n            <span class=\"n\">beta</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[((</span><span class=\"mi\">8</span><span class=\"o\">/</span><span class=\"mi\">3</span><span class=\"o\">*</span><span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;theta0&#39;</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;theta1&#39;</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">mu</span> <span class=\"o\">-</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">lc</span> <span class=\"o\">*</span> <span class=\"n\">mu</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"p\">(</span><span class=\"mi\">1</span> <span class=\"o\">-</span> <span class=\"n\">mu</span><span class=\"o\">**</span><span class=\"mi\">2</span> <span class=\"o\">/</span> <span class=\"mi\">2</span><span class=\"p\">)],</span> <span class=\"c1\"># Longitudinal flapping</span>\n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>                                                              <span class=\"c1\"># Lattitudinal flapping (note sign)</span>\n                <span class=\"p\">])</span>\n    \n                <span class=\"c1\"># sign(w) * (4/3)*((Ct/sigma)*(2*mu*gamma/3/a)/(1+3*e/2/r) + li)/(1+mu^2/2)]; </span>\n    \n            <span class=\"n\">beta</span> <span class=\"o\">=</span> <span class=\"n\">J</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">@</span> <span class=\"n\">beta</span><span class=\"p\">;</span>                                    <span class=\"c1\"># Rotate the beta flapping angles to longitudinal and lateral coordinates.</span>\n            <span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">beta</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"mi\">16</span> <span class=\"o\">/</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;gamma&#39;</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">o</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n            <span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">beta</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"mi\">16</span> <span class=\"o\">/</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;gamma&#39;</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">o</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n            \n            <span class=\"c1\"># Forces and torques</span>\n    \n            <span class=\"c1\"># Rotor thrust, linearised angle approximations</span>\n    \n            <span class=\"n\">T</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;Ct&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;rho&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;A&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">]</span><span class=\"o\">**</span><span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span><span class=\"o\">**</span><span class=\"mi\">2</span> <span class=\"o\">*</span> \\\n                <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span> <span class=\"o\">-</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])]</span> \n    \n            <span class=\"c1\"># Rotor drag torque - note that this preserves w[i] direction sign</span>\n    \n            <span class=\"n\">Q</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;Cq&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;rho&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;A&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">]</span><span class=\"o\">**</span><span class=\"mi\">3</span> <span class=\"o\">*</span> <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span><span class=\"o\">*</span> <span class=\"n\">e3</span>  \n    \n            <span class=\"n\">tau</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">cross</span><span class=\"p\">(</span><span class=\"n\">T</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">])</span>    <span class=\"c1\"># Torque due to rotor thrust</span>\n    \n        <span class=\"c1\"># RIGID BODY DYNAMIC MODEL</span>\n        <span class=\"n\">dz</span> <span class=\"o\">=</span> <span class=\"n\">v</span>\n        <span class=\"n\">dn</span> <span class=\"o\">=</span> <span class=\"n\">iW</span> <span class=\"o\">@</span> <span class=\"n\">o</span>\n        \n        <span class=\"n\">dv</span> <span class=\"o\">=</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;g&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">e3</span> <span class=\"o\">+</span> <span class=\"n\">R</span> <span class=\"o\">@</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sum</span><span class=\"p\">(</span><span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;M&#39;</span><span class=\"p\">]</span>\n        \n        <span class=\"c1\"># vehicle can&#39;t fall below ground, remember z is down</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">groundcheck</span> <span class=\"ow\">and</span> <span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n            <span class=\"n\">dz</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    \n        <span class=\"n\">do</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;J&#39;</span><span class=\"p\">])</span> <span class=\"o\">@</span> <span class=\"p\">(</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">cross</span><span class=\"p\">(</span><span class=\"o\">-</span><span class=\"n\">o</span><span class=\"p\">,</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;J&#39;</span><span class=\"p\">]</span> <span class=\"o\">@</span> <span class=\"n\">o</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sum</span><span class=\"p\">(</span><span class=\"n\">tau</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sum</span><span class=\"p\">(</span><span class=\"n\">Q</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">))</span> <span class=\"c1\"># row sum of torques</span>\n    \n        <span class=\"c1\"># stash the flapping information for plotting</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">a1s</span> <span class=\"o\">=</span> <span class=\"n\">a1s</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">b1s</span> <span class=\"o\">=</span> <span class=\"n\">b1s</span>\n        \n        <span class=\"k\">return</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">dz</span><span class=\"p\">,</span> <span class=\"n\">dn</span><span class=\"p\">,</span> <span class=\"n\">dv</span><span class=\"p\">,</span> <span class=\"n\">do</span><span class=\"p\">]</span>  <span class=\"c1\"># This is the state derivative vector</span></div>\n\n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">import</span> <span class=\"nn\">pathlib</span>\n    <span class=\"kn\">import</span> <span class=\"nn\">os.path</span>\n\n    <span class=\"n\">exec</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">(</span><span class=\"vm\">__file__</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">absolute</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;test_robots.py&quot;</span><span class=\"p\">))</span><span class=\"o\">.</span><span class=\"n\">read</span><span class=\"p\">())</span>\n</pre></div>\n\n          </div>\n          \n        </div>\n      </div>\n    <div class=\"clearer\"></div>\n  </div>\n    <div class=\"footer\">\n      &copy;2020, Peter Corke.\n      \n      |\n      Powered by <a href=\"http://sphinx-doc.org/\">Sphinx 3.2.1</a>\n      &amp; <a href=\"https://github.com/bitprophet/alabaster\">Alabaster 0.7.12</a>\n      \n    </div>\n\n    \n\n    \n  </body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blocks/sinks.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.blocks.sinks &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.blocks.sinks</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.blocks.sinks</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Sink blocks:</span>\n\n<span class=\"sd\">- have inputs but no outputs</span>\n<span class=\"sd\">- have no state variables</span>\n<span class=\"sd\">- are a subclass of ``SinkBlock`` |rarr| ``Block``</span>\n<span class=\"sd\">- that perform graphics are a subclass of  ``GraphicsBlock`` |rarr| ``SinkBlock`` |rarr| ``Block``</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n\n\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">from</span> <span class=\"nn\">math</span> <span class=\"kn\">import</span> <span class=\"n\">pi</span><span class=\"p\">,</span> <span class=\"n\">sqrt</span><span class=\"p\">,</span> <span class=\"n\">sin</span><span class=\"p\">,</span> <span class=\"n\">cos</span><span class=\"p\">,</span> <span class=\"n\">atan2</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">from</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"kn\">import</span> <span class=\"n\">Polygon</span>\n\n\n<span class=\"kn\">import</span> <span class=\"nn\">spatialmath.base</span> <span class=\"k\">as</span> <span class=\"nn\">sm</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">SinkBlock</span>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Print\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sinks.Print\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Print</span><span class=\"p\">(</span><span class=\"n\">SinkBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;    </span>\n<span class=\"sd\">    :blockname:`PRINT`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 1      | 0       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | any    |         |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n\n<div class=\"viewcode-block\" id=\"Print.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sinks.Print.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">fmt</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">file</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Print signal.</span>\n\n<span class=\"sd\">        :param fmt: Format string, defaults to None</span>\n<span class=\"sd\">        :type fmt: str, optional</span>\n<span class=\"sd\">        :param file: file to write data to, defaults to None</span>\n<span class=\"sd\">        :type file: file object, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A PRINT block</span>\n<span class=\"sd\">        :rtype: Print instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Creates a console print block which displays the value of a signal </span>\n<span class=\"sd\">        at each simulation time step. The display format is like::</span>\n\n<span class=\"sd\">            PRINT(print.0 @ t=0.100) [-1.0 0.2]</span>\n\n<span class=\"sd\">        and includes the block name, time, and the formatted value.</span>\n\n<span class=\"sd\">        The numerical formatting of the signal is controlled by ``fmt``:</span>\n\n<span class=\"sd\">        - if not provided, ``str()`` is used to format the signal</span>\n<span class=\"sd\">        - if provided:</span>\n<span class=\"sd\">            - a scalar is formatted by the ``fmt.format()``</span>\n<span class=\"sd\">            - a NumPy array is formatted by ``fmt.format()`` applied to every</span>\n<span class=\"sd\">              element</span>\n\n<span class=\"sd\">        Examples::</span>\n\n<span class=\"sd\">            pr = bd.PRINT()     # create PRINT block</span>\n<span class=\"sd\">            bd.connect(x, inputs=pr)   # its input comes from x</span>\n\n<span class=\"sd\">            bd.PRINT(x)         # create PRINT block with input from x</span>\n\n<span class=\"sd\">            bd.PRINT(x, name=&#39;X&#39;)  # block name appears in the printed text</span>\n\n<span class=\"sd\">            bd.PRINT(x, fmt=&quot;{:.1f}&quot;) # print with explicit format</span>\n\n<span class=\"sd\">        .. note:: </span>\n<span class=\"sd\">            - By default writes to stdout</span>\n<span class=\"sd\">            - The output is cleaner if progress bar printing is disabled.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">format</span> <span class=\"o\">=</span> <span class=\"n\">fmt</span></div>\n        \n        <span class=\"c1\"># TODO format can be a string or function</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">step</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">prefix</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;</span><span class=\"si\">{:12s}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span>\n            <span class=\"s1\">&#39;PRINT(</span><span class=\"si\">{:s}</span><span class=\"s1\"> (t=</span><span class=\"si\">{:.3f}</span><span class=\"s1\">)&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"p\">)</span>\n            <span class=\"p\">)</span>\n        <span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">format</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"c1\"># no format string</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">prefix</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"c1\"># format string provided</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">)):</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">prefix</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">))</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n                <span class=\"k\">with</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">printoptions</span><span class=\"p\">(</span><span class=\"n\">formatter</span><span class=\"o\">=</span><span class=\"p\">{</span><span class=\"s1\">&#39;all&#39;</span><span class=\"p\">:</span><span class=\"k\">lambda</span> <span class=\"n\">x</span><span class=\"p\">:</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)}):</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">prefix</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">)</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">prefix</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">))</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n            \n\n<div class=\"viewcode-block\" id=\"Stop\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sinks.Stop\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Stop</span><span class=\"p\">(</span><span class=\"n\">SinkBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`STOP`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 1      | 0       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | any    |         |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n\n<div class=\"viewcode-block\" id=\"Stop.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sinks.Stop.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">func</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Conditional simulation stop.</span>\n\n<span class=\"sd\">        :param func: evaluate stop condition, defaults to None</span>\n<span class=\"sd\">        :type func: callable, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A STOP block</span>\n<span class=\"sd\">        :rtype: Stop instance</span>\n\n<span class=\"sd\">        Conditionally stop the simulation if the input is:</span>\n\n<span class=\"sd\">        - bool type and True</span>\n<span class=\"sd\">        - numeric type and &gt; 0</span>\n\n<span class=\"sd\">        If ``func`` is provided, then it is applied to the block input</span>\n<span class=\"sd\">        and if it returns True the simulation is stopped.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">callable</span><span class=\"p\">(</span><span class=\"n\">func</span><span class=\"p\">):</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">TypeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;argument must be a callable&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">stopfunc</span>  <span class=\"o\">=</span> <span class=\"n\">func</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">step</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">stopfunc</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">stopfunc</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)</span>\n\n        <span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"nb\">bool</span><span class=\"p\">):</span>\n            <span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"n\">value</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">try</span><span class=\"p\">:</span>\n                <span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"n\">value</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span>\n            <span class=\"k\">except</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;bad input type to stop block&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># we signal stop condition by setting state.stop to the block calling</span>\n        <span class=\"c1\"># the stop</span>\n        <span class=\"k\">if</span> <span class=\"n\">stop</span><span class=\"p\">:</span>\n            <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"bp\">self</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Null\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sinks.Null\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Null</span><span class=\"p\">(</span><span class=\"n\">SinkBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;    </span>\n<span class=\"sd\">    :blockname:`NULL`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | N      | 0       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | any    |         |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n\n<div class=\"viewcode-block\" id=\"Null.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sinks.Null.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Discard signal.</span>\n\n<span class=\"sd\">        :param nin: number of input ports, defaults to 1</span>\n<span class=\"sd\">        :type nin: int, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A NULL block</span>\n<span class=\"sd\">        :rtype: Null instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Create a sink block with arbitrary number of input ports that discards</span>\n<span class=\"sd\">        all data.  Useful for testing.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span></div></div>\n        \n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Watch\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sinks.Watch\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Watch</span><span class=\"p\">(</span><span class=\"n\">SinkBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;    </span>\n<span class=\"sd\">    :blockname:`WATCH`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | N      | 0       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 1      |         |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n\n<div class=\"viewcode-block\" id=\"Watch.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sinks.Watch.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Watch a signal.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A NULL block</span>\n<span class=\"sd\">        :rtype: Null instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Causes the input signal to be logged during the</span>\n<span class=\"sd\">        simulation run.  Equivalent to adding it as the ``watch=`` argument</span>\n<span class=\"sd\">        to ``bdsim.run``.</span>\n\n<span class=\"sd\">        :seealso: :method:`BDSim.run`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># called at start of simulation, add this block to the watchlist</span>\n        <span class=\"n\">plug</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inports</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">start</span>  <span class=\"c1\"># start plug for input wire</span>\n\n        <span class=\"c1\"># append to the watchlist, bdsim.run() will do the rest</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">watchlist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">plug</span><span class=\"p\">)</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">watchnamelist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">plug</span><span class=\"p\">))</span></div>\n        \n\n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">from</span> <span class=\"nn\">pathlib</span> <span class=\"kn\">import</span> <span class=\"n\">Path</span>\n    <span class=\"kn\">import</span> <span class=\"nn\">os.path</span>\n\n    <span class=\"n\">exec</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">Path</span><span class=\"p\">(</span><span class=\"vm\">__file__</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">parent</span> <span class=\"o\">/</span> <span class=\"s2\">&quot;tests&quot;</span> <span class=\"o\">/</span> <span class=\"s2\">&quot;test_sinks.py&quot;</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">read</span><span class=\"p\">())</span>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blocks/sources.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.blocks.sources &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.blocks.sources</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.blocks.sources</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Source blocks:</span>\n\n<span class=\"sd\">- have outputs but no inputs</span>\n<span class=\"sd\">- have no state variables</span>\n<span class=\"sd\">- are a subclass of ``SourceBlock`` |rarr| ``Block``</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">import</span> <span class=\"nn\">math</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">SourceBlock</span>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Constant\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Constant\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Constant</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`CONSTANT`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 0      | 1       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    |        | float,  |         | </span>\n<span class=\"sd\">    |        | A(N,)   |         |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Constant.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Constant.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Constant value.</span>\n\n<span class=\"sd\">        :param value: the constant, defaults to None</span>\n<span class=\"sd\">        :type value: any, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :return: a CONSTANT block</span>\n<span class=\"sd\">        :rtype: Constant instance</span>\n\n<span class=\"sd\">        This block has only one output port, but the value can be any </span>\n<span class=\"sd\">        Python type, for example float, list or Numpy ndarray.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        \n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">tuple</span><span class=\"p\">,</span> <span class=\"nb\">list</span><span class=\"p\">)):</span>\n            <span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"n\">value</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_param</span><span class=\"p\">(</span><span class=\"s1\">&#39;value&#39;</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">value</span><span class=\"p\">]</span>               </div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Time\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Time\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Time</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`TIME`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 0      | 1       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    |        | float   |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Time.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Time.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Simulation time.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a TIME block</span>\n<span class=\"sd\">        :rtype: Time instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The block has only one output port which is the current simulation time.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">t</span><span class=\"p\">]</span>  </div>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"WaveForm\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.WaveForm\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">WaveForm</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`WAVEFORM`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 0      | 1       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    |        | float   |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"WaveForm.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.WaveForm.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"s1\">&#39;square&#39;</span><span class=\"p\">,</span>\n                 <span class=\"n\">freq</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">unit</span><span class=\"o\">=</span><span class=\"s1\">&#39;Hz&#39;</span><span class=\"p\">,</span> <span class=\"n\">phase</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">amplitude</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">offset</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span>\n                 <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\">duty</span><span class=\"o\">=</span><span class=\"mf\">0.5</span><span class=\"p\">,</span>\n                 <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Waveform as function of time.</span>\n\n<span class=\"sd\">        :param wave: type of waveform to generate, one of: &#39;sine&#39;, &#39;square&#39;, &#39;triangle&#39;, defaults to &#39;square&#39;</span>\n<span class=\"sd\">        :type wave: str, optional</span>\n<span class=\"sd\">        :param freq: frequency, defaults to 1</span>\n<span class=\"sd\">        :type freq: float, optional</span>\n<span class=\"sd\">        :param unit: frequency unit, one of: &#39;rad/s&#39;, &#39;Hz&#39;, defaults to &#39;Hz&#39;</span>\n<span class=\"sd\">        :type unit: str, optional</span>\n<span class=\"sd\">        :param amplitude: amplitude, defaults to 1</span>\n<span class=\"sd\">        :type amplitude: float, optional</span>\n<span class=\"sd\">        :param offset: signal offset, defaults to 0</span>\n<span class=\"sd\">        :type offset: float, optional</span>\n<span class=\"sd\">        :param phase: Initial phase of signal in the range [0,1], defaults to 0</span>\n<span class=\"sd\">        :type phase: float, optional</span>\n<span class=\"sd\">        :param min: minimum value, defaults to 0</span>\n<span class=\"sd\">        :type min: float, optional</span>\n<span class=\"sd\">        :param max: maximum value, defaults to 1</span>\n<span class=\"sd\">        :type max: float, optional</span>\n<span class=\"sd\">        :param duty: duty cycle for square wave in range [0,1], defaults to 0.5</span>\n<span class=\"sd\">        :type duty: float, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a WAVEFORM block</span>\n<span class=\"sd\">        :rtype: WaveForm instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Create a waveform generator block.</span>\n\n<span class=\"sd\">        Examples::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            WAVEFORM(wave=&#39;sine&#39;, freq=2)   # 2Hz sine wave varying from -1 to 1</span>\n<span class=\"sd\">            WAVEFORM(wave=&#39;square&#39;, freq=2, unit=&#39;rad/s&#39;) # 2rad/s square wave varying from -1 to 1</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        The minimum and maximum values of the waveform are given by default in</span>\n<span class=\"sd\">        terms of amplitude and offset. The signals are symmetric about the offset </span>\n<span class=\"sd\">        value. For example::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            WAVEFORM(wave=&#39;sine&#39;) varies between -1 and +1</span>\n<span class=\"sd\">            WAVEFORM(wave=&#39;sine&#39;, amplitude=2) varies between -2 and +2</span>\n<span class=\"sd\">            WAVEFORM(wave=&#39;sine&#39;, offset=1) varies between 0 and +2</span>\n<span class=\"sd\">            WAVEFORM(wave=&#39;sine&#39;, amplitude=2, offset=1) varies between -1 and +3</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        Alternatively we can specify the minimum and maximum values which override</span>\n<span class=\"sd\">        amplitude and offset::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            WAVEFORM(wave=&#39;triangle&#39;, min=0, max=5) varies between 0 and +5</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        At time 0 the sine and triangle wave are zero and increasing, and the</span>\n<span class=\"sd\">        square wave has its first rise.  We can specify a phase shift with </span>\n<span class=\"sd\">        a number in the range [0,1] where 1 corresponds to one cycle.</span>\n\n<span class=\"sd\">        .. note:: For discontinuous signals (square, triangle) the block declares</span>\n<span class=\"sd\">            events for every discontinuity.</span>\n\n<span class=\"sd\">        :seealso :meth:`declare_events`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">assert</span> <span class=\"mi\">0</span><span class=\"o\">&lt;</span><span class=\"n\">duty</span><span class=\"o\">&lt;</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"s1\">&#39;duty must be in range [0,1]&#39;</span>\n        \n        <span class=\"k\">if</span> <span class=\"n\">wave</span> <span class=\"ow\">in</span> <span class=\"p\">(</span><span class=\"s1\">&#39;square&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;triangle&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;sine&#39;</span><span class=\"p\">):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wave</span> <span class=\"o\">=</span> <span class=\"n\">wave</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;bad waveform&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">unit</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;Hz&#39;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span> <span class=\"o\">=</span> <span class=\"n\">freq</span>\n        <span class=\"k\">elif</span> <span class=\"n\">unit</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;rad/s&#39;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span> <span class=\"o\">=</span> <span class=\"n\">freq</span> <span class=\"o\">/</span> <span class=\"p\">(</span><span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">pi</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;bad unit&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"mi\">0</span> <span class=\"o\">&lt;=</span> <span class=\"n\">phase</span> <span class=\"o\">&lt;=</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">phase</span> <span class=\"o\">=</span> <span class=\"n\">phase</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;phase out of range&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"nb\">max</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span> <span class=\"ow\">and</span> <span class=\"nb\">min</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">amplitude</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"nb\">max</span> <span class=\"o\">-</span> <span class=\"nb\">min</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"mi\">2</span>\n            <span class=\"n\">offset</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"nb\">max</span> <span class=\"o\">+</span> <span class=\"nb\">min</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"mi\">2</span> \n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">min</span> <span class=\"o\">=</span> <span class=\"nb\">min</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">mablock</span> <span class=\"o\">=</span> <span class=\"nb\">max</span>\n        <span class=\"k\">if</span> <span class=\"mi\">0</span> <span class=\"o\">&lt;=</span> <span class=\"n\">duty</span> <span class=\"o\">&lt;=</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">duty</span> <span class=\"o\">=</span> <span class=\"n\">duty</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;duty out of range&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">amplitude</span> <span class=\"o\">=</span> <span class=\"n\">amplitude</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">offset</span> <span class=\"o\">=</span> <span class=\"n\">offset</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wave</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;square&#39;</span><span class=\"p\">:</span>\n            <span class=\"n\">t1</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">phase</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span>\n            <span class=\"n\">t2</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">duty</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">phase</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span>\n        <span class=\"k\">elif</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wave</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;triangle&#39;</span><span class=\"p\">:</span>\n            <span class=\"n\">t1</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"mf\">0.25</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">phase</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span>\n            <span class=\"n\">t2</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"mf\">0.75</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">phase</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span>\n\n        <span class=\"c1\"># t1 &lt; t2</span>\n        <span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"mf\">1.0</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span>\n        <span class=\"k\">while</span> <span class=\"n\">t1</span> <span class=\"o\">&lt;</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">simstate</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">simstate</span><span class=\"o\">.</span><span class=\"n\">declare_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t1</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">simstate</span><span class=\"o\">.</span><span class=\"n\">declare_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t2</span><span class=\"p\">)</span>\n            <span class=\"n\">t1</span> <span class=\"o\">+=</span> <span class=\"n\">T</span>\n            <span class=\"n\">t2</span> <span class=\"o\">+=</span> <span class=\"n\">T</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"mf\">1.0</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span>\n        <span class=\"n\">phase</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">t</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">freq</span> <span class=\"o\">-</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">phase</span> <span class=\"p\">)</span> <span class=\"o\">%</span> <span class=\"mf\">1.0</span>\n        \n        <span class=\"c1\"># define all signals in the range -1 to 1</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wave</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;square&#39;</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">phase</span> <span class=\"o\">&lt;</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">duty</span><span class=\"p\">:</span>\n                <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n        <span class=\"k\">elif</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wave</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;triangle&#39;</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">phase</span> <span class=\"o\">&lt;</span> <span class=\"mf\">0.25</span><span class=\"p\">:</span>\n                <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">phase</span> <span class=\"o\">*</span> <span class=\"mi\">4</span>\n            <span class=\"k\">elif</span> <span class=\"n\">phase</span> <span class=\"o\">&lt;</span> <span class=\"mf\">0.75</span><span class=\"p\">:</span>\n                <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"mi\">1</span> <span class=\"o\">-</span> <span class=\"mi\">4</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">phase</span> <span class=\"o\">-</span> <span class=\"mf\">0.25</span><span class=\"p\">)</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span> <span class=\"o\">+</span> <span class=\"mi\">4</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">phase</span> <span class=\"o\">-</span> <span class=\"mf\">0.75</span><span class=\"p\">)</span>\n        <span class=\"k\">elif</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">wave</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;sine&#39;</span><span class=\"p\">:</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phase</span><span class=\"o\">*</span><span class=\"mi\">2</span><span class=\"o\">*</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">pi</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;bad option for signal&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">out</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">amplitude</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">offset</span>\n\n        <span class=\"c1\">#print(&#39;waveform = &#39;, out)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Piecewise\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Piecewise\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Piecewise</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`PIECEWISE`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 0      | 1       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    |        | float   |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Piecewise.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Piecewise.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">seq</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Piecewise constant signal.</span>\n\n<span class=\"sd\">        :param seq: sequence of time, value pairs</span>\n<span class=\"sd\">        :type seq: list of 2-tuples</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a PIECEWISE block</span>\n<span class=\"sd\">        :rtype: Piecewise instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Outputs a piecewise constant function of time.  This is described as</span>\n<span class=\"sd\">        a series of 2-tuples (time, value).  The output value is taken from the</span>\n<span class=\"sd\">        active tuple, that is, the latest one in the list whose time is no greater</span>\n<span class=\"sd\">        than simulation time.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        .. note::</span>\n<span class=\"sd\">            - The tuples must be order by monotonically increasing time.</span>\n<span class=\"sd\">            - There is no default initial value, the list should contain</span>\n<span class=\"sd\">              a tuple with time zero otherwise the output will be undefined.</span>\n\n<span class=\"sd\">        .. note:: The block declares an event for the start of each segment.</span>\n\n<span class=\"sd\">        :seealso: :meth:`declare_events`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"p\">[</span> <span class=\"n\">x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"k\">for</span> <span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"n\">seq</span><span class=\"p\">]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"p\">[</span> <span class=\"n\">x</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"k\">for</span> <span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"n\">seq</span><span class=\"p\">]</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">for</span> <span class=\"n\">t</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"p\">:</span>\n            <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">declare_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"n\">i</span> <span class=\"o\">=</span> <span class=\"nb\">sum</span><span class=\"p\">([</span> <span class=\"mi\">1</span> <span class=\"k\">if</span> <span class=\"n\">t</span> <span class=\"o\">&gt;=</span> <span class=\"n\">_t</span> <span class=\"k\">else</span> <span class=\"mi\">0</span>  <span class=\"k\">for</span> <span class=\"n\">_t</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"p\">])</span> <span class=\"o\">-</span> <span class=\"mi\">1</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">y</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span>\n        <span class=\"c1\">#print(out)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span></div>\n    \n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Step\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Step\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Step</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`STEP`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 0      | 1       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    |        | float   |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Step.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Step.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span>\n                 <span class=\"n\">off</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">on</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span>\n                 <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Step signal.</span>\n\n<span class=\"sd\">        :param T: time of step, defaults to 1</span>\n<span class=\"sd\">        :type T: float, optional</span>\n<span class=\"sd\">        :param off: initial value, defaults to 0</span>\n<span class=\"sd\">        :type off: float, optional</span>\n<span class=\"sd\">        :param on: final value, defaults to 1</span>\n<span class=\"sd\">        :type on: float, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a STEP block</span>\n<span class=\"sd\">        :rtype: Step</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Output a step signal that transitions from the value ``off`` to ``on``</span>\n<span class=\"sd\">        when time equals ``T``.</span>\n\n<span class=\"sd\">        .. note:: The block declares an event for the step time.</span>\n\n<span class=\"sd\">        :seealso: :meth:`declare_events`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">T</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">off</span> <span class=\"o\">=</span> <span class=\"n\">off</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">on</span> <span class=\"o\">=</span> <span class=\"n\">on</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">declare_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"n\">t</span> <span class=\"o\">&gt;=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">:</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">on</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">off</span>\n\n        <span class=\"c1\">#print(out)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Ramp\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Ramp\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Ramp</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`RAMP`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 0      | 1       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    |        | float   |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Ramp.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.sources.Ramp.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span>\n                 <span class=\"n\">off</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">slope</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> \n                 <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Ramp signal.</span>\n\n<span class=\"sd\">        :param T: time of ramp start, defaults to 1</span>\n<span class=\"sd\">        :type T: float, optional</span>\n<span class=\"sd\">        :param off: initial value, defaults to 0</span>\n<span class=\"sd\">        :type off: float, optional</span>\n<span class=\"sd\">        :param slope: gradient of slope, defaults to 1</span>\n<span class=\"sd\">        :type slope: float, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a RAMP block</span>\n<span class=\"sd\">        :rtype: Ramp</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Output a ramp signal that starts increasing from the value ``off``</span>\n<span class=\"sd\">        when time equals ``T`` linearly with time, with a gradient of ``slope``.</span>\n\n<span class=\"sd\">        .. note:: The block declares an event for the ramp start time.</span>\n\n<span class=\"sd\">        :seealso: :method:`declare_event`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">T</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">off</span> <span class=\"o\">=</span> <span class=\"n\">off</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">slope</span> <span class=\"o\">=</span> <span class=\"n\">slope</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">declare_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"n\">t</span> <span class=\"o\">&gt;=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">:</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">off</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">slope</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">t</span> <span class=\"o\">-</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">off</span>\n\n        <span class=\"c1\">#print(out)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span></div>\n\n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">import</span> <span class=\"nn\">pathlib</span>\n    <span class=\"kn\">import</span> <span class=\"nn\">os.path</span>\n\n    <span class=\"n\">exec</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">(</span><span class=\"vm\">__file__</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">absolute</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;test_sources.py&quot;</span><span class=\"p\">))</span><span class=\"o\">.</span><span class=\"n\">read</span><span class=\"p\">())</span>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/blocks/transfers.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.blocks.transfers &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.blocks.transfers</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.blocks.transfers</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Transfer blocks:</span>\n\n<span class=\"sd\">- have inputs and outputs</span>\n<span class=\"sd\">- have state variables</span>\n<span class=\"sd\">- are a subclass of ``TransferBlock`` |rarr| ``Block``</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">import</span> <span class=\"nn\">scipy.signal</span>\n<span class=\"kn\">import</span> <span class=\"nn\">math</span>\n<span class=\"kn\">from</span> <span class=\"nn\">math</span> <span class=\"kn\">import</span> <span class=\"n\">sin</span><span class=\"p\">,</span> <span class=\"n\">cos</span><span class=\"p\">,</span> <span class=\"n\">atan2</span><span class=\"p\">,</span> <span class=\"n\">sqrt</span><span class=\"p\">,</span> <span class=\"n\">pi</span>\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">from</span> <span class=\"nn\">spatialmath</span> <span class=\"kn\">import</span> <span class=\"n\">base</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">TransferBlock</span>\n\n\n<div class=\"viewcode-block\" id=\"Integrator\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.transfers.Integrator\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Integrator</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`INTEGRATOR`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 1          | 1       | N       |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | float,     | float,  |         | </span>\n<span class=\"sd\">       | A(N,)      | A(N,)   |         |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Integrator.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.transfers.Integrator.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"mi\">0</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=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Integrator.</span>\n\n<span class=\"sd\">        :param x0: Initial state, defaults to 0</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param min: Minimum value of state, defaults to None</span>\n<span class=\"sd\">        :type min: float or array_like, optional</span>\n<span class=\"sd\">        :param max: Maximum value of state, defaults to None</span>\n<span class=\"sd\">        :type max: float or array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: an INTEGRATOR block</span>\n<span class=\"sd\">        :rtype: Integrator instance</span>\n\n<span class=\"sd\">        Output is the time integral of the input.  The state can be a scalar or a</span>\n<span class=\"sd\">        vector. The initial state, and type, is given by ``x0``.  The shape of</span>\n<span class=\"sd\">        the input signal must match ``x0``.</span>\n\n<span class=\"sd\">        The minimum and maximum values can be:</span>\n\n<span class=\"sd\">            - a scalar, in which case the same value applies to every element of </span>\n<span class=\"sd\">              the state vector, or</span>\n<span class=\"sd\">            - a vector, of the same shape as ``x0`` that applies elementwise to</span>\n<span class=\"sd\">              the state.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">)):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n            <span class=\"k\">if</span> <span class=\"nb\">min</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"nb\">min</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span>\n            <span class=\"k\">if</span> <span class=\"nb\">max</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"nb\">max</span> <span class=\"o\">=</span> <span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span>\n                \n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n                <span class=\"k\">if</span> <span class=\"n\">x0</span><span class=\"o\">.</span><span class=\"n\">ndim</span> <span class=\"o\">&gt;</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n                    <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;state must be a 1D vector&#39;</span><span class=\"p\">)</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span>\n\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"n\">x0</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n            <span class=\"k\">if</span> <span class=\"nb\">min</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"nb\">min</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"nb\">min</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;minimum bound length must match x0&#39;</span><span class=\"p\">)</span>\n\n            <span class=\"k\">if</span> <span class=\"nb\">max</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"nb\">max</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">math</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"nb\">max</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">:</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;maximum bound length must match x0&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">x0</span><span class=\"p\">]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">min</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"nb\">min</span><span class=\"p\">]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">max</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"nb\">max</span><span class=\"p\">]</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;nstates&#39;</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">]</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">xd</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">&lt;</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">min</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"ow\">or</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">&gt;</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">max</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]:</span>\n                <span class=\"n\">xd</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"k\">return</span> <span class=\"n\">xd</span></div>\n\n<div class=\"viewcode-block\" id=\"PoseIntegrator\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.transfers.PoseIntegrator\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">PoseIntegrator</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`POSEINTEGRATOR`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 1          | 1       | N       |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | A(N,)      | A(N,)   |         |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"PoseIntegrator.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.transfers.PoseIntegrator.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Pose integrator</span>\n\n<span class=\"sd\">        :param x0: Initial pose, defaults to null</span>\n<span class=\"sd\">        :type x0: SE3, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: an INTEGRATOR block</span>\n<span class=\"sd\">        :rtype: Integrator instance</span>\n\n<span class=\"sd\">        This block integrates spatial velocity over time.</span>\n<span class=\"sd\">        The block input is a spatial velocity as a 6-vector</span>\n<span class=\"sd\">        :math:`(v_x, v_y, v_z, \\omega_x, \\omega_y, \\omega_z)` and the output</span>\n<span class=\"sd\">        is pose as an ``SE3`` instance.</span>\n\n<span class=\"sd\">        .. note:: State is a velocity twist.</span>\n\n<span class=\"sd\">        .. warning:: NOT WORKING YET</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">SE3</span><span class=\"p\">()</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">6</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">x0</span><span class=\"p\">]</span>\n\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;nstates&#39;</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">Twist3</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">SE3</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)]</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">xd</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">&lt;</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">min</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"ow\">or</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">&gt;</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">max</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]:</span>\n                <span class=\"n\">xd</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"k\">return</span> <span class=\"n\">xd</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"LTI_SS\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.transfers.LTI_SS\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">LTI_SS</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`LTI_SS`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 1          | 1       | nc      |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | float,     | float,  |         | </span>\n<span class=\"sd\">       | A(nb,)     | A(nc,)  |         |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"LTI_SS.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.transfers.LTI_SS.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">A</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">B</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">C</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        State-space LTI dynamics.</span>\n\n<span class=\"sd\">        :param N: numerator coefficients, defaults to 1</span>\n<span class=\"sd\">        :type N: array_like, optional</span>\n<span class=\"sd\">        :param D: denominator coefficients, defaults to [1,1]</span>\n<span class=\"sd\">        :type D: array_like, optional</span>\n<span class=\"sd\">        :param x0: initial states, defaults to None</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A SCOPE block</span>\n<span class=\"sd\">        :rtype: LTI_SISO instance</span>\n\n<span class=\"sd\">        Implements the dynamics of a single-input single-output (SISO) linear</span>\n<span class=\"sd\">        time invariant (LTI) system described by numerator and denominator</span>\n<span class=\"sd\">        polynomial coefficients.</span>\n\n<span class=\"sd\">        Coefficients are given in the order from highest order to zeroth </span>\n<span class=\"sd\">        order, ie. :math:`2s^2 - 4s +3` is ``[2, -4, 3]``.</span>\n\n<span class=\"sd\">        Only proper transfer functions, where order of numerator is less</span>\n<span class=\"sd\">        than denominator are allowed.</span>\n\n<span class=\"sd\">        The order of the states in ``x0`` is consistent with controller canonical</span>\n<span class=\"sd\">        form.</span>\n\n<span class=\"sd\">        Examples::</span>\n\n<span class=\"sd\">            LTI_SISO(N=[1,2], D=[2, 3, -4])</span>\n\n<span class=\"sd\">        is the transfer function :math:`\\frac{s+2}{2s^2+3s-4}`.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\">#print(&#39;in SS constructor&#39;)</span>\n        <span class=\"k\">assert</span> <span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"s1\">&#39;A must be square&#39;</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">B</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n            <span class=\"n\">B</span> <span class=\"o\">=</span> <span class=\"n\">B</span><span class=\"o\">.</span><span class=\"n\">reshape</span><span class=\"p\">((</span><span class=\"n\">n</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"n\">B</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n        <span class=\"k\">assert</span> <span class=\"n\">B</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"n\">n</span><span class=\"p\">,</span> <span class=\"s1\">&#39;B must have same number of rows as A&#39;</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">C</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">1</span><span class=\"p\">:</span>\n            <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n            <span class=\"k\">assert</span> <span class=\"n\">C</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"n\">n</span><span class=\"p\">,</span> <span class=\"s1\">&#39;C must have same number of columns as A&#39;</span>\n            <span class=\"n\">C</span> <span class=\"o\">=</span> <span class=\"n\">C</span><span class=\"o\">.</span><span class=\"n\">reshape</span><span class=\"p\">((</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">n</span><span class=\"p\">))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"n\">C</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n            <span class=\"k\">assert</span> <span class=\"n\">C</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"n\">n</span><span class=\"p\">,</span> <span class=\"s1\">&#39;C must have same number of columns as A&#39;</span>\n\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">A</span> <span class=\"o\">=</span> <span class=\"n\">A</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">B</span> <span class=\"o\">=</span> <span class=\"n\">B</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">C</span> <span class=\"o\">=</span> <span class=\"n\">C</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">list</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">C</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">A</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">B</span> <span class=\"o\">@</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">)</span></div>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n\n<div class=\"viewcode-block\" id=\"LTI_SISO\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.transfers.LTI_SISO\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">LTI_SISO</span><span class=\"p\">(</span><span class=\"n\">LTI_SS</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`LTI_SISO`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 1          | 1       | n       |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | float      | float   |         | </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">     </span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"LTI_SISO.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#bdsim.blocks.transfers.LTI_SISO.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">N</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">D</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        SISO LTI dynamics.</span>\n\n<span class=\"sd\">        :param N: numerator coefficients, defaults to 1</span>\n<span class=\"sd\">        :type N: array_like, optional</span>\n<span class=\"sd\">        :param D: denominator coefficients, defaults to [1,1]</span>\n<span class=\"sd\">        :type D: array_like, optional</span>\n<span class=\"sd\">        :param x0: initial states, defaults to None</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: A SCOPE block</span>\n<span class=\"sd\">        :rtype: LTI_SISO instance</span>\n\n<span class=\"sd\">        Implements the dynamics of a single-input single-output (SISO) linear</span>\n<span class=\"sd\">        time invariant (LTI) system described by numerator and denominator</span>\n<span class=\"sd\">        polynomial coefficients.</span>\n\n<span class=\"sd\">        Coefficients are given in the order from highest order to zeroth </span>\n<span class=\"sd\">        order, ie. :math:`2s^2 - 4s +3` is ``[2, -4, 3]``.</span>\n\n<span class=\"sd\">        Only proper transfer functions, where order of numerator is less</span>\n<span class=\"sd\">        than denominator are allowed.</span>\n\n<span class=\"sd\">        The order of the states in ``x0`` is consistent with controller canonical</span>\n<span class=\"sd\">        form.</span>\n\n<span class=\"sd\">        Examples::</span>\n\n<span class=\"sd\">            LTI_SISO(N=[1, 2], D=[2, 3, -4])</span>\n\n<span class=\"sd\">        is the transfer function :math:`\\frac{s+2}{2s^2+3s-4}`.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\">#print(&#39;in SISO constscutor&#39;)</span>\n\n        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">N</span><span class=\"p\">,</span> <span class=\"nb\">list</span><span class=\"p\">):</span>\n            <span class=\"n\">N</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">N</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">D</span><span class=\"p\">,</span> <span class=\"nb\">list</span><span class=\"p\">):</span>\n            <span class=\"n\">D</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">D</span><span class=\"p\">]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">N</span> <span class=\"o\">=</span> <span class=\"n\">N</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span> <span class=\"o\">=</span> <span class=\"n\">N</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">D</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"mi\">1</span>\n        <span class=\"n\">nn</span> <span class=\"o\">=</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">N</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">n</span><span class=\"p\">,))</span>\n        <span class=\"k\">assert</span> <span class=\"n\">nn</span> <span class=\"o\">&lt;=</span> <span class=\"n\">n</span><span class=\"p\">,</span> <span class=\"s1\">&#39;direct pass through is not supported&#39;</span>\n\n        <span class=\"c1\"># convert to numpy arrays</span>\n        <span class=\"n\">N</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">D</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">N</span><span class=\"p\">),)),</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">N</span><span class=\"p\">)]</span>\n        <span class=\"n\">D</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">D</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># normalize the coefficients to obtain</span>\n        <span class=\"c1\">#</span>\n        <span class=\"c1\">#   b_0 s^n + b_1 s^(n-1) + ... + b_n</span>\n        <span class=\"c1\">#   ---------------------------------</span>\n        <span class=\"c1\">#   a_0 s^n + a_1 s^(n-1) + ....+ a_n</span>\n\n        <span class=\"c1\"># normalize so leading coefficient of denominator is one</span>\n        <span class=\"c1\"># D0 = D[0]</span>\n        <span class=\"c1\"># D = D / D0</span>\n        <span class=\"c1\"># N = N / D0</span>\n\n        <span class=\"c1\"># A = np.eye(len(D) - 1, k=1)  # control canonic (companion matrix) form</span>\n        <span class=\"c1\"># A[-1, :] = -D[1:]</span>\n\n        <span class=\"c1\"># B = np.zeros((n, 1))</span>\n        <span class=\"c1\"># B[-1] = 1</span>\n\n        <span class=\"c1\"># C = (N[1:] - N[0] * D[1:]).reshape((1, n))</span>\n\n        <span class=\"n\">A</span><span class=\"p\">,</span> <span class=\"n\">B</span><span class=\"p\">,</span> <span class=\"n\">C</span><span class=\"p\">,</span> <span class=\"n\">D</span> <span class=\"o\">=</span> <span class=\"n\">scipy</span><span class=\"o\">.</span><span class=\"n\">signal</span><span class=\"o\">.</span><span class=\"n\">tf2ss</span><span class=\"p\">(</span><span class=\"n\">N</span><span class=\"p\">,</span> <span class=\"n\">D</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">num</span> <span class=\"o\">=</span> <span class=\"n\">N</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">den</span> <span class=\"o\">=</span> <span class=\"n\">D</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">flatnonzero</span><span class=\"p\">(</span><span class=\"n\">D</span><span class=\"p\">))</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;D matrix is not zero&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">A</span><span class=\"o\">=</span><span class=\"n\">A</span><span class=\"p\">,</span> <span class=\"n\">B</span><span class=\"o\">=</span><span class=\"n\">B</span><span class=\"p\">,</span> <span class=\"n\">C</span><span class=\"o\">=</span><span class=\"n\">C</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">verbose</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;A=&#39;</span><span class=\"p\">,</span> <span class=\"n\">A</span><span class=\"p\">)</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;B=&#39;</span><span class=\"p\">,</span> <span class=\"n\">B</span><span class=\"p\">)</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;C=&#39;</span><span class=\"p\">,</span> <span class=\"n\">C</span><span class=\"p\">)</span>\n\n\n        <span class=\"k\">def</span> <span class=\"nf\">change_param</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">param</span><span class=\"p\">,</span> <span class=\"n\">newvalue</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span> <span class=\"n\">param</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;num&#39;</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">num</span> <span class=\"o\">=</span> <span class=\"n\">newvalue</span>\n            <span class=\"k\">elif</span> <span class=\"n\">param</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;den&#39;</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">den</span> <span class=\"o\">=</span> <span class=\"n\">newvalue</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">A</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">B</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">C</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span> <span class=\"o\">=</span> <span class=\"n\">scipy</span><span class=\"o\">.</span><span class=\"n\">signal</span><span class=\"o\">.</span><span class=\"n\">tf2ss</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">num</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">den</span><span class=\"p\">)</span>\n            \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_param</span><span class=\"p\">(</span><span class=\"s1\">&#39;num&#39;</span><span class=\"p\">,</span> <span class=\"n\">change_param</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">add_param</span><span class=\"p\">(</span><span class=\"s1\">&#39;den&#39;</span><span class=\"p\">,</span> <span class=\"n\">change_param</span><span class=\"p\">)</span></div></div>\n\n\n\n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">import</span> <span class=\"nn\">pathlib</span>\n    <span class=\"kn\">import</span> <span class=\"nn\">os.path</span>\n\n    <span class=\"n\">exec</span><span class=\"p\">(</span><span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">(</span>\n        <span class=\"vm\">__file__</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">absolute</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;test_transfers.py&quot;</span><span class=\"p\">))</span><span class=\"o\">.</span><span class=\"n\">read</span><span class=\"p\">())</span>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/components.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.components &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../\" src=\"../../_static/documentation_options.js\"></script>\n        <script src=\"../../_static/jquery.js\"></script>\n        <script src=\"../../_static/underscore.js\"></script>\n        <script src=\"../../_static/doctools.js\"></script>\n        <script src=\"../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.components</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.components</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"ch\">#!/usr/bin/env python3</span>\n<span class=\"c1\"># -*- coding: utf-8 -*-</span>\n<span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Components of the simulation system, namely blocks, wires and plugs.</span>\n<span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">math</span>\n<span class=\"kn\">from</span> <span class=\"nn\">re</span> <span class=\"kn\">import</span> <span class=\"n\">S</span>\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">from</span> <span class=\"nn\">matplotlib</span> <span class=\"kn\">import</span> <span class=\"n\">animation</span>\n<span class=\"kn\">from</span> <span class=\"nn\">collections</span> <span class=\"kn\">import</span> <span class=\"n\">UserDict</span>\n<div class=\"viewcode-block\" id=\"Struct\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Struct\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Struct</span><span class=\"p\">(</span><span class=\"n\">UserDict</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    A dict like object that allows items to be added by attribute or by key.</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    For example::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        &gt;&gt;&gt; d = Struct(&#39;thing&#39;)</span>\n<span class=\"sd\">        &gt;&gt;&gt; d.a = 1</span>\n<span class=\"sd\">        &gt;&gt;&gt; d[&#39;b&#39;] = 2</span>\n<span class=\"sd\">        &gt;&gt;&gt; d.a</span>\n<span class=\"sd\">        1</span>\n<span class=\"sd\">        &gt;&gt;&gt; d[&#39;a&#39;]</span>\n<span class=\"sd\">        1</span>\n<span class=\"sd\">        &gt;&gt;&gt; d.b</span>\n<span class=\"sd\">        2</span>\n<span class=\"sd\">        &gt;&gt;&gt; str(d)</span>\n<span class=\"sd\">        &quot;thing {&#39;a&#39;: 1, &#39;b&#39;: 2}&quot;</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    \n<div class=\"viewcode-block\" id=\"Struct.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Struct.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;Struct&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">()</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"n\">name</span>\n        <span class=\"k\">for</span> <span class=\"n\">key</span><span class=\"p\">,</span> <span class=\"n\">value</span> <span class=\"ow\">in</span> <span class=\"n\">kwargs</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"bp\">self</span><span class=\"p\">[</span><span class=\"n\">key</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">value</span></div>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__setattr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">):</span>\n        <span class=\"c1\"># invoked by struct[name] = value</span>\n        <span class=\"k\">if</span> <span class=\"n\">name</span> <span class=\"ow\">in</span> <span class=\"p\">[</span><span class=\"s1\">&#39;data&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;name&#39;</span><span class=\"p\">]:</span>\n            <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__setattr__</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">[</span><span class=\"n\">name</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">value</span>\n    \n<div class=\"viewcode-block\" id=\"Struct.add\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Struct.add\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">add</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"p\">[</span><span class=\"n\">name</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">value</span></div>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__getattr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">):</span>\n        <span class=\"c1\"># return self.data[name]</span>\n        <span class=\"c1\"># some tricks to make this deepcopy safe</span>\n        <span class=\"c1\"># https://stackoverflow.com/questions/40583131/python-deepcopy-with-custom-getattr-and-setattr</span>\n        <span class=\"c1\"># https://stackoverflow.com/questions/25977996/supporting-the-deep-copy-operation-on-a-custom-class</span>\n        <span class=\"k\">try</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__getattribute__</span><span class=\"p\">(</span><span class=\"s1\">&#39;data&#39;</span><span class=\"p\">)[</span><span class=\"n\">name</span><span class=\"p\">]</span>\n        <span class=\"k\">except</span> <span class=\"ne\">KeyError</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">AttributeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;unknown attribute &#39;</span> <span class=\"o\">+</span> <span class=\"n\">name</span><span class=\"p\">)</span>\n        \n    <span class=\"k\">def</span> <span class=\"fm\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span>\n    \n    <span class=\"k\">def</span> <span class=\"fm\">__str__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">def</span> <span class=\"nf\">fmt</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span><span class=\"p\">,</span> <span class=\"n\">indent</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">):</span>\n            <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">,</span> <span class=\"n\">Struct</span><span class=\"p\">):</span>\n                <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;</span><span class=\"si\">{:12s}</span><span class=\"s1\">: </span><span class=\"si\">{:12s}</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"vm\">__name__</span><span class=\"p\">)</span>\n                <span class=\"k\">for</span> <span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"n\">v</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n                    <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"n\">fmt</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span><span class=\"p\">,</span> <span class=\"n\">indent</span> <span class=\"o\">+</span> <span class=\"mi\">1</span><span class=\"p\">)</span>\n                <span class=\"k\">return</span> <span class=\"n\">s</span>\n            <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">):</span>\n                <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;            &gt; &#39;</span> <span class=\"o\">*</span> <span class=\"n\">indent</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;</span><span class=\"si\">{:12s}</span><span class=\"s1\">| </span><span class=\"si\">{:s}</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"vm\">__name__</span> <span class=\"o\">+</span> <span class=\"s1\">&#39; &#39;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">))</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;            &gt; &#39;</span> <span class=\"o\">*</span> <span class=\"n\">indent</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;</span><span class=\"si\">{:12s}</span><span class=\"s1\">| </span><span class=\"si\">{:s}</span><span class=\"s1\"> = </span><span class=\"si\">{}</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"vm\">__name__</span><span class=\"p\">,</span> <span class=\"n\">v</span><span class=\"p\">)</span>\n            <span class=\"k\">return</span> <span class=\"n\">s</span>\n\n        <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;&#39;</span>\n        <span class=\"k\">for</span> <span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">data</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"k\">if</span> <span class=\"n\">k</span><span class=\"o\">.</span><span class=\"n\">startswith</span><span class=\"p\">(</span><span class=\"s1\">&#39;_&#39;</span><span class=\"p\">):</span>\n                <span class=\"k\">continue</span>\n            <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"n\">fmt</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"p\">,</span> <span class=\"n\">v</span><span class=\"p\">)</span>\n\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;:</span><span class=\"se\">\\n</span><span class=\"s1\">&#39;</span> <span class=\"o\">+</span> <span class=\"n\">s</span></div>\n\n<div class=\"viewcode-block\" id=\"PriorityQ\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.PriorityQ\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">PriorityQ</span><span class=\"p\">:</span>\n\n<div class=\"viewcode-block\" id=\"PriorityQ.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.PriorityQ.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"p\">[]</span></div>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__len__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__str__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;PriorityQ: len=</span><span class=\"si\">{</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;PriorityQ: len=</span><span class=\"si\">{</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\">, first out </span><span class=\"si\">{</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"PriorityQ.push\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.PriorityQ.push\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">push</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"PriorityQ.pop\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.PriorityQ.pop\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">pop</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">dt</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"p\">[]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"o\">.</span><span class=\"n\">sort</span><span class=\"p\">(</span><span class=\"n\">key</span><span class=\"o\">=</span><span class=\"k\">lambda</span> <span class=\"n\">x</span><span class=\"p\">:</span> <span class=\"n\">x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n\n        <span class=\"n\">qfirst</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"o\">.</span><span class=\"n\">pop</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">)</span>\n        <span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"n\">qfirst</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">blocks</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">qfirst</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]]</span>\n        <span class=\"k\">while</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span> <span class=\"ow\">and</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">&lt;</span> <span class=\"p\">(</span><span class=\"n\">t</span> <span class=\"o\">+</span> <span class=\"n\">dt</span><span class=\"p\">):</span>\n            <span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"o\">.</span><span class=\"n\">pop</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">)[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n        <span class=\"k\">return</span> <span class=\"n\">t</span><span class=\"p\">,</span> <span class=\"n\">blocks</span></div>\n\n<div class=\"viewcode-block\" id=\"PriorityQ.pop_until\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.PriorityQ.pop_until\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">pop_until</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"p\">[]</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"o\">.</span><span class=\"n\">sort</span><span class=\"p\">(</span><span class=\"n\">key</span><span class=\"o\">=</span><span class=\"k\">lambda</span> <span class=\"n\">x</span><span class=\"p\">:</span> <span class=\"n\">x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n        <span class=\"n\">i</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"k\">while</span> <span class=\"kc\">True</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">][</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">&gt;</span> <span class=\"n\">t</span><span class=\"p\">:</span>\n                <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"p\">[:</span><span class=\"n\">i</span><span class=\"p\">]</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">:]</span>\n                <span class=\"k\">return</span> <span class=\"n\">out</span>\n            <span class=\"n\">i</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span></div></div>\n\n<div class=\"viewcode-block\" id=\"Wire\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Wire\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Wire</span><span class=\"p\">:</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    Create a wire.</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    :param start: Plug at the start of a wire, defaults to None</span>\n<span class=\"sd\">    :type start: Plug, optional</span>\n<span class=\"sd\">    :param end: Plug at the end of a wire, defaults to None</span>\n<span class=\"sd\">    :type end: Plug, optional</span>\n<span class=\"sd\">    :param name: Name of wire, defaults to None</span>\n<span class=\"sd\">    :type name: str, optional</span>\n<span class=\"sd\">    :return: A wire object</span>\n<span class=\"sd\">    :rtype: Wire</span>\n\n<span class=\"sd\">    A Wire object connects two block ports.  A Wire has a reference to the</span>\n<span class=\"sd\">    start and end ports.</span>\n\n<span class=\"sd\">    A wire records all the connections defined by the user.  At compile time</span>\n<span class=\"sd\">    wires are used to build inter-block references.</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    Between two blocks, a wire can connect one or more ports, ie. it can connect</span>\n<span class=\"sd\">    a set of output ports on one block to a same sized set of input ports on </span>\n<span class=\"sd\">    another block.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>      \n                \n    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">start</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">end</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"n\">name</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">start</span> <span class=\"o\">=</span> <span class=\"n\">start</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">end</span> <span class=\"o\">=</span> <span class=\"n\">end</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">value</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n\n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">info</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Interactive display of wire properties.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Displays all attributes of the wire for debugging purposes.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;wire:&quot;</span><span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">k</span><span class=\"p\">,</span><span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;  </span><span class=\"si\">{:8s}{:s}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"o\">+</span><span class=\"s2\">&quot;:&quot;</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">)))</span>\n            \n<div class=\"viewcode-block\" id=\"Wire.send\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Wire.send\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">send</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"n\">sinks</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Send a value to the port at end of this wire.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :param value: A port value</span>\n<span class=\"sd\">        :type value: float, numpy.ndarray, etc.</span>\n\n<span class=\"sd\">        The value is sent to the input port connected to the end of this wire.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># dest is a Wire</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">setinput</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">)</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"fm\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Display wire with name and connection details.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :return: Long-form wire description</span>\n<span class=\"sd\">        :rtype: str</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        String format::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            wire.5: d2goal[0] --&gt; Kv[0]</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">return</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;: &quot;</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fullname</span>\n    \n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">fullname</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Display wire connection details.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :return: Wire name</span>\n<span class=\"sd\">        :rtype: str</span>\n\n<span class=\"sd\">        String format::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            d2goal[0] --&gt; Kv[0]</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">return</span> <span class=\"s2\">&quot;</span><span class=\"si\">{:s}</span><span class=\"s2\">[</span><span class=\"si\">{:d}</span><span class=\"s2\">] --&gt; </span><span class=\"si\">{:s}</span><span class=\"s2\">[</span><span class=\"si\">{:d}</span><span class=\"s2\">]&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"p\">),</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"p\">),</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">)</span>\n    \n    <span class=\"k\">def</span> <span class=\"fm\">__str__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Display wire name.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :return: Wire name</span>\n<span class=\"sd\">        :rtype: str</span>\n\n<span class=\"sd\">        String format::</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            wire.5</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;wire.&quot;</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span>\n        <span class=\"k\">elif</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">id</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">id</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"s1\">&#39;??&#39;</span>\n        <span class=\"k\">return</span> <span class=\"n\">s</span></div>\n\n        \n<span class=\"c1\"># ------------------------------------------------------------------------- # </span>\n\n<div class=\"viewcode-block\" id=\"Plug\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Plug</span><span class=\"p\">:</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    Create a plug.</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    :param block: The block being plugged into</span>\n<span class=\"sd\">    :type block: Block</span>\n<span class=\"sd\">    :param port: The port on the block, defaults to 0</span>\n<span class=\"sd\">    :type port: int, optional</span>\n<span class=\"sd\">    :param type: &#39;start&#39; or &#39;end&#39;, defaults to None</span>\n<span class=\"sd\">    :type type: str, optional</span>\n<span class=\"sd\">    :return: Plug object</span>\n<span class=\"sd\">    :rtype: Plug</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    Plugs are the interface between a wire and block and have information</span>\n<span class=\"sd\">    about port number and wire end. Plugs are on the end of each wire, and connect a </span>\n<span class=\"sd\">    Wire to a specific port on a Block.</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    The ``type`` argument indicates if the ``Plug`` is at:</span>\n<span class=\"sd\">        - the start of a wire, ie. the port is an output port</span>\n<span class=\"sd\">        - the end of a wire, ie. the port is an input port</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">    A plug can specify a set of ports on a block.</span>\n\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">__array_ufunc__</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>  <span class=\"c1\"># allow block operators with NumPy values</span>\n\n<div class=\"viewcode-block\" id=\"Plug.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"p\">,</span> <span class=\"n\">port</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span> <span class=\"o\">=</span> <span class=\"n\">block</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span> <span class=\"o\">=</span> <span class=\"n\">port</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"nb\">type</span>  <span class=\"c1\"># start</span></div>\n        \n    \n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">isslice</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Test if port number is a slice.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :return: Whether the port is a slice</span>\n<span class=\"sd\">        :rtype: bool</span>\n\n<span class=\"sd\">        Returns ``True`` if the port is a slice, eg. ``[0:3]``, and ``False``</span>\n<span class=\"sd\">        for a simple index, eg. ``[2]``.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">return</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"nb\">slice</span><span class=\"p\">)</span>\n    \n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">portlist</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Return port numbers.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :return: Port numbers</span>\n<span class=\"sd\">        :rtype: list of int</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        If the port is a simple index, eg. ``[2]`` returns [2].</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        If the port is a slice, eg. ``[0:3]``, returns [0, 1, 2].</span>\n<span class=\"sd\">        For the case ``[2:]`` the upper bound is the maximum number of input</span>\n<span class=\"sd\">        or output ports of the block.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"nb\">int</span><span class=\"p\">):</span>\n            <span class=\"c1\"># easy case, this plug is a single wire</span>\n            <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">]</span>\n\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"nb\">slice</span><span class=\"p\">):</span>\n            <span class=\"c1\"># this plug is a bunch of wires</span>\n            <span class=\"n\">start</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"o\">.</span><span class=\"n\">start</span> <span class=\"ow\">or</span> <span class=\"mi\">0</span>\n            <span class=\"n\">step</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"o\">.</span><span class=\"n\">step</span> <span class=\"ow\">or</span> <span class=\"mi\">1</span>\n            <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"o\">.</span><span class=\"n\">stop</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;start&#39;</span><span class=\"p\">:</span>\n                    <span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">nout</span>\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">nin</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">stop</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"o\">.</span><span class=\"n\">stop</span>\n\n            <span class=\"k\">return</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"n\">start</span><span class=\"p\">,</span> <span class=\"n\">stop</span><span class=\"p\">,</span> <span class=\"n\">step</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;bad plug index&#39;</span><span class=\"p\">)</span>\n\n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">width</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Return number of ports connected.</span>\n\n<span class=\"sd\">        :return: Number of ports</span>\n<span class=\"sd\">        :rtype: int</span>\n\n<span class=\"sd\">        If the port is a simple index, eg. ``[2]`` returns 1.</span>\n\n<span class=\"sd\">        If the port is a slice, eg. ``[0:3]``, returns 3.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">return</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">portlist</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"Plug.__rshift__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__rshift__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__rshift__</span><span class=\"p\">(</span><span class=\"n\">left</span><span class=\"p\">,</span> <span class=\"n\">right</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded &gt;&gt; operator for implicit wiring.</span>\n\n<span class=\"sd\">        :param left: A plug to be wired from</span>\n<span class=\"sd\">        :type left: Plug</span>\n<span class=\"sd\">        :param right: A block or plug to be wired to</span>\n<span class=\"sd\">        :type right: Block or Plug</span>\n<span class=\"sd\">        :return: ``right``</span>\n<span class=\"sd\">        :rtype: Block or Plug</span>\n\n<span class=\"sd\">        Implements implicit wiring, where the left-hand operator is a Plug, for example::</span>\n\n<span class=\"sd\">            a = bike[2] &gt;&gt; bd.GAIN(3)</span>\n\n<span class=\"sd\">        will connect port 2 of ``bike`` to the input of the GAIN block.</span>\n\n<span class=\"sd\">        Note that::</span>\n\n<span class=\"sd\">           a = bike[2] &gt;&gt; func[1]</span>\n\n<span class=\"sd\">        will connect port 2 of ``bike`` to port 1 of ``func``, and port 1 of ``func``</span>\n<span class=\"sd\">        will be assigned to ``a``.  To specify a different outport port on ``func``</span>\n<span class=\"sd\">        we need to use parentheses::</span>\n\n<span class=\"sd\">            a = (bike[2] &gt;&gt; func[1])[0]</span>\n\n<span class=\"sd\">        which will connect port 2 of ``bike`` to port 1 of ``func``, and port 0 of ``func``</span>\n<span class=\"sd\">        will be assigned to ``a``.</span>\n\n<span class=\"sd\">        :seealso: Block.__mul__</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"c1\"># called for the cases:</span>\n        <span class=\"c1\"># block * block</span>\n        <span class=\"c1\"># block * plug</span>\n        <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">left</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span>\n        <span class=\"c1\">#assert isinstance(right, Block), &#39;arguments to * must be blocks not ports (for now)&#39;</span>\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">s</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">left</span><span class=\"p\">,</span> <span class=\"n\">right</span><span class=\"p\">)</span>  <span class=\"c1\"># add a wire</span>\n        <span class=\"c1\">#print(&#39;plug * &#39; + str(w))</span>\n        <span class=\"k\">return</span> <span class=\"n\">right</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__add__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__add__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__add__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded + operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be added </span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be added</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: SUM block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the + operator when the left operand is a ``Plug``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X[i] + Y</span>\n<span class=\"sd\">            result = X[i] + Y[j]</span>\n<span class=\"sd\">            result = X[i] + C</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Create a ``SUM(&quot;++&quot;)`` block named ``_sum.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new ``CONSTANT(C)`` block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__radd__` :meth:`Block.__add__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># plug + constant, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;++&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">))</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__radd__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__radd__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__radd__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded + operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be added </span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be added</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: SUM block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the + operator when the right operand is a ``Plug``</span>\n<span class=\"sd\">        and the left operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X + Y[j]</span>\n<span class=\"sd\">            result = X[i] + Y[j]</span>\n<span class=\"sd\">            result = C + Y[j]</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Create a ``SUM(&quot;++&quot;) block named ``_sum.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new ``CONSTANT(C)`` block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        .. note:: The inputs to the summing junction are reversed: right then left operand.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__add__` :meth:`Block.__radd__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># constant + plug, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;++&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">))</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__sub__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__sub__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__sub__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded - operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be added (minuend)</span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be subtracted (subtrahend)</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: SUM block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the - operator when the left operand is a ``Plug``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X[i] - Y</span>\n<span class=\"sd\">            result = X[i] - Y[j]</span>\n<span class=\"sd\">            result = X[i] - C</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Create a ``SUM(&quot;+-&quot;)`` block named ``_sum.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new ``CONSTANT(C)`` block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__rsub__` :meth:`Block.__sub__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># plug - constant, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;+-&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">))</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__rsub__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__rsub__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__rsub__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded - operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be added (minuend)</span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be subtracted (subtrahend)</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: SUM block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the - operator when the left operand is a ``Plug``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X - Y[j]</span>\n<span class=\"sd\">            result = X[i] - Y[j]</span>\n<span class=\"sd\">            result = C - Y[j]</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Create a ``SUM(&quot;+-&quot;)`` block named ``_sum.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new ``CONSTANT(C)`` block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        .. note:: The inputs to the summing junction are reversed: right then left operand.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__sub__` :meth:`Block.__rsub__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># TODO deal with other cases as per above</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># constant - plug, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;+-&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">))</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__neg__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__neg__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__neg__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded unary minus operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be negated</span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :return: GAIN block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the - operator for unary minus when the operand is a ``Plug``::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = -X[i]</span>\n\n<span class=\"sd\">        where ``X`` is a block.</span>\n\n<span class=\"sd\">        Create a ``GAIN(-1)`` block named ``_gain.N`` whose input is the </span>\n<span class=\"sd\">        operand.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__neg__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">GAIN</span><span class=\"p\">(</span><span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"p\">])</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__mul__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__mul__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__mul__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded * operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be multiplied </span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be multiplied</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: PROD or GAIN block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the * operator when the left operand is a ``Plug``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X[i] * Y</span>\n<span class=\"sd\">            result = X[i] * Y[j]</span>\n<span class=\"sd\">            result = X[i] * C</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Create a ``PROD(&quot;**&quot;)`` block named ``_prod.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.</span>\n\n<span class=\"sd\">        For the third case, create a ``GAIN(C)`` block named ``_gain.N``.</span>\n\n<span class=\"sd\">        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy</span>\n<span class=\"sd\">            array then the option ``matrix`` is set to True.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__rmul__` :meth:`Block.__mul__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># plug * constant, create a GAIN block</span>\n            <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">_autogain</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">premul</span><span class=\"o\">=</span><span class=\"n\">matrix</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"p\">])</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"c1\"># value * value, create a PROD block</span>\n            <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_prod.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n            <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PROD</span><span class=\"p\">(</span><span class=\"s1\">&#39;**&#39;</span><span class=\"p\">,</span> <span class=\"n\">matrix</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">])</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__rmul__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__rmul__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__rmul__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded * operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be multiplied</span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be multiplied</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: PROD or GAIN block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the * operator when the right operand is a ``Plug``</span>\n<span class=\"sd\">        and the left operand is a ``Plug``, ``Block`` or constant::</span>\n\n<span class=\"sd\">            result = X * Y[j]</span>\n<span class=\"sd\">            result = X[i] * Y[j]</span>\n<span class=\"sd\">            result = C * Y[j]</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        For the first two cases, a ``PROD(&quot;**&quot;)`` block named ``_prod.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  </span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        For the third case, create a ``GAIN(C)`` block named ``_gain.N``.</span>\n\n<span class=\"sd\">        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy</span>\n<span class=\"sd\">            array then the option ``matrix`` is set to True.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__mul__` :meth:`Block.__rmul__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># constant * plug, create a CONSTANT block</span>\n            <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)</span>\n            <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">_autogain</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">premul</span><span class=\"o\">=</span><span class=\"n\">matrix</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"p\">])</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__truediv__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__truediv__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__truediv__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded / operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be multiplied (dividend)</span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be divided (divisor)</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: PROD or GAIN block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the / operator when the left operand is a ``Plug``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X[i] / Y</span>\n<span class=\"sd\">            result = X[i] / Y[j]</span>\n<span class=\"sd\">            result = X[i] / C</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Create a ``PROD(&quot;**&quot;)`` block named ``_prod.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.</span>\n\n<span class=\"sd\">        For the third case, create a ``GAIN(1/C)`` block named ``_gain.N``.</span>\n\n<span class=\"sd\">        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy</span>\n<span class=\"sd\">            array then the option ``matrix`` is set to True.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__rtruediv__` :meth:`Block.__truediv__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># plug / constant , create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PROD</span><span class=\"p\">(</span><span class=\"s1\">&#39;*/&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">))</span></div>\n\n<div class=\"viewcode-block\" id=\"Plug.__rtruediv__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__rtruediv__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__rtruediv__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded / operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (plug) to be multiplied (dividend)</span>\n<span class=\"sd\">        :type self: Plug </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be divided (divisor)</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: PROD block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the / operator when the right operand is a ``Plug``</span>\n<span class=\"sd\">        and the left operand is a ``Plug``, ``Block`` or constant::</span>\n\n<span class=\"sd\">            result = X / Y[j]</span>\n<span class=\"sd\">            result = X[i] / Y[j]</span>\n<span class=\"sd\">            result = C / Y[j]</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        For the first two cases, a ``PROD(&quot;*/&quot;)`` block named ``_prod.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new CONSTANT block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy</span>\n<span class=\"sd\">            array then the option ``matrix`` is set to True.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__truediv__` :meth:`Block.__rtruediv__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># constant / plug, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PROD</span><span class=\"p\">(</span><span class=\"s1\">&#39;*/&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">))</span></div>\n\n\n<div class=\"viewcode-block\" id=\"Plug.__repr__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Plug.__repr__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Display plug details.</span>\n\n<span class=\"sd\">        :return: Plug description</span>\n<span class=\"sd\">        :rtype: str</span>\n\n<span class=\"sd\">        String format::</span>\n\n<span class=\"sd\">            bicycle.0[1]</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">return</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">block</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;[&quot;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">port</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"s2\">&quot;]&quot;</span></div></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------- #</span>\n\n<span class=\"n\">clocklist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n\n<div class=\"viewcode-block\" id=\"Clock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Clock</span><span class=\"p\">:</span>\n\n<div class=\"viewcode-block\" id=\"Clock.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">arg</span><span class=\"p\">,</span> <span class=\"n\">unit</span><span class=\"o\">=</span><span class=\"s1\">&#39;s&#39;</span><span class=\"p\">,</span> <span class=\"n\">offset</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">global</span> <span class=\"n\">clocklist</span>\n        <span class=\"k\">if</span> <span class=\"n\">unit</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;s&#39;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">arg</span>\n        <span class=\"k\">elif</span> <span class=\"n\">unit</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;ms&#39;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">arg</span> <span class=\"o\">/</span> <span class=\"mi\">1000</span>\n        <span class=\"k\">elif</span> <span class=\"n\">unit</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;Hz&#39;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"mi\">1</span> <span class=\"o\">/</span> <span class=\"n\">arg</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s1\">&#39;unknown clock unit&#39;</span><span class=\"p\">,</span> <span class=\"n\">unit</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">offset</span> <span class=\"o\">=</span> <span class=\"n\">offset</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>  <span class=\"c1\"># discrete state vector numpy.ndarray</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">tick</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;clock.&quot;</span> <span class=\"o\">+</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">clocklist</span><span class=\"p\">))</span>\n\n        <span class=\"n\">clocklist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span></div>\n\n        <span class=\"c1\"># events happen at time t = kT + offset</span>\n\n<div class=\"viewcode-block\" id=\"Clock.add_block\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.add_block\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">add_block</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"fm\">__str__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;</span><span class=\"si\">{</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\">: T=</span><span class=\"si\">{</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"si\">}</span><span class=\"s2\"> sec&quot;</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">offset</span> <span class=\"o\">!=</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;, offset=</span><span class=\"si\">{</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">offset</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span>\n        <span class=\"n\">s</span> <span class=\"o\">+=</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;, clocking </span><span class=\"si\">{</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">)</span><span class=\"si\">}</span><span class=\"s2\"> blocks&quot;</span>\n        <span class=\"k\">return</span> <span class=\"n\">s</span>\n\n<div class=\"viewcode-block\" id=\"Clock.getstate0\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.getstate0\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">getstate0</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"c1\"># get the state from each stateful block on this clock</span>\n        <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([])</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">x0</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">getstate0</span><span class=\"p\">()]</span>\n            <span class=\"c1\">#print(&#39;x0&#39;, x0)</span>\n        <span class=\"k\">return</span> <span class=\"n\">x0</span></div>\n\n<div class=\"viewcode-block\" id=\"Clock.getstate\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.getstate\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">getstate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n\n        <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([])</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"c1\"># update dstate</span>\n            <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">next</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">flatten</span><span class=\"p\">()]</span>\n\n        <span class=\"k\">return</span> <span class=\"n\">x</span></div>\n\n<div class=\"viewcode-block\" id=\"Clock.setstate\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.setstate\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">setstate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span>\n        <span class=\"k\">for</span> <span class=\"n\">b</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blocklist</span><span class=\"p\">:</span>\n            <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">b</span><span class=\"o\">.</span><span class=\"n\">setstate</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span>  <span class=\"c1\"># send it to blocks        </span></div>\n\n<div class=\"viewcode-block\" id=\"Clock.start\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.start\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">i</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">declare_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">i</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">i</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span></div>\n\n<div class=\"viewcode-block\" id=\"Clock.next_event\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.next_event\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">next_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">declare_event</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">i</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">i</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span></div>\n\n<div class=\"viewcode-block\" id=\"Clock.time\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.time\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">time</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">i</span><span class=\"p\">):</span>\n        <span class=\"c1\"># return (math.floor((t - self.offset) / self.T) + 1) * self.T + self.offset</span>\n        <span class=\"c1\"># k = int((t - self.offset) / self.T + 0.5)</span>\n        <span class=\"k\">return</span> <span class=\"n\">i</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">offset</span></div>\n\n<div class=\"viewcode-block\" id=\"Clock.savestate\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Clock.savestate\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">savestate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"c1\"># save clock state at time t</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">x</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">getstate</span><span class=\"p\">())</span></div></div>\n<span class=\"c1\"># ------------------------------------------------------------------------- #</span>\n\n<div class=\"viewcode-block\" id=\"Block\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Block</span><span class=\"p\">:</span>\n\n \n    <span class=\"n\">varinputs</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n    <span class=\"n\">varoutputs</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n\n    <span class=\"n\">__array_ufunc__</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>  <span class=\"c1\"># allow block operators with NumPy values</span>\n\n<div class=\"viewcode-block\" id=\"Block.__new__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__new__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__new__</span><span class=\"p\">(</span><span class=\"bp\">cls</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Construct a new Block object.</span>\n\n<span class=\"sd\">        :param cls: The class to construct</span>\n<span class=\"sd\">        :type cls: class type</span>\n<span class=\"sd\">        :param *args: positional args passed to constructor</span>\n<span class=\"sd\">        :type *args: list</span>\n<span class=\"sd\">        :param **kwargs: keyword args passed to constructor</span>\n<span class=\"sd\">        :type **kwargs: dict</span>\n<span class=\"sd\">        :return: new Block instance</span>\n<span class=\"sd\">        :rtype: Block instance</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># print(&#39;Block __new__&#39;, args,bd, kwargs)</span>\n        <span class=\"n\">block</span> <span class=\"o\">=</span> <span class=\"nb\">super</span><span class=\"p\">(</span><span class=\"n\">Block</span><span class=\"p\">,</span> <span class=\"bp\">cls</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"fm\">__new__</span><span class=\"p\">(</span><span class=\"bp\">cls</span><span class=\"p\">)</span>  <span class=\"c1\"># create a new instance</span>\n\n        <span class=\"c1\"># we overload setattr, so need to know whether it is being passed a port</span>\n        <span class=\"c1\"># name.  Add this attribute now to allow proper operation.</span>\n        <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"p\">[</span><span class=\"s1\">&#39;portnames&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>  <span class=\"c1\"># must be first, see __setattr__</span>\n\n        <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"n\">bd</span>\n        <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">ndstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"n\">block</span><span class=\"o\">.</span><span class=\"n\">_sequence</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n\n        <span class=\"k\">return</span> <span class=\"n\">block</span></div>\n\n    <span class=\"n\">_latex_remove</span> <span class=\"o\">=</span> <span class=\"nb\">str</span><span class=\"o\">.</span><span class=\"n\">maketrans</span><span class=\"p\">({</span><span class=\"s1\">&#39;$&#39;</span><span class=\"p\">:</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;</span><span class=\"se\">\\\\</span><span class=\"s1\">&#39;</span><span class=\"p\">:</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;{&#39;</span><span class=\"p\">:</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;}&#39;</span><span class=\"p\">:</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;^&#39;</span><span class=\"p\">:</span><span class=\"s1\">&#39;&#39;</span><span class=\"p\">})</span>\n\n<div class=\"viewcode-block\" id=\"Block.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span>  \n        <span class=\"n\">inames</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">onames</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">snames</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> \n        <span class=\"n\">pos</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">blockclass</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">verbose</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Construct a new block object.</span>\n\n<span class=\"sd\">        :param name: Name of the block, defaults to None</span>\n<span class=\"sd\">        :type name: str, optional</span>\n<span class=\"sd\">        :param nin: Number of inputs, defaults to None</span>\n<span class=\"sd\">        :type nin: int, optional</span>\n<span class=\"sd\">        :param nout: Number of outputs, defaults to None</span>\n<span class=\"sd\">        :type nout: int, optional</span>\n<span class=\"sd\">        :param inputs: Optional incoming connections</span>\n<span class=\"sd\">        :type inputs: Block, Plug or list of Block or Plug</span>\n<span class=\"sd\">        :param inames: Names of input ports, defaults to None</span>\n<span class=\"sd\">        :type inames: list of str, optional</span>\n<span class=\"sd\">        :param onames: Names of output ports, defaults to None</span>\n<span class=\"sd\">        :type onames: list of str, optional</span>\n<span class=\"sd\">        :param snames: Names of states, defaults to None</span>\n<span class=\"sd\">        :type snames: list of str, optional</span>\n<span class=\"sd\">        :param pos: Position of block on the canvas, defaults to None</span>\n<span class=\"sd\">        :type pos: 2-element tuple or list, optional</span>\n<span class=\"sd\">        :param bd: Parent block diagram, defaults to None</span>\n<span class=\"sd\">        :type bd: BlockDiagram, optional</span>\n<span class=\"sd\">        :param verbose: enable diagnostic prints, defaults to False</span>\n<span class=\"sd\">        :type verbose: bool, optional</span>\n<span class=\"sd\">        :param kwargs: Unused arguments</span>\n<span class=\"sd\">        :type kwargs: dict</span>\n<span class=\"sd\">        :return: A Block superclass</span>\n<span class=\"sd\">        :rtype: Block</span>\n\n<span class=\"sd\">        A block object is the superclass of all blocks in the simulation environment.</span>\n\n<span class=\"sd\">        This is the top-level initializer, and handles most options passed to</span>\n<span class=\"sd\">        the superclass initializer for each block in the library.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"c1\"># print(&#39;Block constructor, bd = &#39;, bd)</span>\n        <span class=\"k\">if</span> <span class=\"n\">name</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name_tex</span> <span class=\"o\">=</span> <span class=\"n\">name</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_fixname</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name_tex</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"n\">bd</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pos</span> <span class=\"o\">=</span> <span class=\"n\">pos</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">id</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">updated</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">shape</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;block&#39;</span>  <span class=\"c1\"># for box</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_inport_names</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_outport_names</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_state_names</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">initd</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_clocked</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_graphics</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_parameters</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">verbose</span> <span class=\"o\">=</span> <span class=\"n\">verbose</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">nin</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"n\">nin</span>\n        <span class=\"k\">if</span> <span class=\"n\">nout</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"n\">nout</span>\n        <span class=\"k\">if</span> <span class=\"n\">blockclass</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"n\">blockclass</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">type</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"vm\">__class__</span><span class=\"o\">.</span><span class=\"vm\">__name__</span><span class=\"o\">.</span><span class=\"n\">lower</span><span class=\"p\">()</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">bd</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">add_block</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">inames</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">(</span><span class=\"n\">inames</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">onames</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">(</span><span class=\"n\">onames</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">snames</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state_names</span><span class=\"p\">(</span><span class=\"n\">snames</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"n\">Block</span><span class=\"p\">):</span>\n            <span class=\"n\">inputs</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"p\">,)</span>\n        <span class=\"k\">if</span> <span class=\"n\">inputs</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span> <span class=\"ow\">and</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"c1\">#assert len(inputs) == self.nin, &#39;Number of input connections must match number of inputs&#39;</span>\n            <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"nb\">input</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"p\">):</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"nb\">input</span><span class=\"p\">,</span> <span class=\"n\">Plug</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">port</span><span class=\"o\">=</span><span class=\"n\">i</span><span class=\"p\">))</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">kwargs</span><span class=\"p\">)</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;WARNING: unused arguments&#39;</span><span class=\"p\">,</span> <span class=\"n\">kwargs</span><span class=\"o\">.</span><span class=\"n\">keys</span><span class=\"p\">())</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.add_param\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.add_param\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">add_param</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">param</span><span class=\"p\">,</span> <span class=\"n\">handler</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"n\">handler</span> <span class=\"o\">==</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"k\">def</span> <span class=\"nf\">handler</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">newvalue</span><span class=\"p\">):</span>\n                <span class=\"nb\">setattr</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">newvalue</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"p\">[</span><span class=\"s1\">&#39;_parameters&#39;</span><span class=\"p\">][</span><span class=\"n\">param</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">handler</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.set_param\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.set_param\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">set_param</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">newvalue</span><span class=\"p\">):</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;setting parameter </span><span class=\"si\">{</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\"> of block </span><span class=\"si\">{</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\"> to </span><span class=\"si\">{</span><span class=\"n\">newvalue</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_parameters</span><span class=\"p\">[</span><span class=\"n\">name</span><span class=\"p\">](</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">newvalue</span><span class=\"p\">)</span></div>\n\n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">info</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Interactive display of block properties.</span>\n\n<span class=\"sd\">        Displays all attributes of the block for debugging purposes.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;block: &quot;</span> <span class=\"o\">+</span> <span class=\"nb\">type</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"vm\">__name__</span><span class=\"p\">)</span>\n        <span class=\"k\">for</span> <span class=\"n\">k</span><span class=\"p\">,</span><span class=\"n\">v</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"o\">.</span><span class=\"n\">items</span><span class=\"p\">():</span>\n            <span class=\"k\">if</span> <span class=\"n\">k</span> <span class=\"o\">!=</span> <span class=\"s1\">&#39;sim&#39;</span><span class=\"p\">:</span>\n                <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;  </span><span class=\"si\">{:11s}{:s}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"n\">k</span><span class=\"o\">+</span><span class=\"s2\">&quot;:&quot;</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">)))</span>\n\n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">isclocked</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_clocked</span>\n\n    <span class=\"nd\">@property</span>\n    <span class=\"k\">def</span> <span class=\"nf\">isgraphics</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_graphics</span>\n\n    <span class=\"c1\"># for use in unit testing</span>\n    <span class=\"k\">def</span> <span class=\"nf\">_eval</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Evaluate a block for unit testing.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        :param *inputs: List of input port values</span>\n<span class=\"sd\">        :type *inputs: list</span>\n<span class=\"sd\">        :param t: Simulation time, defaults to None</span>\n<span class=\"sd\">        :type t: float, optional</span>\n<span class=\"sd\">        :return: Block output port values</span>\n<span class=\"sd\">        :rtype: list</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        The output ports of the block are evaluated for a given set of input</span>\n<span class=\"sd\">        port values and simulation time. Input and output port values are treated</span>\n<span class=\"sd\">        as lists.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Mostly used for making concise unit tests.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"s1\">&#39;wrong number of inputs provided&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span> <span class=\"o\">=</span> <span class=\"n\">inputs</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">output</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"o\">=</span><span class=\"n\">t</span><span class=\"p\">)</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">,</span> <span class=\"nb\">list</span><span class=\"p\">),</span> <span class=\"s1\">&#39;result must be a list&#39;</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span><span class=\"p\">,</span> <span class=\"s1\">&#39;result list is wrong length&#39;</span>\n        <span class=\"k\">return</span> <span class=\"n\">out</span>\n\n<div class=\"viewcode-block\" id=\"Block.__getitem__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__getitem__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__getitem__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">port</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Convert a block slice reference to a plug.</span>\n\n<span class=\"sd\">        :param port: Port number</span>\n<span class=\"sd\">        :type port: int</span>\n<span class=\"sd\">        :return: A port plug</span>\n<span class=\"sd\">        :rtype: Plug</span>\n\n<span class=\"sd\">        Invoked whenever a block is referenced as a slice, for example::</span>\n\n<span class=\"sd\">            c = bd.CONSTANT(1)</span>\n\n<span class=\"sd\">            bd.connect(x, c[0])</span>\n<span class=\"sd\">            bd.connect(c[0], x)</span>\n\n<span class=\"sd\">        In both cases ``c[0]`` is converted to a ``Plug`` by this method.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># block[i] is a plug object</span>\n        <span class=\"c1\">#print(&#39;getitem called&#39;, self, port)</span>\n        <span class=\"k\">return</span> <span class=\"n\">Plug</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">port</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__setitem__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__setitem__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__setitem__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"n\">src</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Convert a LHS block slice reference to a wire.</span>\n\n<span class=\"sd\">        :param port: Port number</span>\n<span class=\"sd\">        :type port: int</span>\n<span class=\"sd\">        :param src: the RHS</span>\n<span class=\"sd\">        :type src: Block or Plug</span>\n\n<span class=\"sd\">        Used to create a wired connection by assignment, for example::</span>\n\n<span class=\"sd\">            X[0] = Y</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks. This method is implicitly invoked and</span>\n<span class=\"sd\">        creates a wire from ``Y`` to input port 0 of ``X``.</span>\n\n<span class=\"sd\">        .. note:: The square brackets on the left-hand-side is critical, and</span>\n<span class=\"sd\">            ``X = Y`` will simply overwrite the reference to ``X``.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># b[port] = src</span>\n        <span class=\"c1\"># src --&gt; b[port]</span>\n        <span class=\"c1\">#print(&#39;connecting&#39;, src, self, port)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">src</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">])</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__setattr__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__setattr__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__setattr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Convert a LHS block name reference to a wire.</span>\n\n<span class=\"sd\">        :param name: Port name</span>\n<span class=\"sd\">        :type port: str</span>\n<span class=\"sd\">        :param value: the RHS</span>\n<span class=\"sd\">        :type value: Block or Plug</span>\n\n<span class=\"sd\">        Used to create a wired connection by assignment, for example::</span>\n\n<span class=\"sd\">            c = bd.CONSTANT(1, inames=[&#39;u&#39;])</span>\n\n<span class=\"sd\">            c.u = x</span>\n\n<span class=\"sd\">        Ths method is invoked to create a wire from ``x`` to port &#39;u&#39; of</span>\n<span class=\"sd\">        the constant block ``c``.</span>\n\n<span class=\"sd\">        Notes:</span>\n\n<span class=\"sd\">            - this overloaded method handles all instances of ``setattr`` and</span>\n<span class=\"sd\">              implements normal functionality as well, only creating a wire</span>\n<span class=\"sd\">              if ``name`` is a known port name.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"c1\"># b[port] = src</span>\n        <span class=\"c1\"># src --&gt; b[port]</span>\n        <span class=\"c1\"># gets called for regular attribute settings, as well as for wiring</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">name</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">portnames</span><span class=\"p\">:</span>\n            <span class=\"c1\"># we&#39;re doing wiring</span>\n            <span class=\"c1\">#print(&#39;in __setattr___&#39;, self, name, value)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"nb\">getattr</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"p\">))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"c1\"># regular case, add attribute to the instance&#39;s dictionary</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"vm\">__dict__</span><span class=\"p\">[</span><span class=\"n\">name</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">value</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__rshift__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__rshift__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__rshift__</span><span class=\"p\">(</span><span class=\"n\">left</span><span class=\"p\">,</span> <span class=\"n\">right</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Operator for implicit wiring.</span>\n\n<span class=\"sd\">        :param left: A block to be wired from</span>\n<span class=\"sd\">        :type left: Block</span>\n<span class=\"sd\">        :param right: A block or plugto be wired to</span>\n<span class=\"sd\">        :type right: Block or Plug</span>\n<span class=\"sd\">        :return: ``right``</span>\n<span class=\"sd\">        :rtype: Block or Plug</span>\n\n<span class=\"sd\">        Implements implicit wiring, for example::</span>\n\n<span class=\"sd\">            a = bd.CONSTANT(1) &gt;&gt; bd.GAIN(2)</span>\n\n<span class=\"sd\">        will connect the output of the CONSTANT block to the input of the</span>\n<span class=\"sd\">        GAIN block.  The result will be GAIN block, whose output in this case</span>\n<span class=\"sd\">        will be assigned to ``a``.</span>\n\n<span class=\"sd\">        Note that::</span>\n\n<span class=\"sd\">           a = bd.CONSTANT(1) &gt;&gt; func[1]</span>\n\n<span class=\"sd\">        will connect port 0 of CONSTANT to port 1 of ``func``, and port 1 of ``func``</span>\n<span class=\"sd\">        will be assigned to ``a``.  To specify a different outport port on ``func``</span>\n<span class=\"sd\">        we need to use parentheses::</span>\n\n<span class=\"sd\">            a = (bd.CONSTANT(1) &gt;&gt; func[1])[0]</span>\n\n<span class=\"sd\">        which will connect port 0 of CONSTANT ` to port 1 of ``func``, and port 0 of ``func``</span>\n<span class=\"sd\">        will be assigned to ``a``.</span>\n\n<span class=\"sd\">        :seealso: Plug.__rshift__</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># called for the cases:</span>\n        <span class=\"c1\"># block * block</span>\n        <span class=\"c1\"># block * plug</span>\n        <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">left</span><span class=\"o\">.</span><span class=\"n\">bd</span>\n        <span class=\"c1\">#assert isinstance(right, Block), &#39;arguments to * must be blocks not ports (for now)&#39;</span>\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">s</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">left</span><span class=\"p\">,</span> <span class=\"n\">right</span><span class=\"p\">)</span>  <span class=\"c1\"># add a wire</span>\n        <span class=\"c1\">#print(&#39;block * &#39; + str(w))</span>\n        <span class=\"k\">return</span> <span class=\"n\">right</span></div>\n\n        <span class=\"c1\"># make connection, return a plug</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">_autoconstant</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">)):</span>\n            <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_const.</span><span class=\"si\">{:d}</span><span class=\"s2\">(</span><span class=\"si\">{}</span><span class=\"s2\">)&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_const</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_const.</span><span class=\"si\">{:d}</span><span class=\"s2\">&lt;</span><span class=\"si\">{}</span><span class=\"s2\">&gt;&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_const</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"vm\">__name__</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_const</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">_autogain</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">)):</span>\n            <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_gain.</span><span class=\"si\">{:d}</span><span class=\"s2\">(</span><span class=\"si\">{}</span><span class=\"s2\">)&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_gain</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_gain.</span><span class=\"si\">{:d}</span><span class=\"s2\">&lt;</span><span class=\"si\">{}</span><span class=\"s2\">&gt;&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_gain</span><span class=\"p\">,</span> <span class=\"nb\">type</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"vm\">__name__</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_gain</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">GAIN</span><span class=\"p\">(</span><span class=\"n\">value</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"Block.__add__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__add__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__add__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded + operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be added </span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be added</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: SUM block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the + operator</span>\n<span class=\"sd\">        when the right operand is a ``Block``</span>\n<span class=\"sd\">        and the left operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X + Y</span>\n<span class=\"sd\">            result = X + Y[j]</span>\n<span class=\"sd\">            result = X + C</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Creates a ``SUM(&quot;++&quot;) block named ``_sum.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new ``CONSTANT(C)`` block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        .. note:: The inputs to the summing junction are reversed: right then left operand.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__radd__` :meth:`Plug.__add__` </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># value + value, create a SUM block</span>\n        <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_sum.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># block + constant, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autoconstant</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;++&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">),</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__radd__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__radd__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__radd__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded + operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be added </span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be added</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: SUM block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the + operator</span>\n<span class=\"sd\">        when the right operand is a ``Block``</span>\n<span class=\"sd\">        and the left operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X + Y[j]</span>\n<span class=\"sd\">            result = X[i] + Y[j]</span>\n<span class=\"sd\">            result = C + Y[j]</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Creates a ``SUM(&quot;++&quot;) block named ``_sum.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new ``CONSTANT(C)`` block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        .. note:: The inputs to the summing junction are reversed: right then left operand.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__add__` :meth:`Plug._r_add__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># value + value, create a SUM block</span>\n        <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_sum.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># constant + block, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autoconstant</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;++&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">),</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__sub__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__sub__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__sub__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded - operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be added (minuend)</span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be subtracted (subtrahend)</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: SUM block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the - operator when the left operand is a ``Block``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X - Y</span>\n<span class=\"sd\">            result = X - Y[j]</span>\n<span class=\"sd\">            result = X - C</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Creates a ``SUM(&quot;+-&quot;)`` block named ``_sum.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new ``CONSTANT(C)`` block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__rsub__` :meth:`Plug.__sub__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># value - value, create a SUM block</span>\n        <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_sum.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># block - constant, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autoconstant</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;+-&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">),</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__rsub__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__rsub__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__rsub__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded - operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be added (minuend)</span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be subtracted (subtrahend)</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: SUM block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the - operator when the left operand is a ``Block``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X - Y</span>\n<span class=\"sd\">            result = X[i] - Y</span>\n<span class=\"sd\">            result = C - Y</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Creates a ``SUM(&quot;+-&quot;)`` block named ``_sum.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new ``CONSTANT(C)`` block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        .. note:: The inputs to the summing junction are reversed: right then left operand.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__sub__` :meth:`Plug.__rsub__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># value - value, create a SUM block</span>\n        <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_sum.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_sum</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># constant - block, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autoconstant</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;+-&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">),</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__neg__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__neg__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__neg__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded unary minus operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be negated</span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :return: GAIN block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the - operator for unary minus when the operand is a ``Block``::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = -X</span>\n\n<span class=\"sd\">        where ``X`` is a block.</span>\n\n<span class=\"sd\">        Creates a ``GAIN(-1)`` block named ``_gain.N`` whose input is the </span>\n<span class=\"sd\">        operand.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Plug.__neg__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autogain</span><span class=\"p\">(</span><span class=\"o\">-</span><span class=\"mf\">1.0</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"p\">])</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__mul__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__mul__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__mul__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded * operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be multiplied </span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be multiplied</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: PROD or GAIN block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the * operator when the left operand is a ``Block``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X * Y</span>\n<span class=\"sd\">            result = X * Y[j]</span>\n<span class=\"sd\">            result = X * C</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Create a ``PROD(&quot;**&quot;)`` block named ``_prod.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.</span>\n\n<span class=\"sd\">        For the third case, create a ``GAIN(C)`` block named ``_gain.N``.</span>\n\n<span class=\"sd\">        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy</span>\n<span class=\"sd\">            array then the option ``matrix`` is set to True.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__rmul__` :meth:`Plug.__mul__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># block * constant, create a GAIN block</span>\n            <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)</span>\n            <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autogain</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">premul</span><span class=\"o\">=</span><span class=\"n\">matrix</span><span class=\"p\">,</span> <span class=\"n\">matrix</span><span class=\"o\">=</span><span class=\"n\">matrix</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"p\">])</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"c1\"># value * value, create a PROD block</span>\n            <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_prod.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n            <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PROD</span><span class=\"p\">(</span><span class=\"s1\">&#39;**&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">],</span> <span class=\"n\">matrix</span><span class=\"o\">=</span><span class=\"n\">matrix</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__rmul__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__rmul__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__rmul__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded * operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be multiplied</span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be multiplied</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: PROD or GAIN block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the * operator when the right operand is a ``Block``</span>\n<span class=\"sd\">        and the left operand is a ``Plug``, ``Block`` or constant::</span>\n\n<span class=\"sd\">            result = X * Y</span>\n<span class=\"sd\">            result = X[i] * Y</span>\n<span class=\"sd\">            result = C * Y</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        For the first two cases, a ``PROD(&quot;**&quot;)`` block named ``_prod.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  </span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        For the third case, create a ``GAIN(C)`` block named ``_gain.N``.</span>\n\n<span class=\"sd\">        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy</span>\n<span class=\"sd\">            array then the option ``matrix`` is set to True.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__mul__` :meth:`Plug.__rmul__` </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># constant * block, create a GAIN block</span>\n            <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)</span>\n            <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autogain</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">premul</span><span class=\"o\">=</span><span class=\"n\">matrix</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"p\">])</span></div>\n \n<div class=\"viewcode-block\" id=\"Block.__truediv__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__truediv__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__truediv__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded / operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be multiplied (dividend)</span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be divided (divisor)</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: PROD or GAIN block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the / operator when the left operand is a ``Block``</span>\n<span class=\"sd\">        and the right operand is a ``Plug``, ``Block`` or constant::</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            result = X / Y</span>\n<span class=\"sd\">            result = X / Y[j]</span>\n<span class=\"sd\">            result = X / C</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        Create a ``PROD(&quot;**&quot;)`` block named ``_prod.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.</span>\n\n<span class=\"sd\">        For the third case, create a ``GAIN(1/C)`` block named ``_gain.N``.</span>\n\n<span class=\"sd\">        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy</span>\n<span class=\"sd\">            array then the option ``matrix`` is set to True.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__rtruediv__` :meth:`Plug.__truediv__` </span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># value / value, create a PROD block</span>\n        <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_prod.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># block / constant, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autoconstant</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n            <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PROD</span><span class=\"p\">(</span><span class=\"s1\">&#39;*/&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">),</span> <span class=\"n\">matrix</span><span class=\"o\">=</span><span class=\"n\">matrix</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__rtruediv__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__rtruediv__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__rtruediv__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">other</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Overloaded / operator for implicit block creation.</span>\n\n<span class=\"sd\">        :param self: A signal (block) to be multiplied (dividend)</span>\n<span class=\"sd\">        :type self: Block </span>\n<span class=\"sd\">        :param other: A signal (block or plug) to be divided (divisor)</span>\n<span class=\"sd\">        :type other: Block or Plug </span>\n<span class=\"sd\">        :return: PROD block</span>\n<span class=\"sd\">        :rtype: Block subclass</span>\n\n<span class=\"sd\">        This method is implicitly invoked by the / operator when the right operand is a ``Block``</span>\n<span class=\"sd\">        and the left operand is a ``Plug``, ``Block`` or constant::</span>\n\n<span class=\"sd\">            result = X / Y</span>\n<span class=\"sd\">            result = X[i] / Y</span>\n<span class=\"sd\">            result = C / Y</span>\n\n<span class=\"sd\">        where ``X`` and ``Y`` are blocks and ``C`` is a Python or NumPy constant.</span>\n\n<span class=\"sd\">        For the first two cases, a ``PROD(&quot;*/&quot;)`` block named ``_prod.N`` whose inputs are the </span>\n<span class=\"sd\">        left and right operands.  For the third case, a new CONSTANT block</span>\n<span class=\"sd\">        named ``_const.N`` is also created.</span>\n\n<span class=\"sd\">        .. note:: Signals are assumed to be scalars, but if ``C`` is a NumPy</span>\n<span class=\"sd\">            array then the option ``matrix`` is set to True.</span>\n\n<span class=\"sd\">        :seealso: :meth:`Block.__truediv__` :meth:`Plug.__rtruediv__`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># value / value, create a PROD block</span>\n        <span class=\"n\">name</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;_prod.</span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">n_auto_prod</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"kc\">False</span>\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"nb\">int</span><span class=\"p\">,</span> <span class=\"nb\">float</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)):</span>\n            <span class=\"c1\"># constant / block, create a CONSTANT block</span>\n            <span class=\"n\">other</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_autoconstant</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">)</span>\n            <span class=\"n\">matrix</span> <span class=\"o\">=</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">ndarray</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PROD</span><span class=\"p\">(</span><span class=\"s1\">&#39;*/&#39;</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">other</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">),</span> <span class=\"n\">matrix</span><span class=\"o\">=</span><span class=\"n\">matrix</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"n\">name</span><span class=\"p\">)</span></div>\n\n    \n\n    <span class=\"c1\"># TODO arithmetic with a constant, add a gain block or a constant block</span>\n\n<div class=\"viewcode-block\" id=\"Block.__str__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__str__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__str__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"s1\">&#39;name&#39;</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">blockclass</span> <span class=\"o\">+</span> <span class=\"s1\">&#39;.??&#39;</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.__repr__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.__repr__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__repr__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"fm\">__str__</span><span class=\"p\">()</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">_fixname</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">s</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"n\">s</span><span class=\"o\">.</span><span class=\"n\">translate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_latex_remove</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"Block.inport_names\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.inport_names\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">inport_names</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">names</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Set the names of block input ports.</span>\n\n<span class=\"sd\">        :param names: List of port names</span>\n<span class=\"sd\">        :type names: list of str</span>\n\n<span class=\"sd\">        Invoked by the ``inames`` argument to the Block constructor.</span>\n\n<span class=\"sd\">        The names can include LaTeX math markup.  The LaTeX version is used</span>\n<span class=\"sd\">        where appropriate, but the port names are a de-LaTeXd version of the</span>\n<span class=\"sd\">        given string with backslash, caret, braces and dollar signs</span>\n<span class=\"sd\">        removed.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_inport_names</span> <span class=\"o\">=</span> <span class=\"n\">names</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"n\">name</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">names</span><span class=\"p\">):</span>\n            <span class=\"n\">fn</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_fixname</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">)</span>\n            <span class=\"nb\">setattr</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">fn</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">])</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">portnames</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">fn</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.outport_names\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.outport_names\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">outport_names</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">names</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Set the names of block output ports.</span>\n\n<span class=\"sd\">        :param names: List of port names</span>\n<span class=\"sd\">        :type names: list of str</span>\n\n<span class=\"sd\">        Invoked by the ``onames`` argument to the Block constructor.</span>\n\n<span class=\"sd\">        The names can include LaTeX math markup.  The LaTeX version is used</span>\n<span class=\"sd\">        where appropriate, but the port names are a de-LaTeXd version of the</span>\n<span class=\"sd\">        given string with backslash, caret, braces and dollar signs</span>\n<span class=\"sd\">        removed.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_outport_names</span> <span class=\"o\">=</span> <span class=\"n\">names</span>\n        <span class=\"k\">for</span> <span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"n\">name</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">names</span><span class=\"p\">):</span>\n            <span class=\"n\">fn</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_fixname</span><span class=\"p\">(</span><span class=\"n\">name</span><span class=\"p\">)</span>\n            <span class=\"nb\">setattr</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">fn</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">])</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">portnames</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">fn</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.state_names\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.state_names\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">state_names</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">names</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_state_names</span> <span class=\"o\">=</span> <span class=\"n\">names</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.sourcename\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.sourcename\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">sourcename</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">port</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Get the name of output port driving this input port.</span>\n\n<span class=\"sd\">        :param port: Input port</span>\n<span class=\"sd\">        :type port: int</span>\n<span class=\"sd\">        :return: Port name</span>\n<span class=\"sd\">        :rtype: str</span>\n\n<span class=\"sd\">        Return the name of the output port that drives the specified input</span>\n<span class=\"sd\">        port. The name can be:</span>\n\n<span class=\"sd\">            - a LaTeX string if provided</span>\n<span class=\"sd\">            - block name with port number given in square brackets.  The block</span>\n<span class=\"sd\">              name will the one optionally assigned by the user using the ``name``</span>\n<span class=\"sd\">              keyword, otherwise a systematic default name.</span>\n\n<span class=\"sd\">        :seealso: outport_names</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inports</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">name</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">name</span>\n        <span class=\"n\">src</span> <span class=\"o\">=</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">block</span>\n        <span class=\"n\">srcp</span> <span class=\"o\">=</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">port</span>\n        <span class=\"k\">if</span> <span class=\"n\">src</span><span class=\"o\">.</span><span class=\"n\">_outport_names</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"k\">return</span> <span class=\"n\">src</span><span class=\"o\">.</span><span class=\"n\">_outport_names</span><span class=\"p\">[</span><span class=\"n\">srcp</span><span class=\"p\">]</span>\n        <span class=\"k\">return</span> <span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">)</span></div>\n\n    <span class=\"c1\"># @property</span>\n    <span class=\"c1\"># def fullname(self):</span>\n    <span class=\"c1\">#     return self.blockclass + &quot;.&quot; + str(self)</span>\n\n<div class=\"viewcode-block\" id=\"Block.reset\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.reset\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">reset</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"kc\">None</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">updated</span> <span class=\"o\">=</span> <span class=\"kc\">False</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.add_outport\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.add_outport\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">add_outport</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"p\">):</span>\n        <span class=\"n\">port</span> <span class=\"o\">=</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"o\">.</span><span class=\"n\">port</span>\n        <span class=\"k\">assert</span> <span class=\"n\">port</span> <span class=\"o\">&lt;</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outports</span><span class=\"p\">),</span> <span class=\"s1\">&#39;port number too big&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outports</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.add_inport\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.add_inport\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">add_inport</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"p\">):</span>\n        <span class=\"n\">port</span> <span class=\"o\">=</span> <span class=\"n\">w</span><span class=\"o\">.</span><span class=\"n\">end</span><span class=\"o\">.</span><span class=\"n\">port</span>\n        <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inports</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">]</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"s1\">&#39;attempting to connect second wire to an input&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inports</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">w</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.setinput\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.setinput\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">setinput</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">port</span><span class=\"p\">,</span> <span class=\"n\">value</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Receive input from a wire</span>\n\n<span class=\"sd\">        :param self: Block to be updated</span>\n<span class=\"sd\">        :type wire: Block</span>\n<span class=\"sd\">        :param port: Input port to be updated</span>\n<span class=\"sd\">        :type port: int</span>\n<span class=\"sd\">        :param value: Input value</span>\n<span class=\"sd\">        :type val: any</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># stash it away</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"n\">port</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">value</span></div>\n\n\n<div class=\"viewcode-block\" id=\"Block.setinputs\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.setinputs\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">setinputs</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">pos</span><span class=\"p\">):</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">pos</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"s1\">&#39;mismatch in number of inputs&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">reset</span><span class=\"p\">()</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span><span class=\"p\">,</span> <span class=\"n\">val</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">pos</span><span class=\"p\">):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">val</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.start\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.start\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>  <span class=\"c1\"># begin of a simulation</span>\n        <span class=\"k\">pass</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.check\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.check\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">check</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>  <span class=\"c1\"># check validity of block parameters at start</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"s1\">&#39;nin&#39;</span><span class=\"p\">),</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;block </span><span class=\"si\">{</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\"> has no nin specified&quot;</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"s1\">&#39;nout&#39;</span><span class=\"p\">),</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;block </span><span class=\"si\">{</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\"> has no nout specified&quot;</span>\n\n        <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span> <span class=\"ow\">or</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;block </span><span class=\"si\">{</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"si\">}</span><span class=\"s2\"> no inputs or outputs specified&quot;</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">hasattr</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"s1\">&#39;initd&#39;</span><span class=\"p\">)</span> <span class=\"ow\">and</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">initd</span><span class=\"p\">,</span> <span class=\"s1\">&#39;Block superclass not initalized. was super().__init__ called?&#39;</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.done\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.done\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">done</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>  <span class=\"c1\"># end of simulation</span>\n        <span class=\"k\">pass</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.step\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.step\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">step</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>  <span class=\"c1\"># valid</span>\n        <span class=\"k\">pass</span></div>\n\n<div class=\"viewcode-block\" id=\"Block.savefig\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.Block.savefig\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">savefig</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">pos</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"k\">pass</span></div></div>\n\n<div class=\"viewcode-block\" id=\"SinkBlock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.SinkBlock\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">SinkBlock</span><span class=\"p\">(</span><span class=\"n\">Block</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    A SinkBlock is a subclass of Block that represents a block that has inputs</span>\n<span class=\"sd\">    but no outputs. Typically used to save data to a variable, file or </span>\n<span class=\"sd\">    graphics.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">blockclass</span><span class=\"o\">=</span><span class=\"s1\">&#39;sink&#39;</span>\n\n<div class=\"viewcode-block\" id=\"SinkBlock.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.SinkBlock.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a sink block.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: sink block base class</span>\n<span class=\"sd\">        :rtype: SinkBlock</span>\n\n<span class=\"sd\">        This is the parent class of all sink blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># print(&#39;Sink constructor&#39;)</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span></div></div>\n\n<div class=\"viewcode-block\" id=\"SourceBlock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.SourceBlock\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">SourceBlock</span><span class=\"p\">(</span><span class=\"n\">Block</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    A SourceBlock is a subclass of Block that represents a block that has outputs</span>\n<span class=\"sd\">    but no inputs.  Its output is a function of parameters and time.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;source&#39;</span>\n\n<div class=\"viewcode-block\" id=\"SourceBlock.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.SourceBlock.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a source block.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: source block base class</span>\n<span class=\"sd\">        :rtype: SourceBlock</span>\n\n<span class=\"sd\">        This is the parent class of all source blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># print(&#39;Source constructor&#39;)</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span></div></div>\n\n<div class=\"viewcode-block\" id=\"TransferBlock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.TransferBlock\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">TransferBlock</span><span class=\"p\">(</span><span class=\"n\">Block</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    A TransferBlock is a subclass of Block that represents a block with inputs</span>\n<span class=\"sd\">    outputs and states. Typically used to describe a continuous time dynamic</span>\n<span class=\"sd\">    system, either linear or nonlinear.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;transfer&#39;</span>\n\n<div class=\"viewcode-block\" id=\"TransferBlock.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.TransferBlock.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">nstates</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a transfer function block.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: transfer function block base class</span>\n<span class=\"sd\">        :rtype: TransferBlock</span>\n\n<span class=\"sd\">        This is the parent class of all transfer function blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># print(&#39;Transfer constructor&#39;)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"n\">nstates</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"TransferBlock.reset\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.TransferBlock.reset\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">reset</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">reset</span><span class=\"p\">()</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span></div>\n        <span class=\"c1\"># return self._x</span>\n\n<div class=\"viewcode-block\" id=\"TransferBlock.setstate\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.TransferBlock.setstate\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">setstate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">):</span>\n        <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">=</span> <span class=\"n\">x</span><span class=\"p\">[:</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">]</span>  <span class=\"c1\"># take as much state vector as we need</span>\n        <span class=\"k\">return</span> <span class=\"n\">x</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">:]</span>     <span class=\"c1\"># return the rest</span></div>\n\n<div class=\"viewcode-block\" id=\"TransferBlock.getstate0\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.TransferBlock.getstate0\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">getstate0</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span></div>\n\n<div class=\"viewcode-block\" id=\"TransferBlock.check\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.TransferBlock.check\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">check</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s1\">&#39;incorrect length for initial state&#39;</span>\n        <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span> <span class=\"ow\">or</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"s1\">&#39;no inputs or outputs specified&#39;</span></div></div>\n<div class=\"viewcode-block\" id=\"FunctionBlock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.FunctionBlock\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">FunctionBlock</span><span class=\"p\">(</span><span class=\"n\">Block</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    A FunctionBlock is a subclass of Block that represents a block that has inputs</span>\n<span class=\"sd\">    and outputs but no state variables.  Typically used to describe operations</span>\n<span class=\"sd\">    such as gain, summation or various mappings.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;function&#39;</span>\n\n<div class=\"viewcode-block\" id=\"FunctionBlock.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.FunctionBlock.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a function block.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: function block base class</span>\n<span class=\"sd\">        :rtype: FunctionBlock</span>\n\n<span class=\"sd\">        This is the parent class of all function blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># print(&#39;Function constructor&#39;)</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span></div></div>\n\n\n<div class=\"viewcode-block\" id=\"SubsystemBlock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.SubsystemBlock\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">SubsystemBlock</span><span class=\"p\">(</span><span class=\"n\">Block</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    A SubSystem  s a subclass of Block that represents a block that has inputs</span>\n<span class=\"sd\">    and outputs but no state variables.  Typically used to describe operations</span>\n<span class=\"sd\">    such as gain, summation or various mappings.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;subsystem&#39;</span>\n\n<div class=\"viewcode-block\" id=\"SubsystemBlock.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.SubsystemBlock.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a subsystem block.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: subsystem block base class</span>\n<span class=\"sd\">        :rtype: SubsystemBlock</span>\n\n<span class=\"sd\">        This is the parent class of all subsystem blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># print(&#39;Subsystem constructor&#39;)</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">0</span></div></div>\n\n<div class=\"viewcode-block\" id=\"ClockedBlock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.ClockedBlock\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">ClockedBlock</span><span class=\"p\">(</span><span class=\"n\">Block</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    A ClockedBlock is a subclass of Block that represents a block with inputs</span>\n<span class=\"sd\">    outputs and discrete states. Typically used to describe a discrete time dynamic</span>\n<span class=\"sd\">    system, either linear or nonlinear.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;clocked&#39;</span>\n\n<div class=\"viewcode-block\" id=\"ClockedBlock.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.ClockedBlock.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">clock</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a clocked block.</span>\n\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: clocked block base class</span>\n<span class=\"sd\">        :rtype: ClockedBlock</span>\n\n<span class=\"sd\">        This is the parent class of all clocked blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># print(&#39;Clocked constructor&#39;)</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"k\">assert</span> <span class=\"n\">clock</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"s1\">&#39;clocked block must have a clock&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_clocked</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">clock</span> <span class=\"o\">=</span> <span class=\"n\">clock</span>\n        <span class=\"n\">clock</span><span class=\"o\">.</span><span class=\"n\">add_block</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"ClockedBlock.reset\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.ClockedBlock.reset\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">reset</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">reset</span><span class=\"p\">()</span></div>\n        <span class=\"c1\"># self._x = self._x0</span>\n        <span class=\"c1\"># return self._x</span>\n\n<div class=\"viewcode-block\" id=\"ClockedBlock.setstate\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.ClockedBlock.setstate\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">setstate</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">):</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">=</span> <span class=\"n\">x</span><span class=\"p\">[:</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span><span class=\"p\">]</span>  <span class=\"c1\"># take as much state vector as we need</span>\n        <span class=\"c1\"># print(&#39;** set block state to &#39;, self._x)</span>\n        <span class=\"k\">return</span> <span class=\"n\">x</span><span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span><span class=\"p\">:]</span>     <span class=\"c1\"># return the rest</span></div>\n\n<div class=\"viewcode-block\" id=\"ClockedBlock.getstate0\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.ClockedBlock.getstate0\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">getstate0</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span></div>\n\n<div class=\"viewcode-block\" id=\"ClockedBlock.check\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.ClockedBlock.check\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">check</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ndstates</span><span class=\"p\">,</span> <span class=\"s1\">&#39;incorrect length for initial state&#39;</span>\n\n        <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nin</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span> <span class=\"ow\">or</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nout</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"s1\">&#39;no inputs or outputs specified&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span></div></div>\n\n\n\n<span class=\"c1\"># c = Clock(5)</span>\n<span class=\"c1\"># c1 = Clock(5, 2)</span>\n\n<span class=\"c1\"># print(c, c1)</span>\n<span class=\"c1\"># print(c.next(0), c1.next(0))</span>\n\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/bdsim/graphics.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim.graphics &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../\" src=\"../../_static/documentation_options.js\"></script>\n        <script src=\"../../_static/jquery.js\"></script>\n        <script src=\"../../_static/underscore.js\"></script>\n        <script src=\"../../_static/doctools.js\"></script>\n        <script src=\"../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../index.html\">Module code</a> &raquo;</li>\n      <li>bdsim.graphics</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for bdsim.graphics</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"kn\">import</span> <span class=\"nn\">matplotlib</span>\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">from</span> <span class=\"nn\">matplotlib</span> <span class=\"kn\">import</span> <span class=\"n\">animation</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">SinkBlock</span>\n\n<div class=\"viewcode-block\" id=\"GraphicsBlock\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.GraphicsBlock\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">GraphicsBlock</span><span class=\"p\">(</span><span class=\"n\">SinkBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    A GraphicsBlock is a subclass of SinkBlock that represents a block that has inputs</span>\n<span class=\"sd\">    but no outputs and creates/updates a graphical display.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">blockclass</span><span class=\"o\">=</span><span class=\"s1\">&#39;graphics&#39;</span>\n    \n<div class=\"viewcode-block\" id=\"GraphicsBlock.__init__\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.GraphicsBlock.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">movie</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a graphical display block.</span>\n\n<span class=\"sd\">        :param movie: Save animation in this file in MP4 format, defaults to None</span>\n<span class=\"sd\">        :type movie: str, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: transfer function block base class</span>\n<span class=\"sd\">        :rtype: TransferBlock</span>\n\n<span class=\"sd\">        This is the parent class of all graphic display blocks.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_graphics</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">movie</span> <span class=\"o\">=</span> <span class=\"n\">movie</span></div>\n\n<div class=\"viewcode-block\" id=\"GraphicsBlock.start\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.GraphicsBlock.start\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n\n        <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">draw</span><span class=\"p\">()</span>\n        <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">show</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">movie</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span> <span class=\"ow\">and</span> <span class=\"ow\">not</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">animation</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;enabling global animation option to allow movie option on block&#39;</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">animation</span> <span class=\"o\">=</span> <span class=\"kc\">True</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">movie</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">writer</span> <span class=\"o\">=</span> <span class=\"n\">animation</span><span class=\"o\">.</span><span class=\"n\">FFMpegWriter</span><span class=\"p\">(</span><span class=\"n\">fps</span><span class=\"o\">=</span><span class=\"mi\">10</span><span class=\"p\">,</span> <span class=\"n\">extra_args</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;-vcodec&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;libx264&#39;</span><span class=\"p\">])</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">writer</span><span class=\"o\">.</span><span class=\"n\">setup</span><span class=\"p\">(</span><span class=\"n\">fig</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span><span class=\"p\">,</span> <span class=\"n\">outfile</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">movie</span><span class=\"p\">)</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;movie block&#39;</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"s1\">&#39; --&gt; &#39;</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">movie</span><span class=\"p\">)</span></div>\n\n<div class=\"viewcode-block\" id=\"GraphicsBlock.step\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.GraphicsBlock.step\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">step</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">()</span>\n            \n        <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">animation</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span><span class=\"o\">.</span><span class=\"n\">canvas</span><span class=\"o\">.</span><span class=\"n\">flush_events</span><span class=\"p\">()</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">movie</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">writer</span><span class=\"o\">.</span><span class=\"n\">grab_frame</span><span class=\"p\">()</span></div>\n\n<div class=\"viewcode-block\" id=\"GraphicsBlock.done\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.GraphicsBlock.done\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">done</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span><span class=\"o\">.</span><span class=\"n\">canvas</span><span class=\"o\">.</span><span class=\"n\">start_event_loop</span><span class=\"p\">(</span><span class=\"mf\">0.001</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">movie</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">writer</span><span class=\"o\">.</span><span class=\"n\">finish</span><span class=\"p\">()</span>\n                <span class=\"c1\"># self.cleanup()</span>\n            <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">show</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">=</span><span class=\"n\">block</span><span class=\"p\">)</span></div>\n\n\n<div class=\"viewcode-block\" id=\"GraphicsBlock.savefig\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.GraphicsBlock.savefig\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">savefig</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">filename</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"nb\">format</span><span class=\"o\">=</span><span class=\"s1\">&#39;pdf&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Save the figure as an image file</span>\n\n<span class=\"sd\">        :param fname: Name of file to save graphics to</span>\n<span class=\"sd\">        :type fname: str</span>\n<span class=\"sd\">        :param ``**kwargs``: Options passed to `savefig &lt;https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.pyplot.savefig.html&gt;`_</span>\n\n<span class=\"sd\">        The file format is taken from the file extension and can be</span>\n<span class=\"sd\">        jpeg, png or pdf.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"k\">try</span><span class=\"p\">:</span>\n            <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">figure</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span><span class=\"o\">.</span><span class=\"n\">number</span><span class=\"p\">)</span>  <span class=\"c1\"># make block&#39;s figure the current one</span>\n            <span class=\"k\">if</span> <span class=\"n\">filename</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"n\">filename</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span>\n            <span class=\"n\">filename</span> <span class=\"o\">+=</span> <span class=\"s2\">&quot;.&quot;</span> <span class=\"o\">+</span> <span class=\"nb\">format</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;saved </span><span class=\"si\">{}</span><span class=\"s1\"> -&gt; </span><span class=\"si\">{}</span><span class=\"s1\">&#39;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">),</span> <span class=\"n\">filename</span><span class=\"p\">))</span>\n            <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">savefig</span><span class=\"p\">(</span><span class=\"n\">filename</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>  <span class=\"c1\"># save the current figure</span>\n\n        <span class=\"k\">except</span><span class=\"p\">:</span>\n            <span class=\"k\">pass</span></div>\n\n\n<div class=\"viewcode-block\" id=\"GraphicsBlock.create_figure\"><a class=\"viewcode-back\" href=\"../../internals.html#bdsim.GraphicsBlock.create_figure\">[docs]</a>    <span class=\"k\">def</span> <span class=\"nf\">create_figure</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">):</span>\n\n        <span class=\"k\">def</span> <span class=\"nf\">move_figure</span><span class=\"p\">(</span><span class=\"n\">f</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">):</span>\n            <span class=\"sd\">&quot;&quot;&quot;Move figure&#39;s upper left corner to pixel (x, y)&quot;&quot;&quot;</span>\n            <span class=\"n\">backend</span> <span class=\"o\">=</span> <span class=\"n\">matplotlib</span><span class=\"o\">.</span><span class=\"n\">get_backend</span><span class=\"p\">()</span>\n            <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">xoffset</span>\n            <span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">y</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"n\">backend</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;TkAgg&#39;</span><span class=\"p\">:</span>\n                <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">canvas</span><span class=\"o\">.</span><span class=\"n\">manager</span><span class=\"o\">.</span><span class=\"n\">window</span><span class=\"o\">.</span><span class=\"n\">wm_geometry</span><span class=\"p\">(</span><span class=\"s2\">&quot;+</span><span class=\"si\">%d</span><span class=\"s2\">+</span><span class=\"si\">%d</span><span class=\"s2\">&quot;</span> <span class=\"o\">%</span> <span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">))</span>\n            <span class=\"k\">elif</span> <span class=\"n\">backend</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;WXAgg&#39;</span><span class=\"p\">:</span>\n                <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">canvas</span><span class=\"o\">.</span><span class=\"n\">manager</span><span class=\"o\">.</span><span class=\"n\">window</span><span class=\"o\">.</span><span class=\"n\">SetPosition</span><span class=\"p\">((</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">))</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"c1\"># This works for QT and GTK</span>\n                <span class=\"c1\"># You can also use window.setGeometry</span>\n                <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">canvas</span><span class=\"o\">.</span><span class=\"n\">manager</span><span class=\"o\">.</span><span class=\"n\">window</span><span class=\"o\">.</span><span class=\"n\">move</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">)</span>\n        \n        <span class=\"n\">gstate</span> <span class=\"o\">=</span> <span class=\"n\">state</span>\n        <span class=\"n\">options</span> <span class=\"o\">=</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span>\n\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;#figs&#39;</span><span class=\"p\">,</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">get_fignums</span><span class=\"p\">())</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">fignum</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"c1\"># no figures yet created, lazy initialization</span>\n            \n            <span class=\"n\">matplotlib</span><span class=\"o\">.</span><span class=\"n\">use</span><span class=\"p\">(</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">backend</span><span class=\"p\">)</span>            \n            <span class=\"n\">mpl_backend</span> <span class=\"o\">=</span> <span class=\"n\">matplotlib</span><span class=\"o\">.</span><span class=\"n\">get_backend</span><span class=\"p\">()</span>\n\n            <span class=\"c1\"># split the string            </span>\n            <span class=\"n\">ntiles</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">tiles</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">(</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">)]</span>\n\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s2\">&quot;Graphics:&quot;</span><span class=\"p\">)</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  backend:&#39;</span><span class=\"p\">,</span> <span class=\"n\">mpl_backend</span><span class=\"p\">)</span>\n            <span class=\"n\">xoffset</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n            <span class=\"k\">if</span> <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">shape</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n                <span class=\"k\">if</span> <span class=\"n\">mpl_backend</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;Qt5Agg&#39;</span><span class=\"p\">:</span>\n                    <span class=\"c1\"># next line actually creates a figure if none already exist</span>\n                    <span class=\"n\">screen</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">get_current_fig_manager</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">canvas</span><span class=\"o\">.</span><span class=\"n\">screen</span><span class=\"p\">()</span>\n                    <span class=\"c1\"># this is a QScreenClass object, see https://doc.qt.io/qt-5/qscreen.html#availableGeometry-prop</span>\n                    <span class=\"c1\"># next line creates a figure</span>\n                    <span class=\"n\">sz</span> <span class=\"o\">=</span> <span class=\"n\">screen</span><span class=\"o\">.</span><span class=\"n\">availableSize</span><span class=\"p\">()</span>\n                    <span class=\"n\">dpiscale</span> <span class=\"o\">=</span> <span class=\"n\">screen</span><span class=\"o\">.</span><span class=\"n\">devicePixelRatio</span><span class=\"p\">()</span> <span class=\"c1\"># is 2.0 for Mac laptop screen</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">sz</span><span class=\"o\">.</span><span class=\"n\">width</span><span class=\"p\">(),</span> <span class=\"n\">sz</span><span class=\"o\">.</span><span class=\"n\">height</span><span class=\"p\">(),</span> <span class=\"n\">dpiscale</span><span class=\"p\">)</span>\n\n                    <span class=\"c1\"># check for a second screen</span>\n                    <span class=\"k\">if</span> <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">altscreen</span><span class=\"p\">:</span>\n                        <span class=\"n\">vsize</span> <span class=\"o\">=</span> <span class=\"n\">screen</span><span class=\"o\">.</span><span class=\"n\">availableVirtualGeometry</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">getCoords</span><span class=\"p\">()</span>\n                        <span class=\"k\">if</span> <span class=\"n\">vsize</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">&lt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                            <span class=\"c1\"># extra monitor to the left</span>\n                            <span class=\"n\">xoffset</span> <span class=\"o\">=</span> <span class=\"n\">vsize</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n                        <span class=\"k\">elif</span> <span class=\"n\">vsize</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">&gt;=</span> <span class=\"n\">sz</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]:</span>\n                            <span class=\"c1\"># extra monitor to the right</span>\n                            <span class=\"n\">xoffset</span> <span class=\"o\">=</span> <span class=\"n\">vsize</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n\n                    <span class=\"n\">screen_width</span><span class=\"p\">,</span> <span class=\"n\">screen_height</span> <span class=\"o\">=</span> <span class=\"n\">sz</span><span class=\"o\">.</span><span class=\"n\">width</span><span class=\"p\">(),</span> <span class=\"n\">sz</span><span class=\"o\">.</span><span class=\"n\">height</span><span class=\"p\">()</span>\n                    <span class=\"n\">dpi</span> <span class=\"o\">=</span> <span class=\"n\">screen</span><span class=\"o\">.</span><span class=\"n\">physicalDotsPerInch</span><span class=\"p\">()</span>\n                    <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">gcf</span><span class=\"p\">()</span>\n\n                <span class=\"k\">elif</span> <span class=\"n\">mpl_backend</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;TkAgg&#39;</span><span class=\"p\">:</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  #figs&#39;</span><span class=\"p\">,</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">get_fignums</span><span class=\"p\">())</span>\n                    <span class=\"n\">window</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">get_current_fig_manager</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">window</span>\n                    <span class=\"n\">screen_width</span><span class=\"p\">,</span> <span class=\"n\">screen_height</span> <span class=\"o\">=</span> <span class=\"n\">window</span><span class=\"o\">.</span><span class=\"n\">winfo_screenwidth</span><span class=\"p\">(),</span> <span class=\"n\">window</span><span class=\"o\">.</span><span class=\"n\">winfo_screenheight</span><span class=\"p\">()</span>\n                    <span class=\"n\">dpiscale</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n                    <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  Size: </span><span class=\"si\">%d</span><span class=\"s1\"> x </span><span class=\"si\">%d</span><span class=\"s1\">&#39;</span> <span class=\"o\">%</span> <span class=\"p\">(</span><span class=\"n\">screen_width</span><span class=\"p\">,</span> <span class=\"n\">screen_height</span><span class=\"p\">))</span>\n                    <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">gcf</span><span class=\"p\">()</span>\n                    <span class=\"n\">dpi</span> <span class=\"o\">=</span> <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">dpi</span>\n\n                <span class=\"k\">else</span><span class=\"p\">:</span>\n                    <span class=\"c1\"># all other backends</span>\n                    <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">figure</span><span class=\"p\">()</span>\n                    <span class=\"n\">dpi</span> <span class=\"o\">=</span> <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">dpi</span>\n                    <span class=\"n\">screen_width</span><span class=\"p\">,</span> <span class=\"n\">screen_height</span> <span class=\"o\">=</span> <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">get_size_inches</span><span class=\"p\">()</span> <span class=\"o\">*</span> <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">dpi</span>\n\n                <span class=\"c1\"># compute fig size in inches (width, height)</span>\n                <span class=\"n\">figsize</span> <span class=\"o\">=</span> <span class=\"p\">[</span> <span class=\"n\">screen_width</span> <span class=\"o\">/</span> <span class=\"n\">ntiles</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"n\">dpi</span><span class=\"p\">,</span> \n                <span class=\"n\">screen_height</span> <span class=\"o\">/</span> <span class=\"n\">ntiles</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"n\">dpi</span> <span class=\"p\">]</span>\n\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"c1\"># shape is given explictly</span>\n                <span class=\"n\">screen_width</span><span class=\"p\">,</span> <span class=\"n\">screen_height</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"nb\">int</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span> <span class=\"k\">for</span> <span class=\"n\">x</span> <span class=\"ow\">in</span> <span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"o\">.</span><span class=\"n\">split</span><span class=\"p\">(</span><span class=\"s1\">&#39;:&#39;</span><span class=\"p\">)]</span>\n\n                <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">gcf</span><span class=\"p\">()</span>\n\n            <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">canvas</span><span class=\"o\">.</span><span class=\"n\">manager</span><span class=\"o\">.</span><span class=\"n\">set_window_title</span><span class=\"p\">(</span><span class=\"sa\">f</span><span class=\"s2\">&quot;bdsim: Figure </span><span class=\"si\">{</span><span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">number</span><span class=\"si\">:</span><span class=\"s2\">d</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span>\n\n            <span class=\"c1\"># save graphics info away in state</span>\n            <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">figsize</span> <span class=\"o\">=</span> <span class=\"n\">figsize</span>\n            <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">dpi</span> <span class=\"o\">=</span> <span class=\"n\">dpi</span>\n            <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">screensize_pix</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">screen_width</span><span class=\"p\">,</span> <span class=\"n\">screen_height</span><span class=\"p\">)</span>\n            <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">ntiles</span> <span class=\"o\">=</span> <span class=\"n\">ntiles</span>\n            <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">xoffset</span> <span class=\"o\">=</span> <span class=\"n\">xoffset</span>\n\n            <span class=\"c1\"># resize the figure</span>\n            <span class=\"n\">f</span><span class=\"o\">.</span><span class=\"n\">set_size_inches</span><span class=\"p\">(</span><span class=\"n\">figsize</span><span class=\"p\">,</span> <span class=\"n\">forward</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">)</span>\n            <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">ion</span><span class=\"p\">()</span>\n\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"c1\"># subsequent figures</span>\n            <span class=\"n\">f</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">figure</span><span class=\"p\">(</span><span class=\"n\">figsize</span><span class=\"o\">=</span><span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">figsize</span><span class=\"p\">)</span>\n\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;  #figs&#39;</span><span class=\"p\">,</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">get_fignums</span><span class=\"p\">())</span>\n        <span class=\"c1\"># move the figure to right place on screen</span>\n        <span class=\"n\">row</span> <span class=\"o\">=</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">fignum</span> <span class=\"o\">//</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">ntiles</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">col</span> <span class=\"o\">=</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">fignum</span> <span class=\"o\">%</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">ntiles</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">move_figure</span><span class=\"p\">(</span><span class=\"n\">f</span><span class=\"p\">,</span> <span class=\"n\">col</span> <span class=\"o\">*</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">figsize</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">dpi</span><span class=\"p\">,</span> <span class=\"n\">row</span> <span class=\"o\">*</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">figsize</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">dpi</span><span class=\"p\">)</span>\n        <span class=\"n\">gstate</span><span class=\"o\">.</span><span class=\"n\">fignum</span> <span class=\"o\">+=</span> <span class=\"mi\">1</span>\n        \n        <span class=\"c1\">#print(&#39;create figure&#39;, self.fignum, row, col)</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">f</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"n\">f</span></div></div>\n\n\n            \n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/index.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>Overview: module code &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../\" src=\"../_static/documentation_options.js\"></script>\n        <script src=\"../_static/jquery.js\"></script>\n        <script src=\"../_static/underscore.js\"></script>\n        <script src=\"../_static/doctools.js\"></script>\n        <script src=\"../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>Overview: module code</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>All modules for which code is available</h1>\n<ul><li><a href=\"bdsim/bdsim.html\">bdsim.bdsim</a></li>\n<li><a href=\"bdsim/blocks/connections.html\">bdsim.blocks.connections</a></li>\n<li><a href=\"bdsim/blocks/discrete.html\">bdsim.blocks.discrete</a></li>\n<li><a href=\"bdsim/blocks/functions.html\">bdsim.blocks.functions</a></li>\n<li><a href=\"bdsim/blocks/linalg.html\">bdsim.blocks.linalg</a></li>\n<li><a href=\"bdsim/blocks/sinks.html\">bdsim.blocks.sinks</a></li>\n<li><a href=\"bdsim/blocks/sources.html\">bdsim.blocks.sources</a></li>\n<li><a href=\"bdsim/blocks/transfers.html\">bdsim.blocks.transfers</a></li>\n<li><a href=\"bdsim/components.html\">bdsim.components</a></li>\n<li><a href=\"bdsim/graphics.html\">bdsim.graphics</a></li>\n<li><a href=\"roboticstoolbox/blocks/arm.html\">roboticstoolbox.blocks.arm</a></li>\n<li><a href=\"roboticstoolbox/blocks/mobile.html\">roboticstoolbox.blocks.mobile</a></li>\n<li><a href=\"roboticstoolbox/blocks/uav.html\">roboticstoolbox.blocks.uav</a></li>\n</ul>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/roboticstoolbox/blocks/arm.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>roboticstoolbox.blocks.arm &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>roboticstoolbox.blocks.arm</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for roboticstoolbox.blocks.arm</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">from</span> <span class=\"nn\">math</span> <span class=\"kn\">import</span> <span class=\"n\">sin</span><span class=\"p\">,</span> <span class=\"n\">cos</span><span class=\"p\">,</span> <span class=\"n\">atan2</span><span class=\"p\">,</span> <span class=\"n\">tan</span><span class=\"p\">,</span> <span class=\"n\">sqrt</span><span class=\"p\">,</span> <span class=\"n\">pi</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">import</span> <span class=\"nn\">time</span>\n<span class=\"kn\">from</span> <span class=\"nn\">spatialmath</span> <span class=\"kn\">import</span> <span class=\"n\">base</span><span class=\"p\">,</span> <span class=\"n\">SE3</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">TransferBlock</span><span class=\"p\">,</span> <span class=\"n\">FunctionBlock</span><span class=\"p\">,</span> <span class=\"n\">SourceBlock</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.graphics</span> <span class=\"kn\">import</span> <span class=\"n\">GraphicsBlock</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">roboticstoolbox</span> <span class=\"kn\">import</span> <span class=\"n\">tpoly_func</span><span class=\"p\">,</span> <span class=\"n\">lspb_func</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">Robot blocks:</span>\n<span class=\"sd\">- have inputs and outputs</span>\n<span class=\"sd\">- are a subclass of ``FunctionBlock`` |rarr| ``Block`` for kinematics and have no states</span>\n<span class=\"sd\">- are a subclass of ``TransferBlock`` |rarr| ``Block`` for dynamics and have states</span>\n\n<span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"c1\"># The constructor of each class ``MyClass`` with a ``@block`` decorator becomes a method ``MYCLASS()`` of the BlockDiagram instance.</span>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"FKine\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.FKine\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">FKine</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`FKINE`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | SE3     |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;T&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"FKine.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.FKine.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">args</span><span class=\"o\">=</span><span class=\"p\">{},</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param ``*inputs``: Optional incoming connections</span>\n<span class=\"sd\">        :type ``*inputs``: Block or Plug</span>\n<span class=\"sd\">        :param robot: Robot model, defaults to None</span>\n<span class=\"sd\">        :type robot: Robot subclass, optional</span>\n<span class=\"sd\">        :param args: Options for fkine, defaults to {}</span>\n<span class=\"sd\">        :type args: dict, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a FORWARD_KINEMATICS block</span>\n<span class=\"sd\">        :rtype: Foward_Kinematics instance</span>\n\n<span class=\"sd\">        Robot arm forward kinematic model.</span>\n\n<span class=\"sd\">        **Block ports**</span>\n\n<span class=\"sd\">            :input q: Joint configuration vector as an ndarray.</span>\n\n<span class=\"sd\">            :output T: End-effector pose as an SE(3) object</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;forward-kinematics&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robot</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">args</span> <span class=\"o\">=</span> <span class=\"n\">args</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;T&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">fkine</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"o\">**</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">args</span><span class=\"p\">)]</span></div>\n\n\n<div class=\"viewcode-block\" id=\"IKine\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.IKine\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">IKine</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`IKINE`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | SE3        | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;T&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"IKine.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.IKine.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span>\n        <span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">useprevious</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">ik</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span>\n    <span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param robot: Robot model, defaults to None</span>\n<span class=\"sd\">        :type robot: Robot subclass, optional</span>\n<span class=\"sd\">        :param q0: Initial joint angles, defaults to None</span>\n<span class=\"sd\">        :type q0: array_like(n), optional</span>\n<span class=\"sd\">        :param useprevious: Use previous IK solution as q0, defaults to True</span>\n<span class=\"sd\">        :type useprevious: bool, optional</span>\n<span class=\"sd\">        :param ik: Specify an IK function, defaults to &#39;ikine_LM&#39;</span>\n<span class=\"sd\">        :type ik: callable f(T)</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: an INVERSE_KINEMATICS block</span>\n<span class=\"sd\">        :rtype: Inverse_Kinematics instance</span>\n\n<span class=\"sd\">        Robot arm inverse kinematic model.</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. End-effector pose as an SE(3) object</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. Joint configuration vector as an ndarray.</span>\n\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;inverse-kinematics&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robot</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">q0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qprev</span> <span class=\"o\">=</span> <span class=\"n\">q0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">useprevious</span> <span class=\"o\">=</span> <span class=\"n\">useprevious</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ik</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;T&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">()</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">useprevious</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qprev</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">useprevious</span><span class=\"p\">:</span>\n            <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qprev</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ik</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">sol</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">ikine_LM</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"n\">q0</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">sol</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ik</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n\n        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"n\">sol</span><span class=\"o\">.</span><span class=\"n\">success</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s2\">&quot;inverse kinematic failure for pose&quot;</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">useprevious</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qprev</span> <span class=\"o\">=</span> <span class=\"n\">sol</span><span class=\"o\">.</span><span class=\"n\">q</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">sol</span><span class=\"o\">.</span><span class=\"n\">q</span><span class=\"p\">]</span></div>\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Jacobian\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Jacobian\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Jacobian</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`JACOBIAN`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;J&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"Jacobian.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Jacobian.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span>\n        <span class=\"bp\">self</span><span class=\"p\">,</span>\n        <span class=\"n\">robot</span><span class=\"p\">,</span>\n        <span class=\"n\">frame</span><span class=\"o\">=</span><span class=\"s2\">&quot;0&quot;</span><span class=\"p\">,</span>\n        <span class=\"n\">inverse</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span>\n        <span class=\"n\">pinv</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span>\n        <span class=\"n\">transpose</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span>\n        <span class=\"o\">**</span><span class=\"n\">blockargs</span>\n    <span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param frame: Frame to compute Jacobian for, one of: &#39;0&#39; [default], &#39;e&#39;</span>\n<span class=\"sd\">        :type frame: str, optional</span>\n<span class=\"sd\">        :param inverse: output inverse of Jacobian, defaults to False</span>\n<span class=\"sd\">        :type inverse: bool, optional</span>\n<span class=\"sd\">        :param pinv: output pseudo-inverse of Jacobian, defaults to False</span>\n<span class=\"sd\">        :type pinv: bool, optional</span>\n<span class=\"sd\">        :param transpose: output transpose of Jacobian, defaults to False</span>\n<span class=\"sd\">        :type transpose: bool, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a JACOBIAN block</span>\n<span class=\"sd\">        :rtype: Jacobian instance</span>\n\n<span class=\"sd\">        Robot arm Jacobian.</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. Joint configuration vector as an ndarray.</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. Jacobian matrix as an ndarray(6,n)</span>\n\n<span class=\"sd\">        .. notes::</span>\n<span class=\"sd\">            - Only one of ``inverse`` or ``pinv`` can be True</span>\n<span class=\"sd\">            - ``inverse`` or ``pinv`` can be used in conjunction with ``transpose``</span>\n<span class=\"sd\">            - ``inverse`` requires that the Jacobian is square</span>\n<span class=\"sd\">            - If ``inverse`` is True and the Jacobian is singular a runtime</span>\n<span class=\"sd\">              error will occur.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robot</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">frame</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;0&quot;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">jfunc</span> <span class=\"o\">=</span> <span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">jacob0</span>\n        <span class=\"k\">elif</span> <span class=\"n\">frame</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;e&quot;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">jfunc</span> <span class=\"o\">=</span> <span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">jacobe</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s2\">&quot;unknown frame&quot;</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">inverse</span> <span class=\"ow\">and</span> <span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span> <span class=\"o\">!=</span> <span class=\"mi\">6</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s2\">&quot;cannot invert a non square Jacobian&quot;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">inverse</span> <span class=\"ow\">and</span> <span class=\"n\">pinv</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s2\">&quot;can only set one of inverse and pinv&quot;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inverse</span> <span class=\"o\">=</span> <span class=\"n\">inverse</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pinv</span> <span class=\"o\">=</span> <span class=\"n\">pinv</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">transpose</span> <span class=\"o\">=</span> <span class=\"n\">transpose</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;J&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">J</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">jfunc</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inverse</span><span class=\"p\">:</span>\n            <span class=\"n\">J</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"n\">J</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pinv</span><span class=\"p\">:</span>\n            <span class=\"n\">J</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">pinv</span><span class=\"p\">(</span><span class=\"n\">J</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">transpose</span><span class=\"p\">:</span>\n            <span class=\"n\">J</span> <span class=\"o\">=</span> <span class=\"n\">J</span><span class=\"o\">.</span><span class=\"n\">T</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">J</span><span class=\"p\">]</span></div>\n\n\n<div class=\"viewcode-block\" id=\"Tr2Delta\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Tr2Delta\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Tr2Delta</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`TR2DELTA`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs    |  states |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | 2          | 1          | 0       |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | SE3, SE3   | ndarray(6) |         |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;T1&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;T2&#39;</span><span class=\"p\">)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;Δ&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"Tr2Delta.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Tr2Delta.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a TR2DELTA block</span>\n<span class=\"sd\">        :rtype: Tr2Delta instance</span>\n\n<span class=\"sd\">        Difference between T1 and T2 as a 6-vector</span>\n\n<span class=\"sd\">        The block has two input port:</span>\n\n<span class=\"sd\">            1. T1 as an SE3.</span>\n<span class=\"sd\">            2. T2 as an SE3.</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. delta as an ndarray(6,n)</span>\n\n<span class=\"sd\">        :seealso: :func:`spatialmath.base.tr2delta`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;T1&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;T2&quot;</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;$\\delta$&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">tr2delta</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">A</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">A</span><span class=\"p\">)]</span></div>\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n\n<div class=\"viewcode-block\" id=\"Delta2Tr\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Delta2Tr\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Delta2Tr</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`DELTA2TR`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs  |  states |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | 1          | 1        | 0       |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | ndarray(6) | SE3      |         |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;T&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;Δ&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"Delta2Tr.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Delta2Tr.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a DELTA2TR block</span>\n<span class=\"sd\">        :rtype: Delta2Tr instance</span>\n\n<span class=\"sd\">        Delta to SE(3)</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. delta as an ndarray(6,n)</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. T as an SE3</span>\n\n<span class=\"sd\">        :seealso: :func:`spatialmath.base.delta2tr`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;$\\delta$&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;T&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">SE3</span><span class=\"o\">.</span><span class=\"n\">Delta</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])]</span></div>\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"Point2Tr\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Point2Tr\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Point2Tr</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`POINT2TR`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs  |  states |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | 1          | 1        | 0       |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | ndarray(3) | SE3      |         |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"Point2Tr.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Point2Tr.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param T: the transform</span>\n<span class=\"sd\">        :type T: SE3</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a POINT2TR block</span>\n<span class=\"sd\">        :rtype: Point2Tr instance</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. a 3D point as an ndarray(3)</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. T as an SE3 with its position part replaced by the input</span>\n\n<span class=\"sd\">        :seealso: :func:`spatialmath.base.delta2tr`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;t&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;T&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pose</span> <span class=\"o\">=</span> <span class=\"n\">T</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">SE3</span><span class=\"o\">.</span><span class=\"n\">SO3</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pose</span><span class=\"o\">.</span><span class=\"n\">R</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">T</span><span class=\"p\">]</span></div>\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n\n<div class=\"viewcode-block\" id=\"TR2T\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.TR2T\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">TR2T</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`TR2T`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs  |  states |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | 1          | 3        | 0       |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    | SE3        | float    |         |</span>\n<span class=\"sd\">    +------------+----------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;T&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;y&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;z&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"TR2T.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.TR2T.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param T: the transform</span>\n<span class=\"sd\">        :type T: SE3</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a POINT2TR block</span>\n<span class=\"sd\">        :rtype: Point2Tr instance</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. a 3D point as an ndarray(3)</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. T as an SE3 with its position part replaced by the input</span>\n\n<span class=\"sd\">        :seealso: :func:`spatialmath.base.delta2tr`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;T&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;x&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;y&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;z&quot;</span><span class=\"p\">))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span><span class=\"o\">.</span><span class=\"n\">t</span>\n        <span class=\"k\">return</span> <span class=\"nb\">list</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)</span></div>\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"FDyn\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.FDyn\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">FDyn</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`FDYN`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 3       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | ndarray,|         |</span>\n<span class=\"sd\">    |            | ndarray,|         |</span>\n<span class=\"sd\">    |            | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qd&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qdd&#39;</span><span class=\"p\">)</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;τ&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"FDyn.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.FDyn.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"p\">,</span> <span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param q0: Initial joint configuration</span>\n<span class=\"sd\">        :type q0: array_like(n)</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a FORWARD_DYNAMICS block</span>\n<span class=\"sd\">        :rtype: Foward_Dynamics instance</span>\n\n<span class=\"sd\">        Robot arm forward dynamics model.</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. Joint force/torque as an ndarray.</span>\n\n<span class=\"sd\">        and three output ports:</span>\n\n<span class=\"sd\">            1. joint configuration</span>\n<span class=\"sd\">            2. joint velocity</span>\n<span class=\"sd\">            3. joint acceleration</span>\n\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;forward-dynamics&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robot</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span> <span class=\"o\">*</span> <span class=\"mi\">2</span>\n\n        <span class=\"c1\"># state vector is [q qd]</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;$</span><span class=\"se\">\\t</span><span class=\"s2\">au$&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;qd&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;qdd&quot;</span><span class=\"p\">))</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">q0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span><span class=\"p\">,))]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_qdd</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span>\n        <span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[:</span><span class=\"n\">n</span><span class=\"p\">]</span>\n        <span class=\"n\">qd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"n\">n</span><span class=\"p\">:]</span>\n        <span class=\"n\">qdd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_qdd</span>  <span class=\"c1\"># from last deriv</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">qd</span><span class=\"p\">,</span> <span class=\"n\">qdd</span><span class=\"p\">]</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"c1\"># return [qd qdd]</span>\n        <span class=\"n\">Q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">Q</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"n\">n</span><span class=\"p\">,</span> <span class=\"s2\">&quot;torque vector wrong size&quot;</span>\n\n        <span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[:</span><span class=\"n\">n</span><span class=\"p\">]</span>\n        <span class=\"n\">qd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"n\">n</span><span class=\"p\">:]</span>\n        <span class=\"n\">qdd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">accel</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">qd</span><span class=\"p\">,</span> <span class=\"n\">Q</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_qdd</span> <span class=\"o\">=</span> <span class=\"n\">qdd</span>\n        <span class=\"k\">return</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">qd</span><span class=\"p\">,</span> <span class=\"n\">qdd</span><span class=\"p\">]</span></div>\n\n\n<div class=\"viewcode-block\" id=\"IDyn\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.IDyn\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">IDyn</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`IDYN`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 3          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray,   | ndarray |         |</span>\n<span class=\"sd\">    | ndarray,   |         |         |</span>\n<span class=\"sd\">    | ndarray    |         |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qd&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qdd&#39;</span><span class=\"p\">)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;τ&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"IDyn.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.IDyn.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"p\">,</span> <span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param gravity: gravitational acceleration</span>\n<span class=\"sd\">        :type gravity: float</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: an INVERSE_DYNAMICS block</span>\n<span class=\"sd\">        :rtype: Inverse_Dynamics instance</span>\n\n<span class=\"sd\">        Robot arm forward dynamics model.</span>\n\n<span class=\"sd\">        The block has three input port:</span>\n\n<span class=\"sd\">            1. Joint configuration vector as an ndarray.</span>\n<span class=\"sd\">            2. Joint velocity vector as an ndarray.</span>\n<span class=\"sd\">            3. Joint acceleration vector as an ndarray.</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. joint torque/force</span>\n\n<span class=\"sd\">        .. TODO:: end-effector wrench input, base wrench output, payload input</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;inverse-dynamics&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robot</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gravity</span> <span class=\"o\">=</span> <span class=\"n\">gravity</span>\n\n        <span class=\"c1\"># state vector is [q qd]</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;qd&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;qdd&quot;</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;$</span><span class=\"se\">\\t</span><span class=\"s2\">au$&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">tau</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">rne</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">],</span> <span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"n\">gravity</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">tau</span><span class=\"p\">]</span></div>\n\n\n<div class=\"viewcode-block\" id=\"Gravload\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Gravload\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Gravload</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`GRAVLOAD`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;τ&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"Gravload.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Gravload.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"p\">,</span> <span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param gravity: gravitational acceleration</span>\n<span class=\"sd\">        :type gravity: float</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a GRAVLOAD block</span>\n<span class=\"sd\">        :rtype: Gravload instance</span>\n\n<span class=\"sd\">        Robot arm gravity torque.</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. Joint configuration vector as an ndarray.</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. joint torque/force due to gravity</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;gravload&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robots</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gravity</span> <span class=\"o\">=</span> <span class=\"n\">gravity</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;$</span><span class=\"se\">\\t</span><span class=\"s2\">au$&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">tau</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">gravload</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gravity</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">tau</span><span class=\"p\">]</span></div>\n\n<div class=\"viewcode-block\" id=\"Gravload_X\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Gravload_X\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Gravload_X</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`GRAVLOAD_X`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;w&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"Gravload_X.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Gravload_X.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"p\">,</span> <span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param gravity: gravitational acceleration</span>\n<span class=\"sd\">        :type gravity: float</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a GRAVLOAD block</span>\n<span class=\"sd\">        :rtype: Gravload instance</span>\n\n<span class=\"sd\">        Robot arm gravity torque.</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. Joint configuration vector as an ndarray.</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. joint torque/force due to gravity</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;gravload-x&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robots</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gravity</span> <span class=\"o\">=</span> <span class=\"n\">gravity</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;$</span><span class=\"se\">\\t</span><span class=\"s2\">au$&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">tau</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">gravload</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gravity</span><span class=\"p\">)</span>\n        <span class=\"n\">J</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">jacob0</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">J</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">==</span> <span class=\"n\">J</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]:</span>\n            <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"n\">J</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">*</span> <span class=\"n\">tau</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">pinv</span><span class=\"p\">(</span><span class=\"n\">J</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">*</span> <span class=\"n\">tau</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">w</span><span class=\"p\">]</span></div>\n\n<div class=\"viewcode-block\" id=\"Inertia\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Inertia\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Inertia</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`INERTIA`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;M&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"Inertia.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Inertia.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"p\">,</span> <span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: an INERTIA block</span>\n<span class=\"sd\">        :rtype: Inertia instance</span>\n\n<span class=\"sd\">        Robot arm inertia matrix.</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. Joint configuration vector as an ndarray.</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. Joint-space inertia matrix :math:`\\mat{M}(q)`</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;inertia&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robots</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;M&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">M</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">inertia</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">M</span><span class=\"p\">]</span></div>\n\n<div class=\"viewcode-block\" id=\"Inertia_X\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Inertia_X\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Inertia_X</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`INERTIA_X`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;M&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"Inertia_X.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Inertia_X.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"p\">,</span> <span class=\"n\">representation</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">pinv</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: an INERTIA_X block</span>\n<span class=\"sd\">        :rtype: Inertia_X instance</span>\n\n<span class=\"sd\">        Robot arm task-space inertia matrix.</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. Joint configuration vector as an ndarray.</span>\n\n<span class=\"sd\">        and one output port:</span>\n\n<span class=\"sd\">            1. Task-space inertia matrix :math:`\\mat{M}_x(q)`</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;inertia-x&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robot</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">representation</span> <span class=\"o\">=</span> <span class=\"n\">representation</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pinv</span> <span class=\"o\">=</span> <span class=\"n\">pinv</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;M&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">Mx</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">inertia_x</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">pinv</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pinv</span><span class=\"p\">,</span> <span class=\"n\">representation</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">representation</span><span class=\"p\">)</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">Mx</span><span class=\"p\">]</span></div>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"FDyn_X\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.FDyn_X\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">FDyn_X</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`FDYN_X`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 1          | 3       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | ndarray    | ndarray,|         |</span>\n<span class=\"sd\">    |            | ndarray,|         |</span>\n<span class=\"sd\">    |            | ndarray |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">5</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qd&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;x&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;xd&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;xdd&#39;</span><span class=\"p\">)</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;w&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"FDyn_X.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.FDyn_X.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"p\">,</span> <span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">gravcomp</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">velcomp</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">representation</span><span class=\"o\">=</span><span class=\"s1\">&#39;rpy/xyz&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param end: Link to compute pose of, defaults to end-effector</span>\n<span class=\"sd\">        :type end: Link or str</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a FDYN_X block</span>\n<span class=\"sd\">        :rtype: FDyn_X instance</span>\n\n<span class=\"sd\">        Robot arm forward dynamics model.</span>\n\n<span class=\"sd\">        The block has one input port:</span>\n\n<span class=\"sd\">            1. Applied end-effector wrench as an ndarray.</span>\n\n<span class=\"sd\">        and three output ports:</span>\n\n<span class=\"sd\">            1. task space pose</span>\n<span class=\"sd\">            2. task space velocity</span>\n<span class=\"sd\">            3. task space acceleration</span>\n\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;forward-dynamics-x&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robot</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span> <span class=\"o\">*</span> <span class=\"mi\">2</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gravcomp</span> <span class=\"o\">=</span> <span class=\"n\">gravcomp</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">velcomp</span> <span class=\"o\">=</span> <span class=\"n\">velcomp</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">representation</span> <span class=\"o\">=</span> <span class=\"n\">representation</span>\n\n        <span class=\"c1\"># state vector is [q qd]</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;w&quot;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;qd&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;xd&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;xdd&quot;</span><span class=\"p\">))</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">q0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span><span class=\"p\">)</span>\n        <span class=\"c1\"># append qd0, assumed to be zero</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span><span class=\"p\">,))]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_qdd</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span>\n        <span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[:</span><span class=\"n\">n</span><span class=\"p\">]</span>\n        <span class=\"n\">qd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"n\">n</span><span class=\"p\">:]</span>\n        <span class=\"n\">qdd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_qdd</span>  <span class=\"c1\"># from last deriv</span>\n\n        <span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">fkine</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">)</span>\n        <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">tr2x</span><span class=\"p\">(</span><span class=\"n\">T</span><span class=\"o\">.</span><span class=\"n\">A</span><span class=\"p\">)</span>\n\n        <span class=\"n\">Ja</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">jacob0</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">analytical</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">representation</span><span class=\"p\">)</span>\n        <span class=\"n\">xd</span> <span class=\"o\">=</span> <span class=\"n\">Ja</span> <span class=\"o\">@</span> <span class=\"n\">qd</span>\n        <span class=\"c1\"># print(q)</span>\n        <span class=\"c1\"># print(qd)</span>\n        <span class=\"c1\"># print(xd)</span>\n        <span class=\"c1\"># print(Ja)</span>\n        <span class=\"c1\"># print()</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">qdd</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">xdd</span> <span class=\"o\">=</span> <span class=\"kc\">None</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">Ja_dot</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">jacob_dot</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">qd</span><span class=\"p\">,</span> <span class=\"n\">J0</span><span class=\"o\">=</span><span class=\"n\">Ja</span><span class=\"p\">)</span>\n            <span class=\"n\">xdd</span> <span class=\"o\">=</span> <span class=\"n\">Ja</span> <span class=\"o\">@</span> <span class=\"n\">qdd</span> <span class=\"o\">+</span> <span class=\"n\">Ja_dot</span> <span class=\"o\">@</span> <span class=\"n\">qd</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">qd</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">xd</span><span class=\"p\">,</span> <span class=\"n\">xdd</span><span class=\"p\">]</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"c1\"># return [qd qdd]</span>\n\n        <span class=\"c1\"># get current joint space state</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span>\n        <span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[:</span><span class=\"n\">n</span><span class=\"p\">]</span>\n        <span class=\"n\">qd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"n\">n</span><span class=\"p\">:]</span>\n\n        <span class=\"c1\"># compute joint forces</span>\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">6</span><span class=\"p\">,</span> <span class=\"s2\">&quot;wrench vector wrong size&quot;</span>\n        <span class=\"n\">Q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">jacob0</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">analytical</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">representation</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">@</span> <span class=\"n\">w</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">gravcomp</span> <span class=\"ow\">or</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">velcomp</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">velcomp</span><span class=\"p\">:</span>\n                <span class=\"n\">qd_rne</span> <span class=\"o\">=</span> <span class=\"n\">qd</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">qd_rne</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">n</span><span class=\"p\">,))</span>\n            <span class=\"n\">Q_rne</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">rne</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">qd_rne</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">n</span><span class=\"p\">,)))</span>\n\n        <span class=\"n\">qdd</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">accel</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"p\">,</span> <span class=\"n\">qd</span><span class=\"p\">,</span> <span class=\"n\">Q</span> <span class=\"o\">+</span> <span class=\"n\">Q_rne</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_qdd</span> <span class=\"o\">=</span> <span class=\"n\">qdd</span>\n        <span class=\"k\">return</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">qd</span><span class=\"p\">,</span> <span class=\"n\">qdd</span><span class=\"p\">]</span></div>\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"ArmPlot\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.ArmPlot\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">ArmPlot</span><span class=\"p\">(</span><span class=\"n\">GraphicsBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`ARMPLOT`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 1      | 0       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | ndarray|         |         |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"ArmPlot.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.ArmPlot.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">robot</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">*</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">backend</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        :param ``*inputs``: Optional incoming connections</span>\n<span class=\"sd\">        :type ``*inputs``: Block or Plug</span>\n<span class=\"sd\">        :param robot: Robot model</span>\n<span class=\"sd\">        :type robot: Robot subclass</span>\n<span class=\"sd\">        :param backend: RTB backend name, defaults to &#39;pyplot&#39;</span>\n<span class=\"sd\">        :type backend: str, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: An ARMPLOT block</span>\n<span class=\"sd\">        :rtype: ArmPlot instance</span>\n\n\n<span class=\"sd\">        Create a robot animation.</span>\n\n<span class=\"sd\">        Notes:</span>\n\n<span class=\"sd\">            - Uses RTB ``plot`` method</span>\n\n<span class=\"sd\">           Example of vehicle display (animated).  The label at the top is the</span>\n<span class=\"sd\">           block name.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,))</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">q0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">n</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span> <span class=\"o\">=</span> <span class=\"n\">robot</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">backend</span> <span class=\"o\">=</span> <span class=\"n\">backend</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">q0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">env</span> <span class=\"o\">=</span> <span class=\"kc\">None</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"c1\"># create the plot</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">reset</span><span class=\"p\">()</span>\n        <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">graphics</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">create_figure</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">env</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">(</span>\n                <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"n\">backend</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">backend</span><span class=\"p\">,</span> <span class=\"n\">fig</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">False</span>\n            <span class=\"p\">)</span>\n            <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">()</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">step</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">):</span>\n        <span class=\"c1\"># inputs are set</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">robot</span><span class=\"o\">.</span><span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">animation</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">env</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">()</span>\n\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">done</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">graphics</span><span class=\"p\">:</span>\n            <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">show</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">=</span><span class=\"n\">block</span><span class=\"p\">)</span>\n\n            <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">done</span><span class=\"p\">()</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n\n<div class=\"viewcode-block\" id=\"Traj\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Traj\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Traj</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`TRAJ`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 0 or 1     | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float      | float   |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"Traj.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.Traj.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">y0</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">yf</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">time</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"n\">traj</span><span class=\"o\">=</span><span class=\"s2\">&quot;lspb&quot;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"sd\">        :param y0: initial value, defaults to 0</span>\n<span class=\"sd\">        :type y0: array_like(m), optional</span>\n<span class=\"sd\">        :param yf: final value, defaults to 1</span>\n<span class=\"sd\">        :type yf: array_like(m), optional</span>\n<span class=\"sd\">        :param T: time vector or number of steps, defaults to None</span>\n<span class=\"sd\">        :type T: array_like or int, optional</span>\n<span class=\"sd\">        :param time: x is simulation time, defaults to False</span>\n<span class=\"sd\">        :type time: bool, optional</span>\n<span class=\"sd\">        :param traj: trajectory type, one of: &#39;lspb&#39; [default], &#39;tpoly&#39;</span>\n<span class=\"sd\">        :type traj: str, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: TRAJ block</span>\n<span class=\"sd\">        :rtype: Traj instance</span>\n\n<span class=\"sd\">        Create a trajectory block.</span>\n\n<span class=\"sd\">        A block that generates a trajectory using a trapezoidal or quintic</span>\n<span class=\"sd\">        polynomial profile.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span> <span class=\"o\">=</span> <span class=\"n\">time</span>\n        <span class=\"k\">if</span> <span class=\"n\">time</span><span class=\"p\">:</span>\n            <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n            <span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;function&quot;</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n            <span class=\"n\">blockclass</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;source&quot;</span>\n            \n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"n\">nin</span><span class=\"p\">,</span> <span class=\"n\">blockclass</span><span class=\"o\">=</span><span class=\"n\">blockclass</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"n\">y0</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">y0</span><span class=\"p\">)</span>\n        <span class=\"n\">yf</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">yf</span><span class=\"p\">)</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">y0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">yf</span><span class=\"p\">),</span> <span class=\"s2\">&quot;y0 and yf must have same length&quot;</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">y0</span> <span class=\"o\">=</span> <span class=\"n\">y0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">yf</span> <span class=\"o\">=</span> <span class=\"n\">yf</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span> <span class=\"o\">=</span> <span class=\"n\">time</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">T</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">traj</span> <span class=\"o\">=</span> <span class=\"n\">traj</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;y&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;yd&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;ydd&quot;</span><span class=\"p\">))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">&lt;=</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"s2\">&quot;interpolation not defined for t=0&quot;</span>\n            <span class=\"k\">assert</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">x</span><span class=\"p\">[</span><span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">&gt;=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"s2\">&quot;interpolation not defined for t=T&quot;</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">traj</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;lspb&quot;</span><span class=\"p\">:</span>\n            <span class=\"n\">trajfunc</span> <span class=\"o\">=</span> <span class=\"n\">lspb_func</span>\n        <span class=\"k\">elif</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">traj</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;tpoly&quot;</span><span class=\"p\">:</span>\n            <span class=\"n\">trajfunc</span> <span class=\"o\">=</span> <span class=\"n\">tpoly_func</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">trajfuncs</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">y0</span><span class=\"p\">)):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">trajfuncs</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">trajfunc</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">y0</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">yf</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">))</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">time</span><span class=\"p\">:</span>\n            <span class=\"n\">t</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">y0</span><span class=\"p\">)):</span>\n            <span class=\"n\">out</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">trajfuncs</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">](</span><span class=\"n\">t</span><span class=\"p\">))</span>\n\n        <span class=\"c1\"># we have a list of tuples out[i][j]</span>\n        <span class=\"c1\"># i is the timestep, j is y/yd/ydd</span>\n        <span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">o</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"k\">for</span> <span class=\"n\">o</span> <span class=\"ow\">in</span> <span class=\"n\">out</span><span class=\"p\">]</span>\n        <span class=\"n\">yd</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">o</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"k\">for</span> <span class=\"n\">o</span> <span class=\"ow\">in</span> <span class=\"n\">out</span><span class=\"p\">]</span>\n        <span class=\"n\">ydd</span> <span class=\"o\">=</span> <span class=\"p\">[</span><span class=\"n\">o</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"k\">for</span> <span class=\"n\">o</span> <span class=\"ow\">in</span> <span class=\"n\">out</span><span class=\"p\">]</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">hstack</span><span class=\"p\">(</span><span class=\"n\">y</span><span class=\"p\">),</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">hstack</span><span class=\"p\">(</span><span class=\"n\">yd</span><span class=\"p\">),</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">hstack</span><span class=\"p\">(</span><span class=\"n\">ydd</span><span class=\"p\">)]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"JTraj\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.JTraj\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">JTraj</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`JTRAJ`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs    |  states |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | 0          | 3          | 0       |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    |            | ndarray(n) |         |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qd&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qdd&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"JTraj.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.JTraj.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"n\">qf</span><span class=\"p\">,</span> <span class=\"n\">qd0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">qdf</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Compute a joint-space trajectory</span>\n\n<span class=\"sd\">        :param q0: initial joint coordinate</span>\n<span class=\"sd\">        :type q0: array_like(n)</span>\n<span class=\"sd\">        :param qf: final joint coordinate</span>\n<span class=\"sd\">        :type qf: array_like(n)</span>\n<span class=\"sd\">        :param T: time vector or number of steps, defaults to None</span>\n<span class=\"sd\">        :type T: array_like or int, optional</span>\n<span class=\"sd\">        :param qd0: initial velocity, defaults to None</span>\n<span class=\"sd\">        :type qd0: array_like(n), optional</span>\n<span class=\"sd\">        :param qdf: final velocity, defaults to None</span>\n<span class=\"sd\">        :type qdf: array_like(n), optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: TRAJ block</span>\n<span class=\"sd\">        :rtype: Traj instance</span>\n\n<span class=\"sd\">        - ``tg = jtraj(q0, qf, N)`` is a joint space trajectory where the joint</span>\n<span class=\"sd\">        coordinates vary from ``q0`` (M) to ``qf`` (M).  A quintic (5th order)</span>\n<span class=\"sd\">        polynomial is used with default zero boundary conditions for velocity and</span>\n<span class=\"sd\">        acceleration.  Time is assumed to vary from 0 to 1 in ``N`` steps.</span>\n\n<span class=\"sd\">        - ``tg = jtraj(q0, qf, t)`` as above but ``t`` is a uniformly-spaced time</span>\n<span class=\"sd\">        vector</span>\n\n<span class=\"sd\">        The return value is an object that contains position, velocity and</span>\n<span class=\"sd\">        acceleration data.</span>\n\n<span class=\"sd\">        Notes:</span>\n\n<span class=\"sd\">        - The time vector, if given, scales the velocity and acceleration outputs</span>\n<span class=\"sd\">        assuming that the time vector starts at zero and increases</span>\n<span class=\"sd\">        linearly.</span>\n\n<span class=\"sd\">        :seealso: :func:`ctraj`, :func:`qplot`, :func:`~SerialLink.jtraj`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;source&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">(</span>\n            <span class=\"p\">(</span>\n                <span class=\"s2\">&quot;q&quot;</span><span class=\"p\">,</span>\n                <span class=\"s2\">&quot;qd&quot;</span><span class=\"p\">,</span>\n                <span class=\"s2\">&quot;qdd&quot;</span><span class=\"p\">,</span>\n            <span class=\"p\">)</span>\n        <span class=\"p\">)</span>\n\n        <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">q0</span><span class=\"p\">)</span>\n        <span class=\"n\">qf</span> <span class=\"o\">=</span> <span class=\"n\">base</span><span class=\"o\">.</span><span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">qf</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">q0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">qf</span><span class=\"p\">):</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s2\">&quot;q0 and q1 must be same size&quot;</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">qd0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">qd0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">(</span><span class=\"n\">q0</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">qd0</span> <span class=\"o\">=</span> <span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">qd0</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">qd0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">q0</span><span class=\"p\">):</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s2\">&quot;qd0 has wrong size&quot;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"n\">qdf</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">qdf</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">(</span><span class=\"n\">q0</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">qd1</span> <span class=\"o\">=</span> <span class=\"n\">getvector</span><span class=\"p\">(</span><span class=\"n\">qdf</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"ow\">not</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">qd1</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">q0</span><span class=\"p\">):</span>\n                <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s2\">&quot;qd1 has wrong size&quot;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">q0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qf</span> <span class=\"o\">=</span> <span class=\"n\">qf</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qd0</span> <span class=\"o\">=</span> <span class=\"n\">qd0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qdf</span> <span class=\"o\">=</span> <span class=\"n\">qf</span>\n\n        <span class=\"c1\"># call start now, so that output works when called by compile</span>\n        <span class=\"c1\"># set T to 1 just for now</span>\n        <span class=\"k\">if</span> <span class=\"n\">T</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">()</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">T</span></div>\n        \n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"c1\"># use simulation tmax</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">T</span>\n\n        <span class=\"n\">tscal</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">tscal</span> <span class=\"o\">=</span> <span class=\"n\">tscal</span>\n\n        <span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span>\n        <span class=\"n\">qf</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qf</span>\n        <span class=\"n\">qd0</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qd0</span>\n        <span class=\"n\">qdf</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qdf</span>\n\n        <span class=\"c1\"># compute the polynomial coefficients</span>\n        <span class=\"n\">A</span> <span class=\"o\">=</span> <span class=\"mi\">6</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">qf</span> <span class=\"o\">-</span> <span class=\"n\">q0</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"mi\">3</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">qdf</span> <span class=\"o\">+</span> <span class=\"n\">qd0</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">tscal</span>\n        <span class=\"n\">B</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"mi\">15</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">qf</span> <span class=\"o\">-</span> <span class=\"n\">q0</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"p\">(</span><span class=\"mi\">8</span> <span class=\"o\">*</span> <span class=\"n\">qd0</span> <span class=\"o\">+</span> <span class=\"mi\">7</span> <span class=\"o\">*</span> <span class=\"n\">qdf</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">tscal</span>\n        <span class=\"n\">C</span> <span class=\"o\">=</span> <span class=\"mi\">10</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">qf</span> <span class=\"o\">-</span> <span class=\"n\">q0</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"p\">(</span><span class=\"mi\">6</span> <span class=\"o\">*</span> <span class=\"n\">qd0</span> <span class=\"o\">+</span> <span class=\"mi\">4</span> <span class=\"o\">*</span> <span class=\"n\">qdf</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">tscal</span>\n        <span class=\"n\">E</span> <span class=\"o\">=</span> <span class=\"n\">qd0</span> <span class=\"o\">*</span> <span class=\"n\">tscal</span>\n        <span class=\"n\">F</span> <span class=\"o\">=</span> <span class=\"n\">q0</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">coeffs</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span><span class=\"n\">A</span><span class=\"p\">,</span> <span class=\"n\">B</span><span class=\"p\">,</span> <span class=\"n\">C</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">(</span><span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">),</span> <span class=\"n\">E</span><span class=\"p\">,</span> <span class=\"n\">F</span><span class=\"p\">])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">dcoeffs</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span>\n            <span class=\"p\">[</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">(</span><span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">),</span> <span class=\"mi\">5</span> <span class=\"o\">*</span> <span class=\"n\">A</span><span class=\"p\">,</span> <span class=\"mi\">4</span> <span class=\"o\">*</span> <span class=\"n\">B</span><span class=\"p\">,</span> <span class=\"mi\">3</span> <span class=\"o\">*</span> <span class=\"n\">C</span><span class=\"p\">,</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">(</span><span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">),</span> <span class=\"n\">E</span><span class=\"p\">]</span>\n        <span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ddcoeffs</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">(</span>\n            <span class=\"p\">[</span>\n                <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">(</span><span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">),</span>\n                <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">(</span><span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">),</span>\n                <span class=\"mi\">20</span> <span class=\"o\">*</span> <span class=\"n\">A</span><span class=\"p\">,</span>\n                <span class=\"mi\">12</span> <span class=\"o\">*</span> <span class=\"n\">B</span><span class=\"p\">,</span>\n                <span class=\"mi\">6</span> <span class=\"o\">*</span> <span class=\"n\">C</span><span class=\"p\">,</span>\n                <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">(</span><span class=\"n\">A</span><span class=\"o\">.</span><span class=\"n\">shape</span><span class=\"p\">),</span>\n            <span class=\"p\">]</span>\n        <span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n\n        <span class=\"n\">tscal</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">tscal</span>\n        <span class=\"n\">ts</span> <span class=\"o\">=</span> <span class=\"n\">t</span> <span class=\"o\">/</span> <span class=\"n\">tscal</span>\n        <span class=\"n\">tt</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span><span class=\"n\">ts</span> <span class=\"o\">**</span> <span class=\"mi\">5</span><span class=\"p\">,</span> <span class=\"n\">ts</span> <span class=\"o\">**</span> <span class=\"mi\">4</span><span class=\"p\">,</span> <span class=\"n\">ts</span> <span class=\"o\">**</span> <span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"n\">ts</span> <span class=\"o\">**</span> <span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">ts</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">])</span><span class=\"o\">.</span><span class=\"n\">T</span>\n\n        <span class=\"n\">qt</span> <span class=\"o\">=</span> <span class=\"n\">tt</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">coeffs</span>\n\n        <span class=\"c1\"># compute  velocity</span>\n        <span class=\"n\">qdt</span> <span class=\"o\">=</span> <span class=\"n\">tt</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">dcoeffs</span> <span class=\"o\">/</span> <span class=\"n\">tscal</span>\n\n        <span class=\"c1\"># compute  acceleration</span>\n        <span class=\"n\">qddt</span> <span class=\"o\">=</span> <span class=\"n\">tt</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ddcoeffs</span> <span class=\"o\">/</span> <span class=\"n\">tscal</span> <span class=\"o\">**</span> <span class=\"mi\">2</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">qt</span><span class=\"p\">,</span> <span class=\"n\">qdt</span><span class=\"p\">,</span> <span class=\"n\">qddt</span><span class=\"p\">]</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"LSPB\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.LSPB\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">LSPB</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`LSPB`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs    |  states |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | 0          | 3          | 0       |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    |            | float      |         |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">3</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qd&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;qdd&#39;</span><span class=\"p\">)</span>\n\n<div class=\"viewcode-block\" id=\"LSPB.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.LSPB.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"n\">qf</span><span class=\"p\">,</span> <span class=\"n\">V</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">T</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Compute a joint-space trajectory</span>\n\n<span class=\"sd\">        :param q0: initial joint coordinate</span>\n<span class=\"sd\">        :type q0: array_like(n)</span>\n<span class=\"sd\">        :param qf: final joint coordinate</span>\n<span class=\"sd\">        :type qf: array_like(n)</span>\n<span class=\"sd\">        :param T: time vector or number of steps, defaults to None</span>\n<span class=\"sd\">        :type T: array_like or int, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: LSPB block</span>\n<span class=\"sd\">        :rtype: LSPB instance</span>\n\n<span class=\"sd\">        - ``tg = jtraj(q0, qf, N)`` is a joint space trajectory where the joint</span>\n<span class=\"sd\">        coordinates vary from ``q0`` (M) to ``qf`` (M).  A quintic (5th order)</span>\n<span class=\"sd\">        polynomial is used with default zero boundary conditions for velocity and</span>\n<span class=\"sd\">        acceleration.  Time is assumed to vary from 0 to 1 in ``N`` steps.</span>\n\n<span class=\"sd\">        - ``tg = jtraj(q0, qf, t)`` as above but ``t`` is a uniformly-spaced time</span>\n<span class=\"sd\">        vector</span>\n\n<span class=\"sd\">        The return value is an object that contains position, velocity and</span>\n<span class=\"sd\">        acceleration data.</span>\n\n<span class=\"sd\">        Notes:</span>\n\n<span class=\"sd\">        - The time vector, if given, scales the velocity and acceleration outputs</span>\n<span class=\"sd\">        assuming that the time vector starts at zero and increases</span>\n<span class=\"sd\">        linearly.</span>\n\n<span class=\"sd\">        :seealso: :func:`ctraj`, :func:`qplot`, :func:`~SerialLink.jtraj`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s2\">&quot;source&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">T</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span> <span class=\"o\">=</span> <span class=\"n\">q0</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qf</span> <span class=\"o\">=</span> <span class=\"n\">qf</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">T</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">lspbfunc</span> <span class=\"o\">=</span> <span class=\"n\">lspb_func</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qf</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">lspbfunc</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"CTraj\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.CTraj\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">CTraj</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`CTRAJ`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 0          | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    |            | float   |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;T&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"CTraj.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.CTraj.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span>\n        <span class=\"bp\">self</span><span class=\"p\">,</span>\n        <span class=\"n\">T1</span><span class=\"p\">,</span>\n        <span class=\"n\">T2</span><span class=\"p\">,</span>\n        <span class=\"n\">T</span><span class=\"p\">,</span>\n        <span class=\"n\">lspb</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span>\n        <span class=\"o\">**</span><span class=\"n\">blockargs</span>\n    <span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        [summary]</span>\n\n<span class=\"sd\">        :param T1: initial pose</span>\n<span class=\"sd\">        :type T1: SE3</span>\n<span class=\"sd\">        :param T2: final pose</span>\n<span class=\"sd\">        :type T2: SE3</span>\n<span class=\"sd\">        :param T: motion time</span>\n<span class=\"sd\">        :type T: float</span>\n<span class=\"sd\">        :param lspb: Use LSPB motion profile along the path</span>\n<span class=\"sd\">        :type lspb: bool</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: CTRAJ block</span>\n<span class=\"sd\">        :rtype: CTraj instance</span>\n\n<span class=\"sd\">        Create a Cartesian motion block.</span>\n\n<span class=\"sd\">        The block outputs a pose that varies smoothly from ``T1`` to ``T2`` over</span>\n<span class=\"sd\">        the course of ``T`` seconds.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        If ``T`` is not given it defaults to the simulation time.</span>\n\n<span class=\"sd\">        If ``lspb`` is True then an LSPB motion profile is used along the path</span>\n<span class=\"sd\">        to provide initial acceleration and final deceleration.  Otherwise,</span>\n<span class=\"sd\">        motion is at constant velocity.</span>\n\n<span class=\"sd\">        :seealso: :method:`SE3.interp`</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"c1\"># TODO</span>\n        <span class=\"c1\"># flag to rotate the frame rather than just translate it</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T1</span> <span class=\"o\">=</span> <span class=\"n\">T1</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T2</span> <span class=\"o\">=</span> <span class=\"n\">T2</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">T</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">T</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">lspb</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">lspbfunc</span> <span class=\"o\">=</span> <span class=\"n\">lspb_func</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">q0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">qf</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">)</span>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"n\">lspb</span><span class=\"p\">:</span>\n            <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">lspbfunc</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">)</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">s</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">min</span><span class=\"p\">(</span><span class=\"n\">t</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"mf\">1.0</span><span class=\"p\">)</span>\n\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T1</span><span class=\"o\">.</span><span class=\"n\">interp</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">T2</span><span class=\"p\">,</span> <span class=\"n\">s</span><span class=\"p\">)</span></div>\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"CirclePath\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.CirclePath\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">CirclePath</span><span class=\"p\">(</span><span class=\"n\">SourceBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`CIRCLEPATH`</span>\n\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 0 or 1     | 1       | 0       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float      | float   |         |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n<div class=\"viewcode-block\" id=\"CirclePath.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.arm.CirclePath.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span>\n        <span class=\"bp\">self</span><span class=\"p\">,</span>\n        <span class=\"n\">radius</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span>\n        <span class=\"n\">centre</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">),</span>\n        <span class=\"n\">pose</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span>\n        <span class=\"n\">frequency</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span>\n        <span class=\"n\">unit</span><span class=\"o\">=</span><span class=\"s2\">&quot;rps&quot;</span><span class=\"p\">,</span>\n        <span class=\"n\">phase</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span>\n        <span class=\"o\">**</span><span class=\"n\">blockargs</span>\n    <span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n\n<span class=\"sd\">        :param radius: radius of circle, defaults to 1</span>\n<span class=\"sd\">        :type radius: float</span>\n<span class=\"sd\">        :param centre: center of circle, defaults to [0,0,0]</span>\n<span class=\"sd\">        :type centre: array_like(3)</span>\n<span class=\"sd\">        :param pose: SE3 pose of output, defaults to None</span>\n<span class=\"sd\">        :type pose: SE3</span>\n<span class=\"sd\">        :param frequency: rotational frequency, defaults to 1</span>\n<span class=\"sd\">        :type frequency: float</span>\n<span class=\"sd\">        :param unit: unit for frequency, one of: &#39;rps&#39; [default], &#39;rad&#39;</span>\n<span class=\"sd\">        :type unit: str</span>\n<span class=\"sd\">        :param phase: phase</span>\n<span class=\"sd\">        :type phase: float</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: TRAJ block</span>\n<span class=\"sd\">        :rtype: Traj instance</span>\n\n<span class=\"sd\">        Create a circular motion block.</span>\n\n<span class=\"sd\">        The block outputs the coordinates of a point moving in a circle of</span>\n<span class=\"sd\">        radius ``r`` centred at ``centre`` and parallel to the xy-plane.</span>\n\n<span class=\"sd\">        By default the output is a 3-vector :math:`(x, y, z)` but if </span>\n<span class=\"sd\">        ``pose`` is an ``SE3`` instance the output is a copy of that pose with</span>\n<span class=\"sd\">        its translation set to the coordinate of the moving point.  This is the</span>\n<span class=\"sd\">        motion of a frame with fixed orientation following a circular path.</span>\n\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n\n        <span class=\"c1\"># TODO</span>\n        <span class=\"c1\"># flag to rotate the frame rather than just translate it</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">unit</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;rps&quot;</span><span class=\"p\">:</span>\n            <span class=\"n\">omega</span> <span class=\"o\">=</span> <span class=\"n\">frequency</span> <span class=\"o\">*</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">pi</span>\n            <span class=\"n\">phase</span> <span class=\"o\">=</span> <span class=\"n\">frequency</span> <span class=\"o\">*</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">pi</span>\n        <span class=\"k\">elif</span> <span class=\"n\">unit</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;rad&quot;</span><span class=\"p\">:</span>\n            <span class=\"n\">omega</span> <span class=\"o\">=</span> <span class=\"n\">frequency</span>\n\n            <span class=\"c1\"># Redundant assignment, commented for LGTM</span>\n            <span class=\"c1\"># phase = phase</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">ValueError</span><span class=\"p\">(</span><span class=\"s2\">&quot;bad units: rps or rad&quot;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">radius</span> <span class=\"o\">=</span> <span class=\"n\">radius</span>\n        <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">centre</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"s2\">&quot;centre must be a 3 vector&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">centre</span> <span class=\"o\">=</span> <span class=\"n\">centre</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pose</span> <span class=\"o\">=</span> <span class=\"n\">pose</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">omega</span> <span class=\"o\">=</span> <span class=\"n\">omega</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">phase</span> <span class=\"o\">=</span> <span class=\"n\">phase</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s2\">&quot;y&quot;</span><span class=\"p\">,))</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"n\">t</span> <span class=\"o\">*</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">omega</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">phase</span>\n        <span class=\"n\">x</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">radius</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">centre</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"n\">y</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">radius</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">centre</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n        <span class=\"n\">p</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">centre</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">])</span>\n\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pose</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">pp</span> <span class=\"o\">=</span> <span class=\"n\">SE3</span><span class=\"o\">.</span><span class=\"n\">Rt</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pose</span><span class=\"o\">.</span><span class=\"n\">R</span><span class=\"p\">,</span> <span class=\"n\">p</span><span class=\"p\">)</span>\n            <span class=\"n\">p</span> <span class=\"o\">=</span> <span class=\"n\">pp</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">p</span><span class=\"p\">]</span></div>\n\n<span class=\"k\">if</span> <span class=\"vm\">__name__</span> <span class=\"o\">==</span> <span class=\"s2\">&quot;__main__&quot;</span><span class=\"p\">:</span>\n\n    <span class=\"kn\">import</span> <span class=\"nn\">pathlib</span>\n    <span class=\"kn\">import</span> <span class=\"nn\">os.path</span>\n\n    <span class=\"n\">exec</span><span class=\"p\">(</span>\n        <span class=\"nb\">open</span><span class=\"p\">(</span>\n            <span class=\"n\">os</span><span class=\"o\">.</span><span class=\"n\">path</span><span class=\"o\">.</span><span class=\"n\">join</span><span class=\"p\">(</span><span class=\"n\">pathlib</span><span class=\"o\">.</span><span class=\"n\">Path</span><span class=\"p\">(</span><span class=\"vm\">__file__</span><span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">parent</span><span class=\"o\">.</span><span class=\"n\">absolute</span><span class=\"p\">(),</span> <span class=\"s2\">&quot;test_robots.py&quot;</span><span class=\"p\">)</span>\n        <span class=\"p\">)</span><span class=\"o\">.</span><span class=\"n\">read</span><span class=\"p\">()</span>\n    <span class=\"p\">)</span>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/roboticstoolbox/blocks/mobile.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>roboticstoolbox.blocks.mobile &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>roboticstoolbox.blocks.mobile</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for roboticstoolbox.blocks.mobile</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"kn\">from</span> <span class=\"nn\">typing</span> <span class=\"kn\">import</span> <span class=\"n\">Type</span>\n<span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">from</span> <span class=\"nn\">math</span> <span class=\"kn\">import</span> <span class=\"n\">sin</span><span class=\"p\">,</span> <span class=\"n\">cos</span><span class=\"p\">,</span> <span class=\"n\">atan2</span><span class=\"p\">,</span> <span class=\"n\">tan</span><span class=\"p\">,</span> <span class=\"n\">sqrt</span><span class=\"p\">,</span> <span class=\"n\">pi</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">from</span> <span class=\"nn\">matplotlib.patches</span> <span class=\"kn\">import</span> <span class=\"n\">Polygon</span>\n<span class=\"kn\">import</span> <span class=\"nn\">time</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">TransferBlock</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.graphics</span> <span class=\"kn\">import</span> <span class=\"n\">GraphicsBlock</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">spatialmath</span> <span class=\"kn\">import</span> <span class=\"n\">base</span>\n<span class=\"kn\">from</span> <span class=\"nn\">roboticstoolbox</span> <span class=\"kn\">import</span> <span class=\"n\">mobile</span>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Bicycle\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.mobile.Bicycle\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Bicycle</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`BICYCLE`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs    |  states |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | 2          | 1          | 3       |</span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    | float      | ndarray(3) |         | </span>\n<span class=\"sd\">    +------------+------------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;v&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;γ&#39;</span><span class=\"p\">)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"Bicycle.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.mobile.Bicycle.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">L</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">,</span> <span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">,</span> <span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"mf\">0.45</span> <span class=\"o\">*</span> <span class=\"n\">pi</span><span class=\"p\">,</span> \n        <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a vehicle model with Bicycle kinematics.</span>\n\n<span class=\"sd\">        :param L: Wheelbase, defaults to 1</span>\n<span class=\"sd\">        :type L: float, optional</span>\n<span class=\"sd\">        :param speed_max: Velocity limit, defaults to 1</span>\n<span class=\"sd\">        :type speed_max: float, optional</span>\n<span class=\"sd\">        :param accel_max: maximum acceleration, defaults to math.inf</span>\n<span class=\"sd\">        :type accel_max: float, optional</span>\n<span class=\"sd\">        :param steer_max: maximum steering angle, defaults to math.pi*0.45</span>\n<span class=\"sd\">        :type steer_max: float, optional</span>\n<span class=\"sd\">        :param x0: Inital state, defaults to None</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a BICYCLE block</span>\n<span class=\"sd\">        :rtype: Bicycle instance</span>\n\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Bicycle kinematic model with state :math:`[x, y, \\theta]`.  </span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        **Block ports**</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            :input v: Vehicle speed (metres/sec).  The velocity limit ``vlim`` is</span>\n<span class=\"sd\">                applied to the magnitude of this input.</span>\n<span class=\"sd\">            :input γ: Steering wheel angle (radians).  The steering limit ``slim``</span>\n<span class=\"sd\">                is applied to the magnitude of this input.</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            :output q: configuration (x, y, θ)</span>\n\n<span class=\"sd\">        :seealso: :class:`mobile.Bicycle` :class:`DiffSteer`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"c1\"># TODO: add option to model the effect of steering arms, responds to</span>\n        <span class=\"c1\">#  gamma dot</span>\n        \n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nstates</span><span class=\"o\">=</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vehicle</span> <span class=\"o\">=</span> <span class=\"n\">mobile</span><span class=\"o\">.</span><span class=\"n\">Bicycle</span><span class=\"p\">(</span><span class=\"n\">L</span><span class=\"o\">=</span><span class=\"n\">L</span><span class=\"p\">,</span>\n            <span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"n\">steer_max</span><span class=\"p\">,</span> <span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"n\">speed_max</span><span class=\"p\">,</span> <span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"n\">accel_max</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x0 is </span><span class=\"si\">{:d}</span><span class=\"s2\"> long, should be </span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">),</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n            \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inport_names</span><span class=\"p\">((</span><span class=\"s1\">&#39;v&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;$\\gamma$&#39;</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">outport_names</span><span class=\"p\">((</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">state_names</span><span class=\"p\">((</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;y&#39;</span><span class=\"p\">,</span> <span class=\"sa\">r</span><span class=\"s1\">&#39;$\\theta$&#39;</span><span class=\"p\">))</span></div>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">]</span>  <span class=\"c1\"># one output which is ndarray(3)</span>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vehicle</span><span class=\"o\">.</span><span class=\"n\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">)</span></div>\n    \n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"Unicycle\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.mobile.Unicycle\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">Unicycle</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`UNICYCLE`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 2          | 1       | 3       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float      | float   |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;v&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;ω&#39;</span><span class=\"p\">)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"Unicycle.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.mobile.Unicycle.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">,</span> <span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">,</span> <span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> \n        <span class=\"n\">a</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a vehicle model with Unicycle kinematics.</span>\n\n<span class=\"sd\">        :param w: vehicle width, defaults to 1</span>\n<span class=\"sd\">        :type w: float, optional</span>\n<span class=\"sd\">        :param speed_max: Velocity limit, defaults to 1</span>\n<span class=\"sd\">        :type speed_max: float, optional</span>\n<span class=\"sd\">        :param accel_max: maximum acceleration, defaults to math.inf</span>\n<span class=\"sd\">        :type accel_max: float, optional</span>\n<span class=\"sd\">        :param steer_max: maximum steering rate, defaults to 1</span>\n<span class=\"sd\">        :type steer_max: float, optional</span>\n<span class=\"sd\">        :param x0: Inital state, defaults to None</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict        :return: a UNICYCLE block</span>\n<span class=\"sd\">        :rtype: Unicycle instance</span>\n\n<span class=\"sd\">        Unicycle kinematic model with state :math:`[x, y, \\theta]`.</span>\n\n<span class=\"sd\">        **Block ports**</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            :input v: Vehicle speed (metres/sec).  The velocity limit ``vlim`` is</span>\n<span class=\"sd\">                applied to the magnitude of this input.</span>\n<span class=\"sd\">            :input ω: Angular velocity (radians/sec).  The steering limit ``slim``</span>\n<span class=\"sd\">                is applied to the magnitude of this input.</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            :output q: configuration (x, y, θ)</span>\n\n<span class=\"sd\">        :seealso: :class:`Bicycle` :class:`DiffSteer`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>        \n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nstates</span><span class=\"o\">=</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        \n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x0 is </span><span class=\"si\">{:d}</span><span class=\"s2\"> long, should be </span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">),</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vehicle</span> <span class=\"o\">=</span> <span class=\"n\">mobile</span><span class=\"o\">.</span><span class=\"n\">Unicycle</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"o\">=</span><span class=\"n\">w</span><span class=\"p\">,</span>\n            <span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"n\">steer_max</span><span class=\"p\">,</span> <span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"n\">speed_max</span><span class=\"p\">,</span> <span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"n\">accel_max</span><span class=\"p\">)</span></div>\n\n        <span class=\"c1\">#TODO, add support for origin shift</span>\n        <span class=\"c1\">#         If ``a`` is non-zero then the planar velocity of that point $x=a$</span>\n        <span class=\"c1\"># can be controlled by</span>\n\n        <span class=\"c1\"># .. math::</span>\n\n        <span class=\"c1\">#     \\begin{pmatrix} v \\\\ \\omega \\end{pmatrix} = </span>\n        <span class=\"c1\">#     \\begin{pmatrix}</span>\n        <span class=\"c1\">#         \\cos \\theta &amp; \\sin \\theta \\\\ </span>\n        <span class=\"c1\">#         -\\frac{1}{a}\\sin \\theta &amp; \\frac{1}{a}\\cos \\theta</span>\n        <span class=\"c1\">#     \\end{pmatrix}\\begin{pmatrix}</span>\n        <span class=\"c1\">#         \\dot{x} \\\\ \\dot{y}</span>\n        <span class=\"c1\">#     \\end{pmatrix}</span>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vehicle</span><span class=\"o\">.</span><span class=\"n\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">)</span></div>\n    \n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n<div class=\"viewcode-block\" id=\"DiffSteer\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.mobile.DiffSteer\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">DiffSteer</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`DIFFSTEER`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | inputs     | outputs |  states |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | 2          | 3       | 3       |</span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    | float      | float   |         | </span>\n<span class=\"sd\">    +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;ωL&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;ωR&#39;</span><span class=\"p\">)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"DiffSteer.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.mobile.DiffSteer.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">w</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">R</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">,</span> <span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">inf</span><span class=\"p\">,</span> <span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> \n        <span class=\"n\">a</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a differential steer vehicle model</span>\n\n<span class=\"sd\">        :param w: vehicle width, defaults to 1</span>\n<span class=\"sd\">        :type w: float, optional</span>\n<span class=\"sd\">        :param R: Wheel radius, defaults to 1</span>\n<span class=\"sd\">        :type R: float, optional</span>\n<span class=\"sd\">        :param speed_max: Velocity limit, defaults to 1</span>\n<span class=\"sd\">        :type speed_max: float, optional</span>\n<span class=\"sd\">        :param accel_max: maximum acceleration, defaults to math.inf</span>\n<span class=\"sd\">        :type accel_max: float, optional</span>\n<span class=\"sd\">        :param steer_max: maximum steering rate, defaults to 1</span>\n<span class=\"sd\">        :type steer_max: float, optional</span>\n<span class=\"sd\">        :param x0: Inital state, defaults to None</span>\n<span class=\"sd\">        :type x0: array_like, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict        :return: a DIFFSTEER block</span>\n<span class=\"sd\">        :rtype: DifSteer instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Unicycle kinematic model with state :math:`[x, y, \\theta]`, with</span>\n<span class=\"sd\">        with inputs given as wheel angular velocity.</span>\n\n<span class=\"sd\">        **Block ports**</span>\n\n<span class=\"sd\">            :input ωL: Left-wheel angular velocity (radians/sec).</span>\n<span class=\"sd\">            :input ωR: Right-wheel angular velocity (radians/sec).</span>\n<span class=\"sd\">              </span>\n<span class=\"sd\">            :output q: configuration (x, y, θ)</span>\n\n<span class=\"sd\">        .. note:: Wheel velocity is defined such that if both are positive the vehicle</span>\n<span class=\"sd\">              moves forward.</span>\n\n<span class=\"sd\">        :seealso: :class:`Bicycle` :class:`Unicycle`</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nstates</span><span class=\"o\">=</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;diffsteer&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">R</span> <span class=\"o\">=</span> <span class=\"n\">R</span>\n        \n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"n\">slef</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x0 is </span><span class=\"si\">{:d}</span><span class=\"s2\"> long, should be </span><span class=\"si\">{:d}</span><span class=\"s2\">&quot;</span><span class=\"o\">.</span><span class=\"n\">format</span><span class=\"p\">(</span><span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">),</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vehicle</span> <span class=\"o\">=</span> <span class=\"n\">mobile</span><span class=\"o\">.</span><span class=\"n\">Unicycle</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"o\">=</span><span class=\"n\">w</span><span class=\"p\">,</span>\n            <span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"n\">steer_max</span><span class=\"p\">,</span> <span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"n\">speed_max</span><span class=\"p\">,</span> <span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"n\">accel_max</span><span class=\"p\">)</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n        <span class=\"c1\"># compute (v, omega) from left/right wheel speeds</span>\n        <span class=\"n\">v</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">R</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span> <span class=\"o\">/</span> <span class=\"mi\">2</span>\n        <span class=\"n\">omega</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">W</span>\n        <span class=\"k\">return</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">vehicle</span><span class=\"o\">.</span><span class=\"n\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">,</span> <span class=\"p\">(</span><span class=\"n\">v</span><span class=\"p\">,</span> <span class=\"n\">omega</span><span class=\"p\">))</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"VehiclePlot\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.mobile.VehiclePlot\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">VehiclePlot</span><span class=\"p\">(</span><span class=\"n\">GraphicsBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`VEHICLEPLOT`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | inputs | outputs |  states |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | 1      | 0       | 0       |</span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    | ndarray|         |         | </span>\n<span class=\"sd\">    +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;q&#39;</span><span class=\"p\">,)</span>\n\n    <span class=\"c1\"># TODO add ability to render an image instead of an outline</span>\n    \n<div class=\"viewcode-block\" id=\"VehiclePlot.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.mobile.VehiclePlot.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">animation</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">path</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">labels</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;X&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;Y&#39;</span><span class=\"p\">],</span> <span class=\"n\">square</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">init</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"n\">scale</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a vehicle animation</span>\n\n<span class=\"sd\">        :param animation: Graphical animation of vehicle, defaults to None</span>\n<span class=\"sd\">        :type animation: VehicleAnimation subclass, optional</span>\n<span class=\"sd\">        :param path: linestyle to plot path taken by vehicle, defaults to None</span>\n<span class=\"sd\">        :type path: str or dict, optional</span>\n<span class=\"sd\">        :param labels: axis labels (xlabel, ylabel), defaults to [&quot;X&quot;,&quot;Y&quot;]</span>\n<span class=\"sd\">        :type labels: array_like(2) or list</span>\n<span class=\"sd\">        :param square: Set aspect ratio to 1, defaults to True</span>\n<span class=\"sd\">        :type square: bool, optional</span>\n<span class=\"sd\">        :param init: initialize graphics, defaults to None</span>\n<span class=\"sd\">        :type init: callable, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict        :return: A VEHICLEPLOT block</span>\n<span class=\"sd\">        :rtype: VehiclePlot instance</span>\n\n<span class=\"sd\">        Create a vehicle animation similar to the figure below.</span>\n\n<span class=\"sd\">        **Block ports**</span>\n\n<span class=\"sd\">            :input q: configuration (x, y, θ)</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        Notes:</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">            - The ``init`` function is called after the axes are initialized</span>\n<span class=\"sd\">              and can be used to draw application specific detail on the</span>\n<span class=\"sd\">              plot. In the example below, this is the dot and star.</span>\n<span class=\"sd\">            - A dynamic trail, showing path to date can be animated if</span>\n<span class=\"sd\">              the option ``path`` is set to a linestyle.</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        .. figure:: ../../figs/rvc4_4.gif</span>\n<span class=\"sd\">           :width: 500px</span>\n<span class=\"sd\">           :alt: example of generated graphic</span>\n\n<span class=\"sd\">           Example of vehicle display (animated).  The label at the top is the</span>\n<span class=\"sd\">           block name.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">xdata</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ydata</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;vehicleplot&#39;</span>\n        <span class=\"k\">if</span> <span class=\"n\">init</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"n\">callable</span><span class=\"p\">(</span><span class=\"n\">init</span><span class=\"p\">),</span> <span class=\"s1\">&#39;graphics init function must be callable&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">init</span> <span class=\"o\">=</span> <span class=\"n\">init</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">square</span> <span class=\"o\">=</span> <span class=\"n\">square</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pathstyle</span> <span class=\"o\">=</span> <span class=\"n\">path</span>\n        \n        <span class=\"k\">if</span> <span class=\"n\">scale</span> <span class=\"o\">!=</span> <span class=\"s1\">&#39;auto&#39;</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">scale</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"mi\">2</span><span class=\"p\">:</span>\n                <span class=\"n\">scale</span> <span class=\"o\">=</span> <span class=\"n\">scale</span> <span class=\"o\">*</span> <span class=\"mi\">2</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span> <span class=\"o\">=</span> <span class=\"n\">scale</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">labels</span> <span class=\"o\">=</span> <span class=\"n\">labels</span>\n        \n        <span class=\"k\">if</span> <span class=\"n\">animation</span> <span class=\"ow\">is</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"n\">animation</span> <span class=\"o\">=</span> <span class=\"n\">mobile</span><span class=\"o\">.</span><span class=\"n\">VehiclePolygon</span><span class=\"p\">()</span>\n        <span class=\"k\">elif</span> <span class=\"ow\">not</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"n\">animation</span><span class=\"p\">,</span> <span class=\"n\">mobile</span><span class=\"o\">.</span><span class=\"n\">VehicleAnimationBase</span><span class=\"p\">):</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">TypeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;animation object must be VehicleAnimationBase subclass&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">animation</span> <span class=\"o\">=</span> <span class=\"n\">animation</span></div>\n\n        \n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        <span class=\"c1\"># create the plot</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">reset</span><span class=\"p\">()</span>\n        <span class=\"k\">try</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;graphics start&#39;</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">create_figure</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"p\">)</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;fig created&#39;</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span><span class=\"o\">.</span><span class=\"n\">gca</span><span class=\"p\">()</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;axes&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">except</span><span class=\"p\">:</span>\n            <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;aaargh&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">square</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_aspect</span><span class=\"p\">(</span><span class=\"s1\">&#39;equal&#39;</span><span class=\"p\">)</span>\n        <span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"s1\">&#39;done&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">grid</span><span class=\"p\">(</span><span class=\"kc\">True</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_xlabel</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">labels</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_ylabel</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">labels</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_title</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">name</span><span class=\"p\">)</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span> <span class=\"o\">!=</span> <span class=\"s1\">&#39;auto&#39;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_xlim</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">:</span><span class=\"mi\">2</span><span class=\"p\">])</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_ylim</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">:</span><span class=\"mi\">4</span><span class=\"p\">])</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">init</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">init</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"p\">)</span>\n\n        <span class=\"k\">if</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pathstyle</span><span class=\"p\">,</span> <span class=\"nb\">str</span><span class=\"p\">):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">line</span><span class=\"p\">,</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pathstyle</span><span class=\"p\">)</span>\n        <span class=\"k\">elif</span> <span class=\"nb\">isinstance</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pathstyle</span><span class=\"p\">,</span> <span class=\"nb\">dict</span><span class=\"p\">):</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">line</span><span class=\"p\">,</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pathstyle</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">animation</span><span class=\"o\">.</span><span class=\"n\">add</span><span class=\"p\">()</span>\n            \n        <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">draw</span><span class=\"p\">()</span>\n        <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">show</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\n\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">start</span><span class=\"p\">()</span>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">step</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"c1\"># inputs are set</span>\n        <span class=\"n\">xyt</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n\n        <span class=\"c1\"># update the path line</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">xdata</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">xyt</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ydata</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">xyt</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n        <span class=\"c1\">#plt.figure(self.fig.number)</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">pathstyle</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">line</span><span class=\"o\">.</span><span class=\"n\">set_data</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">xdata</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ydata</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># update the vehicle pose</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">animation</span><span class=\"o\">.</span><span class=\"n\">update</span><span class=\"p\">(</span><span class=\"n\">xyt</span><span class=\"p\">)</span>\n    \n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span> <span class=\"o\">==</span> <span class=\"s1\">&#39;auto&#39;</span><span class=\"p\">:</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">relim</span><span class=\"p\">()</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">autoscale_view</span><span class=\"p\">()</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">)</span>\n        \n    <span class=\"k\">def</span> <span class=\"nf\">done</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">options</span><span class=\"o\">.</span><span class=\"n\">graphics</span><span class=\"p\">:</span>\n            <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">show</span><span class=\"p\">(</span><span class=\"n\">block</span><span class=\"o\">=</span><span class=\"n\">block</span><span class=\"p\">)</span>\n            \n            <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">done</span><span class=\"p\">()</span></div>\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_modules/roboticstoolbox/blocks/uav.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>roboticstoolbox.blocks.uav &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"../../../_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"../../../_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"../../../_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"../../../_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"../../../\" src=\"../../../_static/documentation_options.js\"></script>\n        <script src=\"../../../_static/jquery.js\"></script>\n        <script src=\"../../../_static/underscore.js\"></script>\n        <script src=\"../../../_static/doctools.js\"></script>\n        <script src=\"../../../_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"../../../_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"../../../genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"../../../search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"../../../index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"../../../_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"../../../search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"../../../internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"../../../index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"../../../index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n          <li><a href=\"../../index.html\">Module code</a> &raquo;</li>\n      <li>roboticstoolbox.blocks.uav</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <h1>Source code for roboticstoolbox.blocks.uav</h1><div class=\"highlight\"><pre>\n<span></span><span class=\"kn\">import</span> <span class=\"nn\">numpy</span> <span class=\"k\">as</span> <span class=\"nn\">np</span>\n<span class=\"kn\">from</span> <span class=\"nn\">math</span> <span class=\"kn\">import</span> <span class=\"n\">sin</span><span class=\"p\">,</span> <span class=\"n\">cos</span><span class=\"p\">,</span> <span class=\"n\">atan2</span><span class=\"p\">,</span> <span class=\"n\">tan</span><span class=\"p\">,</span> <span class=\"n\">sqrt</span><span class=\"p\">,</span> <span class=\"n\">pi</span>\n\n<span class=\"kn\">import</span> <span class=\"nn\">matplotlib.pyplot</span> <span class=\"k\">as</span> <span class=\"nn\">plt</span>\n<span class=\"kn\">import</span> <span class=\"nn\">time</span>\n\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.components</span> <span class=\"kn\">import</span> <span class=\"n\">TransferBlock</span><span class=\"p\">,</span> <span class=\"n\">FunctionBlock</span>\n<span class=\"kn\">from</span> <span class=\"nn\">bdsim.graphics</span> <span class=\"kn\">import</span> <span class=\"n\">GraphicsBlock</span>\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"MultiRotor\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotor\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">MultiRotor</span><span class=\"p\">(</span><span class=\"n\">TransferBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`MULTIROTOR`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | inputs     | outputs |  states |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | 1          | 1       | 16      |</span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">       | A(4,)      | dict    |         | </span>\n<span class=\"sd\">       +------------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n\n\n\t<span class=\"c1\"># Flyer2dynamics lovingly coded by Paul Pounds, first coded 12/4/04</span>\n\t<span class=\"c1\"># A simulation of idealised X-4 Flyer II flight dynamics.</span>\n\t<span class=\"c1\"># version 2.0 2005 modified to be compatible with latest version of Matlab</span>\n\t<span class=\"c1\"># version 3.0 2006 fixed rotation matrix problem</span>\n\t<span class=\"c1\"># version 4.0 4/2/10, fixed rotor flapping rotation matrix bug, mirroring</span>\n\t<span class=\"c1\"># version 5.0 8/8/11, simplified and restructured</span>\n\t<span class=\"c1\"># version 6.0 25/10/13, fixed rotation matrix/inverse wronskian definitions, flapping cross-product bug</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># New in version 2:</span>\n\t<span class=\"c1\">#   - Generalised rotor thrust model</span>\n\t<span class=\"c1\">#   - Rotor flapping model</span>\n\t<span class=\"c1\">#   - Frame aerodynamic drag model</span>\n\t<span class=\"c1\">#   - Frame aerodynamic surfaces model</span>\n\t<span class=\"c1\">#   - Internal motor model</span>\n\t<span class=\"c1\">#   - Much coolage</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># Version 1.3</span>\n\t<span class=\"c1\">#   - Rigid body dynamic model</span>\n\t<span class=\"c1\">#   - Rotor gyroscopic model</span>\n\t<span class=\"c1\">#   - External motor model</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># ARGUMENTS</span>\n\t<span class=\"c1\">#   u       Reference inputs                1x4</span>\n\t<span class=\"c1\">#   tele    Enable telemetry (1 or 0)       1x1</span>\n\t<span class=\"c1\">#   crash   Enable crash detection (1 or 0) 1x1</span>\n\t<span class=\"c1\">#   init    Initial conditions              1x12</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># INPUTS</span>\n\t<span class=\"c1\">#   u = [N S E W]</span>\n\t<span class=\"c1\">#   NSEW motor commands                     1x4</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># CONTINUOUS STATES</span>\n\t<span class=\"c1\">#   z      Position                         3x1   (x,y,z)</span>\n\t<span class=\"c1\">#   v      Velocity                         3x1   (xd,yd,zd)</span>\n\t<span class=\"c1\">#   n      Attitude                         3x1   (Y,P,R)</span>\n\t<span class=\"c1\">#   o      Angular velocity                 3x1   (wx,wy,wz)</span>\n\t<span class=\"c1\">#   w      Rotor angular velocity           4x1</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># Notes: z-axis downward so altitude is -z(3)</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># CONTINUOUS STATE MATRIX MAPPING</span>\n\t<span class=\"c1\">#   x = [z1 z2 z3 n1 n2 n3 z1 z2 z3 o1 o2 o3 w1 w2 w3 w4]</span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># </span>\n\t<span class=\"c1\"># CONTINUOUS STATE EQUATIONS</span>\n\t<span class=\"c1\">#   z` = v</span>\n\t<span class=\"c1\">#   v` = g*e3 - (1/m)*T*R*e3</span>\n\t<span class=\"c1\">#   I*o` = -o X I*o + G + torq</span>\n\t<span class=\"c1\">#   R = f(n)</span>\n\t<span class=\"c1\">#   n` = inv(W)*o</span>\n\t<span class=\"c1\"># </span>\n<div class=\"viewcode-block\" id=\"MultiRotor.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotor.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">model</span><span class=\"p\">,</span> <span class=\"n\">groundcheck</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">speedcheck</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">,</span> <span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sa\">r</span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a a multi-rotor dynamic model block.</span>\n\n<span class=\"sd\">        :param model: Vehicle geometric and inertial parameters</span>\n<span class=\"sd\">        :type model: dict</span>\n<span class=\"sd\">        :param groundcheck: Prevent vehicle moving below ground, defaults to True</span>\n<span class=\"sd\">        :type groundcheck: bool</span>\n<span class=\"sd\">        :param speedcheck: Check for zero rotor speed, defaults to True</span>\n<span class=\"sd\">        :type speedcheck: bool</span>\n<span class=\"sd\">        :param x0: Initial state, defaults to None</span>\n<span class=\"sd\">        :type x0: float, optional</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a MULTIROTOR block</span>\n<span class=\"sd\">        :rtype: MultiRotor instance</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">        **Block ports**</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            :input ω: a vector of input rotor speeds in (radians/sec).  These are,</span>\n<span class=\"sd\">                looking down, clockwise from the front rotor which lies on the x-axis.</span>\n<span class=\"sd\">                </span>\n<span class=\"sd\">            :output x: a dictionary signal with the following items:</span>\n<span class=\"sd\">                </span>\n<span class=\"sd\">                - ``x`` pose in the world frame as :math:`[x, y, z, \\theta_Y, \\theta_P, \\theta_R]`</span>\n<span class=\"sd\">                - ``vb`` translational velocity in the world frame (metres/sec)</span>\n<span class=\"sd\">                - ``w`` angular rates in the world frame as yaw-pitch-roll rates (radians/second)</span>\n<span class=\"sd\">                - ``a1s`` longitudinal flapping angles (radians)</span>\n<span class=\"sd\">                - ``b1s`` lateral flapping angles (radians)</span>\n<span class=\"sd\">            </span>\n<span class=\"sd\">        Based on MATLAB code developed by Pauline Pounds 2004.</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;quadrotor&#39;</span>\n    \n        <span class=\"k\">try</span><span class=\"p\">:</span>\n            <span class=\"n\">nrotors</span> <span class=\"o\">=</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;nrotors&#39;</span><span class=\"p\">]</span>\n        <span class=\"k\">except</span> <span class=\"ne\">KeyError</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;vehicle model does not contain nrotors&#39;</span><span class=\"p\">)</span>\n        <span class=\"k\">assert</span> <span class=\"n\">nrotors</span> <span class=\"o\">%</span> <span class=\"mi\">2</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"s1\">&#39;Must have an even number of rotors&#39;</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span> <span class=\"o\">=</span> <span class=\"mi\">12</span>\n        <span class=\"k\">if</span> <span class=\"n\">x0</span> <span class=\"ow\">is</span> <span class=\"ow\">not</span> <span class=\"kc\">None</span><span class=\"p\">:</span>\n            <span class=\"k\">assert</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">x0</span><span class=\"p\">)</span> <span class=\"o\">==</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,</span> <span class=\"s2\">&quot;x0 is the wrong length&quot;</span>\n        <span class=\"k\">else</span><span class=\"p\">:</span>\n            <span class=\"n\">x0</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nstates</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x0</span> <span class=\"o\">=</span> <span class=\"n\">x0</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span> <span class=\"o\">=</span> <span class=\"n\">nrotors</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span> <span class=\"o\">=</span> <span class=\"n\">model</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">groundcheck</span> <span class=\"o\">=</span> <span class=\"n\">groundcheck</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">speedcheck</span> <span class=\"o\">=</span> <span class=\"n\">speedcheck</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">,))</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">):</span>\n            <span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"n\">i</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span> <span class=\"o\">*</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">pi</span>\n            <span class=\"c1\">#  Di      Rotor hub displacements (1x3)</span>\n            <span class=\"c1\"># first rotor is on the x-axis, clockwise order looking down from above</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;d&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;d&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;h&#39;</span><span class=\"p\">]]</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">theta</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">theta</span>\n            \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">a1s</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">b1s</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">,))</span></div>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"kc\">None</span><span class=\"p\">):</span>\n        \n        <span class=\"n\">model</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span>    \n        \n        <span class=\"c1\"># compute output vector as a function of state vector</span>\n        <span class=\"c1\">#   z      Position                         3x1   (x,y,z)</span>\n        <span class=\"c1\">#   v      Velocity                         3x1   (xd,yd,zd)</span>\n        <span class=\"c1\">#   n      Attitude                         3x1   (Y,P,R)</span>\n        <span class=\"c1\">#   o      Angular velocity                 3x1   (Yd,Pd,Rd)</span>\n        \n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">:</span><span class=\"mi\">6</span><span class=\"p\">]</span>   <span class=\"c1\"># RPY angles</span>\n        <span class=\"n\">phi</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>         <span class=\"c1\"># yaw</span>\n        <span class=\"n\">the</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>         <span class=\"c1\"># pitch</span>\n        <span class=\"n\">psi</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span>         <span class=\"c1\"># roll</span>\n        \n        <span class=\"c1\"># rotz(phi)*roty(the)*rotx(psi)</span>\n        <span class=\"c1\">#  BBF &gt; Inertial rotation matrix</span>\n        <span class=\"n\">R</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n                <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n                <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>           <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>                                  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n            <span class=\"p\">])</span>\n        \n        <span class=\"c1\">#inverted Wronskian</span>\n        <span class=\"n\">iW</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>        <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">),</span>             <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)],</span>             \n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>        <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)],</span>\n                    <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n                <span class=\"p\">])</span> <span class=\"o\">/</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span>\n        \n        <span class=\"c1\"># return velocity in the body frame</span>\n        <span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"p\">{}</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">:</span><span class=\"mi\">6</span><span class=\"p\">]</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;vb&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"n\">R</span><span class=\"p\">)</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">6</span><span class=\"p\">:</span><span class=\"mi\">9</span><span class=\"p\">]</span>   <span class=\"c1\"># translational velocity mapped to body frame</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;w&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">iW</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">9</span><span class=\"p\">:</span><span class=\"mi\">12</span><span class=\"p\">]</span>               <span class=\"c1\"># RPY rates mapped to body frame</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;a1s&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">a1s</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;b1s&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">b1s</span>\n        <span class=\"n\">out</span><span class=\"p\">[</span><span class=\"s1\">&#39;X&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span>\n    \n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">out</span><span class=\"p\">]</span>\n    \n    <span class=\"k\">def</span> <span class=\"nf\">deriv</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">):</span>\n    \n        <span class=\"n\">model</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span>\n        \n        <span class=\"c1\"># Body-fixed frame references</span>\n        <span class=\"c1\">#   ei      Body fixed frame references 3x1</span>\n        <span class=\"n\">e3</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">]</span>\n        \n        <span class=\"c1\"># process inputs</span>\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n        <span class=\"k\">if</span> <span class=\"nb\">len</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">)</span> <span class=\"o\">!=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">:</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;input vector wrong size&#39;</span><span class=\"p\">)</span>\n    \n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">speedcheck</span> <span class=\"ow\">and</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">any</span><span class=\"p\">(</span><span class=\"n\">w</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">):</span>\n            <span class=\"c1\"># might need to fix this, preculudes aerobatics :(</span>\n            <span class=\"c1\"># mu becomes NaN due to 0/0</span>\n            <span class=\"k\">raise</span> <span class=\"ne\">RuntimeError</span><span class=\"p\">(</span><span class=\"s1\">&#39;quadrotor_dynamics: not defined for zero rotor speed&#39;</span><span class=\"p\">);</span>\n        \n        <span class=\"c1\"># EXTRACT STATES FROM X</span>\n        <span class=\"n\">z</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">:</span><span class=\"mi\">3</span><span class=\"p\">]</span>   <span class=\"c1\"># position in {W}</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">:</span><span class=\"mi\">6</span><span class=\"p\">]</span>   <span class=\"c1\"># RPY angles {W}</span>\n        <span class=\"n\">v</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">6</span><span class=\"p\">:</span><span class=\"mi\">9</span><span class=\"p\">]</span>   <span class=\"c1\"># velocity in {W}</span>\n        <span class=\"n\">o</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">_x</span><span class=\"p\">[</span><span class=\"mi\">9</span><span class=\"p\">:</span><span class=\"mi\">12</span><span class=\"p\">]</span>  <span class=\"c1\"># angular velocity in {W}</span>\n        \n        <span class=\"c1\"># PREPROCESS ROTATION AND WRONSKIAN MATRICIES</span>\n        <span class=\"n\">phi</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>    <span class=\"c1\"># yaw</span>\n        <span class=\"n\">the</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>    <span class=\"c1\"># pitch</span>\n        <span class=\"n\">psi</span> <span class=\"o\">=</span> <span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span>    <span class=\"c1\"># roll</span>\n        \n        <span class=\"c1\"># rotz(phi)*roty(the)*rotx(psi)</span>\n        <span class=\"c1\"># BBF &gt; Inertial rotation matrix</span>\n        <span class=\"n\">R</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n            <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span><span class=\"o\">-</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span><span class=\"o\">+</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n            <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span><span class=\"o\">+</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span><span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n            <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>         <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>                            <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n            <span class=\"p\">])</span>\n        \n        <span class=\"c1\"># Manual Construction</span>\n        <span class=\"c1\">#     Q3 = [cos(phi) -sin(phi) 0;sin(phi) cos(phi) 0;0 0 1];   % RZ %Rotation mappings</span>\n        <span class=\"c1\">#     Q2 = [cos(the) 0 sin(the);0 1 0;-sin(the) 0 cos(the)];   % RY</span>\n        <span class=\"c1\">#     Q1 = [1 0 0;0 cos(psi) -sin(psi);0 sin(psi) cos(psi)];   % RX</span>\n        <span class=\"c1\">#     R = Q3*Q2*Q1    %Rotation matrix</span>\n        <span class=\"c1\">#</span>\n        <span class=\"c1\">#    RZ * RY * RX</span>\n        <span class=\"c1\"># inverted Wronskian</span>\n        <span class=\"n\">iW</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>        <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">),</span>          <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)],</span>            \n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>        <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)],</span>\n                    <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n                <span class=\"p\">])</span> <span class=\"o\">/</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span>\n    \n        <span class=\"c1\"># ROTOR MODEL</span>\n        <span class=\"n\">T</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"mi\">4</span><span class=\"p\">))</span>\n        <span class=\"n\">Q</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"mi\">4</span><span class=\"p\">))</span>\n        <span class=\"n\">tau</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"mi\">4</span><span class=\"p\">))</span>\n    \n        <span class=\"n\">a1s</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">a1s</span>\n        <span class=\"n\">b1s</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">b1s</span>\n    \n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">):</span>  <span class=\"c1\"># for each rotor</span>\n    \n            <span class=\"c1\"># Relative motion</span>\n            <span class=\"n\">Vr</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">cross</span><span class=\"p\">(</span><span class=\"n\">o</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">+</span> <span class=\"n\">v</span>\n            <span class=\"n\">mu</span> <span class=\"o\">=</span> <span class=\"n\">sqrt</span><span class=\"p\">(</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sum</span><span class=\"p\">(</span><span class=\"n\">Vr</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">:</span><span class=\"mi\">2</span><span class=\"p\">]</span><span class=\"o\">**</span><span class=\"mi\">2</span><span class=\"p\">))</span> <span class=\"o\">/</span> <span class=\"p\">(</span><span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">])</span>  <span class=\"c1\"># Magnitude of mu, planar components</span>\n            <span class=\"n\">lc</span> <span class=\"o\">=</span> <span class=\"n\">Vr</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"p\">(</span><span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">])</span>                     <span class=\"c1\"># Non-dimensionalised normal inflow</span>\n            <span class=\"n\">li</span> <span class=\"o\">=</span> <span class=\"n\">mu</span>                                                  <span class=\"c1\"># Non-dimensionalised induced velocity approximation</span>\n            <span class=\"n\">alphas</span> <span class=\"o\">=</span> <span class=\"n\">atan2</span><span class=\"p\">(</span><span class=\"n\">lc</span><span class=\"p\">,</span> <span class=\"n\">mu</span><span class=\"p\">)</span>\n            <span class=\"n\">j</span> <span class=\"o\">=</span> <span class=\"n\">atan2</span><span class=\"p\">(</span><span class=\"n\">Vr</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"n\">Vr</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>                                  <span class=\"c1\"># Sideslip azimuth relative to e1 (zero over nose)</span>\n            <span class=\"n\">J</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">j</span><span class=\"p\">),</span> <span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">j</span><span class=\"p\">)],</span>\n                    <span class=\"p\">[</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">j</span><span class=\"p\">),</span>  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">j</span><span class=\"p\">)]</span>\n                <span class=\"p\">])</span>                                                   <span class=\"c1\"># BBF &gt; mu sideslip rotation matrix</span>\n            \n            <span class=\"c1\"># Flapping</span>\n            <span class=\"n\">beta</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[((</span><span class=\"mi\">8</span><span class=\"o\">/</span><span class=\"mi\">3</span><span class=\"o\">*</span><span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;theta0&#39;</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;theta1&#39;</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">mu</span> <span class=\"o\">-</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">lc</span> <span class=\"o\">*</span> <span class=\"n\">mu</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"p\">(</span><span class=\"mi\">1</span> <span class=\"o\">-</span> <span class=\"n\">mu</span><span class=\"o\">**</span><span class=\"mi\">2</span> <span class=\"o\">/</span> <span class=\"mi\">2</span><span class=\"p\">)],</span> <span class=\"c1\"># Longitudinal flapping</span>\n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>                                                              <span class=\"c1\"># Lattitudinal flapping (note sign)</span>\n                <span class=\"p\">])</span>\n    \n                <span class=\"c1\"># sign(w) * (4/3)*((Ct/sigma)*(2*mu*gamma/3/a)/(1+3*e/2/r) + li)/(1+mu^2/2)]; </span>\n    \n            <span class=\"n\">beta</span> <span class=\"o\">=</span> <span class=\"n\">J</span><span class=\"o\">.</span><span class=\"n\">T</span> <span class=\"o\">@</span> <span class=\"n\">beta</span><span class=\"p\">;</span>                                    <span class=\"c1\"># Rotate the beta flapping angles to longitudinal and lateral coordinates.</span>\n            <span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">beta</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"mi\">16</span> <span class=\"o\">/</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;gamma&#39;</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">o</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n            <span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">beta</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"mi\">16</span> <span class=\"o\">/</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;gamma&#39;</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">o</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n            \n            <span class=\"c1\"># Forces and torques</span>\n    \n            <span class=\"c1\"># Rotor thrust, linearised angle approximations</span>\n    \n            <span class=\"n\">T</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;Ct&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;rho&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;A&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">]</span><span class=\"o\">**</span><span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span><span class=\"o\">**</span><span class=\"mi\">2</span> <span class=\"o\">*</span> \\\n                <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span> <span class=\"o\">-</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])]</span> \n    \n            <span class=\"c1\"># Rotor drag torque - note that this preserves w[i] direction sign</span>\n    \n            <span class=\"n\">Q</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;Cq&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;rho&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;A&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">]</span><span class=\"o\">**</span><span class=\"mi\">3</span> <span class=\"o\">*</span> <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"nb\">abs</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span><span class=\"o\">*</span> <span class=\"n\">e3</span>  \n    \n            <span class=\"n\">tau</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">cross</span><span class=\"p\">(</span><span class=\"n\">T</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">])</span>    <span class=\"c1\"># Torque due to rotor thrust</span>\n    \n        <span class=\"c1\"># RIGID BODY DYNAMIC MODEL</span>\n        <span class=\"n\">dz</span> <span class=\"o\">=</span> <span class=\"n\">v</span>\n        <span class=\"n\">dn</span> <span class=\"o\">=</span> <span class=\"n\">iW</span> <span class=\"o\">@</span> <span class=\"n\">o</span>\n        \n        <span class=\"n\">dv</span> <span class=\"o\">=</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;g&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">e3</span> <span class=\"o\">+</span> <span class=\"n\">R</span> <span class=\"o\">@</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sum</span><span class=\"p\">(</span><span class=\"n\">T</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;M&#39;</span><span class=\"p\">]</span>\n        \n        <span class=\"c1\"># vehicle can&#39;t fall below ground, remember z is down</span>\n        <span class=\"k\">if</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">groundcheck</span> <span class=\"ow\">and</span> <span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">&gt;</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n            <span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n            <span class=\"n\">dz</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    \n        <span class=\"n\">do</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.</span><span class=\"n\">inv</span><span class=\"p\">(</span><span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;J&#39;</span><span class=\"p\">])</span> <span class=\"o\">@</span> <span class=\"p\">(</span><span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">cross</span><span class=\"p\">(</span><span class=\"o\">-</span><span class=\"n\">o</span><span class=\"p\">,</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;J&#39;</span><span class=\"p\">]</span> <span class=\"o\">@</span> <span class=\"n\">o</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sum</span><span class=\"p\">(</span><span class=\"n\">tau</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sum</span><span class=\"p\">(</span><span class=\"n\">Q</span><span class=\"p\">,</span> <span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">))</span> <span class=\"c1\"># row sum of torques</span>\n    \n        <span class=\"c1\"># # stash the flapping information for plotting</span>\n        <span class=\"c1\"># self.a1s = a1s</span>\n        <span class=\"c1\"># self.b1s = b1s</span>\n        \n        <span class=\"k\">return</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">dz</span><span class=\"p\">,</span> <span class=\"n\">dn</span><span class=\"p\">,</span> <span class=\"n\">dv</span><span class=\"p\">,</span> <span class=\"n\">do</span><span class=\"p\">]</span>  <span class=\"c1\"># This is the state derivative vector</span></div>\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"MultiRotorMixer\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotorMixer\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">MultiRotorMixer</span><span class=\"p\">(</span><span class=\"n\">FunctionBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`MULTIROTORMIXER`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +--------+---------+---------+</span>\n<span class=\"sd\">       | inputs | outputs |  states |</span>\n<span class=\"sd\">       +--------+---------+---------+</span>\n<span class=\"sd\">       | 4      | 1       | 0       |</span>\n<span class=\"sd\">       +--------+---------+---------+</span>\n<span class=\"sd\">       | float  |         |         | </span>\n<span class=\"sd\">       +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n \n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">4</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;𝛕r&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;𝛕p&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;𝛕y&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;T&#39;</span><span class=\"p\">)</span>\n    <span class=\"n\">outlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;ω&#39;</span><span class=\"p\">,)</span>\n\n<div class=\"viewcode-block\" id=\"MultiRotorMixer.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotorMixer.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">maxw</span><span class=\"o\">=</span><span class=\"mi\">1000</span><span class=\"p\">,</span> <span class=\"n\">minw</span><span class=\"o\">=</span><span class=\"mi\">5</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a block that displays/animates a multi-rotor flying vehicle.</span>\n\n<span class=\"sd\">        :param maxw: maximum rotor speed in rad/s, defaults to 1000</span>\n<span class=\"sd\">        :type maxw: float</span>\n<span class=\"sd\">        :param minw: minimum rotor speed in rad/s, defaults to 5</span>\n<span class=\"sd\">        :type minw: float</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a MULTIROTORMIXER block</span>\n<span class=\"sd\">        :rtype: MultiRotorMixer instance</span>\n\n\n<span class=\"sd\">        **Block ports**</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            :input 𝛕r: roll torque</span>\n<span class=\"sd\">            :input 𝛕p: pitch torque</span>\n<span class=\"sd\">            :input 𝛕y: yaw torque</span>\n<span class=\"sd\">            :input T: total thrust</span>\n\n<span class=\"sd\">            :output ω: 1D array of rotor speeds</span>\n\n<span class=\"sd\">        Derived from Simulink model by Pauline Pounds 2004</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">inputs</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;multirotormixer&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">minw</span> <span class=\"o\">=</span> <span class=\"n\">minw</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">maxw</span> <span class=\"o\">=</span> <span class=\"n\">maxw</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">output</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">t</span><span class=\"p\">):</span>\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">,))</span>\n        <span class=\"n\">tau</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">:</span>\n            <span class=\"c1\"># roll and pitch coupling</span>\n            <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+=</span> <span class=\"o\">-</span><span class=\"n\">tau</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">theta</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">+</span> <span class=\"n\">tau</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">theta</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span>\n\n            <span class=\"c1\"># yaw coupling</span>\n            <span class=\"n\">sign</span> <span class=\"o\">=</span> <span class=\"mi\">1</span> <span class=\"k\">if</span> <span class=\"n\">i</span> <span class=\"o\">%</span> <span class=\"mi\">1</span> <span class=\"o\">==</span> <span class=\"mi\">0</span> <span class=\"k\">else</span> <span class=\"o\">-</span><span class=\"mi\">1</span>\n            <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+=</span> <span class=\"n\">sign</span> <span class=\"o\">*</span> <span class=\"n\">tau</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span>\n\n            <span class=\"c1\"># overall thrust</span>\n            <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+=</span> <span class=\"n\">tau</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span>\n\n        <span class=\"c1\"># clip the rotor speeds to the range [minw, maxw]</span>\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">clip</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">minw</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">maxw</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># convert to thrust</span>\n        <span class=\"n\">w</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">sqrt</span><span class=\"p\">(</span><span class=\"n\">w</span><span class=\"p\">)</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;b&#39;</span><span class=\"p\">]</span>\n\n        <span class=\"c1\"># negate alterate rotors to indicate counter-rotation</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">:</span>\n            <span class=\"k\">if</span> <span class=\"n\">i</span> <span class=\"o\">%</span> <span class=\"mi\">1</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"n\">w</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span>\n\n        <span class=\"k\">return</span> <span class=\"p\">[</span><span class=\"n\">w</span><span class=\"p\">]</span></div>\n\n\n<span class=\"c1\"># ------------------------------------------------------------------------ #</span>\n\n<div class=\"viewcode-block\" id=\"MultiRotorPlot\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotorPlot\">[docs]</a><span class=\"k\">class</span> <span class=\"nc\">MultiRotorPlot</span><span class=\"p\">(</span><span class=\"n\">GraphicsBlock</span><span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    :blockname:`MULTIROTORPLOT`</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">    .. table::</span>\n<span class=\"sd\">       :align: left</span>\n<span class=\"sd\">    </span>\n<span class=\"sd\">       +--------+---------+---------+</span>\n<span class=\"sd\">       | inputs | outputs |  states |</span>\n<span class=\"sd\">       +--------+---------+---------+</span>\n<span class=\"sd\">       | 1      | 0       | 0       |</span>\n<span class=\"sd\">       +--------+---------+---------+</span>\n<span class=\"sd\">       | dict   |         |         | </span>\n<span class=\"sd\">       +--------+---------+---------+</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n \n    <span class=\"n\">nin</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n    <span class=\"n\">nout</span> <span class=\"o\">=</span> <span class=\"mi\">0</span>\n    <span class=\"n\">inlabels</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">,)</span>\n\n    <span class=\"c1\"># Based on code lovingly coded by Paul Pounds, first coded 17/4/02</span>\n    <span class=\"c1\"># version 2 2004 added scaling and ground display</span>\n    <span class=\"c1\"># version 3 2010 improved rotor rendering and fixed mirroring bug</span>\n\n    <span class=\"c1\"># Displays X-4 flyer position and attitude in a 3D plot.</span>\n    <span class=\"c1\"># GREEN ROTOR POINTS NORTH</span>\n    <span class=\"c1\"># BLUE ROTOR POINTS EAST</span>\n\n    <span class=\"c1\"># PARAMETERS</span>\n    <span class=\"c1\"># s defines the plot size in meters</span>\n    <span class=\"c1\"># swi controls flyer attitude plot; 1 = on, otherwise off.</span>\n\n    <span class=\"c1\"># INPUTS</span>\n    <span class=\"c1\"># 1 Center X position</span>\n    <span class=\"c1\"># 2 Center Y position</span>\n    <span class=\"c1\"># 3 Center Z position</span>\n    <span class=\"c1\"># 4 Yaw angle in rad</span>\n    <span class=\"c1\"># 5 Pitch angle in rad</span>\n    <span class=\"c1\"># 6 Roll angle in rad</span>\n\n     \n<div class=\"viewcode-block\" id=\"MultiRotorPlot.__init__\"><a class=\"viewcode-back\" href=\"../../../bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotorPlot.__init__\">[docs]</a>    <span class=\"k\">def</span> <span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">model</span><span class=\"p\">,</span> <span class=\"n\">scale</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"o\">-</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"o\">-</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"mi\">10</span><span class=\"p\">],</span> <span class=\"n\">flapscale</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">projection</span><span class=\"o\">=</span><span class=\"s1\">&#39;ortho&#39;</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">):</span>\n        <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">        Create a block that displays/animates a multi-rotor flying vehicle.</span>\n\n<span class=\"sd\">        :param model: A dictionary of vehicle geometric and inertial properties</span>\n<span class=\"sd\">        :type model: dict</span>\n<span class=\"sd\">        :param scale: dimensions of workspace: xmin, xmax, ymin, ymax, zmin, zmax, defaults to [-2,2,-2,2,10]</span>\n<span class=\"sd\">        :type scale: array_like, optional</span>\n<span class=\"sd\">        :param flapscale: exagerate flapping angle by this factor, defaults to 1</span>\n<span class=\"sd\">        :type flapscale: float</span>\n<span class=\"sd\">        :param projection: 3D projection, one of: &#39;ortho&#39; [default], &#39;perspective&#39;</span>\n<span class=\"sd\">        :type projection: str</span>\n<span class=\"sd\">        :param blockargs: |BlockOptions|</span>\n<span class=\"sd\">        :type blockargs: dict</span>\n<span class=\"sd\">        :return: a MULTIROTORPLOT block</span>\n<span class=\"sd\">        :rtype: MultiRotorPlot instance</span>\n\n\n<span class=\"sd\">        **Block ports**</span>\n<span class=\"sd\">        </span>\n<span class=\"sd\">            :input y: a dictionary signal that includes the item:</span>\n<span class=\"sd\">                </span>\n<span class=\"sd\">                - ``x`` pose in the world frame as :math:`[x, y, z, \\theta_Y, \\theta_P, \\theta_R]`</span>\n<span class=\"sd\">                - ``X`` pose in the world frame as :math:`[x, y, z, \\theta_Y, \\theta_P, \\theta_R]`</span>\n<span class=\"sd\">                - ``a1s``</span>\n<span class=\"sd\">                - ``b1s``</span>\n\n<span class=\"sd\">        .. figure:: ../../figs/multirotorplot.png</span>\n<span class=\"sd\">           :width: 500px</span>\n<span class=\"sd\">           :alt: example of generated graphic</span>\n\n<span class=\"sd\">           Example of quad-rotor display.</span>\n\n<span class=\"sd\">        Written by Pauline Pounds 2004</span>\n<span class=\"sd\">        &quot;&quot;&quot;</span>\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"fm\">__init__</span><span class=\"p\">(</span><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">blockargs</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">type</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;quadrotorplot&#39;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span> <span class=\"o\">=</span> <span class=\"n\">model</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span> <span class=\"o\">=</span> <span class=\"n\">scale</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span> <span class=\"o\">=</span> <span class=\"n\">model</span><span class=\"p\">[</span><span class=\"s1\">&#39;nrotors&#39;</span><span class=\"p\">]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">projection</span> <span class=\"o\">=</span> <span class=\"n\">projection</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">flapscale</span> <span class=\"o\">=</span> <span class=\"n\">flapscale</span></div>\n\n    <span class=\"k\">def</span> <span class=\"nf\">start</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">):</span>\n        <span class=\"n\">quad</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span>\n        \n        <span class=\"c1\"># vehicle dimensons</span>\n        <span class=\"n\">d</span> <span class=\"o\">=</span> <span class=\"n\">quad</span><span class=\"p\">[</span><span class=\"s1\">&#39;d&#39;</span><span class=\"p\">];</span>  <span class=\"c1\"># Hub displacement from COG</span>\n        <span class=\"n\">r</span> <span class=\"o\">=</span> <span class=\"n\">quad</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">];</span>  <span class=\"c1\"># Rotor radius</span>\n\n        <span class=\"c1\">#C = np.zeros((3, self.nrotors))   ## WHERE USED?</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">))</span>\n\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">):</span>\n            <span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"n\">i</span> <span class=\"o\">/</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span> <span class=\"o\">*</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">pi</span>\n            <span class=\"c1\">#  Di      Rotor hub displacements (1x3)</span>\n            <span class=\"c1\"># first rotor is on the x-axis, clockwise order looking down from above</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span> <span class=\"n\">quad</span><span class=\"p\">[</span><span class=\"s1\">&#39;d&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">quad</span><span class=\"p\">[</span><span class=\"s1\">&#39;d&#39;</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">),</span> <span class=\"n\">quad</span><span class=\"p\">[</span><span class=\"s1\">&#39;h&#39;</span><span class=\"p\">]]</span>\n        \n        <span class=\"c1\">#draw ground</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span> <span class=\"o\">=</span> <span class=\"n\">plt</span><span class=\"o\">.</span><span class=\"n\">figure</span><span class=\"p\">()</span>\n        <span class=\"c1\"># no axes in the figure, create a 3D axes</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">fig</span><span class=\"o\">.</span><span class=\"n\">add_subplot</span><span class=\"p\">(</span><span class=\"mi\">111</span><span class=\"p\">,</span> <span class=\"n\">projection</span><span class=\"o\">=</span><span class=\"s1\">&#39;3d&#39;</span><span class=\"p\">,</span> <span class=\"n\">proj_type</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">projection</span><span class=\"p\">)</span>\n\n        <span class=\"c1\"># ax.set_aspect(&#39;equal&#39;)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_xlabel</span><span class=\"p\">(</span><span class=\"s1\">&#39;X&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_ylabel</span><span class=\"p\">(</span><span class=\"s1\">&#39;Y&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_zlabel</span><span class=\"p\">(</span><span class=\"s1\">&#39;-Z (height above ground)&#39;</span><span class=\"p\">)</span>\n\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">panel</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">text2D</span><span class=\"p\">(</span><span class=\"mf\">0.05</span><span class=\"p\">,</span> <span class=\"mf\">0.95</span><span class=\"p\">,</span> <span class=\"s1\">&#39;&#39;</span><span class=\"p\">,</span> <span class=\"n\">transform</span><span class=\"o\">=</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">transAxes</span><span class=\"p\">,</span> \n            <span class=\"n\">fontsize</span><span class=\"o\">=</span><span class=\"mi\">10</span><span class=\"p\">,</span> <span class=\"n\">family</span><span class=\"o\">=</span><span class=\"s1\">&#39;monospace&#39;</span><span class=\"p\">,</span> <span class=\"n\">verticalalignment</span><span class=\"o\">=</span><span class=\"s1\">&#39;top&#39;</span><span class=\"p\">,</span>\n            <span class=\"n\">bbox</span><span class=\"o\">=</span><span class=\"nb\">dict</span><span class=\"p\">(</span><span class=\"n\">boxstyle</span><span class=\"o\">=</span><span class=\"s1\">&#39;round&#39;</span><span class=\"p\">,</span> <span class=\"n\">facecolor</span><span class=\"o\">=</span><span class=\"s1\">&#39;white&#39;</span><span class=\"p\">,</span> <span class=\"n\">edgecolor</span><span class=\"o\">=</span><span class=\"s1\">&#39;black&#39;</span><span class=\"p\">))</span>\n\n        \n        <span class=\"c1\"># TODO allow user to set maximum height of plot volume</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_xlim</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_ylim</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">])</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">set_zlim</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">4</span><span class=\"p\">])</span>\n\n        <span class=\"c1\"># plot the ground boundaries and the big cross</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">([</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]],</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">]],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"s1\">&#39;b-&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">([</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]],</span> <span class=\"p\">[</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">],</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">scale</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"s1\">&#39;b-&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">grid</span><span class=\"p\">(</span><span class=\"kc\">True</span><span class=\"p\">)</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">shadow</span><span class=\"p\">,</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">([</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"s1\">&#39;k--&#39;</span><span class=\"p\">)</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">groundmark</span><span class=\"p\">,</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">([</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"s1\">&#39;kx&#39;</span><span class=\"p\">)</span>\n        \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">arm</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">disk</span> <span class=\"o\">=</span> <span class=\"p\">[]</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">):</span>\n            <span class=\"n\">h</span><span class=\"p\">,</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">([</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">arm</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">h</span><span class=\"p\">)</span>\n            <span class=\"k\">if</span> <span class=\"n\">i</span> <span class=\"o\">==</span> <span class=\"mi\">0</span><span class=\"p\">:</span>\n                <span class=\"n\">color</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;b-&#39;</span>\n            <span class=\"k\">else</span><span class=\"p\">:</span>\n                <span class=\"n\">color</span> <span class=\"o\">=</span> <span class=\"s1\">&#39;g-&#39;</span>\n            <span class=\"n\">h</span><span class=\"p\">,</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">ax</span><span class=\"o\">.</span><span class=\"n\">plot</span><span class=\"p\">([</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"n\">color</span><span class=\"p\">)</span>\n            <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">disk</span><span class=\"o\">.</span><span class=\"n\">append</span><span class=\"p\">(</span><span class=\"n\">h</span><span class=\"p\">)</span>\n            \n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">a1s</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">,))</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">b1s</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">,))</span>\n\n\n    <span class=\"k\">def</span> <span class=\"nf\">step</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">):</span>\n\n        <span class=\"k\">def</span> <span class=\"nf\">plot3</span><span class=\"p\">(</span><span class=\"n\">h</span><span class=\"p\">,</span> <span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">,</span> <span class=\"n\">z</span><span class=\"p\">):</span>\n            <span class=\"n\">h</span><span class=\"o\">.</span><span class=\"n\">set_data_3d</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">,</span> <span class=\"n\">z</span><span class=\"p\">)</span>\n            <span class=\"c1\"># h.set_data(x, y)</span>\n            <span class=\"c1\"># h.set_3d_properties(np.r_[z])</span>\n            \n        <span class=\"c1\"># READ STATE</span>\n        <span class=\"n\">z</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">][</span><span class=\"mi\">0</span><span class=\"p\">:</span><span class=\"mi\">3</span><span class=\"p\">]</span>\n        <span class=\"n\">n</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">][</span><span class=\"mi\">3</span><span class=\"p\">:</span><span class=\"mi\">6</span><span class=\"p\">]</span>\n        \n        <span class=\"c1\"># TODO, check input dimensions, 12 or 12+2N, deal with flapping</span>\n        \n        <span class=\"n\">a1s</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"s1\">&#39;a1s&#39;</span><span class=\"p\">]</span>\n        <span class=\"n\">b1s</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">inputs</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">][</span><span class=\"s1\">&#39;b1s&#39;</span><span class=\"p\">]</span>\n        \n        <span class=\"n\">quad</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">model</span>\n        \n        <span class=\"c1\"># vehicle dimensons</span>\n        <span class=\"n\">d</span> <span class=\"o\">=</span> <span class=\"n\">quad</span><span class=\"p\">[</span><span class=\"s1\">&#39;d&#39;</span><span class=\"p\">]</span>  <span class=\"c1\"># Hub displacement from COG</span>\n        <span class=\"n\">r</span> <span class=\"o\">=</span> <span class=\"n\">quad</span><span class=\"p\">[</span><span class=\"s1\">&#39;r&#39;</span><span class=\"p\">]</span>  <span class=\"c1\"># Rotor radius</span>\n        \n        <span class=\"c1\"># PREPROCESS ROTATION MATRIX</span>\n        <span class=\"n\">phi</span><span class=\"p\">,</span> <span class=\"n\">the</span><span class=\"p\">,</span> <span class=\"n\">psi</span> <span class=\"o\">=</span> <span class=\"n\">n</span>    <span class=\"c1\"># Euler angles</span>\n\n        <span class=\"c1\"># BBF &gt; Inertial rotation matrix</span>\n        <span class=\"n\">R</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>   \n                <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">+</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">),</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)</span> <span class=\"o\">-</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span>  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">phi</span><span class=\"p\">)],</span>\n                <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>           <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span><span class=\"o\">*</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">),</span>                                    <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">psi</span><span class=\"p\">)</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">the</span><span class=\"p\">)]</span>\n            <span class=\"p\">])</span>\n        \n        <span class=\"c1\"># Manual Construction</span>\n        <span class=\"c1\">#Q3 = [cos(psi) -sin(psi) 0;sin(psi) cos(psi) 0;0 0 1];   %Rotation mappings</span>\n        <span class=\"c1\">#Q2 = [cos(the) 0 sin(the);0 1 0;-sin(the) 0 cos(the)];</span>\n        <span class=\"c1\">#Q1 = [1 0 0;0 cos(phi) -sin(phi);0 sin(phi) cos(phi)];</span>\n        <span class=\"c1\">#R = Q3*Q2*Q1;    %Rotation matrix</span>\n        \n        <span class=\"c1\"># CALCULATE FLYER TIP POSITONS USING COORDINATE FRAME ROTATION</span>\n        <span class=\"n\">F</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                <span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">,</span>  <span class=\"mi\">0</span><span class=\"p\">,</span>  <span class=\"mi\">0</span><span class=\"p\">],</span>\n                <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">,</span>  <span class=\"mi\">0</span><span class=\"p\">],</span>\n                <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>  <span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n            <span class=\"p\">])</span>\n        \n        <span class=\"c1\"># Draw flyer rotors</span>\n        <span class=\"n\">theta</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">linspace</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">2</span> <span class=\"o\">*</span> <span class=\"n\">pi</span><span class=\"p\">,</span> <span class=\"mi\">20</span><span class=\"p\">)</span>\n        <span class=\"n\">circle</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"mi\">20</span><span class=\"p\">))</span>\n        <span class=\"k\">for</span> <span class=\"n\">j</span><span class=\"p\">,</span> <span class=\"n\">t</span> <span class=\"ow\">in</span> <span class=\"nb\">enumerate</span><span class=\"p\">(</span><span class=\"n\">theta</span><span class=\"p\">):</span>\n            <span class=\"n\">circle</span><span class=\"p\">[:,</span><span class=\"n\">j</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">r_</span><span class=\"p\">[</span><span class=\"n\">r</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">),</span> <span class=\"n\">r</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">t</span><span class=\"p\">),</span> <span class=\"mi\">0</span><span class=\"p\">]</span>\n        \n        <span class=\"n\">hub</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">))</span>\n        <span class=\"n\">tippath</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">zeros</span><span class=\"p\">((</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"mi\">20</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">))</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">):</span>\n            <span class=\"n\">hub</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">F</span> <span class=\"o\">@</span> <span class=\"p\">(</span><span class=\"n\">z</span> <span class=\"o\">+</span> <span class=\"n\">R</span> <span class=\"o\">@</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">D</span><span class=\"p\">[:,</span><span class=\"n\">i</span><span class=\"p\">])</span>  <span class=\"c1\"># points in the inertial frame</span>\n            \n            <span class=\"n\">q</span> <span class=\"o\">=</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">flapscale</span>   <span class=\"c1\"># Flapping angle scaling for output display - makes it easier to see what flapping is occurring</span>\n            <span class=\"c1\"># Rotor -&gt; Plot frame</span>\n            <span class=\"n\">Rr</span> <span class=\"o\">=</span> <span class=\"n\">np</span><span class=\"o\">.</span><span class=\"n\">array</span><span class=\"p\">([</span>\n                    <span class=\"p\">[</span><span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span>  <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span>  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])],</span>\n                    <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span>                <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span>                   <span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">q</span><span class=\"o\">*</span><span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])],</span>\n                    <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span> <span class=\"n\">sin</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]),</span>  <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">b1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])</span> <span class=\"o\">*</span> <span class=\"n\">cos</span><span class=\"p\">(</span><span class=\"n\">q</span> <span class=\"o\">*</span> <span class=\"n\">a1s</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">])]</span>\n                <span class=\"p\">])</span>\n            \n            <span class=\"n\">tippath</span><span class=\"p\">[:,:,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">F</span> <span class=\"o\">@</span> <span class=\"n\">R</span> <span class=\"o\">@</span> <span class=\"n\">Rr</span> <span class=\"o\">@</span> <span class=\"n\">circle</span>\n            <span class=\"n\">plot3</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">disk</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"n\">hub</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"n\">tippath</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,:,</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"n\">hub</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"n\">tippath</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">,:,</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"n\">hub</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">,</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"n\">tippath</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">,:,</span><span class=\"n\">i</span><span class=\"p\">])</span>\n\n        <span class=\"c1\"># Draw flyer</span>\n        <span class=\"n\">hub0</span> <span class=\"o\">=</span> <span class=\"n\">F</span> <span class=\"o\">@</span> <span class=\"n\">z</span>  <span class=\"c1\"># centre of vehicle</span>\n        <span class=\"k\">for</span> <span class=\"n\">i</span> <span class=\"ow\">in</span> <span class=\"nb\">range</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">nrotors</span><span class=\"p\">):</span>\n            <span class=\"c1\"># line from hub to centre plot3([hub(1,N) hub(1,S)],[hub(2,N) hub(2,S)],[hub(3,N) hub(3,S)],&#39;-b&#39;)</span>\n            <span class=\"n\">plot3</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">arm</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"n\">hub</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"n\">hub0</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]],</span> <span class=\"p\">[</span><span class=\"n\">hub</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"n\">hub0</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]],</span> <span class=\"p\">[</span><span class=\"n\">hub</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">,</span><span class=\"n\">i</span><span class=\"p\">],</span> <span class=\"n\">hub0</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]])</span>\n            \n            <span class=\"c1\"># plot a circle at the hub itself</span>\n            <span class=\"c1\">#plot3([hub(1,i)],[hub(2,i)],[hub(3,i)],&#39;o&#39;)</span>\n\n        <span class=\"c1\"># plot the vehicle&#39;s centroid on the ground plane</span>\n        <span class=\"n\">plot3</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">shadow</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"mi\">0</span><span class=\"p\">])</span>\n        <span class=\"n\">plot3</span><span class=\"p\">(</span><span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">groundmark</span><span class=\"p\">,</span> <span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"o\">-</span><span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"mi\">0</span><span class=\"p\">)</span>\n\n        <span class=\"n\">textstr</span> <span class=\"o\">=</span> <span class=\"sa\">f</span><span class=\"s2\">&quot;t=</span><span class=\"si\">{</span><span class=\"n\">state</span><span class=\"o\">.</span><span class=\"n\">t</span><span class=\"si\">:</span><span class=\"s2\"> .2f</span><span class=\"si\">}</span><span class=\"se\">\\n</span><span class=\"s2\">h=</span><span class=\"si\">{</span><span class=\"n\">z</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span><span class=\"si\">:</span><span class=\"s2\"> .2f</span><span class=\"si\">}</span><span class=\"se\">\\n</span><span class=\"s2\">γ=</span><span class=\"si\">{</span><span class=\"n\">n</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span><span class=\"si\">:</span><span class=\"s2\"> .2f</span><span class=\"si\">}</span><span class=\"s2\">&quot;</span>\n        <span class=\"bp\">self</span><span class=\"o\">.</span><span class=\"n\">panel</span><span class=\"o\">.</span><span class=\"n\">set_text</span><span class=\"p\">(</span><span class=\"n\">textstr</span><span class=\"p\">)</span>\n\n        <span class=\"nb\">super</span><span class=\"p\">()</span><span class=\"o\">.</span><span class=\"n\">step</span><span class=\"p\">(</span><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"n\">state</span><span class=\"p\">)</span></div>\n\n\n</pre></div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/_sources/bdsim.blocks.rst.txt",
    "content": ".. _Block library:\n\n*************\nBlock library\n*************\n\n.. include:: <isonum.txt>\n\nThe block diagrams comprise blocks which belong to one of a number of different categories. These come from\nthe package ``bdsim.blocks``, ``roboticstoolbox.blocks``, ``machinevisiontoolbox.blocks``.\n\nIcons, if shown to the left of the black header bar, are as used with `bdedit <https://github.com/petercorke/bdsim/tree/master/bdsim/bdedit>`_.\n\n.. inheritance-diagram:: bdsim.components.SourceBlock bdsim.components.SinkBlock bdsim.graphics.GraphicsBlock bdsim.components.FunctionBlock bdsim.components.TransferBlock bdsim.components.SubsystemBlock\n\n\nSource blocks\n=============\n\n.. automodule:: bdsim.blocks.sources\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\nSink blocks\n===========\n\n.. automodule:: bdsim.blocks.sinks\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\n\nFunction blocks\n===============\n\n.. automodule:: bdsim.blocks.functions\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\nTransfer blocks\n===============\n\n.. automodule:: bdsim.blocks.transfers\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\nDiscrete-time blocks\n====================\n\n.. automodule:: bdsim.blocks.discrete\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n   \nLinear algebra blocks\n=====================\n\n.. automodule:: bdsim.blocks.linalg\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n  \nConnection blocks\n=================\n\n.. automodule:: bdsim.blocks.connections\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\n\nExternal Toolbox blocksets\n==========================\n\nThese blocks are defined within external Toolboxes or packages.\n\n\nRobot blocks\n------------\n\nThese blocks are defined within the Robotics Toolbox for Python.\n\nArm robots\n^^^^^^^^^^\n\n.. automodule:: roboticstoolbox.blocks.arm\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\nMobile robots\n^^^^^^^^^^^^^\n\n.. automodule:: roboticstoolbox.blocks.mobile\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\nMulti rotor flying robots\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. automodule:: roboticstoolbox.blocks.uav\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n   :exclude-members: output, reset, step, start, done, deriv, nin, nout, inlabels, outlabels\n\nVision blocks\n-------------\n\nThese blocks are defined within the Machine Vision Toolbox for Python.\n\n.. automodule:: machinevisiontoolbox.blocks\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :exclude-members: output, reset, step, start, done, nin, nout, inlabels, outlabels\n\n"
  },
  {
    "path": "docs-aside/_sources/bdsim.rst.txt",
    "content": "Overview\n========\n\n\nGetting started\n---------------\n\nWe first sketch the dynamic system we want to simulate as a block diagram, for example this simple first-order system\n\n.. image:: ../../figs/bd1-sketch.png\n   :width: 800\n\nwhich we can express concisely with `bdsim` as (see `bdsim/examples/eg1.py <https://github.com/petercorke/bdsim/blob/master/examples/eg1.py>`_)\n\n.. code-block:: python\n   :linenos:\n\n   import bdsim\n\n   sim = bdsim.BDSim()  # create simulator\n   bd = sim.blockdiagram()  # create an empty block diagram\n\n   # define the blocks\n   demand = bd.STEP(T=1, name='demand')\n   sum = bd.SUM('+-')\n   gain = bd.GAIN(10)\n   plant = bd.LTI_SISO(0.5, [2, 1], name='plant')\n   scope = bd.SCOPE(styles=['k', 'r--'], movie='eg1.mp4')\n\n   # connect the blocks\n   bd.connect(demand, sum[0], scope[1])\n   bd.connect(plant, sum[1])\n   bd.connect(sum, gain)\n   bd.connect(gain, plant)\n   bd.connect(plant, scope[0])\n\n   bd.compile()   # check the diagram\n   bd.report()    # list all blocks and wires\n\n   out = sim.run(bd, 5)  # simulate for 5s\n\n   print(out)\n\n   # sim.savefig(scope, 'scope0') # save scope figure as scope0.pdf\n   sim.done(bd, block=True)  # keep figures open on screen\n\nwhich is just 16 lines of executable code.\n\nThe red block annotations on the hand-drawn diagram are used as the names of the variables holding references to the block instance. The blocks can also have user-assigned names, see lines 8 and 11, which are used in diagnostics and as labels in plots.\n\nAfter the blocks are created their input and output ports need to be connected. In `bdsim` all wires are point to point, a *one-to-many* connection is implemented by *many* wires,\nfor example::\n\n   bd.connect(source, dest1, dest2, ...)\n\ncreates individual wires from `source` -> `dest1`, `source` -> `dest2` and so on.\nPorts are designated using Python indexing notation, for example `block[2]` is port 2 (the third port) of `block`.  Whether it is an input or output port depends on context.\nIn the example above an index on the first argument refers to an output port, while on the second (or subsequent) arguments it refers to an input port.  If a block has only a single input or output port then no index is required, 0 is assumed.\n\nA group of ports can be denoted using slice notation, for example::\n\n   bd.connect(source[2:5], dest[3:6)\n\nwill connect ``source[2]`` -> ``dest[3]``, ``source[3]`` -> ``dest[4]``, ``source[4]`` -> ``dest[5]``.\nThe number of wires in each slice must be consistent.  You could even do a cross over by connecting ``source[2:5]`` to ``dest[6:3:-1]``.\n\nLine 20 assembles all the blocks and wires, instantiates subsystems, checks connectivity to create a flat wire list, and then builds the dataflow execution plan.\n\nLine 21 generates a report, in tabular form, showing a summary of the block diagram:\n\n.. code-block::\n\n   Blocks::\n\n   ┌───┬─────────┬─────┬──────┬────────┬─────────┬───────┐\n   │id │    name │ nin │ nout │ nstate │ ndstate │ type  │\n   ├───┼─────────┼─────┼──────┼────────┼─────────┼───────┤\n   │ 0 │  demand │   0 │    1 │      0 │       0 │ step  │\n   │ 1 │   sum.0 │   2 │    1 │      0 │       0 │ sum   │\n   │ 2 │  gain.0 │   1 │    1 │      0 │       0 │ gain  │\n   │ 3 │   plant │   1 │    1 │      1 │       0 │ LTI   │\n   │ 4 │ scope.0 │   2 │    0 │      0 │       0 │ scope │\n   └───┴─────────┴─────┴──────┴────────┴─────────┴───────┘\n\n   Wires::\n\n   ┌───┬──────┬──────┬──────────────────────────┬─────────┐\n   │id │ from │  to  │       description        │  type   │\n   ├───┼──────┼──────┼──────────────────────────┼─────────┤\n   │ 0 │ 0[0] │ 1[0] │ demand[0] --> sum.0[0]   │ int     │\n   │ 1 │ 0[0] │ 4[1] │ demand[0] --> scope.0[1] │ int     │\n   │ 2 │ 3[0] │ 1[1] │ plant[0] --> sum.0[1]    │ float64 │\n   │ 3 │ 1[0] │ 2[0] │ sum.0[0] --> gain.0[0]   │ float64 │\n   │ 4 │ 2[0] │ 3[0] │ gain.0[0] --> plant[0]   │ float64 │\n   │ 5 │ 3[0] │ 4[0] │ plant[0] --> scope.0[0]  │ float64 │\n   └───┴──────┴──────┴──────────────────────────┴─────────┘\n\n\n.. image:: ../../figs/Figure_1.png\n   :width: 600\n\nThe simulation results are returned in a simple container object::\n\n   >>> out\n   results:\n   t           | ndarray (67,)\n   x           | ndarray (67, 1)\n   xnames      | list              \n\nwhere\n\n- `t` the time vector: ndarray, shape=(M,)\n- `x` is the state vector: ndarray, shape=(M,N), one row per timestep\n- `xnames` is a list of the names of the states corresponding to columns of `x`, eg. \"plant.x0\"\n\nTo record additional simulation variables we \"watch\" them. This can be specified by\nwiring the signal to a WATCH block, or more conveniently by an additional option to\n``run``::\n\n   out = sim.run(bd, 5, watch=[plant,demand])  # simulate for 5s\n\nand now the result ``out`` has additional elements::\n\n   >>> out\n   results:\n   t           | ndarray (67,)\n   x           | ndarray (67, 1)\n   xnames      | list        \n   y0          | ndarray (67,)\n   y1          | ndarray (67,)\n   ynames      | list   \n\nwhere\n\n- `y0` is the time history of the first watched signal\n- `y1` is the time history of the second watched signal\n- `ynames` is a list of the names of the states corresponding to columns of `x`, eg. \"plant[0]\"\n\nLine 27 saves the content of the scope to be saved in the file called `scope0.pdf`.\n\nLine 28 blocks the script until all figure windows are closed, or the script is killed with SIGINT.\n\nLine 29 saves the scope graphics as a PDF file.\n\nLine 30 blocks until the last figure is dismissed.\n\nA list of available blocks can be obtained by::\n\n   >>> sim.blocks()\n      73  blocks loaded\n      bdsim.blocks.functions..................: Sum Prod Gain Clip Function Interpolate \n      bdsim.blocks.sources....................: Constant Time WaveForm Piecewise Step Ramp \n      bdsim.blocks.sinks......................: Print Stop Null Watch \n      bdsim.blocks.transfers..................: Integrator PoseIntegrator LTI_SS LTI_SISO \n      bdsim.blocks.discrete...................: ZOH DIntegrator DPoseIntegrator \n      bdsim.blocks.linalg.....................: Inverse Transpose Norm Flatten Slice2 Slice1 Det Cond \n      bdsim.blocks.displays...................: Scope ScopeXY ScopeXY1 \n      bdsim.blocks.connections................: Item Dict Mux DeMux Index SubSystem InPort OutPort \n      roboticstoolbox.blocks.arm..............: FKine IKine Jacobian Tr2Delta Delta2Tr Point2Tr TR2T FDyn IDyn Gravload \n      ........................................: Inertia Inertia_X FDyn_X ArmPlot Traj JTraj LSPB CTraj CirclePath \n      roboticstoolbox.blocks.mobile...........: Bicycle Unicycle DiffSteer VehiclePlot \n      roboticstoolbox.blocks.uav..............: MultiRotor MultiRotorMixer MultiRotorPlot \n      machinevisiontoolbox.blocks.camera......: Camera Visjac_p EstPose_p ImagePlane \n\nMore details can be found at:\n\n- `Wiki page <https://github.com/petercorke/bdsim/wiki>`_\n   - `Adding blocks <https://github.com/petercorke/bdsim/wiki/Adding-blocks>`_\n   - `Connecting blocks <https://github.com/petercorke/bdsim/wiki/Connecting-blocks>`_\n   - `Running the simulation <https://github.com/petercorke/bdsim/wiki/Running>`_\n- :ref:`Block library`\n\nUsing operator overloading\n--------------------------\n\nWiring, and some simple arithmetic blocks like GAIN, SUM and PROD can be implicitly generated by overloaded Python operators.  This strikes a nice balance between block diagram coding and Pythonic programming.\n\n.. code-block:: python\n   :linenos:\n\n   import bdsim\n\n   sim = bdsim.BDSim()  # create simulator\n   bd = sim.blockdiagram()  # create an empty block diagram\n\n   # define the blocks\n   demand = bd.STEP(T=1, name='demand')\n   plant = bd.LTI_SISO(0.5, [2, 1], name='plant')\n   scope = bd.SCOPE(styles=['k', 'r--'], movie='eg1.mp4')\n\n   # connect the blocks\n   scope[0] = plant\n   scope[1] = demand\n   plant[0] = 10 * (demand - plant)\n\n   bd.compile()   # check the diagram\n   bd.report()    # list all blocks and wires\n\n   out = sim.run(bd, 5)  # simulate for 5s\n   # out = sim.run(bd, 5 watch=[plant,demand])  # simulate for 5s\n   print(out)\n\n   # sim.savefig(scope, 'scope0') # save scope figure as scope0.pdf\n   sim.done(bd, block=True)  # keep figures open on screen\n\nThis requires fewer lines of code and the code is more readable. \nImportantly, it results in in *exactly the same* block diagram in terms of blocks and wires::\n\n\n   ┌───┬──────┬──────┬──────────────────────────────┬─────────┐\n   │id │ from │  to  │         description          │  type   │\n   ├───┼──────┼──────┼──────────────────────────────┼─────────┤\n   │ 0 │ 1[0] │ 2[0] │ plant[0] --> scope.0[0]      │ float64 │\n   │ 1 │ 0[0] │ 2[1] │ demand[0] --> scope.0[1]     │ int     │\n   │ 2 │ 0[0] │ 3[0] │ demand[0] --> _sum.0[0]      │ int     │\n   │ 3 │ 1[0] │ 3[1] │ plant[0] --> _sum.0[1]       │ float64 │\n   │ 4 │ 3[0] │ 4[0] │ _sum.0[0] --> _gain.0(10)[0] │ float64 │\n   │ 5 │ 4[0] │ 1[0] │ _gain.0(10)[0] --> plant[0]  │ float64 │\n   └───┴──────┴──────┴──────────────────────────────┴─────────┘\n\nThe implicitly created blocks have names prefixed with an underscore."
  },
  {
    "path": "docs-aside/_sources/index.rst.txt",
    "content": ".. Spatial Maths package documentation master file, created by\n   sphinx-quickstart on Sun Apr 12 15:50:23 2020.\n   You can adapt this file completely to your liking, but it should at least\n   contain the root `toctree` directive.\n\nBlock diagrams for Python\n=========================\n\n.. raw:: html\n\n   <table>\n   <tr>\n   <td>\n   <img width=350 src=\"https://github.com/petercorke/bdsim/raw/master/figs/bd1-sketch.png\">\n   </td>\n   <td style=\"padding-left: 20px;\">\n   <pre style=\"font-size:10px;\">\n   # define the blocks\n   demand = bd.STEP(T=1, name='demand')\n   sum = bd.SUM('+-')\n   gain = bd.GAIN(10)\n   plant = bd.LTI_SISO(0.5, [2, 1])\n   scope = bd.SCOPE(styles=['k', 'r--'])\n\n   # connect the blocks\n   bd.connect(demand, sum[0], scope[1])\n   bd.connect(plant, sum[1])\n   bd.connect(sum, gain)\n   bd.connect(gain, plant)\n   bd.connect(plant, scope[0])\n   </pre>\n   </td>\n   </tr>\n   </table>\n\nThis Python package enables modelling and simulation of dynamic systems\nconceptualized in block diagram form, but represented in terms of Python class\nand method calls.\n\nUnlike Simulink® or LabView®, we write Python code rather than drawing boxes and\nwires.  Wires can communicate any Python type such as scalars, strings, lists,\ndictionaries, numpy arrays, other objects, and even functions.\n\n    \n.. toctree::\n   :maxdepth: 2\n   :caption: Code documentation:\n\n   bdsim\n   bdsim.blocks\n   internals\n\n"
  },
  {
    "path": "docs-aside/_sources/internals.rst.txt",
    "content": "Supporting classes\n******************\n\n\n.. inheritance-diagram:: bdsim.components\n\n\nBDSim class\n===========\n\nThis class describes the run-time environment for executing a block diagram.\n\n.. autoclass:: bdsim.BDSim\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n.. autoclass:: bdsim.Struct\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n.. autoclass:: bdsim.BDSimState\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\nBlockDiagram class\n==================\n\nThis class describes a block diagram, a collection of blocks and wires that\ncan be \"executed\".\n\n.. autoclass:: bdsim.blockdiagram\n   :members:\n   :undoc-members:\n   :show-inheritance:\n\nComponents\n==========\n\n\nWire\n----\n\n.. autoclass:: bdsim.Wire\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :exclude-members: __dict__, __weakref__, __array_ufunc__, __module__\n\nPlug\n----\n\n.. autoclass:: bdsim.Plug\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members:\n   :exclude-members: __dict__, __weakref__, __array_ufunc__, __module__\n\nBlocks\n------\n\n.. autoclass:: bdsim.Block\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n   :exclude-members: __dict__, __weakref__, __array_ufunc__, __module__\n\nSource block\n^^^^^^^^^^^^\n\n.. autoclass:: bdsim.SourceBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nSink block\n^^^^^^^^^^\n\n.. autoclass:: bdsim.SinkBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nFunction block\n^^^^^^^^^^^^^^\n\n.. autoclass:: bdsim.FunctionBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nTransfer function block\n^^^^^^^^^^^^^^^^^^^^^^^\n\n.. autoclass:: bdsim.TransferBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nSubsystem block\n^^^^^^^^^^^^^^^\n\n.. autoclass:: bdsim.SubsystemBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\nGraphics block\n^^^^^^^^^^^^^^\n\n.. autoclass:: bdsim.GraphicsBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: \n\n\nDiscrete-time systems\n---------------------\n\n.. autoclass:: bdsim.ClockedBlock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n.. autoclass:: bdsim.Clock\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n.. autoclass:: bdsim.PriorityQ\n   :members:\n   :undoc-members:\n   :show-inheritance:\n   :special-members: __init__\n\n"
  },
  {
    "path": "docs-aside/_sources/modules.rst.txt",
    "content": "bdsim\n=====\n\n.. toctree::\n   :maxdepth: 4\n\n   bdsim\n"
  },
  {
    "path": "docs-aside/_static/alabaster.css",
    "content": "@import url(\"basic.css\");\n\n/* -- page layout ----------------------------------------------------------- */\n\nbody {\n    font-family: Georgia, serif;\n    font-size: 17px;\n    background-color: #fff;\n    color: #000;\n    margin: 0;\n    padding: 0;\n}\n\n\ndiv.document {\n    width: 940px;\n    margin: 30px auto 0 auto;\n}\n\ndiv.documentwrapper {\n    float: left;\n    width: 100%;\n}\n\ndiv.bodywrapper {\n    margin: 0 0 0 220px;\n}\n\ndiv.sphinxsidebar {\n    width: 220px;\n    font-size: 14px;\n    line-height: 1.5;\n}\n\nhr {\n    border: 1px solid #B1B4B6;\n}\n\ndiv.body {\n    background-color: #fff;\n    color: #3E4349;\n    padding: 0 30px 0 30px;\n}\n\ndiv.body > .section {\n    text-align: left;\n}\n\ndiv.footer {\n    width: 940px;\n    margin: 20px auto 30px auto;\n    font-size: 14px;\n    color: #888;\n    text-align: right;\n}\n\ndiv.footer a {\n    color: #888;\n}\n\np.caption {\n    font-family: inherit;\n    font-size: inherit;\n}\n\n\ndiv.relations {\n    display: none;\n}\n\n\ndiv.sphinxsidebar a {\n    color: #444;\n    text-decoration: none;\n    border-bottom: 1px dotted #999;\n}\n\ndiv.sphinxsidebar a:hover {\n    border-bottom: 1px solid #999;\n}\n\ndiv.sphinxsidebarwrapper {\n    padding: 18px 10px;\n}\n\ndiv.sphinxsidebarwrapper p.logo {\n    padding: 0;\n    margin: -10px 0 0 0px;\n    text-align: center;\n}\n\ndiv.sphinxsidebarwrapper h1.logo {\n    margin-top: -10px;\n    text-align: center;\n    margin-bottom: 5px;\n    text-align: left;\n}\n\ndiv.sphinxsidebarwrapper h1.logo-name {\n    margin-top: 0px;\n}\n\ndiv.sphinxsidebarwrapper p.blurb {\n    margin-top: 0;\n    font-style: normal;\n}\n\ndiv.sphinxsidebar h3,\ndiv.sphinxsidebar h4 {\n    font-family: Georgia, serif;\n    color: #444;\n    font-size: 24px;\n    font-weight: normal;\n    margin: 0 0 5px 0;\n    padding: 0;\n}\n\ndiv.sphinxsidebar h4 {\n    font-size: 20px;\n}\n\ndiv.sphinxsidebar h3 a {\n    color: #444;\n}\n\ndiv.sphinxsidebar p.logo a,\ndiv.sphinxsidebar h3 a,\ndiv.sphinxsidebar p.logo a:hover,\ndiv.sphinxsidebar h3 a:hover {\n    border: none;\n}\n\ndiv.sphinxsidebar p {\n    color: #555;\n    margin: 10px 0;\n}\n\ndiv.sphinxsidebar ul {\n    margin: 10px 0;\n    padding: 0;\n    color: #000;\n}\n\ndiv.sphinxsidebar ul li.toctree-l1 > a {\n    font-size: 120%;\n}\n\ndiv.sphinxsidebar ul li.toctree-l2 > a {\n    font-size: 110%;\n}\n\ndiv.sphinxsidebar input {\n    border: 1px solid #CCC;\n    font-family: Georgia, serif;\n    font-size: 1em;\n}\n\ndiv.sphinxsidebar hr {\n    border: none;\n    height: 1px;\n    color: #AAA;\n    background: #AAA;\n\n    text-align: left;\n    margin-left: 0;\n    width: 50%;\n}\n\ndiv.sphinxsidebar .badge {\n    border-bottom: none;\n}\n\ndiv.sphinxsidebar .badge:hover {\n    border-bottom: none;\n}\n\n/* To address an issue with donation coming after search */\ndiv.sphinxsidebar h3.donation {\n    margin-top: 10px;\n}\n\n/* -- body styles ----------------------------------------------------------- */\n\na {\n    color: #004B6B;\n    text-decoration: underline;\n}\n\na:hover {\n    color: #6D4100;\n    text-decoration: underline;\n}\n\ndiv.body h1,\ndiv.body h2,\ndiv.body h3,\ndiv.body h4,\ndiv.body h5,\ndiv.body h6 {\n    font-family: Georgia, serif;\n    font-weight: normal;\n    margin: 30px 0px 10px 0px;\n    padding: 0;\n}\n\ndiv.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; }\ndiv.body h2 { font-size: 180%; }\ndiv.body h3 { font-size: 150%; }\ndiv.body h4 { font-size: 130%; }\ndiv.body h5 { font-size: 100%; }\ndiv.body h6 { font-size: 100%; }\n\na.headerlink {\n    color: #DDD;\n    padding: 0 4px;\n    text-decoration: none;\n}\n\na.headerlink:hover {\n    color: #444;\n    background: #EAEAEA;\n}\n\ndiv.body p, div.body dd, div.body li {\n    line-height: 1.4em;\n}\n\ndiv.admonition {\n    margin: 20px 0px;\n    padding: 10px 30px;\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.admonition tt.xref, div.admonition code.xref, div.admonition a tt {\n    background-color: #FBFBFB;\n    border-bottom: 1px solid #fafafa;\n}\n\ndiv.admonition p.admonition-title {\n    font-family: Georgia, serif;\n    font-weight: normal;\n    font-size: 24px;\n    margin: 0 0 10px 0;\n    padding: 0;\n    line-height: 1;\n}\n\ndiv.admonition p.last {\n    margin-bottom: 0;\n}\n\ndiv.highlight {\n    background-color: #fff;\n}\n\ndt:target, .highlight {\n    background: #FAF3E8;\n}\n\ndiv.warning {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n}\n\ndiv.danger {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n    -moz-box-shadow: 2px 2px 4px #D52C2C;\n    -webkit-box-shadow: 2px 2px 4px #D52C2C;\n    box-shadow: 2px 2px 4px #D52C2C;\n}\n\ndiv.error {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n    -moz-box-shadow: 2px 2px 4px #D52C2C;\n    -webkit-box-shadow: 2px 2px 4px #D52C2C;\n    box-shadow: 2px 2px 4px #D52C2C;\n}\n\ndiv.caution {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n}\n\ndiv.attention {\n    background-color: #FCC;\n    border: 1px solid #FAA;\n}\n\ndiv.important {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.note {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.tip {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.hint {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.seealso {\n    background-color: #EEE;\n    border: 1px solid #CCC;\n}\n\ndiv.topic {\n    background-color: #EEE;\n}\n\np.admonition-title {\n    display: inline;\n}\n\np.admonition-title:after {\n    content: \":\";\n}\n\npre, tt, code {\n    font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;\n    font-size: 0.9em;\n}\n\n.hll {\n    background-color: #FFC;\n    margin: 0 -12px;\n    padding: 0 12px;\n    display: block;\n}\n\nimg.screenshot {\n}\n\ntt.descname, tt.descclassname, code.descname, code.descclassname {\n    font-size: 0.95em;\n}\n\ntt.descname, code.descname {\n    padding-right: 0.08em;\n}\n\nimg.screenshot {\n    -moz-box-shadow: 2px 2px 4px #EEE;\n    -webkit-box-shadow: 2px 2px 4px #EEE;\n    box-shadow: 2px 2px 4px #EEE;\n}\n\ntable.docutils {\n    border: 1px solid #888;\n    -moz-box-shadow: 2px 2px 4px #EEE;\n    -webkit-box-shadow: 2px 2px 4px #EEE;\n    box-shadow: 2px 2px 4px #EEE;\n}\n\ntable.docutils td, table.docutils th {\n    border: 1px solid #888;\n    padding: 0.25em 0.7em;\n}\n\ntable.field-list, table.footnote {\n    border: none;\n    -moz-box-shadow: none;\n    -webkit-box-shadow: none;\n    box-shadow: none;\n}\n\ntable.footnote {\n    margin: 15px 0;\n    width: 100%;\n    border: 1px solid #EEE;\n    background: #FDFDFD;\n    font-size: 0.9em;\n}\n\ntable.footnote + table.footnote {\n    margin-top: -15px;\n    border-top: none;\n}\n\ntable.field-list th {\n    padding: 0 0.8em 0 0;\n}\n\ntable.field-list td {\n    padding: 0;\n}\n\ntable.field-list p {\n    margin-bottom: 0.8em;\n}\n\n/* Cloned from\n * https://github.com/sphinx-doc/sphinx/commit/ef60dbfce09286b20b7385333d63a60321784e68\n */\n.field-name {\n    -moz-hyphens: manual;\n    -ms-hyphens: manual;\n    -webkit-hyphens: manual;\n    hyphens: manual;\n}\n\ntable.footnote td.label {\n    width: .1px;\n    padding: 0.3em 0 0.3em 0.5em;\n}\n\ntable.footnote td {\n    padding: 0.3em 0.5em;\n}\n\ndl {\n    margin: 0;\n    padding: 0;\n}\n\ndl dd {\n    margin-left: 30px;\n}\n\nblockquote {\n    margin: 0 0 0 30px;\n    padding: 0;\n}\n\nul, ol {\n    /* Matches the 30px from the narrow-screen \"li > ul\" selector below */\n    margin: 10px 0 10px 30px;\n    padding: 0;\n}\n\npre {\n    background: #EEE;\n    padding: 7px 30px;\n    margin: 15px 0px;\n    line-height: 1.3em;\n}\n\ndiv.viewcode-block:target {\n    background: #ffd;\n}\n\ndl pre, blockquote pre, li pre {\n    margin-left: 0;\n    padding-left: 30px;\n}\n\ntt, code {\n    background-color: #ecf0f3;\n    color: #222;\n    /* padding: 1px 2px; */\n}\n\ntt.xref, code.xref, a tt {\n    background-color: #FBFBFB;\n    border-bottom: 1px solid #fff;\n}\n\na.reference {\n    text-decoration: none;\n    border-bottom: 1px dotted #004B6B;\n}\n\n/* Don't put an underline on images */\na.image-reference, a.image-reference:hover {\n    border-bottom: none;\n}\n\na.reference:hover {\n    border-bottom: 1px solid #6D4100;\n}\n\na.footnote-reference {\n    text-decoration: none;\n    font-size: 0.7em;\n    vertical-align: top;\n    border-bottom: 1px dotted #004B6B;\n}\n\na.footnote-reference:hover {\n    border-bottom: 1px solid #6D4100;\n}\n\na:hover tt, a:hover code {\n    background: #EEE;\n}\n\n\n@media screen and (max-width: 870px) {\n\n    div.sphinxsidebar {\n    \tdisplay: none;\n    }\n\n    div.document {\n       width: 100%;\n\n    }\n\n    div.documentwrapper {\n    \tmargin-left: 0;\n    \tmargin-top: 0;\n    \tmargin-right: 0;\n    \tmargin-bottom: 0;\n    }\n\n    div.bodywrapper {\n    \tmargin-top: 0;\n    \tmargin-right: 0;\n    \tmargin-bottom: 0;\n    \tmargin-left: 0;\n    }\n\n    ul {\n    \tmargin-left: 0;\n    }\n\n\tli > ul {\n        /* Matches the 30px from the \"ul, ol\" selector above */\n\t\tmargin-left: 30px;\n\t}\n\n    .document {\n    \twidth: auto;\n    }\n\n    .footer {\n    \twidth: auto;\n    }\n\n    .bodywrapper {\n    \tmargin: 0;\n    }\n\n    .footer {\n    \twidth: auto;\n    }\n\n    .github {\n        display: none;\n    }\n\n\n\n}\n\n\n\n@media screen and (max-width: 875px) {\n\n    body {\n        margin: 0;\n        padding: 20px 30px;\n    }\n\n    div.documentwrapper {\n        float: none;\n        background: #fff;\n    }\n\n    div.sphinxsidebar {\n        display: block;\n        float: none;\n        width: 102.5%;\n        margin: -20px -30px 20px -30px;\n        padding: 10px 20px;\n        background: #333;\n        color: #FFF;\n    }\n\n    div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p,\n    div.sphinxsidebar h3 a {\n        color: #fff;\n    }\n\n    div.sphinxsidebar a {\n        color: #AAA;\n    }\n\n    div.sphinxsidebar p.logo {\n        display: none;\n    }\n\n    div.document {\n        width: 100%;\n        margin: 0;\n    }\n\n    div.footer {\n        display: none;\n    }\n\n    div.bodywrapper {\n        margin: 0;\n    }\n\n    div.body {\n        min-height: 0;\n        padding: 0;\n    }\n\n    .rtd_doc_footer {\n        display: none;\n    }\n\n    .document {\n        width: auto;\n    }\n\n    .footer {\n        width: auto;\n    }\n\n    .footer {\n        width: auto;\n    }\n\n    .github {\n        display: none;\n    }\n}\n@media screen and (min-width: 876px) {\n    div.sphinxsidebar {\n        position: fixed;\n        margin-left: 0;\n    }\n}\n\n\n/* misc. */\n\n.revsys-inline {\n    display: none!important;\n}\n\n/* Make nested-list/multi-paragraph items look better in Releases changelog\n * pages. Without this, docutils' magical list fuckery causes inconsistent\n * formatting between different release sub-lists.\n */\ndiv#changelog > div.section > ul > li > p:only-child {\n    margin-bottom: 0;\n}\n\n/* Hide fugly table cell borders in ..bibliography:: directive output */\ntable.docutils.citation, table.docutils.citation td, table.docutils.citation th {\n  border: none;\n  /* Below needed in some edge cases; if not applied, bottom shadows appear */\n  -moz-box-shadow: none;\n  -webkit-box-shadow: none;\n  box-shadow: none;\n}\n\n\n/* relbar */\n\n.related {\n    line-height: 30px;\n    width: 100%;\n    font-size: 0.9rem;\n}\n\n.related.top {\n    border-bottom: 1px solid #EEE;\n    margin-bottom: 20px;\n}\n\n.related.bottom {\n    border-top: 1px solid #EEE;\n}\n\n.related ul {\n    padding: 0;\n    margin: 0;\n    list-style: none;\n}\n\n.related li {\n    display: inline;\n}\n\nnav#rellinks {\n    float: right;\n}\n\nnav#rellinks li+li:before {\n    content: \"|\";\n}\n\nnav#breadcrumbs li+li:before {\n    content: \"\\00BB\";\n}\n\n/* Hide certain items when printing */\n@media print {\n    div.related {\n        display: none;\n    }\n}"
  },
  {
    "path": "docs-aside/_static/basic.css",
    "content": "/*\n * basic.css\n * ~~~~~~~~~\n *\n * Sphinx stylesheet -- basic theme.\n *\n * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\n/* -- main layout ----------------------------------------------------------- */\n\ndiv.clearer {\n    clear: both;\n}\n\ndiv.section::after {\n    display: block;\n    content: '';\n    clear: left;\n}\n\n/* -- relbar ---------------------------------------------------------------- */\n\ndiv.related {\n    width: 100%;\n    font-size: 90%;\n}\n\ndiv.related h3 {\n    display: none;\n}\n\ndiv.related ul {\n    margin: 0;\n    padding: 0 0 0 10px;\n    list-style: none;\n}\n\ndiv.related li {\n    display: inline;\n}\n\ndiv.related li.right {\n    float: right;\n    margin-right: 5px;\n}\n\n/* -- sidebar --------------------------------------------------------------- */\n\ndiv.sphinxsidebarwrapper {\n    padding: 10px 5px 0 10px;\n}\n\ndiv.sphinxsidebar {\n    float: left;\n    width: 230px;\n    margin-left: -100%;\n    font-size: 90%;\n    word-wrap: break-word;\n    overflow-wrap : break-word;\n}\n\ndiv.sphinxsidebar ul {\n    list-style: none;\n}\n\ndiv.sphinxsidebar ul ul,\ndiv.sphinxsidebar ul.want-points {\n    margin-left: 20px;\n    list-style: square;\n}\n\ndiv.sphinxsidebar ul ul {\n    margin-top: 0;\n    margin-bottom: 0;\n}\n\ndiv.sphinxsidebar form {\n    margin-top: 10px;\n}\n\ndiv.sphinxsidebar input {\n    border: 1px solid #98dbcc;\n    font-family: sans-serif;\n    font-size: 1em;\n}\n\ndiv.sphinxsidebar #searchbox form.search {\n    overflow: hidden;\n}\n\ndiv.sphinxsidebar #searchbox input[type=\"text\"] {\n    float: left;\n    width: 80%;\n    padding: 0.25em;\n    box-sizing: border-box;\n}\n\ndiv.sphinxsidebar #searchbox input[type=\"submit\"] {\n    float: left;\n    width: 20%;\n    border-left: none;\n    padding: 0.25em;\n    box-sizing: border-box;\n}\n\n\nimg {\n    border: 0;\n    max-width: 100%;\n}\n\n/* -- search page ----------------------------------------------------------- */\n\nul.search {\n    margin: 10px 0 0 20px;\n    padding: 0;\n}\n\nul.search li {\n    padding: 5px 0 5px 20px;\n    background-image: url(file.png);\n    background-repeat: no-repeat;\n    background-position: 0 7px;\n}\n\nul.search li a {\n    font-weight: bold;\n}\n\nul.search li div.context {\n    color: #888;\n    margin: 2px 0 0 30px;\n    text-align: left;\n}\n\nul.keywordmatches li.goodmatch a {\n    font-weight: bold;\n}\n\n/* -- index page ------------------------------------------------------------ */\n\ntable.contentstable {\n    width: 90%;\n    margin-left: auto;\n    margin-right: auto;\n}\n\ntable.contentstable p.biglink {\n    line-height: 150%;\n}\n\na.biglink {\n    font-size: 1.3em;\n}\n\nspan.linkdescr {\n    font-style: italic;\n    padding-top: 5px;\n    font-size: 90%;\n}\n\n/* -- general index --------------------------------------------------------- */\n\ntable.indextable {\n    width: 100%;\n}\n\ntable.indextable td {\n    text-align: left;\n    vertical-align: top;\n}\n\ntable.indextable ul {\n    margin-top: 0;\n    margin-bottom: 0;\n    list-style-type: none;\n}\n\ntable.indextable > tbody > tr > td > ul {\n    padding-left: 0em;\n}\n\ntable.indextable tr.pcap {\n    height: 10px;\n}\n\ntable.indextable tr.cap {\n    margin-top: 10px;\n    background-color: #f2f2f2;\n}\n\nimg.toggler {\n    margin-right: 3px;\n    margin-top: 3px;\n    cursor: pointer;\n}\n\ndiv.modindex-jumpbox {\n    border-top: 1px solid #ddd;\n    border-bottom: 1px solid #ddd;\n    margin: 1em 0 1em 0;\n    padding: 0.4em;\n}\n\ndiv.genindex-jumpbox {\n    border-top: 1px solid #ddd;\n    border-bottom: 1px solid #ddd;\n    margin: 1em 0 1em 0;\n    padding: 0.4em;\n}\n\n/* -- domain module index --------------------------------------------------- */\n\ntable.modindextable td {\n    padding: 2px;\n    border-collapse: collapse;\n}\n\n/* -- general body styles --------------------------------------------------- */\n\ndiv.body {\n    min-width: 450px;\n    max-width: 800px;\n}\n\ndiv.body p, div.body dd, div.body li, div.body blockquote {\n    -moz-hyphens: auto;\n    -ms-hyphens: auto;\n    -webkit-hyphens: auto;\n    hyphens: auto;\n}\n\na.headerlink {\n    visibility: hidden;\n}\n\na.brackets:before,\nspan.brackets > a:before{\n    content: \"[\";\n}\n\na.brackets:after,\nspan.brackets > a:after {\n    content: \"]\";\n}\n\nh1:hover > a.headerlink,\nh2:hover > a.headerlink,\nh3:hover > a.headerlink,\nh4:hover > a.headerlink,\nh5:hover > a.headerlink,\nh6:hover > a.headerlink,\ndt:hover > a.headerlink,\ncaption:hover > a.headerlink,\np.caption:hover > a.headerlink,\ndiv.code-block-caption:hover > a.headerlink {\n    visibility: visible;\n}\n\ndiv.body p.caption {\n    text-align: inherit;\n}\n\ndiv.body td {\n    text-align: left;\n}\n\n.first {\n    margin-top: 0 !important;\n}\n\np.rubric {\n    margin-top: 30px;\n    font-weight: bold;\n}\n\nimg.align-left, .figure.align-left, object.align-left {\n    clear: left;\n    float: left;\n    margin-right: 1em;\n}\n\nimg.align-right, .figure.align-right, object.align-right {\n    clear: right;\n    float: right;\n    margin-left: 1em;\n}\n\nimg.align-center, .figure.align-center, object.align-center {\n  display: block;\n  margin-left: auto;\n  margin-right: auto;\n}\n\nimg.align-default, .figure.align-default {\n  display: block;\n  margin-left: auto;\n  margin-right: auto;\n}\n\n.align-left {\n    text-align: left;\n}\n\n.align-center {\n    text-align: center;\n}\n\n.align-default {\n    text-align: center;\n}\n\n.align-right {\n    text-align: right;\n}\n\n/* -- sidebars -------------------------------------------------------------- */\n\ndiv.sidebar {\n    margin: 0 0 0.5em 1em;\n    border: 1px solid #ddb;\n    padding: 7px;\n    background-color: #ffe;\n    width: 40%;\n    float: right;\n    clear: right;\n    overflow-x: auto;\n}\n\np.sidebar-title {\n    font-weight: bold;\n}\n\ndiv.admonition, div.topic, blockquote {\n    clear: left;\n}\n\n/* -- topics ---------------------------------------------------------------- */\n\ndiv.topic {\n    border: 1px solid #ccc;\n    padding: 7px;\n    margin: 10px 0 10px 0;\n}\n\np.topic-title {\n    font-size: 1.1em;\n    font-weight: bold;\n    margin-top: 10px;\n}\n\n/* -- admonitions ----------------------------------------------------------- */\n\ndiv.admonition {\n    margin-top: 10px;\n    margin-bottom: 10px;\n    padding: 7px;\n}\n\ndiv.admonition dt {\n    font-weight: bold;\n}\n\np.admonition-title {\n    margin: 0px 10px 5px 0px;\n    font-weight: bold;\n}\n\ndiv.body p.centered {\n    text-align: center;\n    margin-top: 25px;\n}\n\n/* -- content of sidebars/topics/admonitions -------------------------------- */\n\ndiv.sidebar > :last-child,\ndiv.topic > :last-child,\ndiv.admonition > :last-child {\n    margin-bottom: 0;\n}\n\ndiv.sidebar::after,\ndiv.topic::after,\ndiv.admonition::after,\nblockquote::after {\n    display: block;\n    content: '';\n    clear: both;\n}\n\n/* -- tables ---------------------------------------------------------------- */\n\ntable.docutils {\n    margin-top: 10px;\n    margin-bottom: 10px;\n    border: 0;\n    border-collapse: collapse;\n}\n\ntable.align-center {\n    margin-left: auto;\n    margin-right: auto;\n}\n\ntable.align-default {\n    margin-left: auto;\n    margin-right: auto;\n}\n\ntable caption span.caption-number {\n    font-style: italic;\n}\n\ntable caption span.caption-text {\n}\n\ntable.docutils td, table.docutils th {\n    padding: 1px 8px 1px 5px;\n    border-top: 0;\n    border-left: 0;\n    border-right: 0;\n    border-bottom: 1px solid #aaa;\n}\n\ntable.footnote td, table.footnote th {\n    border: 0 !important;\n}\n\nth {\n    text-align: left;\n    padding-right: 5px;\n}\n\ntable.citation {\n    border-left: solid 1px gray;\n    margin-left: 1px;\n}\n\ntable.citation td {\n    border-bottom: none;\n}\n\nth > :first-child,\ntd > :first-child {\n    margin-top: 0px;\n}\n\nth > :last-child,\ntd > :last-child {\n    margin-bottom: 0px;\n}\n\n/* -- figures --------------------------------------------------------------- */\n\ndiv.figure {\n    margin: 0.5em;\n    padding: 0.5em;\n}\n\ndiv.figure p.caption {\n    padding: 0.3em;\n}\n\ndiv.figure p.caption span.caption-number {\n    font-style: italic;\n}\n\ndiv.figure p.caption span.caption-text {\n}\n\n/* -- field list styles ----------------------------------------------------- */\n\ntable.field-list td, table.field-list th {\n    border: 0 !important;\n}\n\n.field-list ul {\n    margin: 0;\n    padding-left: 1em;\n}\n\n.field-list p {\n    margin: 0;\n}\n\n.field-name {\n    -moz-hyphens: manual;\n    -ms-hyphens: manual;\n    -webkit-hyphens: manual;\n    hyphens: manual;\n}\n\n/* -- hlist styles ---------------------------------------------------------- */\n\ntable.hlist {\n    margin: 1em 0;\n}\n\ntable.hlist td {\n    vertical-align: top;\n}\n\n\n/* -- other body styles ----------------------------------------------------- */\n\nol.arabic {\n    list-style: decimal;\n}\n\nol.loweralpha {\n    list-style: lower-alpha;\n}\n\nol.upperalpha {\n    list-style: upper-alpha;\n}\n\nol.lowerroman {\n    list-style: lower-roman;\n}\n\nol.upperroman {\n    list-style: upper-roman;\n}\n\n:not(li) > ol > li:first-child > :first-child,\n:not(li) > ul > li:first-child > :first-child {\n    margin-top: 0px;\n}\n\n:not(li) > ol > li:last-child > :last-child,\n:not(li) > ul > li:last-child > :last-child {\n    margin-bottom: 0px;\n}\n\nol.simple ol p,\nol.simple ul p,\nul.simple ol p,\nul.simple ul p {\n    margin-top: 0;\n}\n\nol.simple > li:not(:first-child) > p,\nul.simple > li:not(:first-child) > p {\n    margin-top: 0;\n}\n\nol.simple p,\nul.simple p {\n    margin-bottom: 0;\n}\n\ndl.footnote > dt,\ndl.citation > dt {\n    float: left;\n    margin-right: 0.5em;\n}\n\ndl.footnote > dd,\ndl.citation > dd {\n    margin-bottom: 0em;\n}\n\ndl.footnote > dd:after,\ndl.citation > dd:after {\n    content: \"\";\n    clear: both;\n}\n\ndl.field-list {\n    display: grid;\n    grid-template-columns: fit-content(30%) auto;\n}\n\ndl.field-list > dt {\n    font-weight: bold;\n    word-break: break-word;\n    padding-left: 0.5em;\n    padding-right: 5px;\n}\n\ndl.field-list > dt:after {\n    content: \":\";\n}\n\ndl.field-list > dd {\n    padding-left: 0.5em;\n    margin-top: 0em;\n    margin-left: 0em;\n    margin-bottom: 0em;\n}\n\ndl {\n    margin-bottom: 15px;\n}\n\ndd > :first-child {\n    margin-top: 0px;\n}\n\ndd ul, dd table {\n    margin-bottom: 10px;\n}\n\ndd {\n    margin-top: 3px;\n    margin-bottom: 10px;\n    margin-left: 30px;\n}\n\ndl > dd:last-child,\ndl > dd:last-child > :last-child {\n    margin-bottom: 0;\n}\n\ndt:target, span.highlighted {\n    background-color: #fbe54e;\n}\n\nrect.highlighted {\n    fill: #fbe54e;\n}\n\ndl.glossary dt {\n    font-weight: bold;\n    font-size: 1.1em;\n}\n\n.optional {\n    font-size: 1.3em;\n}\n\n.sig-paren {\n    font-size: larger;\n}\n\n.versionmodified {\n    font-style: italic;\n}\n\n.system-message {\n    background-color: #fda;\n    padding: 5px;\n    border: 3px solid red;\n}\n\n.footnote:target  {\n    background-color: #ffa;\n}\n\n.line-block {\n    display: block;\n    margin-top: 1em;\n    margin-bottom: 1em;\n}\n\n.line-block .line-block {\n    margin-top: 0;\n    margin-bottom: 0;\n    margin-left: 1.5em;\n}\n\n.guilabel, .menuselection {\n    font-family: sans-serif;\n}\n\n.accelerator {\n    text-decoration: underline;\n}\n\n.classifier {\n    font-style: oblique;\n}\n\n.classifier:before {\n    font-style: normal;\n    margin: 0.5em;\n    content: \":\";\n}\n\nabbr, acronym {\n    border-bottom: dotted 1px;\n    cursor: help;\n}\n\n/* -- code displays --------------------------------------------------------- */\n\npre {\n    overflow: auto;\n    overflow-y: hidden;  /* fixes display issues on Chrome browsers */\n}\n\npre, div[class*=\"highlight-\"] {\n    clear: both;\n}\n\nspan.pre {\n    -moz-hyphens: none;\n    -ms-hyphens: none;\n    -webkit-hyphens: none;\n    hyphens: none;\n}\n\ndiv[class*=\"highlight-\"] {\n    margin: 1em 0;\n}\n\ntd.linenos pre {\n    border: 0;\n    background-color: transparent;\n    color: #aaa;\n}\n\ntable.highlighttable {\n    display: block;\n}\n\ntable.highlighttable tbody {\n    display: block;\n}\n\ntable.highlighttable tr {\n    display: flex;\n}\n\ntable.highlighttable td {\n    margin: 0;\n    padding: 0;\n}\n\ntable.highlighttable td.linenos {\n    padding-right: 0.5em;\n}\n\ntable.highlighttable td.code {\n    flex: 1;\n    overflow: hidden;\n}\n\n.highlight .hll {\n    display: block;\n}\n\ndiv.highlight pre,\ntable.highlighttable pre {\n    margin: 0;\n}\n\ndiv.code-block-caption + div {\n    margin-top: 0;\n}\n\ndiv.code-block-caption {\n    margin-top: 1em;\n    padding: 2px 5px;\n    font-size: small;\n}\n\ndiv.code-block-caption code {\n    background-color: transparent;\n}\n\ntable.highlighttable td.linenos,\ndiv.doctest > div.highlight span.gp {  /* gp: Generic.Prompt */\n    user-select: none;\n}\n\ndiv.code-block-caption span.caption-number {\n    padding: 0.1em 0.3em;\n    font-style: italic;\n}\n\ndiv.code-block-caption span.caption-text {\n}\n\ndiv.literal-block-wrapper {\n    margin: 1em 0;\n}\n\ncode.descname {\n    background-color: transparent;\n    font-weight: bold;\n    font-size: 1.2em;\n}\n\ncode.descclassname {\n    background-color: transparent;\n}\n\ncode.xref, a code {\n    background-color: transparent;\n    font-weight: bold;\n}\n\nh1 code, h2 code, h3 code, h4 code, h5 code, h6 code {\n    background-color: transparent;\n}\n\n.viewcode-link {\n    float: right;\n}\n\n.viewcode-back {\n    float: right;\n    font-family: sans-serif;\n}\n\ndiv.viewcode-block:target {\n    margin: -1px -10px;\n    padding: 0 10px;\n}\n\n/* -- math display ---------------------------------------------------------- */\n\nimg.math {\n    vertical-align: middle;\n}\n\ndiv.body div.math p {\n    text-align: center;\n}\n\nspan.eqno {\n    float: right;\n}\n\nspan.eqno a.headerlink {\n    position: absolute;\n    z-index: 1;\n}\n\ndiv.math:hover a.headerlink {\n    visibility: visible;\n}\n\n/* -- printout stylesheet --------------------------------------------------- */\n\n@media print {\n    div.document,\n    div.documentwrapper,\n    div.bodywrapper {\n        margin: 0 !important;\n        width: 100%;\n    }\n\n    div.sphinxsidebar,\n    div.related,\n    div.footer,\n    #top-link {\n        display: none;\n    }\n}"
  },
  {
    "path": "docs-aside/_static/css/badge_only.css",
    "content": ".fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:\"\"}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format(\"embedded-opentype\"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format(\"woff2\"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format(\"woff\"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format(\"truetype\"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format(\"svg\")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:\"\\f02d\"}.fa-caret-down:before,.icon-caret-down:before{content:\"\\f0d7\"}.fa-caret-up:before,.icon-caret-up:before{content:\"\\f0d8\"}.fa-caret-left:before,.icon-caret-left:before{content:\"\\f0d9\"}.fa-caret-right:before,.icon-caret-right:before{content:\"\\f0da\"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:\"\";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}"
  },
  {
    "path": "docs-aside/_static/css/theme.css",
    "content": "html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:\"\";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^=\"#\"]:after,a[href^=\"javascript:\"]:after{content:\"\"}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,.wy-nav-top a,.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:\"\"}.clearfix:after{clear:both}/*!\n *  Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome\n *  License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format(\"embedded-opentype\"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format(\"woff2\"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format(\"woff\"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format(\"truetype\"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format(\"svg\");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)\";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)\";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)\";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)\";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:\"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)\";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:\"\"}.fa-music:before{content:\"\"}.fa-search:before,.icon-search:before{content:\"\"}.fa-envelope-o:before{content:\"\"}.fa-heart:before{content:\"\"}.fa-star:before{content:\"\"}.fa-star-o:before{content:\"\"}.fa-user:before{content:\"\"}.fa-film:before{content:\"\"}.fa-th-large:before{content:\"\"}.fa-th:before{content:\"\"}.fa-th-list:before{content:\"\"}.fa-check:before{content:\"\"}.fa-close:before,.fa-remove:before,.fa-times:before{content:\"\"}.fa-search-plus:before{content:\"\"}.fa-search-minus:before{content:\"\"}.fa-power-off:before{content:\"\"}.fa-signal:before{content:\"\"}.fa-cog:before,.fa-gear:before{content:\"\"}.fa-trash-o:before{content:\"\"}.fa-home:before,.icon-home:before{content:\"\"}.fa-file-o:before{content:\"\"}.fa-clock-o:before{content:\"\"}.fa-road:before{content:\"\"}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:\"\"}.fa-arrow-circle-o-down:before{content:\"\"}.fa-arrow-circle-o-up:before{content:\"\"}.fa-inbox:before{content:\"\"}.fa-play-circle-o:before{content:\"\"}.fa-repeat:before,.fa-rotate-right:before{content:\"\"}.fa-refresh:before{content:\"\"}.fa-list-alt:before{content:\"\"}.fa-lock:before{content:\"\"}.fa-flag:before{content:\"\"}.fa-headphones:before{content:\"\"}.fa-volume-off:before{content:\"\"}.fa-volume-down:before{content:\"\"}.fa-volume-up:before{content:\"\"}.fa-qrcode:before{content:\"\"}.fa-barcode:before{content:\"\"}.fa-tag:before{content:\"\"}.fa-tags:before{content:\"\"}.fa-book:before,.icon-book:before{content:\"\"}.fa-bookmark:before{content:\"\"}.fa-print:before{content:\"\"}.fa-camera:before{content:\"\"}.fa-font:before{content:\"\"}.fa-bold:before{content:\"\"}.fa-italic:before{content:\"\"}.fa-text-height:before{content:\"\"}.fa-text-width:before{content:\"\"}.fa-align-left:before{content:\"\"}.fa-align-center:before{content:\"\"}.fa-align-right:before{content:\"\"}.fa-align-justify:before{content:\"\"}.fa-list:before{content:\"\"}.fa-dedent:before,.fa-outdent:before{content:\"\"}.fa-indent:before{content:\"\"}.fa-video-camera:before{content:\"\"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:\"\"}.fa-pencil:before{content:\"\"}.fa-map-marker:before{content:\"\"}.fa-adjust:before{content:\"\"}.fa-tint:before{content:\"\"}.fa-edit:before,.fa-pencil-square-o:before{content:\"\"}.fa-share-square-o:before{content:\"\"}.fa-check-square-o:before{content:\"\"}.fa-arrows:before{content:\"\"}.fa-step-backward:before{content:\"\"}.fa-fast-backward:before{content:\"\"}.fa-backward:before{content:\"\"}.fa-play:before{content:\"\"}.fa-pause:before{content:\"\"}.fa-stop:before{content:\"\"}.fa-forward:before{content:\"\"}.fa-fast-forward:before{content:\"\"}.fa-step-forward:before{content:\"\"}.fa-eject:before{content:\"\"}.fa-chevron-left:before{content:\"\"}.fa-chevron-right:before{content:\"\"}.fa-plus-circle:before{content:\"\"}.fa-minus-circle:before{content:\"\"}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:\"\"}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:\"\"}.fa-question-circle:before{content:\"\"}.fa-info-circle:before{content:\"\"}.fa-crosshairs:before{content:\"\"}.fa-times-circle-o:before{content:\"\"}.fa-check-circle-o:before{content:\"\"}.fa-ban:before{content:\"\"}.fa-arrow-left:before{content:\"\"}.fa-arrow-right:before{content:\"\"}.fa-arrow-up:before{content:\"\"}.fa-arrow-down:before{content:\"\"}.fa-mail-forward:before,.fa-share:before{content:\"\"}.fa-expand:before{content:\"\"}.fa-compress:before{content:\"\"}.fa-plus:before{content:\"\"}.fa-minus:before{content:\"\"}.fa-asterisk:before{content:\"\"}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:\"\"}.fa-gift:before{content:\"\"}.fa-leaf:before{content:\"\"}.fa-fire:before,.icon-fire:before{content:\"\"}.fa-eye:before{content:\"\"}.fa-eye-slash:before{content:\"\"}.fa-exclamation-triangle:before,.fa-warning:before{content:\"\"}.fa-plane:before{content:\"\"}.fa-calendar:before{content:\"\"}.fa-random:before{content:\"\"}.fa-comment:before{content:\"\"}.fa-magnet:before{content:\"\"}.fa-chevron-up:before{content:\"\"}.fa-chevron-down:before{content:\"\"}.fa-retweet:before{content:\"\"}.fa-shopping-cart:before{content:\"\"}.fa-folder:before{content:\"\"}.fa-folder-open:before{content:\"\"}.fa-arrows-v:before{content:\"\"}.fa-arrows-h:before{content:\"\"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:\"\"}.fa-twitter-square:before{content:\"\"}.fa-facebook-square:before{content:\"\"}.fa-camera-retro:before{content:\"\"}.fa-key:before{content:\"\"}.fa-cogs:before,.fa-gears:before{content:\"\"}.fa-comments:before{content:\"\"}.fa-thumbs-o-up:before{content:\"\"}.fa-thumbs-o-down:before{content:\"\"}.fa-star-half:before{content:\"\"}.fa-heart-o:before{content:\"\"}.fa-sign-out:before{content:\"\"}.fa-linkedin-square:before{content:\"\"}.fa-thumb-tack:before{content:\"\"}.fa-external-link:before{content:\"\"}.fa-sign-in:before{content:\"\"}.fa-trophy:before{content:\"\"}.fa-github-square:before{content:\"\"}.fa-upload:before{content:\"\"}.fa-lemon-o:before{content:\"\"}.fa-phone:before{content:\"\"}.fa-square-o:before{content:\"\"}.fa-bookmark-o:before{content:\"\"}.fa-phone-square:before{content:\"\"}.fa-twitter:before{content:\"\"}.fa-facebook-f:before,.fa-facebook:before{content:\"\"}.fa-github:before,.icon-github:before{content:\"\"}.fa-unlock:before{content:\"\"}.fa-credit-card:before{content:\"\"}.fa-feed:before,.fa-rss:before{content:\"\"}.fa-hdd-o:before{content:\"\"}.fa-bullhorn:before{content:\"\"}.fa-bell:before{content:\"\"}.fa-certificate:before{content:\"\"}.fa-hand-o-right:before{content:\"\"}.fa-hand-o-left:before{content:\"\"}.fa-hand-o-up:before{content:\"\"}.fa-hand-o-down:before{content:\"\"}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:\"\"}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:\"\"}.fa-arrow-circle-up:before{content:\"\"}.fa-arrow-circle-down:before{content:\"\"}.fa-globe:before{content:\"\"}.fa-wrench:before{content:\"\"}.fa-tasks:before{content:\"\"}.fa-filter:before{content:\"\"}.fa-briefcase:before{content:\"\"}.fa-arrows-alt:before{content:\"\"}.fa-group:before,.fa-users:before{content:\"\"}.fa-chain:before,.fa-link:before,.icon-link:before{content:\"\"}.fa-cloud:before{content:\"\"}.fa-flask:before{content:\"\"}.fa-cut:before,.fa-scissors:before{content:\"\"}.fa-copy:before,.fa-files-o:before{content:\"\"}.fa-paperclip:before{content:\"\"}.fa-floppy-o:before,.fa-save:before{content:\"\"}.fa-square:before{content:\"\"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:\"\"}.fa-list-ul:before{content:\"\"}.fa-list-ol:before{content:\"\"}.fa-strikethrough:before{content:\"\"}.fa-underline:before{content:\"\"}.fa-table:before{content:\"\"}.fa-magic:before{content:\"\"}.fa-truck:before{content:\"\"}.fa-pinterest:before{content:\"\"}.fa-pinterest-square:before{content:\"\"}.fa-google-plus-square:before{content:\"\"}.fa-google-plus:before{content:\"\"}.fa-money:before{content:\"\"}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:\"\"}.fa-caret-up:before{content:\"\"}.fa-caret-left:before{content:\"\"}.fa-caret-right:before{content:\"\"}.fa-columns:before{content:\"\"}.fa-sort:before,.fa-unsorted:before{content:\"\"}.fa-sort-desc:before,.fa-sort-down:before{content:\"\"}.fa-sort-asc:before,.fa-sort-up:before{content:\"\"}.fa-envelope:before{content:\"\"}.fa-linkedin:before{content:\"\"}.fa-rotate-left:before,.fa-undo:before{content:\"\"}.fa-gavel:before,.fa-legal:before{content:\"\"}.fa-dashboard:before,.fa-tachometer:before{content:\"\"}.fa-comment-o:before{content:\"\"}.fa-comments-o:before{content:\"\"}.fa-bolt:before,.fa-flash:before{content:\"\"}.fa-sitemap:before{content:\"\"}.fa-umbrella:before{content:\"\"}.fa-clipboard:before,.fa-paste:before{content:\"\"}.fa-lightbulb-o:before{content:\"\"}.fa-exchange:before{content:\"\"}.fa-cloud-download:before{content:\"\"}.fa-cloud-upload:before{content:\"\"}.fa-user-md:before{content:\"\"}.fa-stethoscope:before{content:\"\"}.fa-suitcase:before{content:\"\"}.fa-bell-o:before{content:\"\"}.fa-coffee:before{content:\"\"}.fa-cutlery:before{content:\"\"}.fa-file-text-o:before{content:\"\"}.fa-building-o:before{content:\"\"}.fa-hospital-o:before{content:\"\"}.fa-ambulance:before{content:\"\"}.fa-medkit:before{content:\"\"}.fa-fighter-jet:before{content:\"\"}.fa-beer:before{content:\"\"}.fa-h-square:before{content:\"\"}.fa-plus-square:before{content:\"\"}.fa-angle-double-left:before{content:\"\"}.fa-angle-double-right:before{content:\"\"}.fa-angle-double-up:before{content:\"\"}.fa-angle-double-down:before{content:\"\"}.fa-angle-left:before{content:\"\"}.fa-angle-right:before{content:\"\"}.fa-angle-up:before{content:\"\"}.fa-angle-down:before{content:\"\"}.fa-desktop:before{content:\"\"}.fa-laptop:before{content:\"\"}.fa-tablet:before{content:\"\"}.fa-mobile-phone:before,.fa-mobile:before{content:\"\"}.fa-circle-o:before{content:\"\"}.fa-quote-left:before{content:\"\"}.fa-quote-right:before{content:\"\"}.fa-spinner:before{content:\"\"}.fa-circle:before{content:\"\"}.fa-mail-reply:before,.fa-reply:before{content:\"\"}.fa-github-alt:before{content:\"\"}.fa-folder-o:before{content:\"\"}.fa-folder-open-o:before{content:\"\"}.fa-smile-o:before{content:\"\"}.fa-frown-o:before{content:\"\"}.fa-meh-o:before{content:\"\"}.fa-gamepad:before{content:\"\"}.fa-keyboard-o:before{content:\"\"}.fa-flag-o:before{content:\"\"}.fa-flag-checkered:before{content:\"\"}.fa-terminal:before{content:\"\"}.fa-code:before{content:\"\"}.fa-mail-reply-all:before,.fa-reply-all:before{content:\"\"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:\"\"}.fa-location-arrow:before{content:\"\"}.fa-crop:before{content:\"\"}.fa-code-fork:before{content:\"\"}.fa-chain-broken:before,.fa-unlink:before{content:\"\"}.fa-question:before{content:\"\"}.fa-info:before{content:\"\"}.fa-exclamation:before{content:\"\"}.fa-superscript:before{content:\"\"}.fa-subscript:before{content:\"\"}.fa-eraser:before{content:\"\"}.fa-puzzle-piece:before{content:\"\"}.fa-microphone:before{content:\"\"}.fa-microphone-slash:before{content:\"\"}.fa-shield:before{content:\"\"}.fa-calendar-o:before{content:\"\"}.fa-fire-extinguisher:before{content:\"\"}.fa-rocket:before{content:\"\"}.fa-maxcdn:before{content:\"\"}.fa-chevron-circle-left:before{content:\"\"}.fa-chevron-circle-right:before{content:\"\"}.fa-chevron-circle-up:before{content:\"\"}.fa-chevron-circle-down:before{content:\"\"}.fa-html5:before{content:\"\"}.fa-css3:before{content:\"\"}.fa-anchor:before{content:\"\"}.fa-unlock-alt:before{content:\"\"}.fa-bullseye:before{content:\"\"}.fa-ellipsis-h:before{content:\"\"}.fa-ellipsis-v:before{content:\"\"}.fa-rss-square:before{content:\"\"}.fa-play-circle:before{content:\"\"}.fa-ticket:before{content:\"\"}.fa-minus-square:before{content:\"\"}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:\"\"}.fa-level-up:before{content:\"\"}.fa-level-down:before{content:\"\"}.fa-check-square:before{content:\"\"}.fa-pencil-square:before{content:\"\"}.fa-external-link-square:before{content:\"\"}.fa-share-square:before{content:\"\"}.fa-compass:before{content:\"\"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:\"\"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:\"\"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:\"\"}.fa-eur:before,.fa-euro:before{content:\"\"}.fa-gbp:before{content:\"\"}.fa-dollar:before,.fa-usd:before{content:\"\"}.fa-inr:before,.fa-rupee:before{content:\"\"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:\"\"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:\"\"}.fa-krw:before,.fa-won:before{content:\"\"}.fa-bitcoin:before,.fa-btc:before{content:\"\"}.fa-file:before{content:\"\"}.fa-file-text:before{content:\"\"}.fa-sort-alpha-asc:before{content:\"\"}.fa-sort-alpha-desc:before{content:\"\"}.fa-sort-amount-asc:before{content:\"\"}.fa-sort-amount-desc:before{content:\"\"}.fa-sort-numeric-asc:before{content:\"\"}.fa-sort-numeric-desc:before{content:\"\"}.fa-thumbs-up:before{content:\"\"}.fa-thumbs-down:before{content:\"\"}.fa-youtube-square:before{content:\"\"}.fa-youtube:before{content:\"\"}.fa-xing:before{content:\"\"}.fa-xing-square:before{content:\"\"}.fa-youtube-play:before{content:\"\"}.fa-dropbox:before{content:\"\"}.fa-stack-overflow:before{content:\"\"}.fa-instagram:before{content:\"\"}.fa-flickr:before{content:\"\"}.fa-adn:before{content:\"\"}.fa-bitbucket:before,.icon-bitbucket:before{content:\"\"}.fa-bitbucket-square:before{content:\"\"}.fa-tumblr:before{content:\"\"}.fa-tumblr-square:before{content:\"\"}.fa-long-arrow-down:before{content:\"\"}.fa-long-arrow-up:before{content:\"\"}.fa-long-arrow-left:before{content:\"\"}.fa-long-arrow-right:before{content:\"\"}.fa-apple:before{content:\"\"}.fa-windows:before{content:\"\"}.fa-android:before{content:\"\"}.fa-linux:before{content:\"\"}.fa-dribbble:before{content:\"\"}.fa-skype:before{content:\"\"}.fa-foursquare:before{content:\"\"}.fa-trello:before{content:\"\"}.fa-female:before{content:\"\"}.fa-male:before{content:\"\"}.fa-gittip:before,.fa-gratipay:before{content:\"\"}.fa-sun-o:before{content:\"\"}.fa-moon-o:before{content:\"\"}.fa-archive:before{content:\"\"}.fa-bug:before{content:\"\"}.fa-vk:before{content:\"\"}.fa-weibo:before{content:\"\"}.fa-renren:before{content:\"\"}.fa-pagelines:before{content:\"\"}.fa-stack-exchange:before{content:\"\"}.fa-arrow-circle-o-right:before{content:\"\"}.fa-arrow-circle-o-left:before{content:\"\"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:\"\"}.fa-dot-circle-o:before{content:\"\"}.fa-wheelchair:before{content:\"\"}.fa-vimeo-square:before{content:\"\"}.fa-try:before,.fa-turkish-lira:before{content:\"\"}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:\"\"}.fa-space-shuttle:before{content:\"\"}.fa-slack:before{content:\"\"}.fa-envelope-square:before{content:\"\"}.fa-wordpress:before{content:\"\"}.fa-openid:before{content:\"\"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:\"\"}.fa-graduation-cap:before,.fa-mortar-board:before{content:\"\"}.fa-yahoo:before{content:\"\"}.fa-google:before{content:\"\"}.fa-reddit:before{content:\"\"}.fa-reddit-square:before{content:\"\"}.fa-stumbleupon-circle:before{content:\"\"}.fa-stumbleupon:before{content:\"\"}.fa-delicious:before{content:\"\"}.fa-digg:before{content:\"\"}.fa-pied-piper-pp:before{content:\"\"}.fa-pied-piper-alt:before{content:\"\"}.fa-drupal:before{content:\"\"}.fa-joomla:before{content:\"\"}.fa-language:before{content:\"\"}.fa-fax:before{content:\"\"}.fa-building:before{content:\"\"}.fa-child:before{content:\"\"}.fa-paw:before{content:\"\"}.fa-spoon:before{content:\"\"}.fa-cube:before{content:\"\"}.fa-cubes:before{content:\"\"}.fa-behance:before{content:\"\"}.fa-behance-square:before{content:\"\"}.fa-steam:before{content:\"\"}.fa-steam-square:before{content:\"\"}.fa-recycle:before{content:\"\"}.fa-automobile:before,.fa-car:before{content:\"\"}.fa-cab:before,.fa-taxi:before{content:\"\"}.fa-tree:before{content:\"\"}.fa-spotify:before{content:\"\"}.fa-deviantart:before{content:\"\"}.fa-soundcloud:before{content:\"\"}.fa-database:before{content:\"\"}.fa-file-pdf-o:before{content:\"\"}.fa-file-word-o:before{content:\"\"}.fa-file-excel-o:before{content:\"\"}.fa-file-powerpoint-o:before{content:\"\"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:\"\"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:\"\"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:\"\"}.fa-file-movie-o:before,.fa-file-video-o:before{content:\"\"}.fa-file-code-o:before{content:\"\"}.fa-vine:before{content:\"\"}.fa-codepen:before{content:\"\"}.fa-jsfiddle:before{content:\"\"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:\"\"}.fa-circle-o-notch:before{content:\"\"}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:\"\"}.fa-empire:before,.fa-ge:before{content:\"\"}.fa-git-square:before{content:\"\"}.fa-git:before{content:\"\"}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:\"\"}.fa-tencent-weibo:before{content:\"\"}.fa-qq:before{content:\"\"}.fa-wechat:before,.fa-weixin:before{content:\"\"}.fa-paper-plane:before,.fa-send:before{content:\"\"}.fa-paper-plane-o:before,.fa-send-o:before{content:\"\"}.fa-history:before{content:\"\"}.fa-circle-thin:before{content:\"\"}.fa-header:before{content:\"\"}.fa-paragraph:before{content:\"\"}.fa-sliders:before{content:\"\"}.fa-share-alt:before{content:\"\"}.fa-share-alt-square:before{content:\"\"}.fa-bomb:before{content:\"\"}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:\"\"}.fa-tty:before{content:\"\"}.fa-binoculars:before{content:\"\"}.fa-plug:before{content:\"\"}.fa-slideshare:before{content:\"\"}.fa-twitch:before{content:\"\"}.fa-yelp:before{content:\"\"}.fa-newspaper-o:before{content:\"\"}.fa-wifi:before{content:\"\"}.fa-calculator:before{content:\"\"}.fa-paypal:before{content:\"\"}.fa-google-wallet:before{content:\"\"}.fa-cc-visa:before{content:\"\"}.fa-cc-mastercard:before{content:\"\"}.fa-cc-discover:before{content:\"\"}.fa-cc-amex:before{content:\"\"}.fa-cc-paypal:before{content:\"\"}.fa-cc-stripe:before{content:\"\"}.fa-bell-slash:before{content:\"\"}.fa-bell-slash-o:before{content:\"\"}.fa-trash:before{content:\"\"}.fa-copyright:before{content:\"\"}.fa-at:before{content:\"\"}.fa-eyedropper:before{content:\"\"}.fa-paint-brush:before{content:\"\"}.fa-birthday-cake:before{content:\"\"}.fa-area-chart:before{content:\"\"}.fa-pie-chart:before{content:\"\"}.fa-line-chart:before{content:\"\"}.fa-lastfm:before{content:\"\"}.fa-lastfm-square:before{content:\"\"}.fa-toggle-off:before{content:\"\"}.fa-toggle-on:before{content:\"\"}.fa-bicycle:before{content:\"\"}.fa-bus:before{content:\"\"}.fa-ioxhost:before{content:\"\"}.fa-angellist:before{content:\"\"}.fa-cc:before{content:\"\"}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:\"\"}.fa-meanpath:before{content:\"\"}.fa-buysellads:before{content:\"\"}.fa-connectdevelop:before{content:\"\"}.fa-dashcube:before{content:\"\"}.fa-forumbee:before{content:\"\"}.fa-leanpub:before{content:\"\"}.fa-sellsy:before{content:\"\"}.fa-shirtsinbulk:before{content:\"\"}.fa-simplybuilt:before{content:\"\"}.fa-skyatlas:before{content:\"\"}.fa-cart-plus:before{content:\"\"}.fa-cart-arrow-down:before{content:\"\"}.fa-diamond:before{content:\"\"}.fa-ship:before{content:\"\"}.fa-user-secret:before{content:\"\"}.fa-motorcycle:before{content:\"\"}.fa-street-view:before{content:\"\"}.fa-heartbeat:before{content:\"\"}.fa-venus:before{content:\"\"}.fa-mars:before{content:\"\"}.fa-mercury:before{content:\"\"}.fa-intersex:before,.fa-transgender:before{content:\"\"}.fa-transgender-alt:before{content:\"\"}.fa-venus-double:before{content:\"\"}.fa-mars-double:before{content:\"\"}.fa-venus-mars:before{content:\"\"}.fa-mars-stroke:before{content:\"\"}.fa-mars-stroke-v:before{content:\"\"}.fa-mars-stroke-h:before{content:\"\"}.fa-neuter:before{content:\"\"}.fa-genderless:before{content:\"\"}.fa-facebook-official:before{content:\"\"}.fa-pinterest-p:before{content:\"\"}.fa-whatsapp:before{content:\"\"}.fa-server:before{content:\"\"}.fa-user-plus:before{content:\"\"}.fa-user-times:before{content:\"\"}.fa-bed:before,.fa-hotel:before{content:\"\"}.fa-viacoin:before{content:\"\"}.fa-train:before{content:\"\"}.fa-subway:before{content:\"\"}.fa-medium:before{content:\"\"}.fa-y-combinator:before,.fa-yc:before{content:\"\"}.fa-optin-monster:before{content:\"\"}.fa-opencart:before{content:\"\"}.fa-expeditedssl:before{content:\"\"}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:\"\"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:\"\"}.fa-battery-2:before,.fa-battery-half:before{content:\"\"}.fa-battery-1:before,.fa-battery-quarter:before{content:\"\"}.fa-battery-0:before,.fa-battery-empty:before{content:\"\"}.fa-mouse-pointer:before{content:\"\"}.fa-i-cursor:before{content:\"\"}.fa-object-group:before{content:\"\"}.fa-object-ungroup:before{content:\"\"}.fa-sticky-note:before{content:\"\"}.fa-sticky-note-o:before{content:\"\"}.fa-cc-jcb:before{content:\"\"}.fa-cc-diners-club:before{content:\"\"}.fa-clone:before{content:\"\"}.fa-balance-scale:before{content:\"\"}.fa-hourglass-o:before{content:\"\"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:\"\"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:\"\"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:\"\"}.fa-hourglass:before{content:\"\"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:\"\"}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:\"\"}.fa-hand-scissors-o:before{content:\"\"}.fa-hand-lizard-o:before{content:\"\"}.fa-hand-spock-o:before{content:\"\"}.fa-hand-pointer-o:before{content:\"\"}.fa-hand-peace-o:before{content:\"\"}.fa-trademark:before{content:\"\"}.fa-registered:before{content:\"\"}.fa-creative-commons:before{content:\"\"}.fa-gg:before{content:\"\"}.fa-gg-circle:before{content:\"\"}.fa-tripadvisor:before{content:\"\"}.fa-odnoklassniki:before{content:\"\"}.fa-odnoklassniki-square:before{content:\"\"}.fa-get-pocket:before{content:\"\"}.fa-wikipedia-w:before{content:\"\"}.fa-safari:before{content:\"\"}.fa-chrome:before{content:\"\"}.fa-firefox:before{content:\"\"}.fa-opera:before{content:\"\"}.fa-internet-explorer:before{content:\"\"}.fa-television:before,.fa-tv:before{content:\"\"}.fa-contao:before{content:\"\"}.fa-500px:before{content:\"\"}.fa-amazon:before{content:\"\"}.fa-calendar-plus-o:before{content:\"\"}.fa-calendar-minus-o:before{content:\"\"}.fa-calendar-times-o:before{content:\"\"}.fa-calendar-check-o:before{content:\"\"}.fa-industry:before{content:\"\"}.fa-map-pin:before{content:\"\"}.fa-map-signs:before{content:\"\"}.fa-map-o:before{content:\"\"}.fa-map:before{content:\"\"}.fa-commenting:before{content:\"\"}.fa-commenting-o:before{content:\"\"}.fa-houzz:before{content:\"\"}.fa-vimeo:before{content:\"\"}.fa-black-tie:before{content:\"\"}.fa-fonticons:before{content:\"\"}.fa-reddit-alien:before{content:\"\"}.fa-edge:before{content:\"\"}.fa-credit-card-alt:before{content:\"\"}.fa-codiepie:before{content:\"\"}.fa-modx:before{content:\"\"}.fa-fort-awesome:before{content:\"\"}.fa-usb:before{content:\"\"}.fa-product-hunt:before{content:\"\"}.fa-mixcloud:before{content:\"\"}.fa-scribd:before{content:\"\"}.fa-pause-circle:before{content:\"\"}.fa-pause-circle-o:before{content:\"\"}.fa-stop-circle:before{content:\"\"}.fa-stop-circle-o:before{content:\"\"}.fa-shopping-bag:before{content:\"\"}.fa-shopping-basket:before{content:\"\"}.fa-hashtag:before{content:\"\"}.fa-bluetooth:before{content:\"\"}.fa-bluetooth-b:before{content:\"\"}.fa-percent:before{content:\"\"}.fa-gitlab:before,.icon-gitlab:before{content:\"\"}.fa-wpbeginner:before{content:\"\"}.fa-wpforms:before{content:\"\"}.fa-envira:before{content:\"\"}.fa-universal-access:before{content:\"\"}.fa-wheelchair-alt:before{content:\"\"}.fa-question-circle-o:before{content:\"\"}.fa-blind:before{content:\"\"}.fa-audio-description:before{content:\"\"}.fa-volume-control-phone:before{content:\"\"}.fa-braille:before{content:\"\"}.fa-assistive-listening-systems:before{content:\"\"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:\"\"}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:\"\"}.fa-glide:before{content:\"\"}.fa-glide-g:before{content:\"\"}.fa-sign-language:before,.fa-signing:before{content:\"\"}.fa-low-vision:before{content:\"\"}.fa-viadeo:before{content:\"\"}.fa-viadeo-square:before{content:\"\"}.fa-snapchat:before{content:\"\"}.fa-snapchat-ghost:before{content:\"\"}.fa-snapchat-square:before{content:\"\"}.fa-pied-piper:before{content:\"\"}.fa-first-order:before{content:\"\"}.fa-yoast:before{content:\"\"}.fa-themeisle:before{content:\"\"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:\"\"}.fa-fa:before,.fa-font-awesome:before{content:\"\"}.fa-handshake-o:before{content:\"\"}.fa-envelope-open:before{content:\"\"}.fa-envelope-open-o:before{content:\"\"}.fa-linode:before{content:\"\"}.fa-address-book:before{content:\"\"}.fa-address-book-o:before{content:\"\"}.fa-address-card:before,.fa-vcard:before{content:\"\"}.fa-address-card-o:before,.fa-vcard-o:before{content:\"\"}.fa-user-circle:before{content:\"\"}.fa-user-circle-o:before{content:\"\"}.fa-user-o:before{content:\"\"}.fa-id-badge:before{content:\"\"}.fa-drivers-license:before,.fa-id-card:before{content:\"\"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:\"\"}.fa-quora:before{content:\"\"}.fa-free-code-camp:before{content:\"\"}.fa-telegram:before{content:\"\"}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:\"\"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:\"\"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:\"\"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:\"\"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:\"\"}.fa-shower:before{content:\"\"}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:\"\"}.fa-podcast:before{content:\"\"}.fa-window-maximize:before{content:\"\"}.fa-window-minimize:before{content:\"\"}.fa-window-restore:before{content:\"\"}.fa-times-rectangle:before,.fa-window-close:before{content:\"\"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:\"\"}.fa-bandcamp:before{content:\"\"}.fa-grav:before{content:\"\"}.fa-etsy:before{content:\"\"}.fa-imdb:before{content:\"\"}.fa-ravelry:before{content:\"\"}.fa-eercast:before{content:\"\"}.fa-microchip:before{content:\"\"}.fa-snowflake-o:before{content:\"\"}.fa-superpowers:before{content:\"\"}.fa-wpexplorer:before{content:\"\"}.fa-meetup:before{content:\"\"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:\"\"}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:\" \";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:\"\"}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:\" *\";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:\"\";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:\"\"}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.rst-content .wy-breadcrumbs li tt,.wy-breadcrumbs li .rst-content tt,.wy-breadcrumbs li code{padding:5px;border:none;background:none}.rst-content .wy-breadcrumbs li tt.literal,.wy-breadcrumbs li .rst-content tt.literal,.wy-breadcrumbs li code.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:\"\"}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:\"\"}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:\"\"}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:\"\"}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:\"\"}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:\"\\f08e\";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:\" : \"}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.field-list>dt:after,html.writer-html5 .rst-content dl.footnote>dt:after{content:\":\"}html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.footnote>dt>span.brackets{margin-right:.5rem}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:\"[\"}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:\"]\"}html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{font-style:italic}html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.footnote>dd p,html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{font-size:inherit;line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format(\"woff2\"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format(\"woff\");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format(\"woff2\"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format(\"woff\");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format(\"woff2\"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format(\"woff\");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format(\"woff2\"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format(\"woff\");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format(\"woff2\"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format(\"woff\");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format(\"woff2\"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format(\"woff\");font-display:block}"
  },
  {
    "path": "docs-aside/_static/custom.css",
    "content": "/* This file intentionally left blank. */\n"
  },
  {
    "path": "docs-aside/_static/doctools.js",
    "content": "/*\n * doctools.js\n * ~~~~~~~~~~~\n *\n * Sphinx JavaScript utilities for all documentation.\n *\n * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\n/**\n * select a different prefix for underscore\n */\n$u = _.noConflict();\n\n/**\n * make the code below compatible with browsers without\n * an installed firebug like debugger\nif (!window.console || !console.firebug) {\n  var names = [\"log\", \"debug\", \"info\", \"warn\", \"error\", \"assert\", \"dir\",\n    \"dirxml\", \"group\", \"groupEnd\", \"time\", \"timeEnd\", \"count\", \"trace\",\n    \"profile\", \"profileEnd\"];\n  window.console = {};\n  for (var i = 0; i < names.length; ++i)\n    window.console[names[i]] = function() {};\n}\n */\n\n/**\n * small helper function to urldecode strings\n */\njQuery.urldecode = function(x) {\n  return decodeURIComponent(x).replace(/\\+/g, ' ');\n};\n\n/**\n * small helper function to urlencode strings\n */\njQuery.urlencode = encodeURIComponent;\n\n/**\n * This function returns the parsed url parameters of the\n * current request. Multiple values per key are supported,\n * it will always return arrays of strings for the value parts.\n */\njQuery.getQueryParameters = function(s) {\n  if (typeof s === 'undefined')\n    s = document.location.search;\n  var parts = s.substr(s.indexOf('?') + 1).split('&');\n  var result = {};\n  for (var i = 0; i < parts.length; i++) {\n    var tmp = parts[i].split('=', 2);\n    var key = jQuery.urldecode(tmp[0]);\n    var value = jQuery.urldecode(tmp[1]);\n    if (key in result)\n      result[key].push(value);\n    else\n      result[key] = [value];\n  }\n  return result;\n};\n\n/**\n * highlight a given string on a jquery object by wrapping it in\n * span elements with the given class name.\n */\njQuery.fn.highlightText = function(text, className) {\n  function highlight(node, addItems) {\n    if (node.nodeType === 3) {\n      var val = node.nodeValue;\n      var pos = val.toLowerCase().indexOf(text);\n      if (pos >= 0 &&\n          !jQuery(node.parentNode).hasClass(className) &&\n          !jQuery(node.parentNode).hasClass(\"nohighlight\")) {\n        var span;\n        var isInSVG = jQuery(node).closest(\"body, svg, foreignObject\").is(\"svg\");\n        if (isInSVG) {\n          span = document.createElementNS(\"http://www.w3.org/2000/svg\", \"tspan\");\n        } else {\n          span = document.createElement(\"span\");\n          span.className = className;\n        }\n        span.appendChild(document.createTextNode(val.substr(pos, text.length)));\n        node.parentNode.insertBefore(span, node.parentNode.insertBefore(\n          document.createTextNode(val.substr(pos + text.length)),\n          node.nextSibling));\n        node.nodeValue = val.substr(0, pos);\n        if (isInSVG) {\n          var rect = document.createElementNS(\"http://www.w3.org/2000/svg\", \"rect\");\n          var bbox = node.parentElement.getBBox();\n          rect.x.baseVal.value = bbox.x;\n          rect.y.baseVal.value = bbox.y;\n          rect.width.baseVal.value = bbox.width;\n          rect.height.baseVal.value = bbox.height;\n          rect.setAttribute('class', className);\n          addItems.push({\n              \"parent\": node.parentNode,\n              \"target\": rect});\n        }\n      }\n    }\n    else if (!jQuery(node).is(\"button, select, textarea\")) {\n      jQuery.each(node.childNodes, function() {\n        highlight(this, addItems);\n      });\n    }\n  }\n  var addItems = [];\n  var result = this.each(function() {\n    highlight(this, addItems);\n  });\n  for (var i = 0; i < addItems.length; ++i) {\n    jQuery(addItems[i].parent).before(addItems[i].target);\n  }\n  return result;\n};\n\n/*\n * backward compatibility for jQuery.browser\n * This will be supported until firefox bug is fixed.\n */\nif (!jQuery.browser) {\n  jQuery.uaMatch = function(ua) {\n    ua = ua.toLowerCase();\n\n    var match = /(chrome)[ \\/]([\\w.]+)/.exec(ua) ||\n      /(webkit)[ \\/]([\\w.]+)/.exec(ua) ||\n      /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec(ua) ||\n      /(msie) ([\\w.]+)/.exec(ua) ||\n      ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec(ua) ||\n      [];\n\n    return {\n      browser: match[ 1 ] || \"\",\n      version: match[ 2 ] || \"0\"\n    };\n  };\n  jQuery.browser = {};\n  jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;\n}\n\n/**\n * Small JavaScript module for the documentation.\n */\nvar Documentation = {\n\n  init : function() {\n    this.fixFirefoxAnchorBug();\n    this.highlightSearchWords();\n    this.initIndexTable();\n    if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {\n      this.initOnKeyListeners();\n    }\n  },\n\n  /**\n   * i18n support\n   */\n  TRANSLATIONS : {},\n  PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },\n  LOCALE : 'unknown',\n\n  // gettext and ngettext don't access this so that the functions\n  // can safely bound to a different name (_ = Documentation.gettext)\n  gettext : function(string) {\n    var translated = Documentation.TRANSLATIONS[string];\n    if (typeof translated === 'undefined')\n      return string;\n    return (typeof translated === 'string') ? translated : translated[0];\n  },\n\n  ngettext : function(singular, plural, n) {\n    var translated = Documentation.TRANSLATIONS[singular];\n    if (typeof translated === 'undefined')\n      return (n == 1) ? singular : plural;\n    return translated[Documentation.PLURALEXPR(n)];\n  },\n\n  addTranslations : function(catalog) {\n    for (var key in catalog.messages)\n      this.TRANSLATIONS[key] = catalog.messages[key];\n    this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');\n    this.LOCALE = catalog.locale;\n  },\n\n  /**\n   * add context elements like header anchor links\n   */\n  addContextElements : function() {\n    $('div[id] > :header:first').each(function() {\n      $('<a class=\"headerlink\">\\u00B6</a>').\n      attr('href', '#' + this.id).\n      attr('title', _('Permalink to this headline')).\n      appendTo(this);\n    });\n    $('dt[id]').each(function() {\n      $('<a class=\"headerlink\">\\u00B6</a>').\n      attr('href', '#' + this.id).\n      attr('title', _('Permalink to this definition')).\n      appendTo(this);\n    });\n  },\n\n  /**\n   * workaround a firefox stupidity\n   * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075\n   */\n  fixFirefoxAnchorBug : function() {\n    if (document.location.hash && $.browser.mozilla)\n      window.setTimeout(function() {\n        document.location.href += '';\n      }, 10);\n  },\n\n  /**\n   * highlight the search words provided in the url in the text\n   */\n  highlightSearchWords : function() {\n    var params = $.getQueryParameters();\n    var terms = (params.highlight) ? params.highlight[0].split(/\\s+/) : [];\n    if (terms.length) {\n      var body = $('div.body');\n      if (!body.length) {\n        body = $('body');\n      }\n      window.setTimeout(function() {\n        $.each(terms, function() {\n          body.highlightText(this.toLowerCase(), 'highlighted');\n        });\n      }, 10);\n      $('<p class=\"highlight-link\"><a href=\"javascript:Documentation.' +\n        'hideSearchWords()\">' + _('Hide Search Matches') + '</a></p>')\n          .appendTo($('#searchbox'));\n    }\n  },\n\n  /**\n   * init the domain index toggle buttons\n   */\n  initIndexTable : function() {\n    var togglers = $('img.toggler').click(function() {\n      var src = $(this).attr('src');\n      var idnum = $(this).attr('id').substr(7);\n      $('tr.cg-' + idnum).toggle();\n      if (src.substr(-9) === 'minus.png')\n        $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');\n      else\n        $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');\n    }).css('display', '');\n    if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {\n        togglers.click();\n    }\n  },\n\n  /**\n   * helper function to hide the search marks again\n   */\n  hideSearchWords : function() {\n    $('#searchbox .highlight-link').fadeOut(300);\n    $('span.highlighted').removeClass('highlighted');\n  },\n\n  /**\n   * make the url absolute\n   */\n  makeURL : function(relativeURL) {\n    return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;\n  },\n\n  /**\n   * get the current relative url\n   */\n  getCurrentURL : function() {\n    var path = document.location.pathname;\n    var parts = path.split(/\\//);\n    $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\\//), function() {\n      if (this === '..')\n        parts.pop();\n    });\n    var url = parts.join('/');\n    return path.substring(url.lastIndexOf('/') + 1, path.length - 1);\n  },\n\n  initOnKeyListeners: function() {\n    $(document).keydown(function(event) {\n      var activeElementType = document.activeElement.tagName;\n      // don't navigate when in search box or textarea\n      if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'\n          && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {\n        switch (event.keyCode) {\n          case 37: // left\n            var prevHref = $('link[rel=\"prev\"]').prop('href');\n            if (prevHref) {\n              window.location.href = prevHref;\n              return false;\n            }\n          case 39: // right\n            var nextHref = $('link[rel=\"next\"]').prop('href');\n            if (nextHref) {\n              window.location.href = nextHref;\n              return false;\n            }\n        }\n      }\n    });\n  }\n};\n\n// quick alias for translations\n_ = Documentation.gettext;\n\n$(document).ready(function() {\n  Documentation.init();\n});\n"
  },
  {
    "path": "docs-aside/_static/documentation_options.js",
    "content": "var DOCUMENTATION_OPTIONS = {\n    URL_ROOT: document.getElementById(\"documentation_options\").getAttribute('data-url_root'),\n    VERSION: '0.7',\n    LANGUAGE: 'None',\n    COLLAPSE_INDEX: false,\n    BUILDER: 'html',\n    FILE_SUFFIX: '.html',\n    LINK_SUFFIX: '.html',\n    HAS_SOURCE: true,\n    SOURCELINK_SUFFIX: '.txt',\n    NAVIGATION_WITH_KEYS: false\n};"
  },
  {
    "path": "docs-aside/_static/graphviz.css",
    "content": "/*\n * graphviz.css\n * ~~~~~~~~~~~~\n *\n * Sphinx stylesheet -- graphviz extension.\n *\n * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\nimg.graphviz {\n    border: 0;\n    max-width: 100%;\n}\n\nobject.graphviz {\n    max-width: 100%;\n}\n"
  },
  {
    "path": "docs-aside/_static/jquery-3.4.1.js",
    "content": "/*!\n * jQuery JavaScript Library v3.4.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2019-05-01T21:04Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar document = window.document;\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar concat = arr.concat;\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n      // Support: Chrome <=57, Firefox <=52\n      // In some browsers, typeof returns \"function\" for HTML <object> elements\n      // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n      // We don't want to classify *any* DOM node as a function.\n      return typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n  };\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = \"3.4.1\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t},\n\n\t// Support: Android <=4.0 only\n\t// Make sure we trim BOM and NBSP\n\trtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a global context\n\tglobalEval: function( code, options ) {\n\t\tDOMEval( code, { nonce: options && options.nonce } );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// Support: Android <=4.0 only\n\ttrim: function( text ) {\n\t\treturn text == null ?\n\t\t\t\"\" :\n\t\t\t( text + \"\" ).replace( rtrim, \"\" );\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn concat.apply( [], ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( i, name ) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.4\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2019-04-08\n */\n(function( window ) {\n\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ({}).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpush_native = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\t// Use a stripped-down indexOf as it's faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[i] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier\n\tidentifier = \"(?:\\\\\\\\.|[\\\\w-]|[^\\0-\\\\xa0])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\t\t// \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace +\n\t\t\"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace +\n\t\t\t\"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace +\n\t\t\t\"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" +\n\t\t\twhitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\([\\\\da-f]{1,6}\" + whitespace + \"?|(\" + whitespace + \")|.)\", \"ig\" ),\n\tfunescape = function( _, escaped, escapedWhitespace ) {\n\t\tvar high = \"0x\" + escaped - 0x10000;\n\t\t// NaN means non-codepoint\n\t\t// Support: Firefox<24\n\t\t// Workaround erroneous numeric interpretation of +\"0x\"\n\t\treturn high !== high || escapedWhitespace ?\n\t\t\tescaped :\n\t\t\thigh < 0 ?\n\t\t\t\t// BMP codepoint\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === \"\\0\" ) {\n\t\t\t\treturn \"\\uFFFD\";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + \"\\\\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn \"\\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === \"fieldset\";\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t(arr = slice.call( preferredDoc.childNodes )),\n\t\tpreferredDoc.childNodes\n\t);\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpush_native.apply( target, slice.call(els) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( (target[j++] = els[i++]) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\n\t\tif ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {\n\t\t\tsetDocument( context );\n\t\t}\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( (m = match[1]) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( (elem = context.getElementById( m )) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && (elem = newContext.getElementById( m )) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[2] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( (m = match[3]) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t(!rbuggyQSA || !rbuggyQSA.test( selector )) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t(nodeType !== 1 || context.nodeName.toLowerCase() !== \"object\") ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 && rdescend.test( selector ) ) {\n\n\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\tif ( (nid = context.getAttribute( \"id\" )) ) {\n\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.setAttribute( \"id\", (nid = expando) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[i] = \"#\" + nid + \" \" + toSelector( groups[i] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn (cache[ key + \" \" ] = value);\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement(\"fieldset\");\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch (e) {\n\t\treturn false;\n\t} finally {\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split(\"|\"),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[i] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( (cur = cur.nextSibling) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn (name === \"input\" || name === \"button\") && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction(function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction(function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ (j = matchIndexes[i]) ] ) {\n\t\t\t\t\tseed[j] = !(matches[j] = seed[j]);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem.namespaceURI,\n\t\tdocElem = (elem.ownerDocument || elem).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\tif ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9-11, Edge\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\tif ( preferredDoc !== document &&\n\t\t(subWindow = document.defaultView) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert(function( el ) {\n\t\tel.className = \"i\";\n\t\treturn !el.getAttribute(\"className\");\n\t});\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert(function( el ) {\n\t\tel.appendChild( document.createComment(\"\") );\n\t\treturn !el.getElementsByTagName(\"*\").length;\n\t});\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert(function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t});\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[\"ID\"] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute(\"id\") === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[\"ID\"] =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode(\"id\");\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[\"ID\"] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode(\"id\");\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( (elem = elems[i++]) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode(\"id\");\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[\"TAG\"] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( (elem = results[i++]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[\"CLASS\"] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( (support.qsa = rnative.test( document.querySelectorAll )) ) {\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert(function( el ) {\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n\t\t\t\t\"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n\t\t\t\t\"<option selected=''></option></select>\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll(\"[msallowcapture^='']\").length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !el.querySelectorAll(\"[selected]\").length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push(\"~=\");\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll(\":checked\").length ) {\n\t\t\t\trbuggyQSA.push(\":checked\");\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push(\".#.+[+~]\");\n\t\t\t}\n\t\t});\n\n\t\tassert(function( el ) {\n\t\t\tel.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n\t\t\t\t\"<select disabled='disabled'><option/></select>\";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement(\"input\");\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll(\"[name=d]\").length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll(\":enabled\").length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll(\":disabled\").length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll(\"*,:x\");\n\t\t\trbuggyQSA.push(\",.*:\");\n\t\t});\n\t}\n\n\tif ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector) )) ) {\n\n\t\tassert(function( el ) {\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, \"*\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t});\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join(\"|\") );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join(\"|\") );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t));\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( (b = b.parentNode) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\tcompare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t(!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\tif ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\t\t\treturn a === document ? -1 :\n\t\t\t\tb === document ? 1 :\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( (cur = cur.parentNode) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[i] === bp[i] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[i], bp[i] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\tap[i] === preferredDoc ? -1 :\n\t\t\tbp[i] === preferredDoc ? 1 :\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\t\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t\t// fragment in IE 9\n\t\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\t// Set document vars if needed\n\tif ( ( context.ownerDocument || context ) !== document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\t// Set document vars if needed\n\tif ( ( elem.ownerDocument || elem ) !== document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t(val = elem.getAttributeNode(name)) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn (sel + \"\").replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( (elem = results[i++]) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( (node = elem[i++]) ) {\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[1] = match[1].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[3] = ( match[3] || match[4] || match[5] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[2] === \"~=\" ) {\n\t\t\t\tmatch[3] = \" \" + match[3] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[1] = match[1].toLowerCase();\n\n\t\t\tif ( match[1].slice( 0, 3 ) === \"nth\" ) {\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[3] ) {\n\t\t\t\t\tSizzle.error( match[0] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === \"even\" || match[3] === \"odd\" ) );\n\t\t\t\tmatch[5] = +( ( match[7] + match[8] ) || match[3] === \"odd\" );\n\n\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[3] ) {\n\t\t\t\tSizzle.error( match[0] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[6] && match[2];\n\n\t\t\tif ( matchExpr[\"CHILD\"].test( match[0] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[3] ) {\n\t\t\t\tmatch[2] = match[4] || match[5] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t(excess = tokenize( unquoted, true )) &&\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t(excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[0] = match[0].slice( 0, excess );\n\t\t\t\tmatch[2] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() { return true; } :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t(pattern = new RegExp( \"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\" )) &&\n\t\t\t\tclassCache( className, function( elem ) {\n\t\t\t\t\treturn pattern.test( typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\" );\n\t\t\t\t});\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( (node = node[ dir ]) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( (node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t(diff = nodeIndex = 0) || start.pop()) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] || (node[ expando ] = {});\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t(outerCache[ node.uniqueID ] = {});\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction(function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[i] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction(function( selector ) {\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction(function( seed, matches, context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = unmatched[i]) ) {\n\t\t\t\t\t\t\tseed[i] = !(matches[i] = elem);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}) :\n\t\t\t\tfunction( elem, context, xml ) {\n\t\t\t\t\tinput[0] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[0] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t}),\n\n\t\t\"has\": markFunction(function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t}),\n\n\t\t\"contains\": markFunction(function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t}),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test(lang || \"\") ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( (elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( (elem = elem.parentNode) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t}),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": createDisabledPseudo( false ),\n\t\t\"disabled\": createDisabledPseudo( true ),\n\n\t\t\"checked\": function( elem ) {\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn (nodeName === \"input\" && !!elem.checked) || (nodeName === \"option\" && !!elem.selected);\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t//   but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[\"empty\"]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo(function() {\n\t\t\treturn [ 0 ];\n\t\t}),\n\n\t\t\"last\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t}),\n\n\t\t\"eq\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t}),\n\n\t\t\"even\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"odd\": createPositionalPseudo(function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"lt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ?\n\t\t\t\targument + length :\n\t\t\t\targument > length ?\n\t\t\t\t\tlength :\n\t\t\t\t\targument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t}),\n\n\t\t\"gt\": createPositionalPseudo(function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t})\n\t}\n};\n\nExpr.pseudos[\"nth\"] = Expr.pseudos[\"eq\"];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || (match = rcomma.exec( soFar )) ) {\n\t\t\tif ( match ) {\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[0].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( (tokens = []) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( (match = rcombinators.exec( soFar )) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push({\n\t\t\t\tvalue: matched,\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[0].replace( rtrim, \" \" )\n\t\t\t});\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||\n\t\t\t\t(match = preFilters[ type ]( match ))) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push({\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t});\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[i].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( (elem = elem[ dir ]) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || (elem[ expando ] = {});\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( (oldCache = uniqueCache[ key ]) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn (newCache[ 2 ] = oldCache[ 2 ]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[i]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[0];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[i], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (elem = unmatched[i]) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction(function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts( selector || \"*\", context.nodeType ? [ context ] : context, [] ),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( (elem = temp[i]) ) {\n\t\t\t\t\tmatcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( (elem = matcherOut[i]) ) {\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( (matcherIn[i] = elem) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, (matcherOut = []), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( (elem = matcherOut[i]) &&\n\t\t\t\t\t\t(temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {\n\n\t\t\t\t\t\tseed[temp] = !(results[temp] = elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t});\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[0].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[\" \"],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t(checkContext = context).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( (matcher = Expr.relative[ tokens[i].type ]) ) {\n\t\t\tmatchers = [ addCombinator(elementMatcher( matchers ), matcher) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[j].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\t\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\t\ttokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" })\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( (tokens = tokens.slice( j )) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[\"TAG\"]( \"*\", outermost ),\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\t\t\t\toutermostContext = context === document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && (elem = elems[i]) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\tif ( !context && elem.ownerDocument !== document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( (matcher = elementMatchers[j++]) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( (elem = !matcher && elem) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( (matcher = setMatchers[j++]) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !(unmatched[i] || setMatched[i]) ) {\n\t\t\t\t\t\t\t\tsetMatched[i] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[i] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( (selector = compiled.selector || selector) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[0] = match[0].slice( 0 );\n\t\tif ( tokens.length > 2 && (token = tokens[0]).type === \"ID\" &&\n\t\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {\n\n\t\t\tcontext = ( Expr.find[\"ID\"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[\"needsContext\"].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[i];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ (type = token.type) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( (find = Expr.find[ type ]) ) {\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( (seed = find(\n\t\t\t\t\ttoken.matches[0].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context\n\t\t\t\t)) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split(\"\").sort( sortOrder ).join(\"\") === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert(function( el ) {\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement(\"fieldset\") ) & 1;\n});\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert(function( el ) {\n\tel.innerHTML = \"<a href='#'></a>\";\n\treturn el.firstChild.getAttribute(\"href\") === \"#\" ;\n}) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert(function( el ) {\n\tel.innerHTML = \"<input/>\";\n\tel.firstChild.setAttribute( \"value\", \"\" );\n\treturn el.firstChild.getAttribute( \"value\" ) === \"\";\n}) ) {\n\taddHandle( \"value\", function( elem, name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t});\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert(function( el ) {\n\treturn el.getAttribute(\"disabled\") == null;\n}) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t\t(val = elem.getAttributeNode( name )) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\tnull;\n\t\t}\n\t});\n}\n\nreturn Sizzle;\n\n})( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n  return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n};\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( typeof elem.contentDocument !== \"undefined\" ) {\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the master Deferred\n\t\t\tmaster = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tmaster.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( master.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn master.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n\t\t}\n\n\t\treturn master.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\tvalue :\n\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (#9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\nvar swap = function( elem, options, callback, args ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.apply( elem, args || [] );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// Support: IE <=9 only\n\toption: [ 1, \"<select multiple='multiple'>\", \"</select>\" ],\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\n// Support: IE <=9 only\nwrapMap.optgroup = wrapMap.option;\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n} )();\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 - 11+\n// focus() and blur() are asynchronous, except when they are no-op.\n// So expect focus to be synchronous when the element is already active,\n// and blur to be synchronous when the element is not already active.\n// (focus and blur are always synchronous in other supported browsers,\n// this just defines when we can count on it).\nfunction expectSync( elem, type ) {\n\treturn ( elem === safeActiveElement() ) === ( type === \"focus\" );\n}\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Don't attach events to noData or text/comment nodes (but allow plain objects)\n\t\tif ( !elemData ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = {};\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\t// Make a writable jQuery.Event from the native event object\n\t\tvar event = jQuery.event.fix( nativeEvent );\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\t\t\thandlers = ( dataPriv.get( this, \"events\" ) || {} )[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", returnTrue );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, expectSync ) {\n\n\t// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !expectSync ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar notAsync, result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\t// Saved data should be false in such cases, but might be a leftover capture object\n\t\t\t\t// from an async native handler (gh-4350)\n\t\t\t\tif ( !saved.length ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t// focus() and blur() are asynchronous\n\t\t\t\t\tnotAsync = expectSync( this, type );\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tif ( saved !== result || notAsync ) {\n\t\t\t\t\t\tdataPriv.set( this, type, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t}\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn result.value;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering the\n\t\t\t\t// native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved.length ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, {\n\t\t\t\t\tvalue: jQuery.event.trigger(\n\n\t\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t\t// Extend with the prototype to reset the above stopImmediatePropagation()\n\t\t\t\t\t\tjQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\n\t\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\t\tthis\n\t\t\t\t\t)\n\t\t\t\t} );\n\n\t\t\t\t// Abort handling of the native event\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (#504, #13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\n\twhich: function( event ) {\n\t\tvar button = event.button;\n\n\t\t// Add which for key events\n\t\tif ( event.which == null && rkeyEvent.test( event.type ) ) {\n\t\t\treturn event.charCode != null ? event.charCode : event.keyCode;\n\t\t}\n\n\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\tif ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n\t\t\tif ( button & 1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif ( button & 2 ) {\n\t\t\t\treturn 3;\n\t\t\t}\n\n\t\t\tif ( button & 4 ) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn event.which;\n\t}\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, expectSync );\n\n\t\t\t// Return false to allow normal processing in the caller\n\t\t\treturn false;\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t/* eslint-disable max-len */\n\n\t// See https://github.com/eslint/eslint/issues/3229\n\trxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)[^>]*)\\/>/gi,\n\n\t/* eslint-enable */\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.access( src );\n\t\tpdataCur = dataPriv.set( dest, pdataOld );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdelete pdataCur.handle;\n\t\t\tpdataCur.events = {};\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = concat.apply( [], args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase()  !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html.replace( rxhtmlTag, \"<$1></$2>\" );\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t//   .css('filter') (IE 9 only, #12537)\n\t//   .css('--customProperty) (#3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trcustomProp = /^--/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === \"margin\" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t// This happens for inline elements with no explicit setting (gh-3571)\n\t// Support: Android <=4.1 - 4.3 only\n\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t// Support: IE 9-11 only\n\t// Also use offsetWidth/offsetHeight for when box sizing is unreliable\n\t// We use getClientRects() to check for hidden/disconnected.\n\t// In those cases, the computed value can be trusted to be border-box\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\t\tval === \"auto\" ||\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"animationIterationCount\": true,\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"gridArea\": true,\n\t\t\"gridColumn\": true,\n\t\t\"gridColumnEnd\": true,\n\t\t\"gridColumnStart\": true,\n\t\t\"gridRow\": true,\n\t\t\"gridRowEnd\": true,\n\t\t\"gridRowStart\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t\t} ) :\n\t\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue && type !== false ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\t// Use proper attribute retrieval(#12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar className, i, self, classNames;\n\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\ti = 0;\n\t\t\t\tself = jQuery( this );\n\t\t\t\tclassNames = classesToArray( value );\n\n\t\t\t\twhile ( ( className = classNames[ i++ ] ) ) {\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( dataPriv.get( cur, \"events\" ) || {} )[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\t\t\t\tvar doc = this.ownerDocument || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = Date.now();\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {\n\t\txml = undefined;\n\t}\n\n\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\tjQuery.error( \"Invalid XML: \" + data );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} )\n\t\t.filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} )\n\t\t.map( function( i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\toriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce++ ) + uncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\n\njQuery._evalUrl = function( url, options ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (#11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\"  ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( \"load error\", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\n// Attach a bunch of functions for handling common AJAX events\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t//    documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name },\n\t\tfunction( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( ( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( i, name ) {\n\n\t// Handle event binding\n\tjQuery.fn[ name ] = function( data, fn ) {\n\t\treturn arguments.length > 0 ?\n\t\t\tthis.on( name, null, data, fn ) :\n\t\t\tthis.trigger( name );\n\t};\n} );\n\njQuery.fn.extend( {\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t}\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t}\n} );\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n\tdefine( \"jquery\", [], function() {\n\t\treturn jQuery;\n\t} );\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( !noGlobal ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n"
  },
  {
    "path": "docs-aside/_static/jquery-3.5.1.js",
    "content": "/*!\n * jQuery JavaScript Library v3.5.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2020-05-04T22:49Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n      // Support: Chrome <=57, Firefox <=52\n      // In some browsers, typeof returns \"function\" for HTML <object> elements\n      // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n      // We don't want to classify *any* DOM node as a function.\n      return typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n  };\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( \"script\" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don't support the \"nonce\" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + \"\";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === \"object\" || typeof obj === \"function\" ?\n\t\tclass2type[ toString.call( obj ) ] || \"object\" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = \"3.5.1\",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor 'enhanced'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array's method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === \"boolean\" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== \"object\" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === \"__proto__\" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don't bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: \"jQuery\" + ( version + Math.random() ).replace( /\\D/g, \"\" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== \"[object Object]\" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, \"constructor\" ) && proto.constructor;\n\t\treturn typeof Ctor === \"function\" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === \"string\" ?\n\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === \"function\" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( \"Boolean Number String Function Array Date RegExp Object Error Symbol\".split( \" \" ),\nfunction( _i, name ) {\n\tclass2type[ \"[object \" + name + \"]\" ] = name.toLowerCase();\n} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn't used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && \"length\" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === \"array\" || length === 0 ||\n\t\ttypeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.5\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2020-03-14\n */\n( function( window ) {\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = \"sizzle\" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ( {} ).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpushNative = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\n\t// Use a stripped-down indexOf as it's faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[ i ] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|\" +\n\t\t\"ismap|loop|multiple|open|readonly|required|scoped\",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace +\n\t\t\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t\"*([*^$|!~]?=)\" + whitespace +\n\n\t\t// \"Attribute values must be CSS identifiers [capture 5]\n\t\t// or strings [capture 3 or capture 4]\"\n\t\t\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" +\n\t\twhitespace + \"*\\\\]\",\n\n\tpseudos = \":(\" + identifier + \")(?:\\\\((\" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t\"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n\n\t\t// 2. simple (capture 6)\n\t\t\"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n\n\t\t// 3. anything else (capture 2)\n\t\t\".*\" +\n\t\t\")\\\\)|)\",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + \"+\", \"g\" ),\n\trtrim = new RegExp( \"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" +\n\t\twhitespace + \"+$\", \"g\" ),\n\n\trcomma = new RegExp( \"^\" + whitespace + \"*,\" + whitespace + \"*\" ),\n\trcombinators = new RegExp( \"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace +\n\t\t\"*\" ),\n\trdescend = new RegExp( whitespace + \"|>\" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( \"^\" + identifier + \"$\" ),\n\n\tmatchExpr = {\n\t\t\"ID\": new RegExp( \"^#(\" + identifier + \")\" ),\n\t\t\"CLASS\": new RegExp( \"^\\\\.(\" + identifier + \")\" ),\n\t\t\"TAG\": new RegExp( \"^(\" + identifier + \"|[*])\" ),\n\t\t\"ATTR\": new RegExp( \"^\" + attributes ),\n\t\t\"PSEUDO\": new RegExp( \"^\" + pseudos ),\n\t\t\"CHILD\": new RegExp( \"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" +\n\t\t\twhitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" +\n\t\t\twhitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\" ),\n\t\t\"bool\": new RegExp( \"^(?:\" + booleans + \")$\", \"i\" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t\"needsContext\": new RegExp( \"^\" + whitespace +\n\t\t\t\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace +\n\t\t\t\"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( \"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = \"0x\" + escape.slice( 1 ) - 0x10000;\n\n\t\treturn nonHex ?\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\tnonHex :\n\n\t\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t\t// Support: IE <=11+\n\t\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t\t// surrogate pair\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === \"\\0\" ) {\n\t\t\t\treturn \"\\uFFFD\";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + \"\\\\\" +\n\t\t\t\tch.charCodeAt( ch.length - 1 ).toString( 16 ) + \" \";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn \"\\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a \"Permission Denied\"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === \"fieldset\";\n\t\t},\n\t\t{ dir: \"parentNode\", next: \"legend\" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\n\t\t\t// Can't trust NodeList.length\n\t\t\twhile ( ( target[ j++ ] = els[ i++ ] ) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== \"string\" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don't exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + \" \" ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t( nodeType !== 1 || context.nodeName.toLowerCase() !== \"object\" ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we're not changing the context.\n\t\t\t\t\tif ( newContext !== context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( \"id\" ) ) ) {\n\t\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( \"id\", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? \"#\" + nid : \":scope\" ) + \" \" +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( \",\" );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( \"id\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, \"$1\" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + \" \") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + \" \" ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + \" \" ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( \"fieldset\" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split( \"|\" ),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[ i ] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( ( cur = cur.nextSibling ) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === \"input\" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn ( name === \"input\" || name === \"button\" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( \"form\" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t//   https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a \"form\" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( \"label\" in elem ) {\n\t\t\t\t\tif ( \"label\" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can't be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( \"label\" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== \"undefined\" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem.namespaceURI,\n\t\tdocElem = ( elem.ownerDocument || elem ).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || \"HTML\" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws \"permission denied\" errors (jQuery #13936)\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( preferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( \"unload\", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( \"onunload\", unloadHandler );\n\t\t}\n\t}\n\n\t// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\n\t// Safari 4 - 5 only, Opera <=11.6 - 12.x only\n\t// IE/Edge & older browsers don't support the :scope pseudo-class.\n\t// Support: Safari 6.0 only\n\t// Safari 6.0 supports :scope but it's an alias of :root there.\n\tsupport.scope = assert( function( el ) {\n\t\tdocElem.appendChild( el ).appendChild( document.createElement( \"div\" ) );\n\t\treturn typeof el.querySelectorAll !== \"undefined\" &&\n\t\t\t!el.querySelectorAll( \":scope fieldset div\" ).length;\n\t} );\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert( function( el ) {\n\t\tel.className = \"i\";\n\t\treturn !el.getAttribute( \"className\" );\n\t} );\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName(\"*\") returns only elements\n\tsupport.getElementsByTagName = assert( function( el ) {\n\t\tel.appendChild( document.createComment( \"\" ) );\n\t\treturn !el.getElementsByTagName( \"*\" ).length;\n\t} );\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don't pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[ \"ID\" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( \"id\" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[ \"ID\" ] =  function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== \"undefined\" &&\n\t\t\t\t\telem.getAttributeNode( \"id\" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[ \"ID\" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== \"undefined\" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( \"id\" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[ \"TAG\" ] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don't have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === \"*\" ) {\n\t\t\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[ \"CLASS\" ] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {\n\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert( function( el ) {\n\n\t\t\tvar input;\n\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE's treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = \"<a id='\" + expando + \"'></a>\" +\n\t\t\t\t\"<select id='\" + expando + \"-\\r\\\\' msallowcapture=''>\" +\n\t\t\t\t\"<option selected=''></option></select>\";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but \"safe\" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll( \"[msallowcapture^='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"[*^$]=\" + whitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and \"value\" are not treated correctly\n\t\t\tif ( !el.querySelectorAll( \"[selected]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( \"[id~=\" + expando + \"-]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"~=\" );\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t\t// IE 11/Edge don't find elements on a `[name='']` query in some cases.\n\t\t\t// Adding a temporary attribute to the document before the selection works\n\t\t\t// around the issue.\n\t\t\t// Interestingly, IE 10 & older don't seem to have the issue.\n\t\t\tinput = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"name\", \"\" );\n\t\t\tel.appendChild( input );\n\t\t\tif ( !el.querySelectorAll( \"[name='']\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" +\n\t\t\t\t\twhitespace + \"*(?:''|\\\"\\\")\" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll( \":checked\" ).length ) {\n\t\t\t\trbuggyQSA.push( \":checked\" );\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( \"a#\" + expando + \"+*\" ).length ) {\n\t\t\t\trbuggyQSA.push( \".#.+[+~]\" );\n\t\t\t}\n\n\t\t\t// Support: Firefox <=3.6 - 5 only\n\t\t\t// Old Firefox doesn't throw on a badly-escaped identifier.\n\t\t\tel.querySelectorAll( \"\\\\\\f\" );\n\t\t\trbuggyQSA.push( \"[\\\\r\\\\n\\\\f]\" );\n\t\t} );\n\n\t\tassert( function( el ) {\n\t\t\tel.innerHTML = \"<a href='' disabled='disabled'></a>\" +\n\t\t\t\t\"<select disabled='disabled'><option/></select>\";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement( \"input\" );\n\t\t\tinput.setAttribute( \"type\", \"hidden\" );\n\t\t\tel.appendChild( input ).setAttribute( \"name\", \"D\" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll( \"[name=d]\" ).length ) {\n\t\t\t\trbuggyQSA.push( \"name\" + whitespace + \"*[*^$|!~]?=\" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll( \":enabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE's :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll( \":disabled\" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( \":enabled\", \":disabled\" );\n\t\t\t}\n\n\t\t\t// Support: Opera 10 - 11 only\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll( \"*,:x\" );\n\t\t\trbuggyQSA.push( \",.*:\" );\n\t\t} );\n\t}\n\n\tif ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector ) ) ) ) {\n\n\t\tassert( function( el ) {\n\n\t\t\t// Check to see if it's possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, \"*\" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, \"[s!='']:x\" );\n\t\t\trbuggyMatches.push( \"!=\", pseudos );\n\t\t} );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( \"|\" ) );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( \"|\" ) );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t) );\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( ( b = b.parentNode ) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a == document || a.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b == document || b.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\treturn a == document ? -1 :\n\t\t\t\tb == document ? 1 :\n\t\t\t\t/* eslint-enable eqeqeq */\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[ i ] === bp[ i ] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[ i ], bp[ i ] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\tap[ i ] == preferredDoc ? -1 :\n\t\t\tbp[ i ] == preferredDoc ? 1 :\n\t\t\t/* eslint-enable eqeqeq */\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + \" \" ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA     || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9's matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t// fragment in IE 9\n\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don't get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn ( sel + \"\" ).replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( \"Syntax error, unrecognized expression: \" + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = \"\",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === \"string\" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t\">\": { dir: \"parentNode\", first: true },\n\t\t\" \": { dir: \"parentNode\" },\n\t\t\"+\": { dir: \"previousSibling\", first: true },\n\t\t\"~\": { dir: \"previousSibling\" }\n\t},\n\n\tpreFilter: {\n\t\t\"ATTR\": function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] ||\n\t\t\t\tmatch[ 5 ] || \"\" ).replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === \"~=\" ) {\n\t\t\t\tmatch[ 3 ] = \" \" + match[ 3 ] + \" \";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t\"CHILD\": function( match ) {\n\n\t\t\t/* matches from matchExpr[\"CHILD\"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === \"nth\" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === \"even\" || match[ 3 ] === \"odd\" ) );\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === \"odd\" );\n\n\t\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t\"PSEUDO\": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr[ \"CHILD\" ].test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || \"\";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( \")\", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t\"TAG\": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === \"*\" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t\"CLASS\": function( className ) {\n\t\t\tvar pattern = classCache[ className + \" \" ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( \"(^|\" + whitespace +\n\t\t\t\t\t\")\" + className + \"(\" + whitespace + \"|$)\" ) ) && classCache(\n\t\t\t\t\t\tclassName, function( elem ) {\n\t\t\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\t\t\ttypeof elem.className === \"string\" && elem.className ||\n\t\t\t\t\t\t\t\ttypeof elem.getAttribute !== \"undefined\" &&\n\t\t\t\t\t\t\t\t\telem.getAttribute( \"class\" ) ||\n\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\t\"ATTR\": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === \"!=\";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += \"\";\n\n\t\t\t\t/* eslint-disable max-len */\n\n\t\t\t\treturn operator === \"=\" ? result === check :\n\t\t\t\t\toperator === \"!=\" ? result !== check :\n\t\t\t\t\toperator === \"^=\" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === \"*=\" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"$=\" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === \"~=\" ? ( \" \" + result.replace( rwhitespace, \" \" ) + \" \" ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === \"|=\" ? result === check || result.slice( 0, check.length + 1 ) === check + \"-\" :\n\t\t\t\t\tfalse;\n\t\t\t\t/* eslint-enable max-len */\n\n\t\t\t};\n\t\t},\n\n\t\t\"CHILD\": function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== \"nth\",\n\t\t\t\tforward = type.slice( -4 ) !== \"last\",\n\t\t\t\tofType = what === \"of-type\";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven't yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === \"only\" && !start && \"nextSibling\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t\"PSEUDO\": function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( \"unsupported pseudo: \" + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, \"\", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\t\"not\": markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, \"$1\" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don't keep the element (issue #299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\t\"has\": markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\t\"contains\": markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// \"Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element's language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by \"-\".\n\t\t// The matching of C against the element's language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name.\"\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t\"lang\": markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || \"\" ) ) {\n\t\t\t\tSizzle.error( \"unsupported lang: \" + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( \"xml:lang\" ) || elem.getAttribute( \"lang\" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + \"-\" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\t\"target\": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t\"root\": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t\"focus\": function( elem ) {\n\t\t\treturn elem === document.activeElement &&\n\t\t\t\t( !document.hasFocus || document.hasFocus() ) &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\t\"enabled\": createDisabledPseudo( false ),\n\t\t\"disabled\": createDisabledPseudo( true ),\n\n\t\t\"checked\": function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn ( nodeName === \"input\" && !!elem.checked ) ||\n\t\t\t\t( nodeName === \"option\" && !!elem.selected );\n\t\t},\n\n\t\t\"selected\": function( elem ) {\n\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t\"empty\": function( elem ) {\n\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t//   but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t\"parent\": function( elem ) {\n\t\t\treturn !Expr.pseudos[ \"empty\" ]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t\"header\": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t\"input\": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t\"button\": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === \"input\" && elem.type === \"button\" || name === \"button\";\n\t\t},\n\n\t\t\"text\": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === \"input\" &&\n\t\t\t\telem.type === \"text\" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., \"search\") appear with elem.type === \"text\"\n\t\t\t\t( ( attr = elem.getAttribute( \"type\" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === \"text\" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t\"first\": createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\t\"last\": createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\t\"eq\": createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\t\"even\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"odd\": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"lt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ?\n\t\t\t\targument + length :\n\t\t\t\targument > length ?\n\t\t\t\t\tlength :\n\t\t\t\t\targument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t\"gt\": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos[ \"nth\" ] = Expr.pseudos[ \"eq\" ];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + \" \" ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don't consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rcombinators.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrim, \" \" )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we're just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = \"\";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === \"parentNode\",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] ||\n\t\t\t\t\t\t\t( outerCache[ elem.uniqueID ] = {} );\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = uniqueCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we're done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts(\n\t\t\t\tselector || \"*\",\n\t\t\t\tcontext.nodeType ? [ context ] : context,\n\t\t\t\t[]\n\t\t\t),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ \" \" ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\ttokens\n\t\t\t\t\t\t.slice( 0, i - 1 )\n\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === \" \" ? \"*\" : \"\" } )\n\t\t\t\t\t).replace( rtrim, \"$1\" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = \"0\",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[ \"TAG\" ]( \"*\", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: \"length\"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + \" \" ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache(\n\t\t\tselector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers )\n\t\t);\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle's compiled\n *  selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n *  selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === \"function\" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === \"ID\" &&\n\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find[ \"ID\" ]( token.matches[ 0 ]\n\t\t\t\t.replace( runescape, funescape ), context ) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[ \"needsContext\" ].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split( \"\" ).sort( sortOrder ).join( \"\" ) === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren't passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( \"fieldset\" ) ) & 1;\n} );\n\n// Support: IE<8\n// Prevent attribute/property \"interpolation\"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert( function( el ) {\n\tel.innerHTML = \"<a href='#'></a>\";\n\treturn el.firstChild.getAttribute( \"href\" ) === \"#\";\n} ) ) {\n\taddHandle( \"type|href|height|width\", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === \"type\" ? 1 : 2 );\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute(\"value\")\nif ( !support.attributes || !assert( function( el ) {\n\tel.innerHTML = \"<input/>\";\n\tel.firstChild.setAttribute( \"value\", \"\" );\n\treturn el.firstChild.getAttribute( \"value\" ) === \"\";\n} ) ) {\n\taddHandle( \"value\", function( elem, _name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === \"input\" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert( function( el ) {\n\treturn el.getAttribute( \"disabled\" ) == null;\n} ) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\t\tnull;\n\t\t}\n\t} );\n}\n\nreturn Sizzle;\n\n} )( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ \":\" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n  return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n};\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== \"string\" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = \":not(\" + expr + \")\";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== \"string\" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n\t\t\ttypeof selector === \"string\" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\n\t// Strict HTML recognition (#11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(\"\"), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === \"string\" ) {\n\t\t\tif ( selector[ 0 ] === \"<\" &&\n\t\t\t\tselector[ selector.length - 1 ] === \">\" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== \"string\" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there's no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don't pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === \"string\" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, \"parentNode\" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"parentNode\", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, \"nextSibling\" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, \"previousSibling\" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, \"nextSibling\" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, \"previousSibling\" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"nextSibling\", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, \"previousSibling\", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// <object> elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don't support it.\n\t\tif ( nodeName( elem, \"template\" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== \"Until\" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === \"string\" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === \"string\" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn't re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we're done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we're done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== \"string\" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = \"\";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = \"\";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks( \"memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"memory\" ), 2 ],\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 0, \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks( \"once memory\" ),\n\t\t\t\t\tjQuery.Callbacks( \"once memory\" ), 1, \"rejected\" ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t\"catch\": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( \"Thenable self-resolution\" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === \"object\" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === \"function\" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it's otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = \"resolved\" (i.e., fulfilled)\n\t\t\t\t\t\t// state = \"rejected\"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + \"With\" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + \"With\" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the master Deferred\n\t\t\tmaster = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tmaster.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( master.state() === \"pending\" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn master.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), master.reject );\n\t\t}\n\n\t\treturn master.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( \"jQuery.Deferred exception: \" + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See #6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we're already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( \"DOMContentLoaded\", completed );\n\twindow.removeEventListener( \"load\", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals \"interactive\" too soon\nif ( document.readyState === \"complete\" ||\n\t( document.readyState !== \"loading\" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( \"DOMContentLoaded\", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( \"load\", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it's a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === \"object\" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\tvalue :\n\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (#9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, \"ms-\" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t//  - Node\n\t//    - Node.ELEMENT_NODE\n\t//    - Node.DOCUMENT_NODE\n\t//  - Object\n\t//    - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see #8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === \"string\" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t//   1. No key was specified\n\t\t//   2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the \"read\" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t//   1. The entire cache object\n\t\t//   2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === \"string\" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t//   1. An object of properties\n\t\t//   2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the \"set\" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there's no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module's maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n//\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === \"true\" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === \"false\" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === \"null\" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn't change the string\n\tif ( data === +data + \"\" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = \"data-\" + key.replace( rmultiDash, \"-$&\" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === \"string\" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn't changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, \"hasDataAttrs\" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (#14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( \"data-\" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, \"hasDataAttrs\", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === \"object\" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to \"discover\" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn't exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || \"fx\" ) + \"queue\";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || \"fx\";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === \"inprogress\" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === \"fx\" ) {\n\t\t\t\tqueue.unshift( \"inprogress\" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + \"queueHooks\";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( \"once memory\" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + \"queue\", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tdata = type;\n\t\t\ttype = \"fx\";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === \"fx\" && queue[ 0 ] !== \"inprogress\" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || \"fx\", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || \"fx\";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + \"queueHooks\" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( \"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\" );\n\n\nvar cssExpand = [ \"Top\", \"Right\", \"Bottom\", \"Left\" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === \"none\" ||\n\t\t\telem.style.display === \"\" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, \"display\" ) === \"none\";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, \"\" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== \"px\" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, \"display\" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === \"none\" ) {\n\t\tdisplay = \"block\";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === \"none\" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, \"display\" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === \"\" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== \"none\" ) {\n\t\t\t\tvalues[ index ] = \"none\";\n\n\t\t\t\t// Remember what we're overwriting\n\t\t\t\tdataPriv.set( elem, \"display\", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === \"boolean\" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( \"div\" ) ),\n\t\tinput = document.createElement( \"input\" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (#11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (#14901)\n\tinput.setAttribute( \"type\", \"radio\" );\n\tinput.setAttribute( \"checked\", \"checked\" );\n\tinput.setAttribute( \"name\", \"t\" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn't clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = \"<textarea>x</textarea>\";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces <option> tags with their contents when inserted outside of\n\t// the select element.\n\tdiv.innerHTML = \"<option></option>\";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (#13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, \"<table>\", \"</table>\" ],\n\tcol: [ 2, \"<table><colgroup>\", \"</colgroup></table>\" ],\n\ttr: [ 2, \"<table><tbody>\", \"</tbody></table>\" ],\n\ttd: [ 3, \"<table><tbody><tr>\", \"</tr></tbody></table>\" ],\n\n\t_default: [ 0, \"\", \"\" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, \"<select multiple='multiple'>\", \"</select>\" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (#15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== \"undefined\" ) {\n\t\tret = context.getElementsByTagName( tag || \"*\" );\n\n\t} else if ( typeof context.querySelectorAll !== \"undefined\" ) {\n\t\tret = context.querySelectorAll( tag || \"*\" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t\"globalEval\",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], \"globalEval\" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === \"object\" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( \"div\" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ \"\", \"\" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (#12392)\n\t\t\t\ttmp.textContent = \"\";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = \"\";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), \"script\" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || \"\" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar\n\trkeyEvent = /^key/,\n\trmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,\n\trtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 - 11+\n// focus() and blur() are asynchronous, except when they are no-op.\n// So expect focus to be synchronous when the element is already active,\n// and blur to be synchronous when the element is not already active.\n// (focus and blur are always synchronous in other supported browsers,\n// this just defines when we can count on it).\nfunction expectSync( elem, type ) {\n\treturn ( elem === safeActiveElement() ) === ( type === \"focus\" );\n}\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === \"object\" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== \"string\" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === \"string\" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element's event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( \".\" )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we're the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element's handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || \"\" ).match( rnothtmlwhite ) || [ \"\" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || \"\" ).split( \".\" ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === \"**\" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it's no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, \"handle events\" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\t\tdataPriv.get( this, \"events\" ) || Object.create( null )\n\t\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event's.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === \"click\" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don't check non-elements (#13208)\n\t\t\t\t// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === \"click\" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don't conflict with Object.prototype properties (#13203)\n\t\t\t\t\t\tsel = handleObj.selector + \" \";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, \"click\", ... )\n\t\t\t\t\tleverageNative( el, \"click\", returnTrue );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, \"input\" ) ) {\n\n\t\t\t\t\tleverageNative( el, \"click\" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we're currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, \"input\" ) &&\n\t\t\t\t\tdataPriv.get( target, \"click\" ) ||\n\t\t\t\t\tnodeName( target, \"a\" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn't alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, expectSync ) {\n\n\t// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !expectSync ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar notAsync, result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\t// Saved data should be false in such cases, but might be a leftover capture object\n\t\t\t\t// from an async native handler (gh-4350)\n\t\t\t\tif ( !saved.length ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t// focus() and blur() are asynchronous\n\t\t\t\t\tnotAsync = expectSync( this, type );\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tif ( saved !== result || notAsync ) {\n\t\t\t\t\t\tdataPriv.set( this, type, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t}\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn result.value;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering the\n\t\t\t\t// native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved.length ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, {\n\t\t\t\t\tvalue: jQuery.event.trigger(\n\n\t\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t\t// Extend with the prototype to reset the above stopImmediatePropagation()\n\t\t\t\t\t\tjQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\n\t\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\t\tthis\n\t\t\t\t\t)\n\t\t\t\t} );\n\n\t\t\t\t// Abort handling of the native event\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This \"if\" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the 'new' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (#504, #13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn't have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t\"char\": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\n\twhich: function( event ) {\n\t\tvar button = event.button;\n\n\t\t// Add which for key events\n\t\tif ( event.which == null && rkeyEvent.test( event.type ) ) {\n\t\t\treturn event.charCode != null ? event.charCode : event.keyCode;\n\t\t}\n\n\t\t// Add which for click: 1 === left; 2 === middle; 3 === right\n\t\tif ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {\n\t\t\tif ( button & 1 ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif ( button & 2 ) {\n\t\t\t\treturn 3;\n\t\t\t}\n\n\t\t\tif ( button & 4 ) {\n\t\t\t\treturn 2;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn event.which;\n\t}\n}, jQuery.event.addProp );\n\njQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( type, delegateType ) {\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, \"focus\", ... )\n\t\t\t// dataPriv.set( this, \"blur\", ... )\n\t\t\tleverageNative( this, type, expectSync );\n\n\t\t\t// Return false to allow normal processing in the caller\n\t\t\treturn false;\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: \"mouseover\",\n\tmouseleave: \"mouseout\",\n\tpointerenter: \"pointerover\",\n\tpointerleave: \"pointerout\"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event )  dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + \".\" + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === \"object\" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === \"function\" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked=\"checked\" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\trcleanScript = /^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, \"table\" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, \"tr\" ) ) {\n\n\t\treturn jQuery( elem ).children( \"tbody\" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( \"type\" ) !== null ) + \"/\" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || \"\" ).slice( 0, 5 ) === \"true/\" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( \"type\" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, \"handle events\" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === \"input\" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === \"input\" || nodeName === \"textarea\" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can't cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === \"string\" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, \"script\" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (#8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, \"script\" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || \"\" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, \"globalEval\" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || \"\" ).toLowerCase()  !== \"module\" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won't run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( \"nonce\" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, \"\" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, \"script\" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, \"script\" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, \"script\" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove's overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = \"\";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === \"string\" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ \"\", \"\" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: \"append\",\n\tprependTo: \"prepend\",\n\tinsertBefore: \"before\",\n\tinsertAfter: \"after\",\n\treplaceAll: \"replaceWith\"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( \"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\" );\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (#15098, #14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( \"|\" ), \"i\" );\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they're executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = \"position:absolute;left:-11111px;width:60px;\" +\n\t\t\t\"margin-top:1px;padding:0;border:0\";\n\t\tdiv.style.cssText =\n\t\t\t\"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" +\n\t\t\t\"margin:auto;border:1px;padding:1px;\" +\n\t\t\t\"width:60%;top:1%\";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== \"1%\";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn't\n\t\tdiv.style.right = \"60%\";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don't get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = \"absolute\";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn't be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( \"div\" ),\n\t\tdiv = document.createElement( \"div\" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (#8908)\n\tdiv.style.backgroundClip = \"content-box\";\n\tdiv.cloneNode( true ).style.backgroundClip = \"\";\n\tsupport.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( \"table\" );\n\t\t\t\ttr = document.createElement( \"tr\" );\n\t\t\t\ttrChild = document.createElement( \"div\" );\n\n\t\t\t\ttable.style.cssText = \"position:absolute;left:-11111px\";\n\t\t\t\ttr.style.height = \"1px\";\n\t\t\t\ttrChild.style.height = \"9px\";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = parseInt( trStyle.height ) > 3;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t//   .css('filter') (IE 9 only, #12537)\n\t//   .css('--customProperty) (#3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\tif ( ret === \"\" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the \"awesome hack by Dean Edwards\"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + \"\" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we'll check on the first run if it's really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it's not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ \"Webkit\", \"Moz\", \"ms\" ],\n\temptyStyle = document.createElement( \"div\" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except \"table\", \"table-cell\", or \"table-caption\"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\trcustomProp = /^--/,\n\tcssShow = { position: \"absolute\", visibility: \"hidden\", display: \"block\" },\n\tcssNormalTransform = {\n\t\tletterSpacing: \"0\",\n\t\tfontWeight: \"400\"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined \"subtract\", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || \"px\" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === \"width\" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? \"border\" : \"content\" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === \"margin\" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\n\t\t\t// For \"border\" or \"margin\", add border\n\t\t\tif ( box !== \"padding\" ) {\n\t\t\t\tdelta += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n\t\t// \"padding\" or \"margin\"\n\t\t} else {\n\n\t\t\t// For \"content\", subtract padding\n\t\t\tif ( box === \"content\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"padding\" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For \"content\" or \"padding\", subtract border\n\t\t\tif ( box !== \"margin\" ) {\n\t\t\t\tdelta -= jQuery.css( elem, \"border\" + cssExpand[ i ] + \"Width\", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it's needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = \"auto\";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn't suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, \"tr\" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is \"auto\"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === \"auto\" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, \"display\", false, styles ) === \"inline\" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize \"\" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element's box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? \"border\" : \"content\" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + \"px\";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, \"opacity\" );\n\t\t\t\t\treturn ret === \"\" ? \"1\" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don't automatically add \"px\" to these possibly-unitless properties\n\tcssNumber: {\n\t\t\"animationIterationCount\": true,\n\t\t\"columnCount\": true,\n\t\t\"fillOpacity\": true,\n\t\t\"flexGrow\": true,\n\t\t\"flexShrink\": true,\n\t\t\"fontWeight\": true,\n\t\t\"gridArea\": true,\n\t\t\"gridColumn\": true,\n\t\t\"gridColumnEnd\": true,\n\t\t\"gridColumnStart\": true,\n\t\t\"gridRow\": true,\n\t\t\"gridRowEnd\": true,\n\t\t\"gridRowStart\": true,\n\t\t\"lineHeight\": true,\n\t\t\"opacity\": true,\n\t\t\"order\": true,\n\t\t\"orphans\": true,\n\t\t\"widows\": true,\n\t\t\"zIndex\": true,\n\t\t\"zoom\": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don't set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we're working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we're setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert \"+=\" or \"-=\" to relative numbers (#7345)\n\t\t\tif ( type === \"string\" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug #9237\n\t\t\t\ttype = \"number\";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren't set (#7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// \"px\" to a few hardcoded values.\n\t\t\tif ( type === \"number\" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? \"\" : \"px\" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone's values\n\t\t\tif ( !support.clearCloneStyle && value === \"\" && name.indexOf( \"background\" ) === 0 ) {\n\t\t\t\tstyle[ name ] = \"inherit\";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( \"set\" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && \"get\" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we're working with the right name. We don't\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && \"get\" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert \"normal\" to computed value\n\t\tif ( val === \"normal\" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === \"\" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ \"height\", \"width\" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, \"display\" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t\t} ) :\n\t\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === \"absolute\",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, \"boxSizing\", false, styles ) === \"border-box\",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ \"offset\" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, \"border\", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || \"px\" ) !== \"px\" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, \"marginLeft\" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t\t) + \"px\";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: \"\",\n\tpadding: \"\",\n\tborder: \"Width\"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === \"string\" ? value.split( \" \" ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== \"margin\" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? \"\" : \"px\" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as \"10px\" are parsed to Float;\n\t\t\t// complex values such as \"rotate(1rad)\" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, \"\" );\n\n\t\t\t// Empty strings, null, undefined and \"auto\" are converted to 0.\n\t\t\treturn !result || result === \"auto\" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: \"swing\"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ \"margin\" + which ] = attrs[ \"padding\" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ \"*\" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We're done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = \"width\" in props || \"height\" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, \"fxshow\" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, \"fx\" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, \"fx\" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === \"toggle\";\n\t\t\tif ( value === ( hidden ? \"hide\" : \"show\" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a \"show\" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === \"show\" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict \"overflow\" and \"display\" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, \"display\" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\tif ( display === \"none\" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, \"display\" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === \"inline\" || display === \"inline-block\" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, \"float\" ) === \"none\" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === \"none\" ? \"\" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = \"inline-block\";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = \"hidden\";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( \"hidden\" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, \"fxshow\", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a \"hide\" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, \"fxshow\" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && \"expand\" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won't overwrite existing keys.\n\t\t\t// Reusing 'index' because we have the correct \"name\"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don't match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there's more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t\"*\": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ \"*\" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === \"object\" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== \"number\" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> \"fx\"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = \"fx\";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( \"opacity\", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won't be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, \"finish\" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\t\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== \"string\" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || \"fx\", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + \"queueHooks\",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn't forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || \"fx\";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + \"queue\" ],\n\t\t\t\thooks = data[ type + \"queueHooks\" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ \"toggle\", \"show\", \"hide\" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === \"boolean\" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( \"show\" ),\n\tslideUp: genFx( \"hide\" ),\n\tslideToggle: genFx( \"toggle\" ),\n\tfadeIn: { opacity: \"show\" },\n\tfadeOut: { opacity: \"hide\" },\n\tfadeToggle: { opacity: \"toggle\" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\n// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || \"fx\";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( \"input\" ),\n\t\tselect = document.createElement( \"select\" ),\n\t\topt = select.appendChild( document.createElement( \"option\" ) );\n\n\tinput.type = \"checkbox\";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be \"on\"\n\tsupport.checkOn = input.value !== \"\";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( \"input\" );\n\tinput.value = \"t\";\n\tinput.type = \"radio\";\n\tsupport.radioValue = input.value === \"t\";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === \"undefined\" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + \"\" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === \"radio\" &&\n\t\t\t\t\tnodeName( elem, \"input\" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( \"type\", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don't get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && \"set\" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && \"get\" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn't always return the\n\t\t\t\t// correct value when it hasn't been explicitly set\n\t\t\t\t// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\n\t\t\t\t// Use proper attribute retrieval(#12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, \"tabindex\" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t\"for\": \"htmlFor\",\n\t\t\"class\": \"className\"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule \"no-unused-expressions\" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: \"off\" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t\"tabIndex\",\n\t\"readOnly\",\n\t\"maxLength\",\n\t\"cellSpacing\",\n\t\"cellPadding\",\n\t\"rowSpan\",\n\t\"colSpan\",\n\t\"useMap\",\n\t\"frameBorder\",\n\t\"contentEditable\"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( \"class\" ) || \"\";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === \"string\" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\t\t\t\t\t\tif ( cur.indexOf( \" \" + clazz + \" \" ) < 0 ) {\n\t\t\t\t\t\t\tcur += clazz + \" \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classes, elem, cur, curValue, clazz, j, finalValue,\n\t\t\ti = 0;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( \"class\", \"\" );\n\t\t}\n\n\t\tclasses = classesToArray( value );\n\n\t\tif ( classes.length ) {\n\t\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\t\tcurValue = getClass( elem );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = elem.nodeType === 1 && ( \" \" + stripAndCollapse( curValue ) + \" \" );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tj = 0;\n\t\t\t\t\twhile ( ( clazz = classes[ j++ ] ) ) {\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( \" \" + clazz + \" \" ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( \" \" + clazz + \" \", \" \" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\telem.setAttribute( \"class\", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar type = typeof value,\n\t\t\tisValidValue = type === \"string\" || Array.isArray( value );\n\n\t\tif ( typeof stateVal === \"boolean\" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar className, i, self, classNames;\n\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\ti = 0;\n\t\t\t\tself = jQuery( this );\n\t\t\t\tclassNames = classesToArray( value );\n\n\t\t\t\twhile ( ( className = classNames[ i++ ] ) ) {\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === \"boolean\" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, \"__className__\", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we're passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( \"class\",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\"\" :\n\t\t\t\t\t\tdataPriv.get( this, \"__className__\" ) || \"\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = \" \" + selector + \" \";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( \" \" + stripAndCollapse( getClass( elem ) ) + \" \" ).indexOf( className ) > -1 ) {\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t\"get\" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, \"value\" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === \"string\" ) {\n\t\t\t\t\treturn ret.replace( rreturn, \"\" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? \"\" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as \"\"; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = \"\";\n\n\t\t\t} else if ( typeof val === \"number\" ) {\n\t\t\t\tval += \"\";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? \"\" : value + \"\";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( \"set\" in hooks ) || hooks.set( this, val, \"value\" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, \"value\" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (#14686, #14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === \"select-one\",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn't update selected after form reset (#2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don't return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, \"optgroup\" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don't need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ \"radio\", \"checkbox\" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( \"value\" ) === null ? \"on\" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = \"onfocusin\" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, \"type\" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, \"namespace\" ) ? event.namespace.split( \".\" ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don't do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we're not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( \".\" ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( \".\" );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( \":\" ) < 0 && \"on\" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === \"object\" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( \".\" );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( \"(^|\\\\.)\" + namespaces.join( \"\\\\.(?:.*\\\\.|)\" ) + \"(\\\\.|$)\" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (#9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = (\n\t\t\t\t\tdataPriv.get( cur, \"events\" ) || Object.create( null )\n\t\t\t\t)[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, \"handle\" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don't do default actions on window, that's where global variables be (#6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don't re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn't have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: \"focusin\", blur: \"focusout\" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\n\t\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml;\n\tif ( !data || typeof data !== \"string\" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, \"text/xml\" );\n\t} catch ( e ) {\n\t\txml = undefined;\n\t}\n\n\tif ( !xml || xml.getElementsByTagName( \"parsererror\" ).length ) {\n\t\tjQuery.error( \"Invalid XML: \" + data );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + \"[\" + ( typeof v === \"object\" && v != null ? i : \"\" ) + \"]\",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === \"object\" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + \"[\" + name + \"]\", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + \"=\" +\n\t\t\t\tencodeURIComponent( value == null ? \"\" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn \"\";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the \"old\" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( \"&\" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for \"elements\" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, \"elements\" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} )\n\t\t.filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( \":disabled\" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( \":disabled\" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} )\n\t\t.map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, \"\\r\\n\" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// #7653, #8125, #8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t *    - BEFORE asking for a transport\n\t *    - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol \"*\" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol \"*\" can be used\n\t * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\n\tallTypes = \"*/\".concat( \"*\" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( \"a\" );\n\toriginAnchor.href = location.href;\n\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to \"*\"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== \"string\" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = \"*\";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === \"+\" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || \"*\";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === \"string\" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ \"*\" ] && inspect( \"*\" );\n}\n\n// A special extend for ajax options\n// that takes \"flat\" options (not to be deep extended)\n// Fixes #9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === \"*\" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( \"Content-Type\" );\n\t\t}\n\t}\n\n\t// Check if we're dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + \" \" + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There's only work to do if current dataType is non-auto\n\t\t\tif ( current === \"*\" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== \"*\" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + \" \" + current ] || converters[ \"* \" + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( \" \" );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + \" \" + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ \"* \" + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: \"parsererror\",\n\t\t\t\t\t\t\t\terror: conv ? e : \"No conversion from \" + prev + \" to \" + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: \"success\", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: \"GET\",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t\"*\": allTypes,\n\t\t\ttext: \"text/plain\",\n\t\t\thtml: \"text/html\",\n\t\t\txml: \"application/xml, text/xml\",\n\t\t\tjson: \"application/json, text/javascript\"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: \"responseXML\",\n\t\t\ttext: \"responseText\",\n\t\t\tjson: \"responseJSON\"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall \"*\") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t\"* text\": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t\"text html\": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t\"text json\": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t\"text xml\": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn't be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn't be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === \"object\" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( \"once memory\" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = \"canceled\",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + \" \" ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + \" \" ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + \" \" ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( \", \" );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (#10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + \"\" )\n\t\t\t.replace( rprotocol, location.protocol + \"//\" );\n\n\t\t// Alias method option to type as per ticket #12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || \"*\" ).toLowerCase().match( rnothtmlwhite ) || [ \"\" ];\n\n\t\t// A cross-domain request is in order when the origin doesn't match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( \"a\" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor's host property isn't correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + \"//\" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== \"string\" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we're toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, \"\" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === \"string\" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + s.data;\n\n\t\t\t\t// #9682: remove data so that it's not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, \"$1\" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? \"&\" : \"?\" ) + \"_=\" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change '%20' to '+' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || \"\" ).indexOf( \"application/x-www-form-urlencoded\" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, \"+\" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-Modified-Since\", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( \"If-None-Match\", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( \"Content-Type\", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t\"Accept\",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\n\t\t\t\ts.accepts[ \"*\" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = \"abort\";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, \"No Transport\" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxSend\", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( \"timeout\" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || \"\";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script\n\t\t\tif ( !isSuccess && jQuery.inArray( \"script\", s.dataTypes ) > -1 ) {\n\t\t\t\ts.converters[ \"text script\" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"Last-Modified\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( \"etag\" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === \"HEAD\" ) {\n\t\t\t\t\tstatusText = \"nocontent\";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = \"notmodified\";\n\n\t\t\t\t// If we have data, let's convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = \"error\";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( \"ajaxComplete\", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( \"ajaxStop\" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, \"json\" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, \"script\" );\n\t}\n} );\n\njQuery.each( [ \"get\", \"post\" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === \"content-type\" ) {\n\t\t\ts.contentType = s.headers[ i ] || \"\";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (#11264)\n\t\ttype: \"GET\",\n\t\tdataType: \"script\",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t\"text script\": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( \"body\" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// #1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won't change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ \"X-Requested-With\" ] ) {\n\t\t\t\t\theaders[ \"X-Requested-With\" ] = \"XMLHttpRequest\";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === \"abort\" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === \"error\" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== \"number\" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, \"error\" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see #8605, #14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || \"text\" ) !== \"text\"  ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== \"string\" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( \"error\" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( \"abort\" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// #14683: Only rethrow if this hasn't been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: \"text/javascript, application/javascript, \" +\n\t\t\t\"application/ecmascript, application/x-ecmascript\"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t\"text script\": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache's special case and crossDomain\njQuery.ajaxPrefilter( \"script\", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = \"GET\";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( \"script\", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( \"<script>\" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( \"load error\", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === \"error\" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: \"callback\",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce.guid++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( \"json jsonp\", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t\"url\" :\n\t\t\ttypeof s.data === \"string\" &&\n\t\t\t\t( s.contentType || \"\" )\n\t\t\t\t\t.indexOf( \"application/x-www-form-urlencoded\" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && \"data\"\n\t\t);\n\n\t// Handle iff the expected data type is \"jsonp\" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === \"jsonp\" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, \"$1\" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ \"script json\" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + \" was not called\" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = \"json\";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn't exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn't screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn \"script\";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( \"\" ).body;\n\tbody.innerHTML = \"<form></form><form></form>\";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument \"data\" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== \"string\" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === \"boolean\" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( \"\" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document's URL (gh-2965)\n\t\t\tbase = context.createElement( \"base\" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( \" \" );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it's a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it's the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === \"object\" ) {\n\t\ttype = \"POST\";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If \"type\" variable is undefined, then \"GET\" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || \"GET\",\n\t\t\tdataType: \"html\",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE 'Permission Denied' errors\n\t\t\t\tjQuery( \"<div>\" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets \"data\", \"status\", \"jqXHR\"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets \"jqXHR\", \"status\", \"error\"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === \"static\" ) {\n\t\t\telem.style.position = \"relative\";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( \"auto\" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( \"using\" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tif ( typeof props.top === \"number\" ) {\n\t\t\t\tprops.top += \"px\";\n\t\t\t}\n\t\t\tif ( typeof props.left === \"number\" ) {\n\t\t\t\tprops.left += \"px\";\n\t\t\t}\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element's border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element's margin box to its offset parent's padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, \"borderLeftWidth\", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t//    documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, \"position\" ) === \"static\" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\tvar top = \"pageYOffset\" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ \"top\", \"left\" ], function( _i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name },\n\t\tfunction( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( \"outer\" ) === 0 ?\n\t\t\t\t\t\telem[ \"inner\" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ \"client\" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( [\n\t\"ajaxStart\",\n\t\"ajaxStop\",\n\t\"ajaxComplete\",\n\t\"ajaxError\",\n\t\"ajaxSuccess\",\n\t\"ajaxSend\"\n], function( _i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, \"**\" ) :\n\t\t\tthis.off( types, selector || \"**\", fn );\n\t},\n\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t}\n} );\n\njQuery.each( ( \"blur focus focusin focusout resize scroll click dblclick \" +\n\t\"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave \" +\n\t\"change select submit keydown keypress keyup contextmenu\" ).split( \" \" ),\n\tfunction( _i, name ) {\n\n\t\t// Handle event binding\n\t\tjQuery.fn[ name ] = function( data, fn ) {\n\t\t\treturn arguments.length > 0 ?\n\t\t\t\tthis.on( name, null, data, fn ) :\n\t\t\t\tthis.trigger( name );\n\t\t};\n\t} );\n\n\n\n\n// Support: Android <=4.0 only\n// Make sure we trim BOM and NBSP\nvar rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === \"string\" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === \"number\" || type === \"string\" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives (\"\")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\njQuery.trim = function( text ) {\n\treturn text == null ?\n\t\t\"\" :\n\t\t( text + \"\" ).replace( rtrim, \"\" );\n};\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( typeof define === \"function\" && define.amd ) {\n\tdefine( \"jquery\", [], function() {\n\t\treturn jQuery;\n\t} );\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (#13566)\nif ( typeof noGlobal === \"undefined\" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n"
  },
  {
    "path": "docs-aside/_static/jquery.js",
    "content": "/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */\n!function(e,t){\"use strict\";\"object\"==typeof module&&\"object\"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error(\"jQuery requires a window with a document\");return t(e)}:t(e)}(\"undefined\"!=typeof window?window:this,function(C,e){\"use strict\";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return\"function\"==typeof e&&\"number\"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement(\"script\");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+\"\":\"object\"==typeof e||\"function\"==typeof e?n[o.call(e)]||\"object\":typeof e}var f=\"3.5.1\",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&\"length\"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&(\"array\"===n||0===t||\"number\"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for(\"boolean\"==typeof a&&(l=a,a=arguments[s]||{},s++),\"object\"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],\"__proto__\"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:\"jQuery\"+(f+Math.random()).replace(/\\D/g,\"\"),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||\"[object Object]\"!==o.call(e))&&(!(t=r(e))||\"function\"==typeof(n=v.call(t,\"constructor\")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,\"string\"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),\"function\"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"),function(e,t){n[\"[object \"+t+\"]\"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S=\"sizzle\"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R=\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",M=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",I=\"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\"+M+\"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",W=\"\\\\[\"+M+\"*(\"+I+\")(?:\"+M+\"*([*^$|!~]?=)\"+M+\"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\"+I+\"))|)\"+M+\"*\\\\]\",F=\":(\"+I+\")(?:\\\\((('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\"+W+\")*)|.*)\\\\)|)\",B=new RegExp(M+\"+\",\"g\"),$=new RegExp(\"^\"+M+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+M+\"+$\",\"g\"),_=new RegExp(\"^\"+M+\"*,\"+M+\"*\"),z=new RegExp(\"^\"+M+\"*([>+~]|\"+M+\")\"+M+\"*\"),U=new RegExp(M+\"|>\"),X=new RegExp(F),V=new RegExp(\"^\"+I+\"$\"),G={ID:new RegExp(\"^#(\"+I+\")\"),CLASS:new RegExp(\"^\\\\.(\"+I+\")\"),TAG:new RegExp(\"^(\"+I+\"|[*])\"),ATTR:new RegExp(\"^\"+W),PSEUDO:new RegExp(\"^\"+F),CHILD:new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\"+M+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+M+\"*(?:([+-]|)\"+M+\"*(\\\\d+)|))\"+M+\"*\\\\)|)\",\"i\"),bool:new RegExp(\"^(?:\"+R+\")$\",\"i\"),needsContext:new RegExp(\"^\"+M+\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+M+\"*((?:-\\\\d)?\\\\d*)\"+M+\"*\\\\)|)(?=[^-]|$)\",\"i\")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\\d$/i,K=/^[^{]+\\{\\s*\\[native \\w/,Z=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,ee=/[+~]/,te=new RegExp(\"\\\\\\\\[\\\\da-fA-F]{1,6}\"+M+\"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\",\"g\"),ne=function(e,t){var n=\"0x\"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,ie=function(e,t){return t?\"\\0\"===e?\"\\ufffd\":e.slice(0,-1)+\"\\\\\"+e.charCodeAt(e.length-1).toString(16)+\" \":\"\\\\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&\"fieldset\"===e.nodeName.toLowerCase()},{dir:\"parentNode\",next:\"legend\"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],\"string\"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+\" \"]&&(!v||!v.test(t))&&(1!==p||\"object\"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute(\"id\"))?s=s.replace(re,ie):e.setAttribute(\"id\",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?\"#\"+s:\":scope\")+\" \"+xe(l[o]);c=l.join(\",\")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute(\"id\")}}}return g(t.replace($,\"$1\"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+\" \")>b.cacheLength&&delete e[r.shift()],e[t+\" \"]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement(\"fieldset\");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split(\"|\"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return\"input\"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return(\"input\"===t||\"button\"===t)&&e.type===n}}function ge(t){return function(e){return\"form\"in e?e.parentNode&&!1===e.disabled?\"label\"in e?\"label\"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:\"label\"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&\"undefined\"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||\"HTML\")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener(\"unload\",oe,!1):n.attachEvent&&n.attachEvent(\"onunload\",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement(\"div\")),\"undefined\"!=typeof e.querySelectorAll&&!e.querySelectorAll(\":scope fieldset div\").length}),d.attributes=ce(function(e){return e.className=\"i\",!e.getAttribute(\"className\")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment(\"\")),!e.getElementsByTagName(\"*\").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute(\"id\")===t}},b.find.ID=function(e,t){if(\"undefined\"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t=\"undefined\"!=typeof e.getAttributeNode&&e.getAttributeNode(\"id\");return t&&t.value===n}},b.find.ID=function(e,t){if(\"undefined\"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode(\"id\"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode(\"id\"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return\"undefined\"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if(\"*\"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if(\"undefined\"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML=\"<a id='\"+S+\"'></a><select id='\"+S+\"-\\r\\\\' msallowcapture=''><option selected=''></option></select>\",e.querySelectorAll(\"[msallowcapture^='']\").length&&v.push(\"[*^$]=\"+M+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\"[selected]\").length||v.push(\"\\\\[\"+M+\"*(?:value|\"+R+\")\"),e.querySelectorAll(\"[id~=\"+S+\"-]\").length||v.push(\"~=\"),(t=C.createElement(\"input\")).setAttribute(\"name\",\"\"),e.appendChild(t),e.querySelectorAll(\"[name='']\").length||v.push(\"\\\\[\"+M+\"*name\"+M+\"*=\"+M+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\":checked\").length||v.push(\":checked\"),e.querySelectorAll(\"a#\"+S+\"+*\").length||v.push(\".#.+[+~]\"),e.querySelectorAll(\"\\\\\\f\"),v.push(\"[\\\\r\\\\n\\\\f]\")}),ce(function(e){e.innerHTML=\"<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>\";var t=C.createElement(\"input\");t.setAttribute(\"type\",\"hidden\"),e.appendChild(t).setAttribute(\"name\",\"D\"),e.querySelectorAll(\"[name=d]\").length&&v.push(\"name\"+M+\"*[*^$|!~]?=\"),2!==e.querySelectorAll(\":enabled\").length&&v.push(\":enabled\",\":disabled\"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(\":disabled\").length&&v.push(\":enabled\",\":disabled\"),e.querySelectorAll(\"*,:x\"),v.push(\",.*:\")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,\"*\"),c.call(e,\"[s!='']:x\"),s.push(\"!=\",F)}),v=v.length&&new RegExp(v.join(\"|\")),s=s.length&&new RegExp(s.join(\"|\")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+\" \"]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+\"\").replace(re,ie)},se.error=function(e){throw new Error(\"Syntax error, unrecognized expression: \"+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n=\"\",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if(\"string\"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||\"\").replace(te,ne),\"~=\"===e[2]&&(e[3]=\" \"+e[3]+\" \"),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),\"nth\"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(\"even\"===e[3]||\"odd\"===e[3])),e[5]=+(e[7]+e[8]||\"odd\"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||\"\":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(\")\",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return\"*\"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+\" \"];return t||(t=new RegExp(\"(^|\"+M+\")\"+e+\"(\"+M+\"|$)\"))&&m(e,function(e){return t.test(\"string\"==typeof e.className&&e.className||\"undefined\"!=typeof e.getAttribute&&e.getAttribute(\"class\")||\"\")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?\"!=\"===r:!r||(t+=\"\",\"=\"===r?t===i:\"!=\"===r?t!==i:\"^=\"===r?i&&0===t.indexOf(i):\"*=\"===r?i&&-1<t.indexOf(i):\"$=\"===r?i&&t.slice(-i.length)===i:\"~=\"===r?-1<(\" \"+t.replace(B,\" \")+\" \").indexOf(i):\"|=\"===r&&(t===i||t.slice(0,i.length+1)===i+\"-\"))}},CHILD:function(h,e,t,g,v){var y=\"nth\"!==h.slice(0,3),m=\"last\"!==h.slice(-4),x=\"of-type\"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?\"nextSibling\":\"previousSibling\",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l=\"only\"===h&&!u&&\"nextSibling\"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error(\"unsupported pseudo: \"+e);return a[S]?a(o):1<a.length?(t=[e,e,\"\",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,\"$1\"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||\"\")||se.error(\"unsupported lang: \"+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute(\"xml:lang\")||e.getAttribute(\"lang\"))return(t=t.toLowerCase())===n||0===t.indexOf(n+\"-\")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&!!e.checked||\"option\"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&\"button\"===e.type||\"button\"===t},text:function(e){var t;return\"input\"===e.nodeName.toLowerCase()&&\"text\"===e.type&&(null==(t=e.getAttribute(\"type\"))||\"text\"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r=\"\";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&\"parentNode\"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||\"*\",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[\" \"],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:\" \"===e[s-2].type?\"*\":\"\"})).replace($,\"$1\"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+\" \"];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($,\" \")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+\" \"];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l=\"0\",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG(\"*\",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l=\"function\"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&\"ID\"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split(\"\").sort(D).join(\"\")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement(\"fieldset\"))}),ce(function(e){return e.innerHTML=\"<a href='#'></a>\",\"#\"===e.firstChild.getAttribute(\"href\")})||fe(\"type|href|height|width\",function(e,t,n){if(!n)return e.getAttribute(t,\"type\"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML=\"<input/>\",e.firstChild.setAttribute(\"value\",\"\"),\"\"===e.firstChild.getAttribute(\"value\")})||fe(\"value\",function(e,t,n){if(!n&&\"input\"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute(\"disabled\")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[\":\"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):\"string\"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=\":not(\"+e+\")\"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if(\"string\"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,\"string\"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,\"string\"==typeof e){if(!(r=\"<\"===e[0]&&\">\"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a=\"string\"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?\"string\"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,\"parentNode\")},parentsUntil:function(e,t,n){return h(e,\"parentNode\",n)},next:function(e){return O(e,\"nextSibling\")},prev:function(e){return O(e,\"previousSibling\")},nextAll:function(e){return h(e,\"nextSibling\")},prevAll:function(e){return h(e,\"previousSibling\")},nextUntil:function(e,t,n){return h(e,\"nextSibling\",n)},prevUntil:function(e,t,n){return h(e,\"previousSibling\",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,\"template\")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return\"Until\"!==r.slice(-5)&&(t=e),t&&\"string\"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\\x20\\t\\r\\n\\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r=\"string\"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:\"\")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&\"string\"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t=\"\",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=\"\"),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[[\"notify\",\"progress\",S.Callbacks(\"memory\"),S.Callbacks(\"memory\"),2],[\"resolve\",\"done\",S.Callbacks(\"once memory\"),S.Callbacks(\"once memory\"),0,\"resolved\"],[\"reject\",\"fail\",S.Callbacks(\"once memory\"),S.Callbacks(\"once memory\"),1,\"rejected\"]],i=\"pending\",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},\"catch\":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+\"With\"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError(\"Thenable self-resolution\");t=e&&(\"object\"==typeof e||\"function\"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+\"With\"](this===s?void 0:this,arguments),this},s[t[0]+\"With\"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),\"pending\"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn(\"jQuery.Deferred exception: \"+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener(\"DOMContentLoaded\",B),C.removeEventListener(\"load\",B),S.ready()}S.fn.ready=function(e){return F.then(e)[\"catch\"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,\"complete\"===E.readyState||\"loading\"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener(\"DOMContentLoaded\",B),C.addEventListener(\"load\",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if(\"object\"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,\"ms-\").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if(\"string\"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&\"string\"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r=\"data-\"+t.replace(K,\"-$&\").toLowerCase(),\"string\"==typeof(n=e.getAttribute(r))){try{n=\"true\"===(i=n)||\"false\"!==i&&(\"null\"===i?null:i===+i+\"\"?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,\"hasDataAttrs\"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf(\"data-\")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,\"hasDataAttrs\",!0)}return i}return\"object\"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||\"fx\")+\"queue\",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||\"fx\";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);\"inprogress\"===i&&(i=n.shift(),r--),i&&(\"fx\"===t&&n.unshift(\"inprogress\"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+\"queueHooks\";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks(\"once memory\").add(function(){Y.remove(e,[t+\"queue\",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return\"string\"!=typeof t&&(n=t,t=\"fx\",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),\"fx\"===t&&\"inprogress\"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||\"fx\",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};\"string\"!=typeof e&&(t=e,e=void 0),e=e||\"fx\";while(a--)(n=Y.get(o[a],e+\"queueHooks\"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,te=new RegExp(\"^(?:([+-])=|)(\"+ee+\")([a-z%]*)$\",\"i\"),ne=[\"Top\",\"Right\",\"Bottom\",\"Left\"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return\"none\"===(e=t||e).style.display||\"\"===e.style.display&&ie(e)&&\"none\"===S.css(e,\"display\")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,\"\")},u=s(),l=n&&n[3]||(S.cssNumber[t]?\"\":\"px\"),c=e.nodeType&&(S.cssNumber[t]||\"px\"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?(\"none\"===n&&(l[c]=Y.get(r,\"display\")||null,l[c]||(r.style.display=\"\")),\"\"===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,\"display\"),o.parentNode.removeChild(o),\"none\"===u&&(u=\"block\"),ue[s]=u)))):\"none\"!==n&&(l[c]=\"none\",Y.set(r,\"display\",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return\"boolean\"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i,he=/^$|^module$|\\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement(\"div\")),(fe=E.createElement(\"input\")).setAttribute(\"type\",\"radio\"),fe.setAttribute(\"checked\",\"checked\"),fe.setAttribute(\"name\",\"t\"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML=\"<textarea>x</textarea>\",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML=\"<option></option>\",y.option=!!ce.lastChild;var ge={thead:[1,\"<table>\",\"</table>\"],col:[2,\"<table><colgroup>\",\"</colgroup></table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],_default:[0,\"\",\"\"]};function ve(e,t){var n;return n=\"undefined\"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||\"*\"):\"undefined\"!=typeof e.querySelectorAll?e.querySelectorAll(t||\"*\"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],\"globalEval\",!t||Y.get(t[n],\"globalEval\"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,\"<select multiple='multiple'>\",\"</select>\"]);var me=/<|&#?\\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if(\"object\"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement(\"div\")),s=(de.exec(o)||[\"\",\"\"])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=\"\"}else p.push(t.createTextNode(o));f.textContent=\"\",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),\"script\"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||\"\")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==(\"focus\"===t)}function ke(e,t,n,r,i,o){var a,s;if(\"object\"==typeof t){for(s in\"string\"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&(\"string\"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return\"undefined\"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||\"\").match(P)||[\"\"]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||\"\").split(\".\").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(\".\")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||\"\").match(P)||[\"\"]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||\"\").split(\".\").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&(\"**\"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,\"handle events\")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,\"events\")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!(\"click\"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(\"click\"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+\" \"]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Ae(t,\"click\",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Ae(t,\"click\"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,\"input\")&&Y.get(t,\"click\")||A(t,\"a\")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,\"char\":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:\"focusin\",blur:\"focusout\"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\",pointerenter:\"pointerover\",pointerleave:\"pointerout\"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+\".\"+r.namespace:r.origType,r.selector,r.handler),this;if(\"object\"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&\"function\"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\\s*(?:[^=]|=\\s*.checked.)/i,je=/^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g;function qe(e,t){return A(e,\"table\")&&A(11!==t.nodeType?t:t.firstChild,\"tr\")&&S(e).children(\"tbody\")[0]||e}function Le(e){return e.type=(null!==e.getAttribute(\"type\"))+\"/\"+e.type,e}function He(e){return\"true/\"===(e.type||\"\").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute(\"type\"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,\"handle events\"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&\"string\"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,\"script\"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,\"script\"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||\"\")&&!Y.access(u,\"globalEval\")&&S.contains(l,u)&&(u.src&&\"module\"!==(u.type||\"\").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute(\"nonce\")},l):b(u.textContent.replace(je,\"\"),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,\"script\")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,\"input\"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:\"input\"!==l&&\"textarea\"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,\"script\")).length&&ye(a,!f&&ve(e,\"script\")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent=\"\");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if(\"string\"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||[\"\",\"\"])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp(\"^(\"+ee+\")(?!px)[a-z%]+$\",\"i\"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join(\"|\"),\"i\");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(\"\"!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+\"\":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText=\"position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0\",l.style.cssText=\"position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%\",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n=\"1%\"!==e.top,s=12===t(e.marginLeft),l.style.right=\"60%\",o=36===t(e.right),r=36===t(e.width),l.style.position=\"absolute\",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement(\"div\"),l=E.createElement(\"div\");l.style&&(l.style.backgroundClip=\"content-box\",l.cloneNode(!0).style.backgroundClip=\"\",y.clearCloneStyle=\"content-box\"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement(\"table\"),t=E.createElement(\"tr\"),n=E.createElement(\"div\"),e.style.cssText=\"position:absolute;left:-11111px\",t.style.height=\"1px\",n.style.height=\"9px\",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=[\"Webkit\",\"Moz\",\"ms\"],ze=E.createElement(\"div\").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:\"absolute\",visibility:\"hidden\",display:\"block\"},Qe={letterSpacing:\"0\",fontWeight:\"400\"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||\"px\"):t}function Ke(e,t,n,r,i,o){var a=\"width\"===t?1:0,s=0,u=0;if(n===(r?\"border\":\"content\"))return 0;for(;a<4;a+=2)\"margin\"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?(\"content\"===n&&(u-=S.css(e,\"padding\"+ne[a],!0,i)),\"margin\"!==n&&(u-=S.css(e,\"border\"+ne[a]+\"Width\",!0,i))):(u+=S.css(e,\"padding\"+ne[a],!0,i),\"padding\"!==n?u+=S.css(e,\"border\"+ne[a]+\"Width\",!0,i):s+=S.css(e,\"border\"+ne[a]+\"Width\",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e[\"offset\"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&\"border-box\"===S.css(e,\"boxSizing\",!1,r),o=i,a=Be(e,t,r),s=\"offset\"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a=\"auto\"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,\"tr\")||\"auto\"===a||!parseFloat(a)&&\"inline\"===S.css(e,\"display\",!1,r))&&e.getClientRects().length&&(i=\"border-box\"===S.css(e,\"boxSizing\",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?\"border\":\"content\"),o,r,a)+\"px\"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,\"opacity\");return\"\"===n?\"1\":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&\"get\"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];\"string\"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o=\"number\"),null!=n&&n==n&&(\"number\"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?\"\":\"px\")),y.clearCloneStyle||\"\"!==n||0!==t.indexOf(\"background\")||(l[t]=\"inherit\"),a&&\"set\"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&\"get\"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),\"normal\"===i&&t in Qe&&(i=Qe[t]),\"\"===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each([\"height\",\"width\"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,\"display\"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&\"absolute\"===i.position,a=(o||n)&&\"border-box\"===S.css(e,\"boxSizing\",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e[\"offset\"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,\"border\",!1,i)-.5)),s&&(r=te.exec(t))&&\"px\"!==(r[3]||\"px\")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,\"marginLeft\"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+\"px\"}),S.each({margin:\"\",padding:\"\",border:\"Width\"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r=\"string\"==typeof e?e.split(\" \"):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},\"margin\"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?\"\":\"px\")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,\"\"))&&\"auto\"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:\"swing\"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i[\"margin\"+(n=ne[r])]=i[\"padding\"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners[\"*\"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&\"expand\"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{\"*\":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=[\"*\"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f=\"width\"in t||\"height\"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,\"fxshow\");for(r in n.queue||(null==(a=S._queueHooks(e,\"fx\")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,\"fx\").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||\"toggle\"===i,i===(g?\"hide\":\"show\")){if(\"show\"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,\"display\")),\"none\"===(c=S.css(e,\"display\"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,\"display\"),le([e]))),(\"inline\"===c||\"inline-block\"===c&&null!=l)&&\"none\"===S.css(e,\"float\")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l=\"none\"===c?\"\":c)),h.display=\"inline-block\")),n.overflow&&(h.overflow=\"hidden\",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?\"hidden\"in v&&(g=v.hidden):v=Y.access(e,\"fxshow\",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,\"fxshow\"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&\"object\"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:\"number\"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue=\"fx\"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css(\"opacity\",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,\"finish\"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return\"string\"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||\"fx\",[]),this.each(function(){var e=!0,t=null!=i&&i+\"queueHooks\",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||\"fx\"),this.each(function(){var e,t=Y.get(this),n=t[a+\"queue\"],r=t[a+\"queueHooks\"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each([\"toggle\",\"show\",\"hide\"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||\"boolean\"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt(\"show\"),slideUp:lt(\"hide\"),slideToggle:lt(\"toggle\"),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||\"fx\",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement(\"input\"),it=E.createElement(\"select\").appendChild(E.createElement(\"option\")),rt.type=\"checkbox\",y.checkOn=\"\"!==rt.value,y.optSelected=it.selected,(rt=E.createElement(\"input\")).value=\"t\",rt.type=\"radio\",y.radioValue=\"t\"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return\"undefined\"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&\"set\"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+\"\"),n):i&&\"get\"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&\"radio\"===t&&A(e,\"input\")){var n=e.value;return e.setAttribute(\"type\",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(\" \")}function yt(e){return e.getAttribute&&e.getAttribute(\"class\")||\"\"}function mt(e){return Array.isArray(e)?e:\"string\"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&\"set\"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&\"get\"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,\"tabindex\");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{\"for\":\"htmlFor\",\"class\":\"className\"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&\" \"+vt(i)+\" \"){a=0;while(o=e[a++])r.indexOf(\" \"+o+\" \")<0&&(r+=o+\" \");i!==(s=vt(r))&&n.setAttribute(\"class\",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr(\"class\",\"\");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&\" \"+vt(i)+\" \"){a=0;while(o=e[a++])while(-1<r.indexOf(\" \"+o+\" \"))r=r.replace(\" \"+o+\" \",\" \");i!==(s=vt(r))&&n.setAttribute(\"class\",s)}return this},toggleClass:function(i,t){var o=typeof i,a=\"string\"===o||Array.isArray(i);return\"boolean\"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&\"boolean\"!==o||((e=yt(this))&&Y.set(this,\"__className__\",e),this.setAttribute&&this.setAttribute(\"class\",e||!1===i?\"\":Y.get(this,\"__className__\")||\"\"))})},hasClass:function(e){var t,n,r=0;t=\" \"+e+\" \";while(n=this[r++])if(1===n.nodeType&&-1<(\" \"+vt(yt(n))+\" \").indexOf(t))return!0;return!1}});var xt=/\\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t=\"\":\"number\"==typeof t?t+=\"\":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?\"\":e+\"\"})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&\"set\"in r&&void 0!==r.set(this,t,\"value\")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&\"get\"in r&&void 0!==(e=r.get(t,\"value\"))?e:\"string\"==typeof(e=t.value)?e.replace(xt,\"\"):null==e?\"\":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,\"value\");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a=\"select-one\"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,\"optgroup\"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each([\"radio\",\"checkbox\"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute(\"value\")?\"on\":e.value})}),y.focusin=\"onfocusin\"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,\"type\")?e.type:e,h=v.call(e,\"namespace\")?e.namespace.split(\".\"):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(\".\")&&(d=(h=d.split(\".\")).shift(),h.sort()),u=d.indexOf(\":\")<0&&\"on\"+d,(e=e[S.expando]?e:new S.Event(d,\"object\"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join(\".\"),e.rnamespace=e.namespace?new RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,\"events\")||Object.create(null))[e.type]&&Y.get(o,\"handle\"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:\"focusin\",blur:\"focusout\"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\\?/;S.parseXML=function(e){var t;if(!e||\"string\"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,\"text/xml\")}catch(e){t=void 0}return t&&!t.getElementsByTagName(\"parsererror\").length||S.error(\"Invalid XML: \"+e),t};var St=/\\[\\]$/,kt=/\\r?\\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+\"[\"+(\"object\"==typeof t&&null!=t?e:\"\")+\"]\",t,r,i)});else if(r||\"object\"!==w(e))i(n,e);else for(t in e)Dt(n+\"[\"+t+\"]\",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+\"=\"+encodeURIComponent(null==n?\"\":n)};if(null==e)return\"\";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join(\"&\")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,\"elements\");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(\":disabled\")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,\"\\r\\n\")}}):{name:t.name,value:n.replace(kt,\"\\r\\n\")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \\t]*([^\\r\\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\\/\\//,Rt={},Mt={},It=\"*/\".concat(\"*\"),Wt=E.createElement(\"a\");function Ft(o){return function(e,t){\"string\"!=typeof e&&(t=e,e=\"*\");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])\"+\"===n[0]?(n=n.slice(1)||\"*\",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return\"string\"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s[\"*\"]&&l(\"*\")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:\"GET\",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":It,text:\"text/plain\",html:\"text/html\",xml:\"application/xml, text/xml\",json:\"application/json, text/javascript\"},contents:{xml:/\\bxml\\b/,html:/\\bhtml/,json:/\\bjson\\b/},responseFields:{xml:\"responseXML\",text:\"responseText\",json:\"responseJSON\"},converters:{\"* text\":String,\"text html\":!0,\"text json\":JSON.parse,\"text xml\":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){\"object\"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks(\"once memory\"),w=v.statusCode||{},a={},s={},u=\"canceled\",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+\" \"]=(n[t[1].toLowerCase()+\" \"]||[]).concat(t[2])}t=n[e.toLowerCase()+\" \"]}return null==t?null:t.join(\", \")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+\"\").replace(Pt,Tt.protocol+\"//\"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||\"*\").toLowerCase().match(P)||[\"\"],null==v.crossDomain){r=E.createElement(\"a\");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+\"//\"+Wt.host!=r.protocol+\"//\"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&\"string\"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger(\"ajaxStart\"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,\"\"),v.hasContent?v.data&&v.processData&&0===(v.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&(v.data=v.data.replace(jt,\"+\")):(o=v.url.slice(f.length),v.data&&(v.processData||\"string\"==typeof v.data)&&(f+=(Et.test(f)?\"&\":\"?\")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,\"$1\"),o=(Et.test(f)?\"&\":\"?\")+\"_=\"+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader(\"If-Modified-Since\",S.lastModified[f]),S.etag[f]&&T.setRequestHeader(\"If-None-Match\",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader(\"Content-Type\",v.contentType),T.setRequestHeader(\"Accept\",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+(\"*\"!==v.dataTypes[0]?\", \"+It+\"; q=0.01\":\"\"):v.accepts[\"*\"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u=\"abort\",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger(\"ajaxSend\",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort(\"timeout\")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,\"No Transport\");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||\"\",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while(\"*\"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader(\"Content-Type\"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+\" \"+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray(\"script\",v.dataTypes)&&(v.converters[\"text script\"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if(\"*\"===o)o=u;else if(\"*\"!==u&&u!==o){if(!(a=l[u+\" \"+o]||l[\"* \"+o]))for(i in l)if((s=i.split(\" \"))[1]===o&&(a=l[u+\" \"+s[0]]||l[\"* \"+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e[\"throws\"])t=a(t);else try{t=a(t)}catch(e){return{state:\"parsererror\",error:a?e:\"No conversion from \"+u+\" to \"+o}}}return{state:\"success\",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader(\"Last-Modified\"))&&(S.lastModified[f]=u),(u=T.getResponseHeader(\"etag\"))&&(S.etag[f]=u)),204===e||\"HEAD\"===v.type?l=\"nocontent\":304===e?l=\"notmodified\":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l=\"error\",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+\"\",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?\"ajaxSuccess\":\"ajaxError\",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger(\"ajaxComplete\",[T,v]),--S.active||S.event.trigger(\"ajaxStop\")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,\"json\")},getScript:function(e,t){return S.get(e,void 0,t,\"script\")}}),S.each([\"get\",\"post\"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)\"content-type\"===t.toLowerCase()&&(e.contentType=e.headers[t]||\"\")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:\"GET\",dataType:\"script\",cache:!0,async:!1,global:!1,converters:{\"text script\":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not(\"body\").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&\"withCredentials\"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e[\"X-Requested-With\"]||(e[\"X-Requested-With\"]=\"XMLHttpRequest\"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,\"abort\"===e?r.abort():\"error\"===e?\"number\"!=typeof r.status?t(0,\"error\"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,\"text\"!==(r.responseType||\"text\")||\"string\"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o(\"error\"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o(\"abort\");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/\\b(?:java|ecma)script\\b/},converters:{\"text script\":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter(\"script\",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type=\"GET\")}),S.ajaxTransport(\"script\",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S(\"<script>\").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on(\"load error\",i=function(e){r.remove(),i=null,e&&t(\"error\"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\\?(?=&|$)|\\?\\?/;S.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){var e=Xt.pop()||S.expando+\"_\"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter(\"json jsonp\",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?\"url\":\"string\"==typeof e.data&&0===(e.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&Vt.test(e.data)&&\"data\");if(a||\"jsonp\"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,\"$1\"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?\"&\":\"?\")+e.jsonp+\"=\"+r),e.converters[\"script json\"]=function(){return o||S.error(r+\" was not called\"),o[0]},e.dataTypes[0]=\"json\",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),\"script\"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument(\"\").body).innerHTML=\"<form></form><form></form>\",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return\"string\"!=typeof e?[]:(\"boolean\"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument(\"\")).createElement(\"base\")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(\" \");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&\"object\"==typeof t&&(i=\"POST\"),0<a.length&&S.ajax({url:e,type:i||\"GET\",dataType:\"html\",data:t}).done(function(e){o=arguments,a.html(r?S(\"<div>\").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,\"position\"),c=S(e),f={};\"static\"===l&&(e.style.position=\"relative\"),s=c.offset(),o=S.css(e,\"top\"),u=S.css(e,\"left\"),(\"absolute\"===l||\"fixed\"===l)&&-1<(o+u).indexOf(\"auto\")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),\"using\"in t?t.using.call(e,f):(\"number\"==typeof f.top&&(f.top+=\"px\"),\"number\"==typeof f.left&&(f.left+=\"px\"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if(\"fixed\"===S.css(r,\"position\"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&\"static\"===S.css(e,\"position\"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,\"borderTopWidth\",!0),i.left+=S.css(e,\"borderLeftWidth\",!0))}return{top:t.top-i.top-S.css(r,\"marginTop\",!0),left:t.left-i.left-S.css(r,\"marginLeft\",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&\"static\"===S.css(e,\"position\"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:\"pageXOffset\",scrollTop:\"pageYOffset\"},function(t,i){var o=\"pageYOffset\"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each([\"top\",\"left\"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+\"px\":t})}),S.each({Height:\"height\",Width:\"width\"},function(a,s){S.each({padding:\"inner\"+a,content:s,\"\":\"outer\"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||\"boolean\"!=typeof e),i=r||(!0===e||!0===t?\"margin\":\"border\");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf(\"outer\")?e[\"inner\"+a]:e.document.documentElement[\"client\"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body[\"scroll\"+a],r[\"scroll\"+a],e.body[\"offset\"+a],r[\"offset\"+a],r[\"client\"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each([\"ajaxStart\",\"ajaxStop\",\"ajaxComplete\",\"ajaxError\",\"ajaxSuccess\",\"ajaxSend\"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,\"**\"):this.off(t,e||\"**\",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each(\"blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu\".split(\" \"),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if(\"string\"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return(\"number\"===t||\"string\"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?\"\":(e+\"\").replace(Gt,\"\")},\"function\"==typeof define&&define.amd&&define(\"jquery\",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},\"undefined\"==typeof e&&(C.jQuery=C.$=S),S});\n"
  },
  {
    "path": "docs-aside/_static/js/badge_only.js",
    "content": "!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=4)}({4:function(e,t,r){}});"
  },
  {
    "path": "docs-aside/_static/js/theme.js",
    "content": "!function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(n,\"__esModule\",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&\"object\"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:n}),2&e&&\"string\"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,\"a\",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p=\"\",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e=\"undefined\"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on(\"hashchange\",t.reset),n&&t.win.on(\"scroll\",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on(\"resize\",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n(\"div.wy-side-scroll:first\"),this.win=n(window),n(document).on(\"click\",\"[data-toggle='wy-nav-top']\",(function(){n(\"[data-toggle='wy-nav-shift']\").toggleClass(\"shift\"),n(\"[data-toggle='rst-versions']\").toggleClass(\"shift\")})).on(\"click\",\".wy-menu-vertical .current ul li a\",(function(){var t=n(this);n(\"[data-toggle='wy-nav-shift']\").removeClass(\"shift\"),n(\"[data-toggle='rst-versions']\").toggleClass(\"shift\"),e.toggleCurrent(t),e.hashChange()})).on(\"click\",\"[data-toggle='rst-current-version']\",(function(){n(\"[data-toggle='rst-versions']\").toggleClass(\"shift-up\")})),n(\"table.docutils:not(.field-list,.footnote,.citation)\").wrap(\"<div class='wy-table-responsive'></div>\"),n(\"table.docutils.footnote\").wrap(\"<div class='wy-table-responsive footnote'></div>\"),n(\"table.docutils.citation\").wrap(\"<div class='wy-table-responsive citation'></div>\"),n(\".wy-menu-vertical ul\").not(\".simple\").siblings(\"a\").each((function(){var t=n(this);expand=n('<button class=\"toctree-expand\" title=\"Open/close menu\"></button>'),expand.on(\"click\",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||\"#\";try{var e=$(\".wy-menu-vertical\"),t=e.find('[href=\"'+n+'\"]');if(0===t.length){var i=$('.document [id=\"'+n.substring(1)+'\"]').closest(\"div.section\");0===(t=e.find('[href=\"#'+i.attr(\"id\")+'\"]')).length&&(t=e.find('[href=\"#\"]'))}if(t.length>0){$(\".wy-menu-vertical .current\").removeClass(\"current\").attr(\"aria-expanded\",\"false\"),t.addClass(\"current\").attr(\"aria-expanded\",\"true\"),t.closest(\"li.toctree-l1\").parent().addClass(\"current\").attr(\"aria-expanded\",\"true\");for(let n=1;n<=10;n++)t.closest(\"li.toctree-l\"+n).addClass(\"current\").attr(\"aria-expanded\",\"true\");t[0].scrollIntoView()}}catch(n){console.log(\"Error expanding nav for anchor\",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one(\"hashchange\",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest(\"li\");e.siblings(\"li.current\").removeClass(\"current\").attr(\"aria-expanded\",\"false\"),e.siblings().find(\"li.current\").removeClass(\"current\").attr(\"aria-expanded\",\"false\");var t=e.find(\"> ul li\");t.length&&(t.removeClass(\"current\").attr(\"aria-expanded\",\"false\"),e.toggleClass(\"current\").attr(\"aria-expanded\",(function(n,e){return\"true\"==e?\"false\":\"true\"})))}},\"undefined\"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=[\"ms\",\"moz\",\"webkit\",\"o\"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+\"RequestAnimationFrame\"],window.cancelAnimationFrame=window[e[t]+\"CancelAnimationFrame\"]||window[e[t]+\"CancelRequestAnimationFrame\"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,t){var i=(new Date).getTime(),o=Math.max(0,16-(i-n)),r=window.setTimeout((function(){e(i+o)}),o);return n=i+o,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})}()}).call(window)},function(n,e){n.exports=jQuery},function(n,e,t){}]);"
  },
  {
    "path": "docs-aside/_static/language_data.js",
    "content": "/*\n * language_data.js\n * ~~~~~~~~~~~~~~~~\n *\n * This script contains the language-specific data used by searchtools.js,\n * namely the list of stopwords, stemmer, scorer and splitter.\n *\n * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\nvar stopwords = [\"a\",\"and\",\"are\",\"as\",\"at\",\"be\",\"but\",\"by\",\"for\",\"if\",\"in\",\"into\",\"is\",\"it\",\"near\",\"no\",\"not\",\"of\",\"on\",\"or\",\"such\",\"that\",\"the\",\"their\",\"then\",\"there\",\"these\",\"they\",\"this\",\"to\",\"was\",\"will\",\"with\"];\n\n\n/* Non-minified version JS is _stemmer.js if file is provided */ \n/**\n * Porter Stemmer\n */\nvar Stemmer = function() {\n\n  var step2list = {\n    ational: 'ate',\n    tional: 'tion',\n    enci: 'ence',\n    anci: 'ance',\n    izer: 'ize',\n    bli: 'ble',\n    alli: 'al',\n    entli: 'ent',\n    eli: 'e',\n    ousli: 'ous',\n    ization: 'ize',\n    ation: 'ate',\n    ator: 'ate',\n    alism: 'al',\n    iveness: 'ive',\n    fulness: 'ful',\n    ousness: 'ous',\n    aliti: 'al',\n    iviti: 'ive',\n    biliti: 'ble',\n    logi: 'log'\n  };\n\n  var step3list = {\n    icate: 'ic',\n    ative: '',\n    alize: 'al',\n    iciti: 'ic',\n    ical: 'ic',\n    ful: '',\n    ness: ''\n  };\n\n  var c = \"[^aeiou]\";          // consonant\n  var v = \"[aeiouy]\";          // vowel\n  var C = c + \"[^aeiouy]*\";    // consonant sequence\n  var V = v + \"[aeiou]*\";      // vowel sequence\n\n  var mgr0 = \"^(\" + C + \")?\" + V + C;                      // [C]VC... is m>0\n  var meq1 = \"^(\" + C + \")?\" + V + C + \"(\" + V + \")?$\";    // [C]VC[V] is m=1\n  var mgr1 = \"^(\" + C + \")?\" + V + C + V + C;              // [C]VCVC... is m>1\n  var s_v   = \"^(\" + C + \")?\" + v;                         // vowel in stem\n\n  this.stemWord = function (w) {\n    var stem;\n    var suffix;\n    var firstch;\n    var origword = w;\n\n    if (w.length < 3)\n      return w;\n\n    var re;\n    var re2;\n    var re3;\n    var re4;\n\n    firstch = w.substr(0,1);\n    if (firstch == \"y\")\n      w = firstch.toUpperCase() + w.substr(1);\n\n    // Step 1a\n    re = /^(.+?)(ss|i)es$/;\n    re2 = /^(.+?)([^s])s$/;\n\n    if (re.test(w))\n      w = w.replace(re,\"$1$2\");\n    else if (re2.test(w))\n      w = w.replace(re2,\"$1$2\");\n\n    // Step 1b\n    re = /^(.+?)eed$/;\n    re2 = /^(.+?)(ed|ing)$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      re = new RegExp(mgr0);\n      if (re.test(fp[1])) {\n        re = /.$/;\n        w = w.replace(re,\"\");\n      }\n    }\n    else if (re2.test(w)) {\n      var fp = re2.exec(w);\n      stem = fp[1];\n      re2 = new RegExp(s_v);\n      if (re2.test(stem)) {\n        w = stem;\n        re2 = /(at|bl|iz)$/;\n        re3 = new RegExp(\"([^aeiouylsz])\\\\1$\");\n        re4 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n        if (re2.test(w))\n          w = w + \"e\";\n        else if (re3.test(w)) {\n          re = /.$/;\n          w = w.replace(re,\"\");\n        }\n        else if (re4.test(w))\n          w = w + \"e\";\n      }\n    }\n\n    // Step 1c\n    re = /^(.+?)y$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      re = new RegExp(s_v);\n      if (re.test(stem))\n        w = stem + \"i\";\n    }\n\n    // Step 2\n    re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      suffix = fp[2];\n      re = new RegExp(mgr0);\n      if (re.test(stem))\n        w = stem + step2list[suffix];\n    }\n\n    // Step 3\n    re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      suffix = fp[2];\n      re = new RegExp(mgr0);\n      if (re.test(stem))\n        w = stem + step3list[suffix];\n    }\n\n    // Step 4\n    re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;\n    re2 = /^(.+?)(s|t)(ion)$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      re = new RegExp(mgr1);\n      if (re.test(stem))\n        w = stem;\n    }\n    else if (re2.test(w)) {\n      var fp = re2.exec(w);\n      stem = fp[1] + fp[2];\n      re2 = new RegExp(mgr1);\n      if (re2.test(stem))\n        w = stem;\n    }\n\n    // Step 5\n    re = /^(.+?)e$/;\n    if (re.test(w)) {\n      var fp = re.exec(w);\n      stem = fp[1];\n      re = new RegExp(mgr1);\n      re2 = new RegExp(meq1);\n      re3 = new RegExp(\"^\" + C + v + \"[^aeiouwxy]$\");\n      if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))\n        w = stem;\n    }\n    re = /ll$/;\n    re2 = new RegExp(mgr1);\n    if (re.test(w) && re2.test(w)) {\n      re = /.$/;\n      w = w.replace(re,\"\");\n    }\n\n    // and turn initial Y back to y\n    if (firstch == \"y\")\n      w = firstch.toLowerCase() + w.substr(1);\n    return w;\n  }\n}\n\n\n\n\n\nvar splitChars = (function() {\n    var result = {};\n    var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,\n         1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,\n         2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,\n         2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,\n         3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,\n         3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,\n         4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,\n         8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,\n         11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,\n         43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];\n    var i, j, start, end;\n    for (i = 0; i < singles.length; i++) {\n        result[singles[i]] = true;\n    }\n    var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],\n         [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],\n         [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],\n         [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],\n         [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],\n         [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],\n         [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],\n         [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],\n         [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],\n         [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],\n         [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],\n         [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],\n         [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],\n         [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],\n         [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],\n         [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],\n         [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],\n         [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],\n         [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],\n         [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],\n         [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],\n         [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],\n         [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],\n         [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],\n         [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],\n         [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],\n         [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],\n         [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],\n         [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],\n         [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],\n         [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],\n         [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],\n         [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],\n         [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],\n         [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],\n         [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],\n         [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],\n         [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],\n         [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],\n         [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],\n         [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],\n         [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],\n         [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],\n         [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],\n         [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],\n         [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],\n         [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],\n         [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],\n         [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];\n    for (i = 0; i < ranges.length; i++) {\n        start = ranges[i][0];\n        end = ranges[i][1];\n        for (j = start; j <= end; j++) {\n            result[j] = true;\n        }\n    }\n    return result;\n})();\n\nfunction splitQuery(query) {\n    var result = [];\n    var start = -1;\n    for (var i = 0; i < query.length; i++) {\n        if (splitChars[query.charCodeAt(i)]) {\n            if (start !== -1) {\n                result.push(query.slice(start, i));\n                start = -1;\n            }\n        } else if (start === -1) {\n            start = i;\n        }\n    }\n    if (start !== -1) {\n        result.push(query.slice(start));\n    }\n    return result;\n}\n\n\n"
  },
  {
    "path": "docs-aside/_static/pygments.css",
    "content": "pre { line-height: 125%; }\ntd.linenos pre { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }\nspan.linenos { color: #000000; background-color: #f0f0f0; padding-left: 5px; padding-right: 5px; }\ntd.linenos pre.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\nspan.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }\n.highlight .hll { background-color: #ffffcc }\n.highlight { background: #f8f8f8; }\n.highlight .c { color: #408080; font-style: italic } /* Comment */\n.highlight .err { border: 1px solid #FF0000 } /* Error */\n.highlight .k { color: #008000; font-weight: bold } /* Keyword */\n.highlight .o { color: #666666 } /* Operator */\n.highlight .ch { color: #408080; font-style: italic } /* Comment.Hashbang */\n.highlight .cm { color: #408080; font-style: italic } /* Comment.Multiline */\n.highlight .cp { color: #BC7A00 } /* Comment.Preproc */\n.highlight .cpf { color: #408080; font-style: italic } /* Comment.PreprocFile */\n.highlight .c1 { color: #408080; font-style: italic } /* Comment.Single */\n.highlight .cs { color: #408080; font-style: italic } /* Comment.Special */\n.highlight .gd { color: #A00000 } /* Generic.Deleted */\n.highlight .ge { font-style: italic } /* Generic.Emph */\n.highlight .gr { color: #FF0000 } /* Generic.Error */\n.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */\n.highlight .gi { color: #00A000 } /* Generic.Inserted */\n.highlight .go { color: #888888 } /* Generic.Output */\n.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */\n.highlight .gs { font-weight: bold } /* Generic.Strong */\n.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */\n.highlight .gt { color: #0044DD } /* Generic.Traceback */\n.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */\n.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */\n.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */\n.highlight .kp { color: #008000 } /* Keyword.Pseudo */\n.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */\n.highlight .kt { color: #B00040 } /* Keyword.Type */\n.highlight .m { color: #666666 } /* Literal.Number */\n.highlight .s { color: #BA2121 } /* Literal.String */\n.highlight .na { color: #7D9029 } /* Name.Attribute */\n.highlight .nb { color: #008000 } /* Name.Builtin */\n.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */\n.highlight .no { color: #880000 } /* Name.Constant */\n.highlight .nd { color: #AA22FF } /* Name.Decorator */\n.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */\n.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */\n.highlight .nf { color: #0000FF } /* Name.Function */\n.highlight .nl { color: #A0A000 } /* Name.Label */\n.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */\n.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */\n.highlight .nv { color: #19177C } /* Name.Variable */\n.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */\n.highlight .w { color: #bbbbbb } /* Text.Whitespace */\n.highlight .mb { color: #666666 } /* Literal.Number.Bin */\n.highlight .mf { color: #666666 } /* Literal.Number.Float */\n.highlight .mh { color: #666666 } /* Literal.Number.Hex */\n.highlight .mi { color: #666666 } /* Literal.Number.Integer */\n.highlight .mo { color: #666666 } /* Literal.Number.Oct */\n.highlight .sa { color: #BA2121 } /* Literal.String.Affix */\n.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */\n.highlight .sc { color: #BA2121 } /* Literal.String.Char */\n.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */\n.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */\n.highlight .s2 { color: #BA2121 } /* Literal.String.Double */\n.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */\n.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */\n.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */\n.highlight .sx { color: #008000 } /* Literal.String.Other */\n.highlight .sr { color: #BB6688 } /* Literal.String.Regex */\n.highlight .s1 { color: #BA2121 } /* Literal.String.Single */\n.highlight .ss { color: #19177C } /* Literal.String.Symbol */\n.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */\n.highlight .fm { color: #0000FF } /* Name.Function.Magic */\n.highlight .vc { color: #19177C } /* Name.Variable.Class */\n.highlight .vg { color: #19177C } /* Name.Variable.Global */\n.highlight .vi { color: #19177C } /* Name.Variable.Instance */\n.highlight .vm { color: #19177C } /* Name.Variable.Magic */\n.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */"
  },
  {
    "path": "docs-aside/_static/searchtools.js",
    "content": "/*\n * searchtools.js\n * ~~~~~~~~~~~~~~~~\n *\n * Sphinx JavaScript utilities for the full-text search.\n *\n * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.\n * :license: BSD, see LICENSE for details.\n *\n */\n\nif (!Scorer) {\n  /**\n   * Simple result scoring code.\n   */\n  var Scorer = {\n    // Implement the following function to further tweak the score for each result\n    // The function takes a result array [filename, title, anchor, descr, score]\n    // and returns the new score.\n    /*\n    score: function(result) {\n      return result[4];\n    },\n    */\n\n    // query matches the full name of an object\n    objNameMatch: 11,\n    // or matches in the last dotted part of the object name\n    objPartialMatch: 6,\n    // Additive scores depending on the priority of the object\n    objPrio: {0:  15,   // used to be importantResults\n              1:  5,   // used to be objectResults\n              2: -5},  // used to be unimportantResults\n    //  Used when the priority is not in the mapping.\n    objPrioDefault: 0,\n\n    // query found in title\n    title: 15,\n    partialTitle: 7,\n    // query found in terms\n    term: 5,\n    partialTerm: 2\n  };\n}\n\nif (!splitQuery) {\n  function splitQuery(query) {\n    return query.split(/\\s+/);\n  }\n}\n\n/**\n * Search Module\n */\nvar Search = {\n\n  _index : null,\n  _queued_query : null,\n  _pulse_status : -1,\n\n  htmlToText : function(htmlString) {\n      var htmlElement = document.createElement('span');\n      htmlElement.innerHTML = htmlString;\n      $(htmlElement).find('.headerlink').remove();\n      docContent = $(htmlElement).find('[role=main]')[0];\n      if(docContent === undefined) {\n          console.warn(\"Content block not found. Sphinx search tries to obtain it \" +\n                       \"via '[role=main]'. Could you check your theme or template.\");\n          return \"\";\n      }\n      return docContent.textContent || docContent.innerText;\n  },\n\n  init : function() {\n      var params = $.getQueryParameters();\n      if (params.q) {\n          var query = params.q[0];\n          $('input[name=\"q\"]')[0].value = query;\n          this.performSearch(query);\n      }\n  },\n\n  loadIndex : function(url) {\n    $.ajax({type: \"GET\", url: url, data: null,\n            dataType: \"script\", cache: true,\n            complete: function(jqxhr, textstatus) {\n              if (textstatus != \"success\") {\n                document.getElementById(\"searchindexloader\").src = url;\n              }\n            }});\n  },\n\n  setIndex : function(index) {\n    var q;\n    this._index = index;\n    if ((q = this._queued_query) !== null) {\n      this._queued_query = null;\n      Search.query(q);\n    }\n  },\n\n  hasIndex : function() {\n      return this._index !== null;\n  },\n\n  deferQuery : function(query) {\n      this._queued_query = query;\n  },\n\n  stopPulse : function() {\n      this._pulse_status = 0;\n  },\n\n  startPulse : function() {\n    if (this._pulse_status >= 0)\n        return;\n    function pulse() {\n      var i;\n      Search._pulse_status = (Search._pulse_status + 1) % 4;\n      var dotString = '';\n      for (i = 0; i < Search._pulse_status; i++)\n        dotString += '.';\n      Search.dots.text(dotString);\n      if (Search._pulse_status > -1)\n        window.setTimeout(pulse, 500);\n    }\n    pulse();\n  },\n\n  /**\n   * perform a search for something (or wait until index is loaded)\n   */\n  performSearch : function(query) {\n    // create the required interface elements\n    this.out = $('#search-results');\n    this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);\n    this.dots = $('<span></span>').appendTo(this.title);\n    this.status = $('<p class=\"search-summary\">&nbsp;</p>').appendTo(this.out);\n    this.output = $('<ul class=\"search\"/>').appendTo(this.out);\n\n    $('#search-progress').text(_('Preparing search...'));\n    this.startPulse();\n\n    // index already loaded, the browser was quick!\n    if (this.hasIndex())\n      this.query(query);\n    else\n      this.deferQuery(query);\n  },\n\n  /**\n   * execute search (requires search index to be loaded)\n   */\n  query : function(query) {\n    var i;\n\n    // stem the searchterms and add them to the correct list\n    var stemmer = new Stemmer();\n    var searchterms = [];\n    var excluded = [];\n    var hlterms = [];\n    var tmp = splitQuery(query);\n    var objectterms = [];\n    for (i = 0; i < tmp.length; i++) {\n      if (tmp[i] !== \"\") {\n          objectterms.push(tmp[i].toLowerCase());\n      }\n\n      if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i] === \"\") {\n        // skip this \"word\"\n        continue;\n      }\n      // stem the word\n      var word = stemmer.stemWord(tmp[i].toLowerCase());\n      // prevent stemmer from cutting word smaller than two chars\n      if(word.length < 3 && tmp[i].length >= 3) {\n        word = tmp[i];\n      }\n      var toAppend;\n      // select the correct list\n      if (word[0] == '-') {\n        toAppend = excluded;\n        word = word.substr(1);\n      }\n      else {\n        toAppend = searchterms;\n        hlterms.push(tmp[i].toLowerCase());\n      }\n      // only add if not already in the list\n      if (!$u.contains(toAppend, word))\n        toAppend.push(word);\n    }\n    var highlightstring = '?highlight=' + $.urlencode(hlterms.join(\" \"));\n\n    // console.debug('SEARCH: searching for:');\n    // console.info('required: ', searchterms);\n    // console.info('excluded: ', excluded);\n\n    // prepare search\n    var terms = this._index.terms;\n    var titleterms = this._index.titleterms;\n\n    // array of [filename, title, anchor, descr, score]\n    var results = [];\n    $('#search-progress').empty();\n\n    // lookup as object\n    for (i = 0; i < objectterms.length; i++) {\n      var others = [].concat(objectterms.slice(0, i),\n                             objectterms.slice(i+1, objectterms.length));\n      results = results.concat(this.performObjectSearch(objectterms[i], others));\n    }\n\n    // lookup as search terms in fulltext\n    results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));\n\n    // let the scorer override scores with a custom scoring function\n    if (Scorer.score) {\n      for (i = 0; i < results.length; i++)\n        results[i][4] = Scorer.score(results[i]);\n    }\n\n    // now sort the results by score (in opposite order of appearance, since the\n    // display function below uses pop() to retrieve items) and then\n    // alphabetically\n    results.sort(function(a, b) {\n      var left = a[4];\n      var right = b[4];\n      if (left > right) {\n        return 1;\n      } else if (left < right) {\n        return -1;\n      } else {\n        // same score: sort alphabetically\n        left = a[1].toLowerCase();\n        right = b[1].toLowerCase();\n        return (left > right) ? -1 : ((left < right) ? 1 : 0);\n      }\n    });\n\n    // for debugging\n    //Search.lastresults = results.slice();  // a copy\n    //console.info('search results:', Search.lastresults);\n\n    // print the results\n    var resultCount = results.length;\n    function displayNextItem() {\n      // results left, load the summary and display it\n      if (results.length) {\n        var item = results.pop();\n        var listItem = $('<li style=\"display:none\"></li>');\n        var requestUrl = \"\";\n        var linkUrl = \"\";\n        if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {\n          // dirhtml builder\n          var dirname = item[0] + '/';\n          if (dirname.match(/\\/index\\/$/)) {\n            dirname = dirname.substring(0, dirname.length-6);\n          } else if (dirname == 'index/') {\n            dirname = '';\n          }\n          requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname;\n          linkUrl = requestUrl;\n\n        } else {\n          // normal html builders\n          requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;\n          linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;\n        }\n        listItem.append($('<a/>').attr('href',\n            linkUrl +\n            highlightstring + item[2]).html(item[1]));\n        if (item[3]) {\n          listItem.append($('<span> (' + item[3] + ')</span>'));\n          Search.output.append(listItem);\n          listItem.slideDown(5, function() {\n            displayNextItem();\n          });\n        } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {\n          $.ajax({url: requestUrl,\n                  dataType: \"text\",\n                  complete: function(jqxhr, textstatus) {\n                    var data = jqxhr.responseText;\n                    if (data !== '' && data !== undefined) {\n                      listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));\n                    }\n                    Search.output.append(listItem);\n                    listItem.slideDown(5, function() {\n                      displayNextItem();\n                    });\n                  }});\n        } else {\n          // no source available, just display title\n          Search.output.append(listItem);\n          listItem.slideDown(5, function() {\n            displayNextItem();\n          });\n        }\n      }\n      // search finished, update title and status message\n      else {\n        Search.stopPulse();\n        Search.title.text(_('Search Results'));\n        if (!resultCount)\n          Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\\'ve selected enough categories.'));\n        else\n            Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));\n        Search.status.fadeIn(500);\n      }\n    }\n    displayNextItem();\n  },\n\n  /**\n   * search for object names\n   */\n  performObjectSearch : function(object, otherterms) {\n    var filenames = this._index.filenames;\n    var docnames = this._index.docnames;\n    var objects = this._index.objects;\n    var objnames = this._index.objnames;\n    var titles = this._index.titles;\n\n    var i;\n    var results = [];\n\n    for (var prefix in objects) {\n      for (var name in objects[prefix]) {\n        var fullname = (prefix ? prefix + '.' : '') + name;\n        var fullnameLower = fullname.toLowerCase()\n        if (fullnameLower.indexOf(object) > -1) {\n          var score = 0;\n          var parts = fullnameLower.split('.');\n          // check for different match types: exact matches of full name or\n          // \"last name\" (i.e. last dotted part)\n          if (fullnameLower == object || parts[parts.length - 1] == object) {\n            score += Scorer.objNameMatch;\n          // matches in last name\n          } else if (parts[parts.length - 1].indexOf(object) > -1) {\n            score += Scorer.objPartialMatch;\n          }\n          var match = objects[prefix][name];\n          var objname = objnames[match[1]][2];\n          var title = titles[match[0]];\n          // If more than one term searched for, we require other words to be\n          // found in the name/title/description\n          if (otherterms.length > 0) {\n            var haystack = (prefix + ' ' + name + ' ' +\n                            objname + ' ' + title).toLowerCase();\n            var allfound = true;\n            for (i = 0; i < otherterms.length; i++) {\n              if (haystack.indexOf(otherterms[i]) == -1) {\n                allfound = false;\n                break;\n              }\n            }\n            if (!allfound) {\n              continue;\n            }\n          }\n          var descr = objname + _(', in ') + title;\n\n          var anchor = match[3];\n          if (anchor === '')\n            anchor = fullname;\n          else if (anchor == '-')\n            anchor = objnames[match[1]][1] + '-' + fullname;\n          // add custom score for some objects according to scorer\n          if (Scorer.objPrio.hasOwnProperty(match[2])) {\n            score += Scorer.objPrio[match[2]];\n          } else {\n            score += Scorer.objPrioDefault;\n          }\n          results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);\n        }\n      }\n    }\n\n    return results;\n  },\n\n  /**\n   * search for full-text terms in the index\n   */\n  performTermsSearch : function(searchterms, excluded, terms, titleterms) {\n    var docnames = this._index.docnames;\n    var filenames = this._index.filenames;\n    var titles = this._index.titles;\n\n    var i, j, file;\n    var fileMap = {};\n    var scoreMap = {};\n    var results = [];\n\n    // perform the search on the required terms\n    for (i = 0; i < searchterms.length; i++) {\n      var word = searchterms[i];\n      var files = [];\n      var _o = [\n        {files: terms[word], score: Scorer.term},\n        {files: titleterms[word], score: Scorer.title}\n      ];\n      // add support for partial matches\n      if (word.length > 2) {\n        for (var w in terms) {\n          if (w.match(word) && !terms[word]) {\n            _o.push({files: terms[w], score: Scorer.partialTerm})\n          }\n        }\n        for (var w in titleterms) {\n          if (w.match(word) && !titleterms[word]) {\n              _o.push({files: titleterms[w], score: Scorer.partialTitle})\n          }\n        }\n      }\n\n      // no match but word was a required one\n      if ($u.every(_o, function(o){return o.files === undefined;})) {\n        break;\n      }\n      // found search word in contents\n      $u.each(_o, function(o) {\n        var _files = o.files;\n        if (_files === undefined)\n          return\n\n        if (_files.length === undefined)\n          _files = [_files];\n        files = files.concat(_files);\n\n        // set score for the word in each file to Scorer.term\n        for (j = 0; j < _files.length; j++) {\n          file = _files[j];\n          if (!(file in scoreMap))\n            scoreMap[file] = {};\n          scoreMap[file][word] = o.score;\n        }\n      });\n\n      // create the mapping\n      for (j = 0; j < files.length; j++) {\n        file = files[j];\n        if (file in fileMap && fileMap[file].indexOf(word) === -1)\n          fileMap[file].push(word);\n        else\n          fileMap[file] = [word];\n      }\n    }\n\n    // now check if the files don't contain excluded terms\n    for (file in fileMap) {\n      var valid = true;\n\n      // check if all requirements are matched\n      var filteredTermCount = // as search terms with length < 3 are discarded: ignore\n        searchterms.filter(function(term){return term.length > 2}).length\n      if (\n        fileMap[file].length != searchterms.length &&\n        fileMap[file].length != filteredTermCount\n      ) continue;\n\n      // ensure that none of the excluded terms is in the search result\n      for (i = 0; i < excluded.length; i++) {\n        if (terms[excluded[i]] == file ||\n            titleterms[excluded[i]] == file ||\n            $u.contains(terms[excluded[i]] || [], file) ||\n            $u.contains(titleterms[excluded[i]] || [], file)) {\n          valid = false;\n          break;\n        }\n      }\n\n      // if we have still a valid result we can add it to the result list\n      if (valid) {\n        // select one (max) score for the file.\n        // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...\n        var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));\n        results.push([docnames[file], titles[file], '', null, score, filenames[file]]);\n      }\n    }\n    return results;\n  },\n\n  /**\n   * helper function to return a node containing the\n   * search summary for a given text. keywords is a list\n   * of stemmed words, hlwords is the list of normal, unstemmed\n   * words. the first one is used to find the occurrence, the\n   * latter for highlighting it.\n   */\n  makeSearchSummary : function(htmlText, keywords, hlwords) {\n    var text = Search.htmlToText(htmlText);\n    var textLower = text.toLowerCase();\n    var start = 0;\n    $.each(keywords, function() {\n      var i = textLower.indexOf(this.toLowerCase());\n      if (i > -1)\n        start = i;\n    });\n    start = Math.max(start - 120, 0);\n    var excerpt = ((start > 0) ? '...' : '') +\n      $.trim(text.substr(start, 240)) +\n      ((start + 240 - text.length) ? '...' : '');\n    var rv = $('<div class=\"context\"></div>').text(excerpt);\n    $.each(hlwords, function() {\n      rv = rv.highlightText(this, 'highlighted');\n    });\n    return rv;\n  }\n};\n\n$(document).ready(function() {\n  Search.init();\n});\n"
  },
  {
    "path": "docs-aside/_static/underscore-1.3.1.js",
    "content": "//     Underscore.js 1.3.1\n//     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.\n//     Underscore is freely distributable under the MIT license.\n//     Portions of Underscore are inspired or borrowed from Prototype,\n//     Oliver Steele's Functional, and John Resig's Micro-Templating.\n//     For all details and documentation:\n//     http://documentcloud.github.com/underscore\n\n(function() {\n\n  // Baseline setup\n  // --------------\n\n  // Establish the root object, `window` in the browser, or `global` on the server.\n  var root = this;\n\n  // Save the previous value of the `_` variable.\n  var previousUnderscore = root._;\n\n  // Establish the object that gets returned to break out of a loop iteration.\n  var breaker = {};\n\n  // Save bytes in the minified (but not gzipped) version:\n  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n  // Create quick reference variables for speed access to core prototypes.\n  var slice            = ArrayProto.slice,\n      unshift          = ArrayProto.unshift,\n      toString         = ObjProto.toString,\n      hasOwnProperty   = ObjProto.hasOwnProperty;\n\n  // All **ECMAScript 5** native function implementations that we hope to use\n  // are declared here.\n  var\n    nativeForEach      = ArrayProto.forEach,\n    nativeMap          = ArrayProto.map,\n    nativeReduce       = ArrayProto.reduce,\n    nativeReduceRight  = ArrayProto.reduceRight,\n    nativeFilter       = ArrayProto.filter,\n    nativeEvery        = ArrayProto.every,\n    nativeSome         = ArrayProto.some,\n    nativeIndexOf      = ArrayProto.indexOf,\n    nativeLastIndexOf  = ArrayProto.lastIndexOf,\n    nativeIsArray      = Array.isArray,\n    nativeKeys         = Object.keys,\n    nativeBind         = FuncProto.bind;\n\n  // Create a safe reference to the Underscore object for use below.\n  var _ = function(obj) { return new wrapper(obj); };\n\n  // Export the Underscore object for **Node.js**, with\n  // backwards-compatibility for the old `require()` API. If we're in\n  // the browser, add `_` as a global object via a string identifier,\n  // for Closure Compiler \"advanced\" mode.\n  if (typeof exports !== 'undefined') {\n    if (typeof module !== 'undefined' && module.exports) {\n      exports = module.exports = _;\n    }\n    exports._ = _;\n  } else {\n    root['_'] = _;\n  }\n\n  // Current version.\n  _.VERSION = '1.3.1';\n\n  // Collection Functions\n  // --------------------\n\n  // The cornerstone, an `each` implementation, aka `forEach`.\n  // Handles objects with the built-in `forEach`, arrays, and raw objects.\n  // Delegates to **ECMAScript 5**'s native `forEach` if available.\n  var each = _.each = _.forEach = function(obj, iterator, context) {\n    if (obj == null) return;\n    if (nativeForEach && obj.forEach === nativeForEach) {\n      obj.forEach(iterator, context);\n    } else if (obj.length === +obj.length) {\n      for (var i = 0, l = obj.length; i < l; i++) {\n        if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;\n      }\n    } else {\n      for (var key in obj) {\n        if (_.has(obj, key)) {\n          if (iterator.call(context, obj[key], key, obj) === breaker) return;\n        }\n      }\n    }\n  };\n\n  // Return the results of applying the iterator to each element.\n  // Delegates to **ECMAScript 5**'s native `map` if available.\n  _.map = _.collect = function(obj, iterator, context) {\n    var results = [];\n    if (obj == null) return results;\n    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);\n    each(obj, function(value, index, list) {\n      results[results.length] = iterator.call(context, value, index, list);\n    });\n    if (obj.length === +obj.length) results.length = obj.length;\n    return results;\n  };\n\n  // **Reduce** builds up a single result from a list of values, aka `inject`,\n  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.\n  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {\n    var initial = arguments.length > 2;\n    if (obj == null) obj = [];\n    if (nativeReduce && obj.reduce === nativeReduce) {\n      if (context) iterator = _.bind(iterator, context);\n      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);\n    }\n    each(obj, function(value, index, list) {\n      if (!initial) {\n        memo = value;\n        initial = true;\n      } else {\n        memo = iterator.call(context, memo, value, index, list);\n      }\n    });\n    if (!initial) throw new TypeError('Reduce of empty array with no initial value');\n    return memo;\n  };\n\n  // The right-associative version of reduce, also known as `foldr`.\n  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.\n  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {\n    var initial = arguments.length > 2;\n    if (obj == null) obj = [];\n    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {\n      if (context) iterator = _.bind(iterator, context);\n      return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);\n    }\n    var reversed = _.toArray(obj).reverse();\n    if (context && !initial) iterator = _.bind(iterator, context);\n    return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);\n  };\n\n  // Return the first value which passes a truth test. Aliased as `detect`.\n  _.find = _.detect = function(obj, iterator, context) {\n    var result;\n    any(obj, function(value, index, list) {\n      if (iterator.call(context, value, index, list)) {\n        result = value;\n        return true;\n      }\n    });\n    return result;\n  };\n\n  // Return all the elements that pass a truth test.\n  // Delegates to **ECMAScript 5**'s native `filter` if available.\n  // Aliased as `select`.\n  _.filter = _.select = function(obj, iterator, context) {\n    var results = [];\n    if (obj == null) return results;\n    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);\n    each(obj, function(value, index, list) {\n      if (iterator.call(context, value, index, list)) results[results.length] = value;\n    });\n    return results;\n  };\n\n  // Return all the elements for which a truth test fails.\n  _.reject = function(obj, iterator, context) {\n    var results = [];\n    if (obj == null) return results;\n    each(obj, function(value, index, list) {\n      if (!iterator.call(context, value, index, list)) results[results.length] = value;\n    });\n    return results;\n  };\n\n  // Determine whether all of the elements match a truth test.\n  // Delegates to **ECMAScript 5**'s native `every` if available.\n  // Aliased as `all`.\n  _.every = _.all = function(obj, iterator, context) {\n    var result = true;\n    if (obj == null) return result;\n    if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);\n    each(obj, function(value, index, list) {\n      if (!(result = result && iterator.call(context, value, index, list))) return breaker;\n    });\n    return result;\n  };\n\n  // Determine if at least one element in the object matches a truth test.\n  // Delegates to **ECMAScript 5**'s native `some` if available.\n  // Aliased as `any`.\n  var any = _.some = _.any = function(obj, iterator, context) {\n    iterator || (iterator = _.identity);\n    var result = false;\n    if (obj == null) return result;\n    if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);\n    each(obj, function(value, index, list) {\n      if (result || (result = iterator.call(context, value, index, list))) return breaker;\n    });\n    return !!result;\n  };\n\n  // Determine if a given value is included in the array or object using `===`.\n  // Aliased as `contains`.\n  _.include = _.contains = function(obj, target) {\n    var found = false;\n    if (obj == null) return found;\n    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;\n    found = any(obj, function(value) {\n      return value === target;\n    });\n    return found;\n  };\n\n  // Invoke a method (with arguments) on every item in a collection.\n  _.invoke = function(obj, method) {\n    var args = slice.call(arguments, 2);\n    return _.map(obj, function(value) {\n      return (_.isFunction(method) ? method || value : value[method]).apply(value, args);\n    });\n  };\n\n  // Convenience version of a common use case of `map`: fetching a property.\n  _.pluck = function(obj, key) {\n    return _.map(obj, function(value){ return value[key]; });\n  };\n\n  // Return the maximum element or (element-based computation).\n  _.max = function(obj, iterator, context) {\n    if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);\n    if (!iterator && _.isEmpty(obj)) return -Infinity;\n    var result = {computed : -Infinity};\n    each(obj, function(value, index, list) {\n      var computed = iterator ? iterator.call(context, value, index, list) : value;\n      computed >= result.computed && (result = {value : value, computed : computed});\n    });\n    return result.value;\n  };\n\n  // Return the minimum element (or element-based computation).\n  _.min = function(obj, iterator, context) {\n    if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);\n    if (!iterator && _.isEmpty(obj)) return Infinity;\n    var result = {computed : Infinity};\n    each(obj, function(value, index, list) {\n      var computed = iterator ? iterator.call(context, value, index, list) : value;\n      computed < result.computed && (result = {value : value, computed : computed});\n    });\n    return result.value;\n  };\n\n  // Shuffle an array.\n  _.shuffle = function(obj) {\n    var shuffled = [], rand;\n    each(obj, function(value, index, list) {\n      if (index == 0) {\n        shuffled[0] = value;\n      } else {\n        rand = Math.floor(Math.random() * (index + 1));\n        shuffled[index] = shuffled[rand];\n        shuffled[rand] = value;\n      }\n    });\n    return shuffled;\n  };\n\n  // Sort the object's values by a criterion produced by an iterator.\n  _.sortBy = function(obj, iterator, context) {\n    return _.pluck(_.map(obj, function(value, index, list) {\n      return {\n        value : value,\n        criteria : iterator.call(context, value, index, list)\n      };\n    }).sort(function(left, right) {\n      var a = left.criteria, b = right.criteria;\n      return a < b ? -1 : a > b ? 1 : 0;\n    }), 'value');\n  };\n\n  // Groups the object's values by a criterion. Pass either a string attribute\n  // to group by, or a function that returns the criterion.\n  _.groupBy = function(obj, val) {\n    var result = {};\n    var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };\n    each(obj, function(value, index) {\n      var key = iterator(value, index);\n      (result[key] || (result[key] = [])).push(value);\n    });\n    return result;\n  };\n\n  // Use a comparator function to figure out at what index an object should\n  // be inserted so as to maintain order. Uses binary search.\n  _.sortedIndex = function(array, obj, iterator) {\n    iterator || (iterator = _.identity);\n    var low = 0, high = array.length;\n    while (low < high) {\n      var mid = (low + high) >> 1;\n      iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;\n    }\n    return low;\n  };\n\n  // Safely convert anything iterable into a real, live array.\n  _.toArray = function(iterable) {\n    if (!iterable)                return [];\n    if (iterable.toArray)         return iterable.toArray();\n    if (_.isArray(iterable))      return slice.call(iterable);\n    if (_.isArguments(iterable))  return slice.call(iterable);\n    return _.values(iterable);\n  };\n\n  // Return the number of elements in an object.\n  _.size = function(obj) {\n    return _.toArray(obj).length;\n  };\n\n  // Array Functions\n  // ---------------\n\n  // Get the first element of an array. Passing **n** will return the first N\n  // values in the array. Aliased as `head`. The **guard** check allows it to work\n  // with `_.map`.\n  _.first = _.head = function(array, n, guard) {\n    return (n != null) && !guard ? slice.call(array, 0, n) : array[0];\n  };\n\n  // Returns everything but the last entry of the array. Especcialy useful on\n  // the arguments object. Passing **n** will return all the values in\n  // the array, excluding the last N. The **guard** check allows it to work with\n  // `_.map`.\n  _.initial = function(array, n, guard) {\n    return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));\n  };\n\n  // Get the last element of an array. Passing **n** will return the last N\n  // values in the array. The **guard** check allows it to work with `_.map`.\n  _.last = function(array, n, guard) {\n    if ((n != null) && !guard) {\n      return slice.call(array, Math.max(array.length - n, 0));\n    } else {\n      return array[array.length - 1];\n    }\n  };\n\n  // Returns everything but the first entry of the array. Aliased as `tail`.\n  // Especially useful on the arguments object. Passing an **index** will return\n  // the rest of the values in the array from that index onward. The **guard**\n  // check allows it to work with `_.map`.\n  _.rest = _.tail = function(array, index, guard) {\n    return slice.call(array, (index == null) || guard ? 1 : index);\n  };\n\n  // Trim out all falsy values from an array.\n  _.compact = function(array) {\n    return _.filter(array, function(value){ return !!value; });\n  };\n\n  // Return a completely flattened version of an array.\n  _.flatten = function(array, shallow) {\n    return _.reduce(array, function(memo, value) {\n      if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));\n      memo[memo.length] = value;\n      return memo;\n    }, []);\n  };\n\n  // Return a version of the array that does not contain the specified value(s).\n  _.without = function(array) {\n    return _.difference(array, slice.call(arguments, 1));\n  };\n\n  // Produce a duplicate-free version of the array. If the array has already\n  // been sorted, you have the option of using a faster algorithm.\n  // Aliased as `unique`.\n  _.uniq = _.unique = function(array, isSorted, iterator) {\n    var initial = iterator ? _.map(array, iterator) : array;\n    var result = [];\n    _.reduce(initial, function(memo, el, i) {\n      if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) {\n        memo[memo.length] = el;\n        result[result.length] = array[i];\n      }\n      return memo;\n    }, []);\n    return result;\n  };\n\n  // Produce an array that contains the union: each distinct element from all of\n  // the passed-in arrays.\n  _.union = function() {\n    return _.uniq(_.flatten(arguments, true));\n  };\n\n  // Produce an array that contains every item shared between all the\n  // passed-in arrays. (Aliased as \"intersect\" for back-compat.)\n  _.intersection = _.intersect = function(array) {\n    var rest = slice.call(arguments, 1);\n    return _.filter(_.uniq(array), function(item) {\n      return _.every(rest, function(other) {\n        return _.indexOf(other, item) >= 0;\n      });\n    });\n  };\n\n  // Take the difference between one array and a number of other arrays.\n  // Only the elements present in just the first array will remain.\n  _.difference = function(array) {\n    var rest = _.flatten(slice.call(arguments, 1));\n    return _.filter(array, function(value){ return !_.include(rest, value); });\n  };\n\n  // Zip together multiple lists into a single array -- elements that share\n  // an index go together.\n  _.zip = function() {\n    var args = slice.call(arguments);\n    var length = _.max(_.pluck(args, 'length'));\n    var results = new Array(length);\n    for (var i = 0; i < length; i++) results[i] = _.pluck(args, \"\" + i);\n    return results;\n  };\n\n  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),\n  // we need this function. Return the position of the first occurrence of an\n  // item in an array, or -1 if the item is not included in the array.\n  // Delegates to **ECMAScript 5**'s native `indexOf` if available.\n  // If the array is large and already in sort order, pass `true`\n  // for **isSorted** to use binary search.\n  _.indexOf = function(array, item, isSorted) {\n    if (array == null) return -1;\n    var i, l;\n    if (isSorted) {\n      i = _.sortedIndex(array, item);\n      return array[i] === item ? i : -1;\n    }\n    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);\n    for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;\n    return -1;\n  };\n\n  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.\n  _.lastIndexOf = function(array, item) {\n    if (array == null) return -1;\n    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);\n    var i = array.length;\n    while (i--) if (i in array && array[i] === item) return i;\n    return -1;\n  };\n\n  // Generate an integer Array containing an arithmetic progression. A port of\n  // the native Python `range()` function. See\n  // [the Python documentation](http://docs.python.org/library/functions.html#range).\n  _.range = function(start, stop, step) {\n    if (arguments.length <= 1) {\n      stop = start || 0;\n      start = 0;\n    }\n    step = arguments[2] || 1;\n\n    var len = Math.max(Math.ceil((stop - start) / step), 0);\n    var idx = 0;\n    var range = new Array(len);\n\n    while(idx < len) {\n      range[idx++] = start;\n      start += step;\n    }\n\n    return range;\n  };\n\n  // Function (ahem) Functions\n  // ------------------\n\n  // Reusable constructor function for prototype setting.\n  var ctor = function(){};\n\n  // Create a function bound to a given object (assigning `this`, and arguments,\n  // optionally). Binding with arguments is also known as `curry`.\n  // Delegates to **ECMAScript 5**'s native `Function.bind` if available.\n  // We check for `func.bind` first, to fail fast when `func` is undefined.\n  _.bind = function bind(func, context) {\n    var bound, args;\n    if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n    if (!_.isFunction(func)) throw new TypeError;\n    args = slice.call(arguments, 2);\n    return bound = function() {\n      if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));\n      ctor.prototype = func.prototype;\n      var self = new ctor;\n      var result = func.apply(self, args.concat(slice.call(arguments)));\n      if (Object(result) === result) return result;\n      return self;\n    };\n  };\n\n  // Bind all of an object's methods to that object. Useful for ensuring that\n  // all callbacks defined on an object belong to it.\n  _.bindAll = function(obj) {\n    var funcs = slice.call(arguments, 1);\n    if (funcs.length == 0) funcs = _.functions(obj);\n    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });\n    return obj;\n  };\n\n  // Memoize an expensive function by storing its results.\n  _.memoize = function(func, hasher) {\n    var memo = {};\n    hasher || (hasher = _.identity);\n    return function() {\n      var key = hasher.apply(this, arguments);\n      return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));\n    };\n  };\n\n  // Delays a function for the given number of milliseconds, and then calls\n  // it with the arguments supplied.\n  _.delay = function(func, wait) {\n    var args = slice.call(arguments, 2);\n    return setTimeout(function(){ return func.apply(func, args); }, wait);\n  };\n\n  // Defers a function, scheduling it to run after the current call stack has\n  // cleared.\n  _.defer = function(func) {\n    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));\n  };\n\n  // Returns a function, that, when invoked, will only be triggered at most once\n  // during a given window of time.\n  _.throttle = function(func, wait) {\n    var context, args, timeout, throttling, more;\n    var whenDone = _.debounce(function(){ more = throttling = false; }, wait);\n    return function() {\n      context = this; args = arguments;\n      var later = function() {\n        timeout = null;\n        if (more) func.apply(context, args);\n        whenDone();\n      };\n      if (!timeout) timeout = setTimeout(later, wait);\n      if (throttling) {\n        more = true;\n      } else {\n        func.apply(context, args);\n      }\n      whenDone();\n      throttling = true;\n    };\n  };\n\n  // Returns a function, that, as long as it continues to be invoked, will not\n  // be triggered. The function will be called after it stops being called for\n  // N milliseconds.\n  _.debounce = function(func, wait) {\n    var timeout;\n    return function() {\n      var context = this, args = arguments;\n      var later = function() {\n        timeout = null;\n        func.apply(context, args);\n      };\n      clearTimeout(timeout);\n      timeout = setTimeout(later, wait);\n    };\n  };\n\n  // Returns a function that will be executed at most one time, no matter how\n  // often you call it. Useful for lazy initialization.\n  _.once = function(func) {\n    var ran = false, memo;\n    return function() {\n      if (ran) return memo;\n      ran = true;\n      return memo = func.apply(this, arguments);\n    };\n  };\n\n  // Returns the first function passed as an argument to the second,\n  // allowing you to adjust arguments, run code before and after, and\n  // conditionally execute the original function.\n  _.wrap = function(func, wrapper) {\n    return function() {\n      var args = [func].concat(slice.call(arguments, 0));\n      return wrapper.apply(this, args);\n    };\n  };\n\n  // Returns a function that is the composition of a list of functions, each\n  // consuming the return value of the function that follows.\n  _.compose = function() {\n    var funcs = arguments;\n    return function() {\n      var args = arguments;\n      for (var i = funcs.length - 1; i >= 0; i--) {\n        args = [funcs[i].apply(this, args)];\n      }\n      return args[0];\n    };\n  };\n\n  // Returns a function that will only be executed after being called N times.\n  _.after = function(times, func) {\n    if (times <= 0) return func();\n    return function() {\n      if (--times < 1) { return func.apply(this, arguments); }\n    };\n  };\n\n  // Object Functions\n  // ----------------\n\n  // Retrieve the names of an object's properties.\n  // Delegates to **ECMAScript 5**'s native `Object.keys`\n  _.keys = nativeKeys || function(obj) {\n    if (obj !== Object(obj)) throw new TypeError('Invalid object');\n    var keys = [];\n    for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;\n    return keys;\n  };\n\n  // Retrieve the values of an object's properties.\n  _.values = function(obj) {\n    return _.map(obj, _.identity);\n  };\n\n  // Return a sorted list of the function names available on the object.\n  // Aliased as `methods`\n  _.functions = _.methods = function(obj) {\n    var names = [];\n    for (var key in obj) {\n      if (_.isFunction(obj[key])) names.push(key);\n    }\n    return names.sort();\n  };\n\n  // Extend a given object with all the properties in passed-in object(s).\n  _.extend = function(obj) {\n    each(slice.call(arguments, 1), function(source) {\n      for (var prop in source) {\n        obj[prop] = source[prop];\n      }\n    });\n    return obj;\n  };\n\n  // Fill in a given object with default properties.\n  _.defaults = function(obj) {\n    each(slice.call(arguments, 1), function(source) {\n      for (var prop in source) {\n        if (obj[prop] == null) obj[prop] = source[prop];\n      }\n    });\n    return obj;\n  };\n\n  // Create a (shallow-cloned) duplicate of an object.\n  _.clone = function(obj) {\n    if (!_.isObject(obj)) return obj;\n    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n  };\n\n  // Invokes interceptor with the obj, and then returns obj.\n  // The primary purpose of this method is to \"tap into\" a method chain, in\n  // order to perform operations on intermediate results within the chain.\n  _.tap = function(obj, interceptor) {\n    interceptor(obj);\n    return obj;\n  };\n\n  // Internal recursive comparison function.\n  function eq(a, b, stack) {\n    // Identical objects are equal. `0 === -0`, but they aren't identical.\n    // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.\n    if (a === b) return a !== 0 || 1 / a == 1 / b;\n    // A strict comparison is necessary because `null == undefined`.\n    if (a == null || b == null) return a === b;\n    // Unwrap any wrapped objects.\n    if (a._chain) a = a._wrapped;\n    if (b._chain) b = b._wrapped;\n    // Invoke a custom `isEqual` method if one is provided.\n    if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);\n    if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);\n    // Compare `[[Class]]` names.\n    var className = toString.call(a);\n    if (className != toString.call(b)) return false;\n    switch (className) {\n      // Strings, numbers, dates, and booleans are compared by value.\n      case '[object String]':\n        // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n        // equivalent to `new String(\"5\")`.\n        return a == String(b);\n      case '[object Number]':\n        // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for\n        // other numeric values.\n        return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);\n      case '[object Date]':\n      case '[object Boolean]':\n        // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n        // millisecond representations. Note that invalid dates with millisecond representations\n        // of `NaN` are not equivalent.\n        return +a == +b;\n      // RegExps are compared by their source patterns and flags.\n      case '[object RegExp]':\n        return a.source == b.source &&\n               a.global == b.global &&\n               a.multiline == b.multiline &&\n               a.ignoreCase == b.ignoreCase;\n    }\n    if (typeof a != 'object' || typeof b != 'object') return false;\n    // Assume equality for cyclic structures. The algorithm for detecting cyclic\n    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n    var length = stack.length;\n    while (length--) {\n      // Linear search. Performance is inversely proportional to the number of\n      // unique nested structures.\n      if (stack[length] == a) return true;\n    }\n    // Add the first object to the stack of traversed objects.\n    stack.push(a);\n    var size = 0, result = true;\n    // Recursively compare objects and arrays.\n    if (className == '[object Array]') {\n      // Compare array lengths to determine if a deep comparison is necessary.\n      size = a.length;\n      result = size == b.length;\n      if (result) {\n        // Deep compare the contents, ignoring non-numeric properties.\n        while (size--) {\n          // Ensure commutative equality for sparse arrays.\n          if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;\n        }\n      }\n    } else {\n      // Objects with different constructors are not equivalent.\n      if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;\n      // Deep compare objects.\n      for (var key in a) {\n        if (_.has(a, key)) {\n          // Count the expected number of properties.\n          size++;\n          // Deep compare each member.\n          if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;\n        }\n      }\n      // Ensure that both objects contain the same number of properties.\n      if (result) {\n        for (key in b) {\n          if (_.has(b, key) && !(size--)) break;\n        }\n        result = !size;\n      }\n    }\n    // Remove the first object from the stack of traversed objects.\n    stack.pop();\n    return result;\n  }\n\n  // Perform a deep comparison to check if two objects are equal.\n  _.isEqual = function(a, b) {\n    return eq(a, b, []);\n  };\n\n  // Is a given array, string, or object empty?\n  // An \"empty\" object has no enumerable own-properties.\n  _.isEmpty = function(obj) {\n    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;\n    for (var key in obj) if (_.has(obj, key)) return false;\n    return true;\n  };\n\n  // Is a given value a DOM element?\n  _.isElement = function(obj) {\n    return !!(obj && obj.nodeType == 1);\n  };\n\n  // Is a given value an array?\n  // Delegates to ECMA5's native Array.isArray\n  _.isArray = nativeIsArray || function(obj) {\n    return toString.call(obj) == '[object Array]';\n  };\n\n  // Is a given variable an object?\n  _.isObject = function(obj) {\n    return obj === Object(obj);\n  };\n\n  // Is a given variable an arguments object?\n  _.isArguments = function(obj) {\n    return toString.call(obj) == '[object Arguments]';\n  };\n  if (!_.isArguments(arguments)) {\n    _.isArguments = function(obj) {\n      return !!(obj && _.has(obj, 'callee'));\n    };\n  }\n\n  // Is a given value a function?\n  _.isFunction = function(obj) {\n    return toString.call(obj) == '[object Function]';\n  };\n\n  // Is a given value a string?\n  _.isString = function(obj) {\n    return toString.call(obj) == '[object String]';\n  };\n\n  // Is a given value a number?\n  _.isNumber = function(obj) {\n    return toString.call(obj) == '[object Number]';\n  };\n\n  // Is the given value `NaN`?\n  _.isNaN = function(obj) {\n    // `NaN` is the only value for which `===` is not reflexive.\n    return obj !== obj;\n  };\n\n  // Is a given value a boolean?\n  _.isBoolean = function(obj) {\n    return obj === true || obj === false || toString.call(obj) == '[object Boolean]';\n  };\n\n  // Is a given value a date?\n  _.isDate = function(obj) {\n    return toString.call(obj) == '[object Date]';\n  };\n\n  // Is the given value a regular expression?\n  _.isRegExp = function(obj) {\n    return toString.call(obj) == '[object RegExp]';\n  };\n\n  // Is a given value equal to null?\n  _.isNull = function(obj) {\n    return obj === null;\n  };\n\n  // Is a given variable undefined?\n  _.isUndefined = function(obj) {\n    return obj === void 0;\n  };\n\n  // Has own property?\n  _.has = function(obj, key) {\n    return hasOwnProperty.call(obj, key);\n  };\n\n  // Utility Functions\n  // -----------------\n\n  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n  // previous owner. Returns a reference to the Underscore object.\n  _.noConflict = function() {\n    root._ = previousUnderscore;\n    return this;\n  };\n\n  // Keep the identity function around for default iterators.\n  _.identity = function(value) {\n    return value;\n  };\n\n  // Run a function **n** times.\n  _.times = function (n, iterator, context) {\n    for (var i = 0; i < n; i++) iterator.call(context, i);\n  };\n\n  // Escape a string for HTML interpolation.\n  _.escape = function(string) {\n    return (''+string).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\\//g,'&#x2F;');\n  };\n\n  // Add your own custom functions to the Underscore object, ensuring that\n  // they're correctly added to the OOP wrapper as well.\n  _.mixin = function(obj) {\n    each(_.functions(obj), function(name){\n      addToWrapper(name, _[name] = obj[name]);\n    });\n  };\n\n  // Generate a unique integer id (unique within the entire client session).\n  // Useful for temporary DOM ids.\n  var idCounter = 0;\n  _.uniqueId = function(prefix) {\n    var id = idCounter++;\n    return prefix ? prefix + id : id;\n  };\n\n  // By default, Underscore uses ERB-style template delimiters, change the\n  // following template settings to use alternative delimiters.\n  _.templateSettings = {\n    evaluate    : /<%([\\s\\S]+?)%>/g,\n    interpolate : /<%=([\\s\\S]+?)%>/g,\n    escape      : /<%-([\\s\\S]+?)%>/g\n  };\n\n  // When customizing `templateSettings`, if you don't want to define an\n  // interpolation, evaluation or escaping regex, we need one that is\n  // guaranteed not to match.\n  var noMatch = /.^/;\n\n  // Within an interpolation, evaluation, or escaping, remove HTML escaping\n  // that had been previously added.\n  var unescape = function(code) {\n    return code.replace(/\\\\\\\\/g, '\\\\').replace(/\\\\'/g, \"'\");\n  };\n\n  // JavaScript micro-templating, similar to John Resig's implementation.\n  // Underscore templating handles arbitrary delimiters, preserves whitespace,\n  // and correctly escapes quotes within interpolated code.\n  _.template = function(str, data) {\n    var c  = _.templateSettings;\n    var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +\n      'with(obj||{}){__p.push(\\'' +\n      str.replace(/\\\\/g, '\\\\\\\\')\n         .replace(/'/g, \"\\\\'\")\n         .replace(c.escape || noMatch, function(match, code) {\n           return \"',_.escape(\" + unescape(code) + \"),'\";\n         })\n         .replace(c.interpolate || noMatch, function(match, code) {\n           return \"',\" + unescape(code) + \",'\";\n         })\n         .replace(c.evaluate || noMatch, function(match, code) {\n           return \"');\" + unescape(code).replace(/[\\r\\n\\t]/g, ' ') + \";__p.push('\";\n         })\n         .replace(/\\r/g, '\\\\r')\n         .replace(/\\n/g, '\\\\n')\n         .replace(/\\t/g, '\\\\t')\n         + \"');}return __p.join('');\";\n    var func = new Function('obj', '_', tmpl);\n    if (data) return func(data, _);\n    return function(data) {\n      return func.call(this, data, _);\n    };\n  };\n\n  // Add a \"chain\" function, which will delegate to the wrapper.\n  _.chain = function(obj) {\n    return _(obj).chain();\n  };\n\n  // The OOP Wrapper\n  // ---------------\n\n  // If Underscore is called as a function, it returns a wrapped object that\n  // can be used OO-style. This wrapper holds altered versions of all the\n  // underscore functions. Wrapped objects may be chained.\n  var wrapper = function(obj) { this._wrapped = obj; };\n\n  // Expose `wrapper.prototype` as `_.prototype`\n  _.prototype = wrapper.prototype;\n\n  // Helper function to continue chaining intermediate results.\n  var result = function(obj, chain) {\n    return chain ? _(obj).chain() : obj;\n  };\n\n  // A method to easily add functions to the OOP wrapper.\n  var addToWrapper = function(name, func) {\n    wrapper.prototype[name] = function() {\n      var args = slice.call(arguments);\n      unshift.call(args, this._wrapped);\n      return result(func.apply(_, args), this._chain);\n    };\n  };\n\n  // Add all of the Underscore functions to the wrapper object.\n  _.mixin(_);\n\n  // Add all mutator Array functions to the wrapper.\n  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n    var method = ArrayProto[name];\n    wrapper.prototype[name] = function() {\n      var wrapped = this._wrapped;\n      method.apply(wrapped, arguments);\n      var length = wrapped.length;\n      if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];\n      return result(wrapped, this._chain);\n    };\n  });\n\n  // Add all accessor Array functions to the wrapper.\n  each(['concat', 'join', 'slice'], function(name) {\n    var method = ArrayProto[name];\n    wrapper.prototype[name] = function() {\n      return result(method.apply(this._wrapped, arguments), this._chain);\n    };\n  });\n\n  // Start chaining a wrapped Underscore object.\n  wrapper.prototype.chain = function() {\n    this._chain = true;\n    return this;\n  };\n\n  // Extracts the result from a wrapped and chained object.\n  wrapper.prototype.value = function() {\n    return this._wrapped;\n  };\n\n}).call(this);\n"
  },
  {
    "path": "docs-aside/_static/underscore.js",
    "content": "// Underscore.js 1.3.1\n// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.\n// Underscore is freely distributable under the MIT license.\n// Portions of Underscore are inspired or borrowed from Prototype,\n// Oliver Steele's Functional, and John Resig's Micro-Templating.\n// For all details and documentation:\n// http://documentcloud.github.com/underscore\n(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case \"[object String]\":return a==String(c);case \"[object Number]\":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case \"[object Date]\":case \"[object Boolean]\":return+a==+c;case \"[object RegExp]\":return a.source==\nc.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!=\"object\"||typeof c!=\"object\")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e==\"[object Array]\"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if(\"constructor\"in a!=\"constructor\"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,\nh)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!==\"undefined\"){if(typeof module!==\"undefined\"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION=\"1.3.1\";var j=b.each=\nb.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===n)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===n)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(x&&a.map===x)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a==\nnull&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError(\"Reduce of empty array with no initial value\");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=\nfunction(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e=\ne&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck=\nfunction(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})});\nreturn e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){f==0?b[0]=a:(d=Math.floor(Math.random()*(f+1)),b[f]=b[d],b[d]=a)});return b};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,g){return{value:a,criteria:c.call(d,a,b,g)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),\"value\")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,\nc,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:a.toArray?a.toArray():b.isArray(a)?i.call(a):b.isArguments(a)?i.call(a):b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest=\nb.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,e=[];b.reduce(d,function(d,g,h){if(0==h||(c===true?b.last(d)!=g:!b.include(d,g)))d[d.length]=g,e[e.length]=a[h];return d},[]);\nreturn e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,\"length\")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,\"\"+e);return d};b.indexOf=function(a,c,\nd){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(p&&a.indexOf===p)return a.indexOf(c);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(D&&a.lastIndexOf===D)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g};\nvar F=function(){};b.bind=function(a,c){var d,e;if(a.bind===s&&s)return s.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));F.prototype=a.prototype;var b=new F,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,\nc){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i=b.debounce(function(){h=g=false},c);return function(){d=this;e=arguments;var b;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);i()},c));g?h=true:\na.apply(d,e);i();g=true}};b.debounce=function(a,b){var d;return function(){var e=this,f=arguments;clearTimeout(d);d=setTimeout(function(){d=null;a.apply(e,f)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};\nb.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError(\"Invalid object\");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments,\n1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)==\"[object Array]\"};b.isObject=function(a){return a===Object(a)};\nb.isArguments=function(a){return l.call(a)==\"[object Arguments]\"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,\"callee\"))};b.isFunction=function(a){return l.call(a)==\"[object Function]\"};b.isString=function(a){return l.call(a)==\"[object String]\"};b.isNumber=function(a){return l.call(a)==\"[object Number]\"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)==\"[object Boolean]\"};b.isDate=function(a){return l.call(a)==\"[object Date]\"};\nb.isRegExp=function(a){return l.call(a)==\"[object RegExp]\"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(\"\"+a).replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#x27;\").replace(/\\//g,\"&#x2F;\")};b.mixin=function(a){j(b.functions(a),\nfunction(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\\s\\S]+?)%>/g,interpolate:/<%=([\\s\\S]+?)%>/g,escape:/<%-([\\s\\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\\\\\/g,\"\\\\\").replace(/\\\\'/g,\"'\")};b.template=function(a,c){var d=b.templateSettings,d=\"var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('\"+a.replace(/\\\\/g,\"\\\\\\\\\").replace(/'/g,\"\\\\'\").replace(d.escape||t,function(a,b){return\"',_.escape(\"+\nu(b)+\"),'\"}).replace(d.interpolate||t,function(a,b){return\"',\"+u(b)+\",'\"}).replace(d.evaluate||t,function(a,b){return\"');\"+u(b).replace(/[\\r\\n\\t]/g,\" \")+\";__p.push('\"}).replace(/\\r/g,\"\\\\r\").replace(/\\n/g,\"\\\\n\").replace(/\\t/g,\"\\\\t\")+\"');}return __p.join('');\",e=new Function(\"obj\",\"_\",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]=\nfunction(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j(\"pop,push,reverse,shift,sort,splice,unshift\".split(\",\"),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a==\"shift\"||a==\"splice\")&&e===0&&delete d[0];return v(d,this._chain)}});j([\"concat\",\"join\",\"slice\"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=\ntrue;return this};m.prototype.value=function(){return this._wrapped}}).call(this);\n"
  },
  {
    "path": "docs-aside/bdsim.blocks.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>Block library &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n        <script src=\"_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n    <link rel=\"next\" title=\"Supporting classes\" href=\"internals.html\" />\n    <link rel=\"prev\" title=\"Overview\" href=\"bdsim.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul class=\"current\">\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1 current\"><a class=\"current reference internal\" href=\"#\">Block library</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#module-bdsim.blocks.sources\">Source blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#module-bdsim.blocks.sinks\">Sink blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#module-bdsim.blocks.functions\">Function blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#module-bdsim.blocks.transfers\">Transfer blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#module-bdsim.blocks.discrete\">Discrete-time blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#module-bdsim.blocks.linalg\">Linear algebra blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#module-bdsim.blocks.connections\">Connection blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#external-toolbox-blocksets\">External Toolbox blocksets</a><ul>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#robot-blocks\">Robot blocks</a><ul>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#module-roboticstoolbox.blocks.arm\">Arm robots</a></li>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#module-roboticstoolbox.blocks.mobile\">Mobile robots</a></li>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#module-roboticstoolbox.blocks.uav\">Multi rotor flying robots</a></li>\n</ul>\n</li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#vision-blocks\">Vision blocks</a></li>\n</ul>\n</li>\n</ul>\n</li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>Block library</li>\n      <li class=\"wy-breadcrumbs-aside\">\n            <a href=\"_sources/bdsim.blocks.rst.txt\" rel=\"nofollow\"> View page source</a>\n      </li>\n  </ul><div class=\"rst-breadcrumbs-buttons\" role=\"navigation\" aria-label=\"Sequential page navigation\">\n        <a href=\"bdsim.html\" class=\"btn btn-neutral float-left\" title=\"Overview\" accesskey=\"p\"><span class=\"fa fa-arrow-circle-left\" aria-hidden=\"true\"></span> Previous</a>\n        <a href=\"internals.html\" class=\"btn btn-neutral float-right\" title=\"Supporting classes\" accesskey=\"n\">Next <span class=\"fa fa-arrow-circle-right\" aria-hidden=\"true\"></span></a>\n  </div>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <div class=\"section\" id=\"block-library\">\n<span id=\"id1\"></span><h1>Block library<a class=\"headerlink\" href=\"#block-library\" title=\"Permalink to this headline\">¶</a></h1>\n<p>The block diagrams comprise blocks which belong to one of a number of different categories. These come from\nthe package <code class=\"docutils literal notranslate\"><span class=\"pre\">bdsim.blocks</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">roboticstoolbox.blocks</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">machinevisiontoolbox.blocks</span></code>.</p>\n<p>Icons, if shown to the left of the black header bar, are as used with <a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/tree/master/bdsim/bdedit\">bdedit</a>.</p>\n<div class=\"graphviz\"><img src=\"_images/inheritance-af7f307d273227aa82ea3606256c0bea24eae672.png\" alt=\"Inheritance diagram of bdsim.components.SourceBlock, bdsim.components.SinkBlock, bdsim.graphics.GraphicsBlock, bdsim.components.FunctionBlock, bdsim.components.TransferBlock, bdsim.components.SubsystemBlock\" class=\"inheritance graphviz\" /></div>\n<div class=\"section\" id=\"module-bdsim.blocks.sources\">\n<span id=\"source-blocks\"></span><h2>Source blocks<a class=\"headerlink\" href=\"#module-bdsim.blocks.sources\" title=\"Permalink to this headline\">¶</a></h2>\n<p>Source blocks:</p>\n<ul class=\"simple\">\n<li><p>have outputs but no inputs</p></li>\n<li><p>have no state variables</p></li>\n<li><p>are a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">SourceBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sources.Constant\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sources.</code><code class=\"sig-name descname\">Constant</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Constant\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Constant\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    CONSTANT\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/constant.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>float,\nA(N,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sources.Constant.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">value</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Constant.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Constant.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Constant value.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>value</strong> (<em>any</em><em>, </em><em>optional</em>) – the constant, defaults to None</p></li>\n<li><p><strong>blockargs</strong> – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a CONSTANT block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Constant instance</p>\n</dd>\n</dl>\n<p>This block has only one output port, but the value can be any \nPython type, for example float, list or Numpy ndarray.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sources.Piecewise\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sources.</code><code class=\"sig-name descname\">Piecewise</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Piecewise\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Piecewise\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    PIECEWISE\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/piecewise.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sources.Piecewise.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">seq</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Piecewise.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Piecewise.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Piecewise constant signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>seq</strong> (<em>list of 2-tuples</em>) – sequence of time, value pairs</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a PIECEWISE block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Piecewise instance</p>\n</dd>\n</dl>\n<p>Outputs a piecewise constant function of time.  This is described as\na series of 2-tuples (time, value).  The output value is taken from the\nactive tuple, that is, the latest one in the list whose time is no greater\nthan simulation time.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<ul class=\"simple\">\n<li><p>The tuples must be order by monotonically increasing time.</p></li>\n<li><p>There is no default initial value, the list should contain\na tuple with time zero otherwise the output will be undefined.</p></li>\n</ul>\n</div>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The block declares an event for the start of each segment.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">declare_events()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sources.Ramp\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sources.</code><code class=\"sig-name descname\">Ramp</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Ramp\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Ramp\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    RAMP\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/ramp.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sources.Ramp.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">off</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">slope</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Ramp.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Ramp.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Ramp signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>T</strong> (<em>float</em><em>, </em><em>optional</em>) – time of ramp start, defaults to 1</p></li>\n<li><p><strong>off</strong> (<em>float</em><em>, </em><em>optional</em>) – initial value, defaults to 0</p></li>\n<li><p><strong>slope</strong> (<em>float</em><em>, </em><em>optional</em>) – gradient of slope, defaults to 1</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a RAMP block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.blocks.sources.Ramp\" title=\"bdsim.blocks.sources.Ramp\">Ramp</a></p>\n</dd>\n</dl>\n<p>Output a ramp signal that starts increasing from the value <code class=\"docutils literal notranslate\"><span class=\"pre\">off</span></code>\nwhen time equals <code class=\"docutils literal notranslate\"><span class=\"pre\">T</span></code> linearly with time, with a gradient of <code class=\"docutils literal notranslate\"><span class=\"pre\">slope</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The block declares an event for the ramp start time.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a href=\"#id2\"><span class=\"problematic\" id=\"id3\">:method:`declare_event`</span></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sources.Step\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sources.</code><code class=\"sig-name descname\">Step</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Step\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Step\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    STEP\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/step.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sources.Step.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">off</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">on</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Step.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Step.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Step signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>T</strong> (<em>float</em><em>, </em><em>optional</em>) – time of step, defaults to 1</p></li>\n<li><p><strong>off</strong> (<em>float</em><em>, </em><em>optional</em>) – initial value, defaults to 0</p></li>\n<li><p><strong>on</strong> (<em>float</em><em>, </em><em>optional</em>) – final value, defaults to 1</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a STEP block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.blocks.sources.Step\" title=\"bdsim.blocks.sources.Step\">Step</a></p>\n</dd>\n</dl>\n<p>Output a step signal that transitions from the value <code class=\"docutils literal notranslate\"><span class=\"pre\">off</span></code> to <code class=\"docutils literal notranslate\"><span class=\"pre\">on</span></code>\nwhen time equals <code class=\"docutils literal notranslate\"><span class=\"pre\">T</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The block declares an event for the step time.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">declare_events()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sources.Time\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sources.</code><code class=\"sig-name descname\">Time</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Time\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Time\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    TIME\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/time.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sources.Time.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">value</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#Time.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.Time.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Simulation time.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a TIME block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Time instance</p>\n</dd>\n</dl>\n<p>The block has only one output port which is the current simulation time.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sources.WaveForm\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sources.</code><code class=\"sig-name descname\">WaveForm</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#WaveForm\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.WaveForm\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    WAVEFORM\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/waveform.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sources.WaveForm.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"default_value\">'square'</span></em>, <em class=\"sig-param\"><span class=\"n\">freq</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">unit</span><span class=\"o\">=</span><span class=\"default_value\">'Hz'</span></em>, <em class=\"sig-param\"><span class=\"n\">phase</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">amplitude</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">offset</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">min</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">max</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">duty</span><span class=\"o\">=</span><span class=\"default_value\">0.5</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sources.html#WaveForm.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sources.WaveForm.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Waveform as function of time.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>wave</strong> (<em>str</em><em>, </em><em>optional</em>) – type of waveform to generate, one of: ‘sine’, ‘square’, ‘triangle’, defaults to ‘square’</p></li>\n<li><p><strong>freq</strong> (<em>float</em><em>, </em><em>optional</em>) – frequency, defaults to 1</p></li>\n<li><p><strong>unit</strong> (<em>str</em><em>, </em><em>optional</em>) – frequency unit, one of: ‘rad/s’, ‘Hz’, defaults to ‘Hz’</p></li>\n<li><p><strong>amplitude</strong> (<em>float</em><em>, </em><em>optional</em>) – amplitude, defaults to 1</p></li>\n<li><p><strong>offset</strong> (<em>float</em><em>, </em><em>optional</em>) – signal offset, defaults to 0</p></li>\n<li><p><strong>phase</strong> (<em>float</em><em>, </em><em>optional</em>) – Initial phase of signal in the range [0,1], defaults to 0</p></li>\n<li><p><strong>min</strong> (<em>float</em><em>, </em><em>optional</em>) – minimum value, defaults to 0</p></li>\n<li><p><strong>max</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum value, defaults to 1</p></li>\n<li><p><strong>duty</strong> (<em>float</em><em>, </em><em>optional</em>) – duty cycle for square wave in range [0,1], defaults to 0.5</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a WAVEFORM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>WaveForm instance</p>\n</dd>\n</dl>\n<p>Create a waveform generator block.</p>\n<p>Examples:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">WAVEFORM</span><span class=\"p\">(</span><span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"s1\">&#39;sine&#39;</span><span class=\"p\">,</span> <span class=\"n\">freq</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">)</span>   <span class=\"c1\"># 2Hz sine wave varying from -1 to 1</span>\n<span class=\"n\">WAVEFORM</span><span class=\"p\">(</span><span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"s1\">&#39;square&#39;</span><span class=\"p\">,</span> <span class=\"n\">freq</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">unit</span><span class=\"o\">=</span><span class=\"s1\">&#39;rad/s&#39;</span><span class=\"p\">)</span> <span class=\"c1\"># 2rad/s square wave varying from -1 to 1</span>\n</pre></div>\n</div>\n<p>The minimum and maximum values of the waveform are given by default in\nterms of amplitude and offset. The signals are symmetric about the offset \nvalue. For example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">WAVEFORM</span><span class=\"p\">(</span><span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"s1\">&#39;sine&#39;</span><span class=\"p\">)</span> <span class=\"n\">varies</span> <span class=\"n\">between</span> <span class=\"o\">-</span><span class=\"mi\">1</span> <span class=\"ow\">and</span> <span class=\"o\">+</span><span class=\"mi\">1</span>\n<span class=\"n\">WAVEFORM</span><span class=\"p\">(</span><span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"s1\">&#39;sine&#39;</span><span class=\"p\">,</span> <span class=\"n\">amplitude</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">)</span> <span class=\"n\">varies</span> <span class=\"n\">between</span> <span class=\"o\">-</span><span class=\"mi\">2</span> <span class=\"ow\">and</span> <span class=\"o\">+</span><span class=\"mi\">2</span>\n<span class=\"n\">WAVEFORM</span><span class=\"p\">(</span><span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"s1\">&#39;sine&#39;</span><span class=\"p\">,</span> <span class=\"n\">offset</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"n\">varies</span> <span class=\"n\">between</span> <span class=\"mi\">0</span> <span class=\"ow\">and</span> <span class=\"o\">+</span><span class=\"mi\">2</span>\n<span class=\"n\">WAVEFORM</span><span class=\"p\">(</span><span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"s1\">&#39;sine&#39;</span><span class=\"p\">,</span> <span class=\"n\">amplitude</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">offset</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"n\">varies</span> <span class=\"n\">between</span> <span class=\"o\">-</span><span class=\"mi\">1</span> <span class=\"ow\">and</span> <span class=\"o\">+</span><span class=\"mi\">3</span>\n</pre></div>\n</div>\n<p>Alternatively we can specify the minimum and maximum values which override\namplitude and offset:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">WAVEFORM</span><span class=\"p\">(</span><span class=\"n\">wave</span><span class=\"o\">=</span><span class=\"s1\">&#39;triangle&#39;</span><span class=\"p\">,</span> <span class=\"nb\">min</span><span class=\"o\">=</span><span class=\"mi\">0</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\">varies</span> <span class=\"n\">between</span> <span class=\"mi\">0</span> <span class=\"ow\">and</span> <span class=\"o\">+</span><span class=\"mi\">5</span>\n</pre></div>\n</div>\n<p>At time 0 the sine and triangle wave are zero and increasing, and the\nsquare wave has its first rise.  We can specify a phase shift with \na number in the range [0,1] where 1 corresponds to one cycle.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>For discontinuous signals (square, triangle) the block declares\nevents for every discontinuity.</p>\n</div>\n<p>:seealso <code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">declare_events()</span></code></p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdsim.blocks.sinks\">\n<span id=\"sink-blocks\"></span><h2>Sink blocks<a class=\"headerlink\" href=\"#module-bdsim.blocks.sinks\" title=\"Permalink to this headline\">¶</a></h2>\n<p>Sink blocks:</p>\n<ul class=\"simple\">\n<li><p>have inputs but no outputs</p></li>\n<li><p>have no state variables</p></li>\n<li><p>are a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">SinkBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n<li><p>that perform graphics are a subclass of  <code class=\"docutils literal notranslate\"><span class=\"pre\">GraphicsBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">SinkBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sinks.Null\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sinks.</code><code class=\"sig-name descname\">Null</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sinks.html#Null\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sinks.Null\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SinkBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    NULL\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/null.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>N</p></td>\n<td><p>0</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>any</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sinks.Null.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sinks.html#Null.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sinks.Null.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Discard signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>nin</strong> (<em>int</em><em>, </em><em>optional</em>) – number of input ports, defaults to 1</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A NULL block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Null instance</p>\n</dd>\n</dl>\n<p>Create a sink block with arbitrary number of input ports that discards\nall data.  Useful for testing.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sinks.Print\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sinks.</code><code class=\"sig-name descname\">Print</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sinks.html#Print\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sinks.Print\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SinkBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    PRINT\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/print.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>0</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>any</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sinks.Print.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">fmt</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">file</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sinks.html#Print.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sinks.Print.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Print signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>fmt</strong> (<em>str</em><em>, </em><em>optional</em>) – Format string, defaults to None</p></li>\n<li><p><strong>file</strong> (<em>file object</em><em>, </em><em>optional</em>) – file to write data to, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A PRINT block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Print instance</p>\n</dd>\n</dl>\n<p>Creates a console print block which displays the value of a signal \nat each simulation time step. The display format is like:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">PRINT</span><span class=\"p\">(</span><span class=\"nb\">print</span><span class=\"o\">.</span><span class=\"mi\">0</span> <span class=\"o\">@</span> <span class=\"n\">t</span><span class=\"o\">=</span><span class=\"mf\">0.100</span><span class=\"p\">)</span> <span class=\"p\">[</span><span class=\"o\">-</span><span class=\"mf\">1.0</span> <span class=\"mf\">0.2</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>and includes the block name, time, and the formatted value.</p>\n<p>The numerical formatting of the signal is controlled by <code class=\"docutils literal notranslate\"><span class=\"pre\">fmt</span></code>:</p>\n<ul class=\"simple\">\n<li><p>if not provided, <code class=\"docutils literal notranslate\"><span class=\"pre\">str()</span></code> is used to format the signal</p></li>\n<li><dl class=\"simple\">\n<dt>if provided:</dt><dd><ul>\n<li><p>a scalar is formatted by the <code class=\"docutils literal notranslate\"><span class=\"pre\">fmt.format()</span></code></p></li>\n<li><p>a NumPy array is formatted by <code class=\"docutils literal notranslate\"><span class=\"pre\">fmt.format()</span></code> applied to every\nelement</p></li>\n</ul>\n</dd>\n</dl>\n</li>\n</ul>\n<p>Examples:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">pr</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PRINT</span><span class=\"p\">()</span>     <span class=\"c1\"># create PRINT block</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"n\">pr</span><span class=\"p\">)</span>   <span class=\"c1\"># its input comes from x</span>\n\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PRINT</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">)</span>         <span class=\"c1\"># create PRINT block with input from x</span>\n\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PRINT</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;X&#39;</span><span class=\"p\">)</span>  <span class=\"c1\"># block name appears in the printed text</span>\n\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">PRINT</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">fmt</span><span class=\"o\">=</span><span class=\"s2\">&quot;</span><span class=\"si\">{:.1f}</span><span class=\"s2\">&quot;</span><span class=\"p\">)</span> <span class=\"c1\"># print with explicit format</span>\n</pre></div>\n</div>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<ul class=\"simple\">\n<li><p>By default writes to stdout</p></li>\n<li><p>The output is cleaner if progress bar printing is disabled.</p></li>\n</ul>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sinks.Stop\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sinks.</code><code class=\"sig-name descname\">Stop</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sinks.html#Stop\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sinks.Stop\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SinkBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    STOP\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/stop.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>0</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>any</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sinks.Stop.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">func</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sinks.html#Stop.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sinks.Stop.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Conditional simulation stop.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>func</strong> (<em>callable</em><em>, </em><em>optional</em>) – evaluate stop condition, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A STOP block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Stop instance</p>\n</dd>\n</dl>\n<p>Conditionally stop the simulation if the input is:</p>\n<ul class=\"simple\">\n<li><p>bool type and True</p></li>\n<li><p>numeric type and &gt; 0</p></li>\n</ul>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code> is provided, then it is applied to the block input\nand if it returns True the simulation is stopped.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.sinks.Watch\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.sinks.</code><code class=\"sig-name descname\">Watch</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sinks.html#Watch\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sinks.Watch\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SinkBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    WATCH\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/watch.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>N</p></td>\n<td><p>0</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>1</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.sinks.Watch.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/sinks.html#Watch.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.sinks.Watch.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Watch a signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A NULL block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Null instance</p>\n</dd>\n</dl>\n<p>Causes the input signal to be logged during the\nsimulation run.  Equivalent to adding it as the <code class=\"docutils literal notranslate\"><span class=\"pre\">watch=</span></code> argument\nto <code class=\"docutils literal notranslate\"><span class=\"pre\">bdsim.run</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a href=\"#id4\"><span class=\"problematic\" id=\"id5\">:method:`BDSim.run`</span></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdsim.blocks.functions\">\n<span id=\"function-blocks\"></span><h2>Function blocks<a class=\"headerlink\" href=\"#module-bdsim.blocks.functions\" title=\"Permalink to this headline\">¶</a></h2>\n<p>Function blocks:</p>\n<ul class=\"simple\">\n<li><p>have inputs and outputs</p></li>\n<li><p>have no state variables</p></li>\n<li><p>are a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">FunctionBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.functions.Clip\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.functions.</code><code class=\"sig-name descname\">Clip</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Clip\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Clip\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    CLIP\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/clip.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(N,)</p></td>\n<td><p>float,\nA(N,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.functions.Clip.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">min</span><span class=\"o\">=</span><span class=\"default_value\">- inf</span></em>, <em class=\"sig-param\"><span class=\"n\">max</span><span class=\"o\">=</span><span class=\"default_value\">inf</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Clip.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Clip.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Signal clipping.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>min</strong> (<em>float</em><em> or </em><em>array_like</em><em>, </em><em>optional</em>) – Minimum value, defaults to -math.inf</p></li>\n<li><p><strong>max</strong> (<em>float</em><em> or </em><em>array_like</em><em>, </em><em>optional</em>) – Maximum value, defaults to math.inf</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A CLIP block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Clip instance</p>\n</dd>\n</dl>\n<p>The input signal is clipped to the range from <code class=\"docutils literal notranslate\"><span class=\"pre\">minimum</span></code> to <code class=\"docutils literal notranslate\"><span class=\"pre\">maximum</span></code> inclusive.</p>\n<p>The signal can be a 1D-array in which case each element is clipped.  The\nminimum and maximum values can be:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>a scalar, in which case the same value applies to every element of \nthe input vector , or</p></li>\n<li><p>a 1D-array, of the same shape as the input vector that applies elementwise to\nthe input vector.</p></li>\n</ul>\n</div></blockquote>\n<p>For example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">clip</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CLIP</span><span class=\"p\">()</span>\n</pre></div>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.functions.Function\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.functions.</code><code class=\"sig-name descname\">Function</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Function\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Function\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    FUNCTION\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/function.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>nin</p></td>\n<td><p>nout</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>any</p></td>\n<td><p>any</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.functions.Function.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">func</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">persistent</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"n\">args</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">kwargs</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Function.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Function.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Python function.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>func</strong> (<em>callable</em><em> or </em><em>sequence of callables</em><em>, </em><em>optional</em>) – A function or lambda, or list thereof, defaults to None</p></li>\n<li><p><strong>nin</strong> (<em>int</em><em>, </em><em>optional</em>) – number of inputs, defaults to 1</p></li>\n<li><p><strong>nout</strong> (<em>int</em><em>, </em><em>optional</em>) – number of outputs, defaults to 1</p></li>\n<li><p><strong>persistent</strong> (<em>bool</em><em>, </em><em>optional</em>) – pass in a reference to a dictionary instance to hold persistent state, defaults to False</p></li>\n<li><p><strong>args</strong> (<em>list</em><em>, </em><em>optional</em>) – extra positional arguments passed to the function, defaults to []</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em><em>, </em><em>optional</em>) – extra keyword arguments passed to the function, defaults to {}</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em><em>, </em><em>optional</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A FUNCTION block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>A Function instance</p>\n</dd>\n</dl>\n<p>Inputs to the block are passed as separate arguments to the function.  \nProgrammatic ositional or keyword arguments can also be passed to the function.</p>\n<p>A block with one output port that sums its two input ports is:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">FUNCTION</span><span class=\"p\">(</span><span class=\"k\">lambda</span> <span class=\"n\">u1</span><span class=\"p\">,</span> <span class=\"n\">u2</span><span class=\"p\">:</span> <span class=\"n\">u1</span><span class=\"o\">+</span><span class=\"n\">u2</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>A block with a function that takes two inputs and has two additional arguments:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"k\">def</span> <span class=\"nf\">myfun</span><span class=\"p\">(</span><span class=\"n\">u1</span><span class=\"p\">,</span> <span class=\"n\">u2</span><span class=\"p\">,</span> <span class=\"n\">param1</span><span class=\"p\">,</span> <span class=\"n\">param2</span><span class=\"p\">):</span>\n    <span class=\"k\">pass</span>\n\n<span class=\"n\">FUNCTION</span><span class=\"p\">(</span><span class=\"n\">myfun</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">args</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">p1</span><span class=\"p\">,</span><span class=\"n\">p2</span><span class=\"p\">))</span>\n</pre></div>\n</div>\n<p>If we need access to persistent (static) data, to keep some state:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"k\">def</span> <span class=\"nf\">myfun</span><span class=\"p\">(</span><span class=\"n\">u1</span><span class=\"p\">,</span> <span class=\"n\">u2</span><span class=\"p\">,</span> <span class=\"n\">param1</span><span class=\"p\">,</span> <span class=\"n\">param2</span><span class=\"p\">,</span> <span class=\"n\">state</span><span class=\"p\">):</span>\n    <span class=\"k\">pass</span>\n\n<span class=\"n\">FUNCTION</span><span class=\"p\">(</span><span class=\"n\">myfun</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">args</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">p1</span><span class=\"p\">,</span><span class=\"n\">p2</span><span class=\"p\">),</span> <span class=\"n\">persistent</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>where a dictionary is passed in as the last argument and which is kept from call to call.</p>\n<p>A block with a function that takes two inputs and additional keyword arguments:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"k\">def</span> <span class=\"nf\">myfun</span><span class=\"p\">(</span><span class=\"n\">u1</span><span class=\"p\">,</span> <span class=\"n\">u2</span><span class=\"p\">,</span> <span class=\"n\">param1</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">param2</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">param3</span><span class=\"o\">=</span><span class=\"mi\">3</span><span class=\"p\">,</span> <span class=\"n\">param4</span><span class=\"o\">=</span><span class=\"mi\">4</span><span class=\"p\">):</span>\n    <span class=\"k\">pass</span>\n\n<span class=\"n\">FUNCTION</span><span class=\"p\">(</span><span class=\"n\">myfun</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">kwargs</span><span class=\"o\">=</span><span class=\"nb\">dict</span><span class=\"p\">(</span><span class=\"n\">param2</span><span class=\"o\">=</span><span class=\"mi\">7</span><span class=\"p\">,</span> <span class=\"n\">param3</span><span class=\"o\">=</span><span class=\"mi\">8</span><span class=\"p\">))</span>\n</pre></div>\n</div>\n<p>A block with two inputs and two outputs, the outputs are defined by two lambda\nfunctions with the same inputs:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">FUNCTION</span><span class=\"p\">(</span> <span class=\"p\">[</span> <span class=\"k\">lambda</span> <span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">:</span> <span class=\"n\">x_t</span><span class=\"p\">,</span> <span class=\"k\">lambda</span> <span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">y</span><span class=\"p\">:</span> <span class=\"n\">x</span><span class=\"o\">*</span> <span class=\"n\">y</span><span class=\"p\">])</span>\n</pre></div>\n</div>\n<p>A block with two inputs and two outputs, the outputs are defined by a \nsingle function which returns a list:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"k\">def</span> <span class=\"nf\">myfun</span><span class=\"p\">(</span><span class=\"n\">u1</span><span class=\"p\">,</span> <span class=\"n\">u2</span><span class=\"p\">):</span>\n    <span class=\"k\">return</span> <span class=\"p\">[</span> <span class=\"n\">u1</span><span class=\"o\">+</span><span class=\"n\">u2</span><span class=\"p\">,</span> <span class=\"n\">u1</span><span class=\"o\">*</span><span class=\"n\">u2</span> <span class=\"p\">]</span>\n\n<span class=\"n\">FUNCTION</span><span class=\"p\">(</span> <span class=\"n\">myfun</span><span class=\"p\">,</span> <span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>For example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">func</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">FUNCTION</span><span class=\"p\">(</span><span class=\"n\">myfun</span><span class=\"p\">,</span> <span class=\"n\">args</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>If inputs are specified then connections are automatically made and\nare assigned to sequential input ports:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">func</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">FUNCTION</span><span class=\"p\">(</span><span class=\"n\">myfun</span><span class=\"p\">,</span> <span class=\"n\">block1</span><span class=\"p\">,</span> <span class=\"n\">block2</span><span class=\"p\">,</span> <span class=\"n\">args</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>is equivalent to:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">func</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">FUNCTION</span><span class=\"p\">(</span><span class=\"n\">myfun</span><span class=\"p\">,</span> <span class=\"n\">args</span><span class=\"p\">)</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">block1</span><span class=\"p\">,</span> <span class=\"n\">func</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">block2</span><span class=\"p\">,</span> <span class=\"n\">func</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n</pre></div>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.functions.Gain\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.functions.</code><code class=\"sig-name descname\">Gain</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Gain\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Gain\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    GAIN\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/gain.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(N,),\nA(N,M)</p></td>\n<td><p>float,\nA(N,),\nA(N,M)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.functions.Gain.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">K</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">premul</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Gain.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Gain.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Gain block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>K</strong> (<em>array_like</em>) – The gain value, defaults to 1</p></li>\n<li><p><strong>premul</strong> (<em>bool</em><em>, </em><em>optional</em>) – premultiply by constant, default is postmultiply, defaults to False</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Gain instance</p>\n</dd>\n</dl>\n<p>Scale the input signal. If the input is <span class=\"math notranslate nohighlight\">\\(u\\)</span> the output is <span class=\"math notranslate nohighlight\">\\(u K\\)</span>.</p>\n<p>Either or both the input and gain can be Numpy arrays and Numpy will\ncompute the appropriate product <span class=\"math notranslate nohighlight\">\\(u K\\)</span>.</p>\n<p>If <span class=\"math notranslate nohighlight\">\\(u\\)</span> and <code class=\"docutils literal notranslate\"><span class=\"pre\">K</span></code> are both NumPy arrays the <code class=\"docutils literal notranslate\"><span class=\"pre\">&#64;</span></code> operator is used\nand <span class=\"math notranslate nohighlight\">\\(u\\)</span> is postmultiplied by the gain. To premultiply by the gain, \nto compute <span class=\"math notranslate nohighlight\">\\(K u\\)</span> use the <code class=\"docutils literal notranslate\"><span class=\"pre\">premul</span></code> option.</p>\n<p>For example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">gain</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">GAIN</span><span class=\"p\">(</span><span class=\"n\">constant</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.functions.Interpolate\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.functions.</code><code class=\"sig-name descname\">Interpolate</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Interpolate\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Interpolate\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    INTERPOLATE\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/interpolate.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0 or 1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float</p></td>\n<td><p>any</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.functions.Interpolate.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">x</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">y</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">xy</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">time</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"n\">kind</span><span class=\"o\">=</span><span class=\"default_value\">'linear'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Interpolate.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Interpolate.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Interpolate signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>x</strong> (<em>array_like</em><em>, </em><em>shape</em><em> (</em><em>N</em><em>,</em><em>) </em><em>optional</em>) – x-values of function, defaults to None</p></li>\n<li><p><strong>y</strong> (<em>array_like</em><em>, </em><em>optional</em>) – y-values of function, defaults to None</p></li>\n<li><p><strong>xy</strong> (<em>array_like</em><em>, </em><em>optional</em>) – combined x- and y-values of function, defaults to None</p></li>\n<li><p><strong>time</strong> (<em>bool</em><em>, </em><em>optional</em>) – x new is simulation time, defaults to False</p></li>\n<li><p><strong>kind</strong> (<em>str</em><em>, </em><em>optional</em>) – interpolation method, defaults to ‘linear’</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>An INTERPOLATE block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>An Interpolate instance</p>\n</dd>\n</dl>\n<p>Interpolate the input signal using to a piecewise function.</p>\n<p>A simple triangle function with domain [0,10] and range [0,1] can be\ndefined by:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">INTERPOLATE</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span><span class=\"mi\">5</span><span class=\"p\">,</span><span class=\"mi\">10</span><span class=\"p\">),</span> <span class=\"n\">y</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"mi\">0</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">,</span><span class=\"mi\">0</span><span class=\"p\">))</span>\n</pre></div>\n</div>\n<p>We might also express this as a list of 2D-coordinats:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">INTERPOLATE</span><span class=\"p\">(</span><span class=\"n\">xy</span><span class=\"o\">=</span><span class=\"p\">[(</span><span class=\"mi\">0</span><span class=\"p\">,</span><span class=\"mi\">0</span><span class=\"p\">),</span> <span class=\"p\">(</span><span class=\"mi\">5</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">),</span> <span class=\"p\">(</span><span class=\"mi\">10</span><span class=\"p\">,</span><span class=\"mi\">0</span><span class=\"p\">)])</span>\n</pre></div>\n</div>\n<p>The data can also be expressed as Numpy arrays.  If that is the case,\nthe interpolation function can be vector valued. <code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> has a shape of\n(N,1) and <code class=\"docutils literal notranslate\"><span class=\"pre\">y</span></code> has a shape of (N,M).  Alternatively <code class=\"docutils literal notranslate\"><span class=\"pre\">xy</span></code> has a shape\nof (N,M+1) and the first column is the x-data.</p>\n<p>The input to the interpolator comes from:</p>\n<ul class=\"simple\">\n<li><p>Input port 0</p></li>\n<li><p>Simulation time, if <code class=\"docutils literal notranslate\"><span class=\"pre\">time=True</span></code>.  In this case the block has no\ninput ports and is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Source</span></code> not a <code class=\"docutils literal notranslate\"><span class=\"pre\">Function</span></code>.</p></li>\n</ul>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.functions.Prod\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.functions.</code><code class=\"sig-name descname\">Prod</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Prod\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Prod\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    PROD\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/prod.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>len(ops)</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(N,),\nA(N,M)</p></td>\n<td><p>float,\nA(N,),\nA(N,M)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.functions.Prod.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">ops</span><span class=\"o\">=</span><span class=\"default_value\">'**'</span></em>, <em class=\"sig-param\"><span class=\"n\">matrix</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Prod.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Prod.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Product junction.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>ops</strong> (<em>str</em><em>, </em><em>optional</em>) – operations associated with input ports, accepted characters: * or /, defaults to ‘**’</p></li>\n<li><p><strong>inputs</strong> (<a class=\"reference internal\" href=\"internals.html#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"internals.html#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – Optional incoming connections</p></li>\n<li><p><strong>matrix</strong> (<em>bool</em><em>, </em><em>optional</em>) – Arguments are matrices, defaults to False</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A PROD block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Prod instance</p>\n</dd>\n</dl>\n<p>Multiply or divide input signals according to the <cite>ops</cite> string.  The\nnumber of input ports is the length of this string.</p>\n<p>For example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">prod</span> <span class=\"o\">=</span> <span class=\"n\">PROD</span><span class=\"p\">(</span><span class=\"s1\">&#39;*/*&#39;</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>is a 3-input product junction which computes port0 / port 1 * port2.</p>\n<p>Implicit PROD blocks are created by:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"n\">block1</span>  <span class=\"n\">block2</span>\n</pre></div>\n</div>\n<p>which will create a summation block named “_prod.N”.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<ul class=\"simple\">\n<li><p>The inputs can be scalars or NumPy arrays.</p></li>\n<li><p>By default the <code class=\"docutils literal notranslate\"><span class=\"pre\">*</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">/</span></code> operators are used.</p></li>\n<li><p>The option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> will instead use <code class=\"docutils literal notranslate\"><span class=\"pre\">&#64;</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">&#64;</span> <span class=\"pre\">np.linalg.inv()</span></code>.\n- the shapes of matrices must conform.\n- only square matrices are supported.</p></li>\n</ul>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.functions.Sum\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.functions.</code><code class=\"sig-name descname\">Sum</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Sum\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Sum\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    SUM\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/sum.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>len(signs)</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(N,),\nA(N,M)</p></td>\n<td><p>float,\nA(N,),\nA(N,M)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.functions.Sum.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">signs</span><span class=\"o\">=</span><span class=\"default_value\">'++'</span></em>, <em class=\"sig-param\"><span class=\"n\">angles</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/functions.html#Sum.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.functions.Sum.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Summing junction.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>signs</strong> (<em>str</em><em>, </em><em>optional</em>) – signs associated with input ports, accepted characters: + or -, defaults to ‘++’</p></li>\n<li><p><strong>angles</strong> (<em>bool</em><em>, </em><em>optional</em>) – the signals are angles, wraps to [-pi,pi], defaults to False</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – common <a href=\"#id11\"><span class=\"problematic\" id=\"id12\">`Block options &lt;https://petercorke.github.io/bdsim/bdsim.html?highlight=block.__init__#bdsim.components.Block.__init__`_</span></a></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Sum instance</p>\n</dd>\n</dl>\n<p>Add or subtract input signals according to the <cite>signs</cite> string.  The\nnumber of input ports is the length of this string.</p>\n<p>For example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;+-+&#39;</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>is a 3-input summing junction which computes port0 - port1 + port2.</p>\n<p>Implicit SUM blocks are created by:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"n\">block1</span> <span class=\"o\">+</span> <span class=\"n\">block2</span>\n</pre></div>\n</div>\n<p>which will create a summation block named “_sum.N”.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The signals must be compatible, all scalars, or all arrays \nof the same shape.</p>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdsim.blocks.transfers\">\n<span id=\"transfer-blocks\"></span><h2>Transfer blocks<a class=\"headerlink\" href=\"#module-bdsim.blocks.transfers\" title=\"Permalink to this headline\">¶</a></h2>\n<p>Transfer blocks:</p>\n<ul class=\"simple\">\n<li><p>have inputs and outputs</p></li>\n<li><p>have state variables</p></li>\n<li><p>are a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">TransferBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.transfers.Integrator\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.transfers.</code><code class=\"sig-name descname\">Integrator</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/transfers.html#Integrator\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.transfers.Integrator\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    INTEGRATOR\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/integrator.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-left\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>N</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(N,)</p></td>\n<td><p>float,\nA(N,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.transfers.Integrator.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">min</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">max</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/transfers.html#Integrator.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.transfers.Integrator.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Integrator.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>x0</strong> (<em>array_like</em><em>, </em><em>optional</em>) – Initial state, defaults to 0</p></li>\n<li><p><strong>min</strong> (<em>float</em><em> or </em><em>array_like</em><em>, </em><em>optional</em>) – Minimum value of state, defaults to None</p></li>\n<li><p><strong>max</strong> (<em>float</em><em> or </em><em>array_like</em><em>, </em><em>optional</em>) – Maximum value of state, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>an INTEGRATOR block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Integrator instance</p>\n</dd>\n</dl>\n<p>Output is the time integral of the input.  The state can be a scalar or a\nvector. The initial state, and type, is given by <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code>.  The shape of\nthe input signal must match <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code>.</p>\n<p>The minimum and maximum values can be:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>a scalar, in which case the same value applies to every element of \nthe state vector, or</p></li>\n<li><p>a vector, of the same shape as <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code> that applies elementwise to\nthe state.</p></li>\n</ul>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.transfers.LTI_SISO\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.transfers.</code><code class=\"sig-name descname\">LTI_SISO</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/transfers.html#LTI_SISO\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.transfers.LTI_SISO\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <a class=\"reference internal\" href=\"#bdsim.blocks.transfers.LTI_SS\" title=\"bdsim.blocks.transfers.LTI_SS\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.blocks.transfers.LTI_SS</span></code></a></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    LTI_SISO\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/lti_siso.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-left\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>n</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.transfers.LTI_SISO.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">N</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">D</span><span class=\"o\">=</span><span class=\"default_value\">[1, 1]</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/transfers.html#LTI_SISO.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.transfers.LTI_SISO.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>SISO LTI dynamics.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>N</strong> (<em>array_like</em><em>, </em><em>optional</em>) – numerator coefficients, defaults to 1</p></li>\n<li><p><strong>D</strong> (<em>array_like</em><em>, </em><em>optional</em>) – denominator coefficients, defaults to [1,1]</p></li>\n<li><p><strong>x0</strong> (<em>array_like</em><em>, </em><em>optional</em>) – initial states, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A SCOPE block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>LTI_SISO instance</p>\n</dd>\n</dl>\n<p>Implements the dynamics of a single-input single-output (SISO) linear\ntime invariant (LTI) system described by numerator and denominator\npolynomial coefficients.</p>\n<p>Coefficients are given in the order from highest order to zeroth \norder, ie. <span class=\"math notranslate nohighlight\">\\(2s^2 - 4s +3\\)</span> is <code class=\"docutils literal notranslate\"><span class=\"pre\">[2,</span> <span class=\"pre\">-4,</span> <span class=\"pre\">3]</span></code>.</p>\n<p>Only proper transfer functions, where order of numerator is less\nthan denominator are allowed.</p>\n<p>The order of the states in <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code> is consistent with controller canonical\nform.</p>\n<p>Examples:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">LTI_SISO</span><span class=\"p\">(</span><span class=\"n\">N</span><span class=\"o\">=</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=\"n\">D</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=\"o\">-</span><span class=\"mi\">4</span><span class=\"p\">])</span>\n</pre></div>\n</div>\n<p>is the transfer function <span class=\"math notranslate nohighlight\">\\(\\frac{s+2}{2s^2+3s-4}\\)</span>.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.transfers.LTI_SS\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.transfers.</code><code class=\"sig-name descname\">LTI_SS</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/transfers.html#LTI_SS\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.transfers.LTI_SS\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    LTI_SS\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/lti_ss.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-left\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>nc</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(nb,)</p></td>\n<td><p>float,\nA(nc,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.transfers.LTI_SS.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">A</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">B</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">C</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/transfers.html#LTI_SS.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.transfers.LTI_SS.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>State-space LTI dynamics.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>N</strong> (<em>array_like</em><em>, </em><em>optional</em>) – numerator coefficients, defaults to 1</p></li>\n<li><p><strong>D</strong> (<em>array_like</em><em>, </em><em>optional</em>) – denominator coefficients, defaults to [1,1]</p></li>\n<li><p><strong>x0</strong> (<em>array_like</em><em>, </em><em>optional</em>) – initial states, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A SCOPE block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>LTI_SISO instance</p>\n</dd>\n</dl>\n<p>Implements the dynamics of a single-input single-output (SISO) linear\ntime invariant (LTI) system described by numerator and denominator\npolynomial coefficients.</p>\n<p>Coefficients are given in the order from highest order to zeroth \norder, ie. <span class=\"math notranslate nohighlight\">\\(2s^2 - 4s +3\\)</span> is <code class=\"docutils literal notranslate\"><span class=\"pre\">[2,</span> <span class=\"pre\">-4,</span> <span class=\"pre\">3]</span></code>.</p>\n<p>Only proper transfer functions, where order of numerator is less\nthan denominator are allowed.</p>\n<p>The order of the states in <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code> is consistent with controller canonical\nform.</p>\n<p>Examples:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">LTI_SISO</span><span class=\"p\">(</span><span class=\"n\">N</span><span class=\"o\">=</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=\"n\">D</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=\"o\">-</span><span class=\"mi\">4</span><span class=\"p\">])</span>\n</pre></div>\n</div>\n<p>is the transfer function <span class=\"math notranslate nohighlight\">\\(\\frac{s+2}{2s^2+3s-4}\\)</span>.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.transfers.PoseIntegrator\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.transfers.</code><code class=\"sig-name descname\">PoseIntegrator</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/transfers.html#PoseIntegrator\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.transfers.PoseIntegrator\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    POSEINTEGRATOR\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/poseintegrator.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-left\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>N</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(N,)</p></td>\n<td><p>A(N,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.transfers.PoseIntegrator.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/transfers.html#PoseIntegrator.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.transfers.PoseIntegrator.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Pose integrator</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>x0</strong> (<em>SE3</em><em>, </em><em>optional</em>) – Initial pose, defaults to null</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>an INTEGRATOR block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Integrator instance</p>\n</dd>\n</dl>\n<p>This block integrates spatial velocity over time.\nThe block input is a spatial velocity as a 6-vector\n<span class=\"math notranslate nohighlight\">\\((v_x, v_y, v_z, \\omega_x, \\omega_y, \\omega_z)\\)</span> and the output\nis pose as an <code class=\"docutils literal notranslate\"><span class=\"pre\">SE3</span></code> instance.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>State is a velocity twist.</p>\n</div>\n<div class=\"admonition warning\">\n<p class=\"admonition-title\">Warning</p>\n<p>NOT WORKING YET</p>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdsim.blocks.discrete\">\n<span id=\"discrete-time-blocks\"></span><h2>Discrete-time blocks<a class=\"headerlink\" href=\"#module-bdsim.blocks.discrete\" title=\"Permalink to this headline\">¶</a></h2>\n<p>Transfer blocks:</p>\n<ul class=\"simple\">\n<li><p>have inputs and outputs</p></li>\n<li><p>have state variables</p></li>\n<li><p>are a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">TransferBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.discrete.DIntegrator\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.discrete.</code><code class=\"sig-name descname\">DIntegrator</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#DIntegrator\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.DIntegrator\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.ClockedBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    DINTEGRATOR\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/dintegrator.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>N</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(N,)</p></td>\n<td><p>float,\nA(N,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.discrete.DIntegrator.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">clock</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">gain</span><span class=\"o\">=</span><span class=\"default_value\">1.0</span></em>, <em class=\"sig-param\"><span class=\"n\">min</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">max</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#DIntegrator.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.DIntegrator.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Discrete-time integrator.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>clock</strong> (<a class=\"reference internal\" href=\"internals.html#bdsim.Clock\" title=\"bdsim.Clock\"><em>Clock</em></a>) – clock source</p></li>\n<li><p><strong>x0</strong> (<em>array_like</em><em>, </em><em>optional</em>) – Initial state, defaults to 0</p></li>\n<li><p><strong>min</strong> (<em>float</em><em> or </em><em>array_like</em><em>, </em><em>optional</em>) – Minimum value of state, defaults to None</p></li>\n<li><p><strong>max</strong> (<em>float</em><em> or </em><em>array_like</em><em>, </em><em>optional</em>) – Maximum value of state, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>an INTEGRATOR block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Integrator instance</p>\n</dd>\n</dl>\n<p>Create a discrete-time integrator block.</p>\n<p>Output is the time integral of the input.  The state can be a scalar or a\nvector, this is given by the type of <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code>.</p>\n<p>The minimum and maximum values can be:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>a scalar, in which case the same value applies to every element of \nthe state vector, or</p></li>\n<li><p>a vector, of the same shape as <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code> that applies elementwise to\nthe state.</p></li>\n</ul>\n</div></blockquote>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.discrete.DIntegrator.next\">\n<code class=\"sig-name descname\">next</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#DIntegrator.next\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.DIntegrator.next\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.discrete.DPoseIntegrator\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.discrete.</code><code class=\"sig-name descname\">DPoseIntegrator</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#DPoseIntegrator\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.DPoseIntegrator\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.ClockedBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    DPOSEINTEGRATOR\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/dposeintegrator.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-left\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>N</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(6,)</p></td>\n<td><p>SE3</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.discrete.DPoseIntegrator.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">clock</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#DPoseIntegrator.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.DPoseIntegrator.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Discrete-time spatial velocity integrator.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>clock</strong> (<a class=\"reference internal\" href=\"internals.html#bdsim.Clock\" title=\"bdsim.Clock\"><em>Clock</em></a>) – clock source</p></li>\n<li><p><strong>x0</strong> (<em>SE3</em><em>, </em><em>optional</em>) – Initial pose, defaults to null</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>an DPOSEINTEGRATOR block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Integrator instance</p>\n</dd>\n</dl>\n<p>This block integrates spatial velocity over time.\nThe block input is a spatial velocity as a 6-vector\n<span class=\"math notranslate nohighlight\">\\((v_x, v_y, v_z, \\omega_x, \\omega_y, \\omega_z)\\)</span> and the output\nis pose as an <code class=\"docutils literal notranslate\"><span class=\"pre\">SE3</span></code> instance.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>State is a velocity twist.</p>\n</div>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.discrete.DPoseIntegrator.next\">\n<code class=\"sig-name descname\">next</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#DPoseIntegrator.next\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.DPoseIntegrator.next\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.discrete.ZOH\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.discrete.</code><code class=\"sig-name descname\">ZOH</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#ZOH\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.ZOH\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.ClockedBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    ZOH\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/zoh.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>N</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(N,)</p></td>\n<td><p>float,\nA(N,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.discrete.ZOH.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">clock</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#ZOH.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.ZOH.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Zero-order hold.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>clock</strong> (<a class=\"reference internal\" href=\"internals.html#bdsim.Clock\" title=\"bdsim.Clock\"><em>Clock</em></a>) – clock source</p></li>\n<li><p><strong>x0</strong> (<em>array_like</em><em>, </em><em>optional</em>) – Initial value of the hold, defaults to 0</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a ZOH block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Integrator instance</p>\n</dd>\n</dl>\n<p>Output is the input at the previous clock time.  The state can be a scalar or a\nvector, this is given by the type of <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>If input is not a scalar, <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code> must have the shape of the\ninput signal.</p>\n</div>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.discrete.ZOH.next\">\n<code class=\"sig-name descname\">next</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/discrete.html#ZOH.next\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.discrete.ZOH.next\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdsim.blocks.linalg\">\n<span id=\"linear-algebra-blocks\"></span><h2>Linear algebra blocks<a class=\"headerlink\" href=\"#module-bdsim.blocks.linalg\" title=\"Permalink to this headline\">¶</a></h2>\n<p>Linear algebra blocks:</p>\n<ul class=\"simple\">\n<li><p>have inputs and outputs</p></li>\n<li><p>have no state variables</p></li>\n<li><p>are a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">FunctionBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.linalg.Cond\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.linalg.</code><code class=\"sig-name descname\">Cond</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Cond\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Cond\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    COND\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/cond.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(N,M)</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.linalg.Cond.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Cond.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Cond.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Compute the matrix condition number.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A COND block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Cond instance</p>\n</dd>\n<dt class=\"field-even\">Seealso</dt>\n<dd class=\"field-even\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">numpy.linalg.cond()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.linalg.Det\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.linalg.</code><code class=\"sig-name descname\">Det</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Det\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Det\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    DET\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/det.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(N,N)</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.linalg.Det.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Det.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Det.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Matrix determinant</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A DET block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Det instance</p>\n</dd>\n</dl>\n<p>Compute the matrix determinant.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">numpy.linalg.inv()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.linalg.Flatten\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.linalg.</code><code class=\"sig-name descname\">Flatten</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Flatten\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Flatten\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    FLATTEN\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/flatten.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(N,M )</p></td>\n<td><p>A(NM,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.linalg.Flatten.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">order</span><span class=\"o\">=</span><span class=\"default_value\">'C'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Flatten.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Flatten.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Flatten a multi-dimensional array.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>order</strong> (<em>str</em>) – flattening order, either “C” or “F”, defaults to “C”</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A FLATTEN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Flatten instance</p>\n</dd>\n</dl>\n<p>Flattens the incoming array in either row major (‘C’) or column major (‘F’) order.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">numpy.flatten()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.linalg.Inverse\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.linalg.</code><code class=\"sig-name descname\">Inverse</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Inverse\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Inverse\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    INVERSE\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/inverse.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 36%\" />\n<col style=\"width: 32%\" />\n<col style=\"width: 32%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>2</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(M,N)</p></td>\n<td><p>A(N,M)\nfloat</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.linalg.Inverse.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">pinv</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Inverse.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Inverse.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Matrix inverse.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>pinv</strong> (<em>bool</em><em>, </em><em>optional</em>) – force pseudo inverse, defaults to False</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>An INVERSE block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Inverse instance</p>\n</dd>\n</dl>\n<p>Compute inverse of the 2D-array input signal.  If the matrix is square\nthe inverse is computed unless the <code class=\"docutils literal notranslate\"><span class=\"pre\">pinv</span></code> flag is True.  For a\nnon-square matrix the pseudo-inverse is used.  The condition number is\noutput on the second port.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">numpy.linalg.inv()</span></code> <code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">numpy.linalg.pinv()</span></code> <code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">numpy.linalg.cond()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.blocks.linalg.Inverse.onames\">\n<code class=\"sig-name descname\">onames</code><em class=\"property\"> = ('inv', 'cond')</em><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Inverse.onames\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.linalg.Norm\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.linalg.</code><code class=\"sig-name descname\">Norm</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Norm\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Norm\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    NORM\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/norm.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(N,)\nA(N,M)</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.linalg.Norm.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">ord</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">axis</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Norm.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Norm.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Array norm.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>axis</strong> (<em>int</em><em>, </em><em>optional</em>) – specifies the axis along which to compute the vector norms, defaults to None.</p></li>\n<li><p><strong>ord</strong> (<em>int</em><em> or </em><em>str</em>) – Order of the norm, default to None.</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A NORM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Norm instance</p>\n</dd>\n</dl>\n<p>Computes the specified norm for a 1D- or 2D-array.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">numpy.linalg.norm()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.linalg.Slice1\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.linalg.</code><code class=\"sig-name descname\">Slice1</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Slice1\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Slice1\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    SLICE1\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/slice1.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(N)</p></td>\n<td><p>A(M)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.linalg.Slice1.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">index</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Slice1.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Slice1.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Slice out subarray of 1D-array.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>index</strong> (<em>tuple</em><em>(</em><em>3</em><em>)</em>) – slice, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A SLICE1 block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Slice1 instance</p>\n</dd>\n</dl>\n<p>Compute a 1D slice of input 1D array.</p>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">index</span></code> is <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> it means all elements.</p>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">index</span></code> is a list, perform NumPy fancy indexing, returning\nthe specified elements</p>\n<p>Example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">SLICE1</span><span class=\"p\">(</span><span class=\"n\">index</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=\"c1\"># return elements 2 and 3 as a 1D array</span>\n<span class=\"n\">SLICE1</span><span class=\"p\">(</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">])</span>   <span class=\"c1\"># return element 2 as a 1D array</span>\n<span class=\"n\">SLICE1</span><span class=\"p\">(</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"mi\">2</span><span class=\"p\">)</span>     <span class=\"c1\"># return element 2 as a NumPy scalar</span>\n</pre></div>\n</div>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">index</span></code> is a tuple, it must have three elements.  It\ndescribes a Python slice <code class=\"docutils literal notranslate\"><span class=\"pre\">(start,</span> <span class=\"pre\">stop,</span> <span class=\"pre\">step)</span></code> where any element can be <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code></p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">start=None</span></code> means start at first element</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">stop=None</span></code> means finish at last element</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">step=None</span></code> means step by one</p></li>\n</ul>\n</div></blockquote>\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">rows=None</span></code> is equivalent to <code class=\"docutils literal notranslate\"><span class=\"pre\">rows=(None,</span> <span class=\"pre\">None,</span> <span class=\"pre\">None)</span></code>.</p>\n<p>Example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">SLICE1</span><span class=\"p\">(</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"kc\">None</span><span class=\"p\">,</span><span class=\"kc\">None</span><span class=\"p\">,</span><span class=\"mi\">2</span><span class=\"p\">))</span>  <span class=\"c1\"># return every second element</span>\n<span class=\"n\">SLICE1</span><span class=\"p\">(</span><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"kc\">None</span><span class=\"p\">,</span><span class=\"kc\">None</span><span class=\"p\">,</span><span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">))</span> <span class=\"c1\"># reverse the elements</span>\n</pre></div>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.blocks.linalg.Slice1\" title=\"bdsim.blocks.linalg.Slice1\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Slice1</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.linalg.Slice2\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.linalg.</code><code class=\"sig-name descname\">Slice2</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Slice2\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Slice2\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    SLICE2\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/slice2.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(N,M)</p></td>\n<td><p>A(K,L)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.linalg.Slice2.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">rows</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">cols</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Slice2.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Slice2.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Slice out subarray of 2D-array.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>rows</strong> (<em>tuple</em><em>(</em><em>3</em><em>) or </em><em>list</em>) – row selection, defaults to None</p></li>\n<li><p><strong>cols</strong> (<em>tuple</em><em>(</em><em>3</em><em>) or </em><em>list</em>) – column selection, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A SLICE2 block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Slice2 instance</p>\n</dd>\n</dl>\n<p>Compute a 2D slice of input 2D array.</p>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">rows</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">cols</span></code> is <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code> it means all rows or columns\nrespectively.</p>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">rows</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">cols</span></code> is a list, perform NumPy fancy indexing, returning\nthe specified rows or columns</p>\n<p>Example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">SLICE2</span><span class=\"p\">(</span><span class=\"n\">rows</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=\"c1\"># return rows 2 and 3, all columns</span>\n<span class=\"n\">SLICE2</span><span class=\"p\">(</span><span class=\"n\">cols</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"mi\">4</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">])</span>  <span class=\"c1\"># return columns 4 and 1, all rows</span>\n<span class=\"n\">SLICE2</span><span class=\"p\">(</span><span class=\"n\">rows</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=\"n\">cols</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"mi\">4</span><span class=\"p\">,</span><span class=\"mi\">1</span><span class=\"p\">])</span> <span class=\"c1\"># return elements [2,4] and [3,1] as a 1D array</span>\n</pre></div>\n</div>\n<p>If a single row or column is selected, the result will be a 1D array</p>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">rows</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">cols</span></code> is a tuple, it must have three elements.  It\ndescribes a Python slice <code class=\"docutils literal notranslate\"><span class=\"pre\">(start,</span> <span class=\"pre\">stop,</span> <span class=\"pre\">step)</span></code> where any element can be <code class=\"docutils literal notranslate\"><span class=\"pre\">None</span></code></p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">start=None</span></code> means start at first element</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">stop=None</span></code> means finish at last element</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">step=None</span></code> means step by one</p></li>\n</ul>\n</div></blockquote>\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">rows=None</span></code> is equivalent to <code class=\"docutils literal notranslate\"><span class=\"pre\">rows=(None,</span> <span class=\"pre\">None,</span> <span class=\"pre\">None)</span></code>.</p>\n<p>Example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">SLICE2</span><span class=\"p\">(</span><span class=\"n\">rows</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"kc\">None</span><span class=\"p\">,</span><span class=\"kc\">None</span><span class=\"p\">,</span><span class=\"mi\">2</span><span class=\"p\">))</span>  <span class=\"c1\"># return every second row</span>\n<span class=\"n\">SLICE2</span><span class=\"p\">(</span><span class=\"n\">cols</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"kc\">None</span><span class=\"p\">,</span><span class=\"kc\">None</span><span class=\"p\">,</span><span class=\"o\">-</span><span class=\"mi\">1</span><span class=\"p\">))</span> <span class=\"c1\"># reverse the columns</span>\n</pre></div>\n</div>\n<p>The list and tuple notation can be mixed, for example, one for rows\nand one for columns.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.blocks.linalg.Slice1\" title=\"bdsim.blocks.linalg.Slice1\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Slice1</span></code></a> <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Index</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.linalg.Transpose\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.linalg.</code><code class=\"sig-name descname\">Transpose</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Transpose\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Transpose\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    TRANSPOSE\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/transpose.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(M,N)</p></td>\n<td><p>A(N,M)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.linalg.Transpose.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/linalg.html#Transpose.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.linalg.Transpose.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Matrix transpose.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A TRANSPOSE block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Transpose instance</p>\n</dd>\n</dl>\n<p>Compute transpose of the 2D-array input signal.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<ul class=\"simple\">\n<li><p>An input 1D-array of shape (N,) is turned into a 2D-array column vector\nwith shape (N,1).</p></li>\n<li><p>An input 2D-array column vector of shape (N,1) becomes a 2D-array</p></li>\n</ul>\n<blockquote>\n<div><p>row vector with shape (1,N).</p>\n</div></blockquote>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">numpy.transpose()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-bdsim.blocks.connections\">\n<span id=\"connection-blocks\"></span><h2>Connection blocks<a class=\"headerlink\" href=\"#module-bdsim.blocks.connections\" title=\"Permalink to this headline\">¶</a></h2>\n<p>Connection blocks are in two categories:</p>\n<ol class=\"arabic simple\">\n<li><dl class=\"simple\">\n<dt>Signal manipulation:</dt><dd><ul class=\"simple\">\n<li><p>have inputs and outputs</p></li>\n<li><p>have no state variables</p></li>\n<li><p>are a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">FunctionBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n</dd>\n</dl>\n</li>\n<li><dl class=\"simple\">\n<dt>Subsystem support</dt><dd><ul class=\"simple\">\n<li><p>have inputs or outputs</p></li>\n<li><p>have no state variables</p></li>\n<li><p>are a subclass of <code class=\"docutils literal notranslate\"><span class=\"pre\">SubsysytemBlock</span></code> → <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code></p></li>\n</ul>\n</dd>\n</dl>\n</li>\n</ol>\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.connections.DeMux\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.connections.</code><code class=\"sig-name descname\">DeMux</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#DeMux\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.DeMux\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    DEMUX\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/demux.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>nout</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(nout,)</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.connections.DeMux.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#DeMux.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.DeMux.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Demultiplex signals.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>nout</strong> (<em>int</em><em>, </em><em>optional</em>) – number of outputs, defaults to 1</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A DEMUX block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>DeMux instance</p>\n</dd>\n</dl>\n<p>This block has a single input port and <code class=\"docutils literal notranslate\"><span class=\"pre\">nout</span></code> output ports.  A 1D-array\ninput signal (with <code class=\"docutils literal notranslate\"><span class=\"pre\">nout</span></code> elements) is routed element-wise to individual\nscalar output ports.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.connections.Dict\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.connections.</code><code class=\"sig-name descname\">Dict</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#Dict\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.Dict\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    DICT\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/dict.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>N</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>any</p></td>\n<td><p>dict</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.connections.Dict.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">item</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#Dict.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.Dict.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a dictionary signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>keys</strong> (<em>list</em>) – list of dictionary keys</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A DICT block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Dict instance</p>\n</dd>\n</dl>\n<p>Inputs are assigned to a dictionary signal, using the corresponding \nnames from <code class=\"docutils literal notranslate\"><span class=\"pre\">keys</span></code>.\nFor example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">DICT</span><span class=\"p\">([</span><span class=\"s1\">&#39;x&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;xd&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;xdd&#39;</span><span class=\"p\">])</span>\n</pre></div>\n</div>\n<p>expects three inputs and assigns them to dictionary items <code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">xd</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">xdd</span></code> of\nthe output dictionary respectively.</p>\n<p>A dictionary signal can serve a similar purpose to a “bus” in Simulink(R).</p>\n<p>This is somewhat like a multiplexer <a class=\"reference internal\" href=\"#bdsim.blocks.connections.Mux\" title=\"bdsim.blocks.connections.Mux\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Mux</span></code></a> but allows for\nnamed heterogeneous data.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.blocks.connections.Item\" title=\"bdsim.blocks.connections.Item\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Item</span></code></a> <a class=\"reference internal\" href=\"#bdsim.blocks.connections.Mux\" title=\"bdsim.blocks.connections.Mux\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Mux</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.connections.InPort\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.connections.</code><code class=\"sig-name descname\">InPort</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#InPort\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.InPort\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SubsystemBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    INPORT\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/inport.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>nout</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>any</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.connections.InPort.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#InPort.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.InPort.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Input ports for a subsystem.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>nout</strong> (<em>int</em><em>, </em><em>optional</em>) – Number of output ports, defaults to 1</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>An INPORT block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>InPort instance</p>\n</dd>\n</dl>\n<p>This block connects a subsystem to a parent block diagram.  Inputs to the\nparent-level <code class=\"docutils literal notranslate\"><span class=\"pre\">SubSystem</span></code> block appear as the outputs of this block.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Only one <code class=\"docutils literal notranslate\"><span class=\"pre\">INPORT</span></code> block can appear in a block diagram but it\ncan have multiple ports.  This is different to Simulink(R) which \nwould require multiple single-port input blocks.</p>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.connections.Index\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.connections.</code><code class=\"sig-name descname\">Index</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#Index\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.Index\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    INDEX\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/index.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>ndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.connections.Index.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">index</span><span class=\"o\">=</span><span class=\"default_value\">[]</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#Index.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.Index.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Index an iterable signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>index</strong> (<em>list</em><em>, </em><em>slice</em><em> or </em><em>str</em><em>, </em><em>optional</em>) – elements of input array, defaults to []</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>An INDEX block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Index instance</p>\n</dd>\n</dl>\n<p>The specified element(s) of the input iterable (list, string, etc.)\nare output.  The index can be an integer, sequence of integers, a Python slice\nobject, or a string with Python slice notation, eg. <code class=\"docutils literal notranslate\"><span class=\"pre\">&quot;::-1&quot;</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Slice1</span></code> <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Slice2</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.connections.Item\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.connections.</code><code class=\"sig-name descname\">Item</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#Item\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.Item\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    ITEM\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/item.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>dict</p></td>\n<td><p>any</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.connections.Item.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">item</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#Item.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.Item.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Selector item from a dictionary signal.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>item</strong> (<em>str</em>) – name of dictionary item</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>An ITEM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Item instance</p>\n</dd>\n</dl>\n<p>For a dictionary type input signal, select one item as the output signal.\nFor example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">ITEM</span><span class=\"p\">(</span><span class=\"s1\">&#39;xd&#39;</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>selects the <code class=\"docutils literal notranslate\"><span class=\"pre\">xd</span></code> item from the dictionary signal input to the block.</p>\n<p>A dictionary signal can serve a similar purpose to a “bus” in Simulink(R).</p>\n<p>This is somewhat like a demultiplexer <a class=\"reference internal\" href=\"#bdsim.blocks.connections.DeMux\" title=\"bdsim.blocks.connections.DeMux\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">DeMux</span></code></a> but allows for\nnamed heterogeneous data.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.blocks.connections.Dict\" title=\"bdsim.blocks.connections.Dict\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Dict</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.connections.Mux\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.connections.</code><code class=\"sig-name descname\">Mux</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#Mux\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.Mux\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    MUX\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/mux.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>nin</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float,\nA(N,)</p></td>\n<td><p>A(M,)\nA(M,)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.connections.Mux.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#Mux.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.Mux.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Multiplex signals.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>nin</strong> (<em>int</em><em>, </em><em>optional</em>) – Number of input ports, defaults to 1</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A MUX block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Mux instance</p>\n</dd>\n</dl>\n<p>This block takes a number of scalar or 1D-array signals and concatenates\nthem into a single 1-D array signal.  For example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">MUX</span><span class=\"p\">(</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"p\">(</span><span class=\"n\">func1</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">],</span> <span class=\"n\">sum3</span><span class=\"p\">))</span>\n</pre></div>\n</div>\n<p>multiplexes the outputs of blocks <code class=\"docutils literal notranslate\"><span class=\"pre\">func1</span></code> (port 2) and <code class=\"docutils literal notranslate\"><span class=\"pre\">sum3</span></code> into a\nsingle output vector as a 1D-array.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.blocks.connections.Dict\" title=\"bdsim.blocks.connections.Dict\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Dict</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.connections.OutPort\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.connections.</code><code class=\"sig-name descname\">OutPort</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#OutPort\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.OutPort\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SubsystemBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    OUTPORT\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/outport.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>nin</p></td>\n<td><p>0</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>any</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.connections.OutPort.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#OutPort.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.OutPort.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Output ports for a subsystem.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>nin</strong> (<em>int</em><em>, </em><em>optional</em>) – Number of input ports, defaults to 1</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A OUTPORT block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>OutPort instance</p>\n</dd>\n</dl>\n<p>This block connects a subsystem to a parent block diagram.  The the \ninputs of this block become the outputs of the parent-level <code class=\"docutils literal notranslate\"><span class=\"pre\">SubSystem</span></code>\nblock.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Only one <code class=\"docutils literal notranslate\"><span class=\"pre\">OUTPORT</span></code> block can appear in a block diagram but it\ncan have multiple ports.  This is different to Simulink(R) which \nwould require multiple single-port output blocks.</p>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.blocks.connections.SubSystem\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.blocks.connections.</code><code class=\"sig-name descname\">SubSystem</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#SubSystem\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.SubSystem\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SubsystemBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    SUBSYSTEM\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/subsystem.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 36%\" />\n<col style=\"width: 36%\" />\n<col style=\"width: 27%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>ss.in.nout</p></td>\n<td><p>ss.out.nin</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>any</p></td>\n<td><p>any</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"bdsim.blocks.connections.SubSystem.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">subsys</span></em>, <em class=\"sig-param\"><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/blocks/connections.html#SubSystem.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.blocks.connections.SubSystem.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Instantiate a subsystem.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>subsys</strong> (<em>str</em><em> or </em><em>BlockDiagram</em>) – Subsystem as either a filename or a <code class=\"docutils literal notranslate\"><span class=\"pre\">BlockDiagram</span></code> instance</p></li>\n<li><p><strong>nin</strong> (<em>int</em><em>, </em><em>optional</em>) – Number of input ports, defaults to 1</p></li>\n<li><p><strong>nout</strong> (<em>int</em><em>, </em><em>optional</em>) – Number of output ports, defaults to 1</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Raises</dt>\n<dd class=\"field-even\"><ul class=\"simple\">\n<li><p><strong>ImportError</strong> – DESCRIPTION</p></li>\n<li><p><strong>ValueError</strong> – DESCRIPTION</p></li>\n</ul>\n</dd>\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>A SUBSYSTEM block</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>SubSystem instance</p>\n</dd>\n</dl>\n<p>This block represents a subsystem in a block diagram.  The definition\nof the subsystem can be:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>the name of a module which is imported and must contain only\nonly <code class=\"docutils literal notranslate\"><span class=\"pre\">BlockDiagram</span></code> instance, or</p></li>\n<li><p>a <code class=\"docutils literal notranslate\"><span class=\"pre\">BlockDiagram</span></code> instance</p></li>\n</ul>\n</div></blockquote>\n<p>The referenced block diagram must contain one or both of:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>one <code class=\"docutils literal notranslate\"><span class=\"pre\">InPort</span></code> block, which has outputs but no inputs. These\noutputs are connected to the inputs to the enclosing <code class=\"docutils literal notranslate\"><span class=\"pre\">SubSystem</span></code> block.</p></li>\n<li><p>one <code class=\"docutils literal notranslate\"><span class=\"pre\">OutPort</span></code> block, which has inputs but no outputs. These\ninputs are connected to the outputs to the enclosing <code class=\"docutils literal notranslate\"><span class=\"pre\">SubSystem</span></code> block.</p></li>\n</ul>\n</div></blockquote>\n<ul class=\"simple\">\n<li><p>The referenced block diagram is treated like a macro and copied into \nthe parent block diagram at compile time. The <code class=\"docutils literal notranslate\"><span class=\"pre\">SubSystem</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">InPort</span></code> and\n<code class=\"docutils literal notranslate\"><span class=\"pre\">OutPort</span></code> blocks are eliminated, that is, all hierarchical structure is \nlost.</p></li>\n<li><dl class=\"simple\">\n<dt>The same subsystem can be used multiple times, its blocks and wires</dt><dd><p>will be cloned.  Subsystems can also include subsystems.</p>\n</dd>\n</dl>\n</li>\n<li><p>The number of input and output ports is not specified, they are computed\nfrom the number of ports on the <code class=\"docutils literal notranslate\"><span class=\"pre\">InPort</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">OutPort</span></code> blocks within the\nsubsystem.</p></li>\n</ul>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"external-toolbox-blocksets\">\n<h2>External Toolbox blocksets<a class=\"headerlink\" href=\"#external-toolbox-blocksets\" title=\"Permalink to this headline\">¶</a></h2>\n<p>These blocks are defined within external Toolboxes or packages.</p>\n<div class=\"section\" id=\"robot-blocks\">\n<h3>Robot blocks<a class=\"headerlink\" href=\"#robot-blocks\" title=\"Permalink to this headline\">¶</a></h3>\n<p>These blocks are defined within the Robotics Toolbox for Python.</p>\n<div class=\"section\" id=\"module-roboticstoolbox.blocks.arm\">\n<span id=\"arm-robots\"></span><h4>Arm robots<a class=\"headerlink\" href=\"#module-roboticstoolbox.blocks.arm\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.ArmPlot\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">ArmPlot</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#ArmPlot\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.ArmPlot\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.graphics.GraphicsBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    ARMPLOT\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/armplot.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>0</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.ArmPlot.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">inputs</span></em>, <em class=\"sig-param\"><span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">backend</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#ArmPlot.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.ArmPlot.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>*inputs</strong> (<a class=\"reference internal\" href=\"internals.html#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"internals.html#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – Optional incoming connections</p></li>\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>backend</strong> (<em>str</em><em>, </em><em>optional</em>) – RTB backend name, defaults to ‘pyplot’</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>An ARMPLOT block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>ArmPlot instance</p>\n</dd>\n</dl>\n<p>Create a robot animation.</p>\n<p>Notes:</p>\n<blockquote>\n<div><blockquote>\n<div><ul class=\"simple\">\n<li><p>Uses RTB <code class=\"docutils literal notranslate\"><span class=\"pre\">plot</span></code> method</p></li>\n</ul>\n</div></blockquote>\n<p>Example of vehicle display (animated).  The label at the top is the\nblock name.</p>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.CTraj\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">CTraj</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#CTraj\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.CTraj\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    CTRAJ\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/ctraj.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.CTraj.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">T1</span></em>, <em class=\"sig-param\"><span class=\"n\">T2</span></em>, <em class=\"sig-param\"><span class=\"n\">T</span></em>, <em class=\"sig-param\"><span class=\"n\">lspb</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#CTraj.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.CTraj.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>[summary]</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>T1</strong> (<em>SE3</em>) – initial pose</p></li>\n<li><p><strong>T2</strong> (<em>SE3</em>) – final pose</p></li>\n<li><p><strong>T</strong> (<em>float</em>) – motion time</p></li>\n<li><p><strong>lspb</strong> (<em>bool</em>) – Use LSPB motion profile along the path</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>CTRAJ block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>CTraj instance</p>\n</dd>\n</dl>\n<p>Create a Cartesian motion block.</p>\n<p>The block outputs a pose that varies smoothly from <code class=\"docutils literal notranslate\"><span class=\"pre\">T1</span></code> to <code class=\"docutils literal notranslate\"><span class=\"pre\">T2</span></code> over\nthe course of <code class=\"docutils literal notranslate\"><span class=\"pre\">T</span></code> seconds.</p>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">T</span></code> is not given it defaults to the simulation time.</p>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">lspb</span></code> is True then an LSPB motion profile is used along the path\nto provide initial acceleration and final deceleration.  Otherwise,\nmotion is at constant velocity.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a href=\"#id6\"><span class=\"problematic\" id=\"id7\">:method:`SE3.interp`</span></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.CirclePath\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">CirclePath</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#CirclePath\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.CirclePath\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    CIRCLEPATH\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/circlepath.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0 or 1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.CirclePath.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">radius</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">centre</span><span class=\"o\">=</span><span class=\"default_value\">0, 0, 0</span></em>, <em class=\"sig-param\"><span class=\"n\">pose</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">frequency</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">unit</span><span class=\"o\">=</span><span class=\"default_value\">'rps'</span></em>, <em class=\"sig-param\"><span class=\"n\">phase</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#CirclePath.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.CirclePath.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>radius</strong> (<em>float</em>) – radius of circle, defaults to 1</p></li>\n<li><p><strong>centre</strong> (<em>array_like</em><em>(</em><em>3</em><em>)</em>) – center of circle, defaults to [0,0,0]</p></li>\n<li><p><strong>pose</strong> (<em>SE3</em>) – SE3 pose of output, defaults to None</p></li>\n<li><p><strong>frequency</strong> (<em>float</em>) – rotational frequency, defaults to 1</p></li>\n<li><p><strong>unit</strong> (<em>str</em>) – unit for frequency, one of: ‘rps’ [default], ‘rad’</p></li>\n<li><p><strong>phase</strong> (<em>float</em>) – phase</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>TRAJ block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Traj instance</p>\n</dd>\n</dl>\n<p>Create a circular motion block.</p>\n<p>The block outputs the coordinates of a point moving in a circle of\nradius <code class=\"docutils literal notranslate\"><span class=\"pre\">r</span></code> centred at <code class=\"docutils literal notranslate\"><span class=\"pre\">centre</span></code> and parallel to the xy-plane.</p>\n<p>By default the output is a 3-vector <span class=\"math notranslate nohighlight\">\\((x, y, z)\\)</span> but if \n<code class=\"docutils literal notranslate\"><span class=\"pre\">pose</span></code> is an <code class=\"docutils literal notranslate\"><span class=\"pre\">SE3</span></code> instance the output is a copy of that pose with\nits translation set to the coordinate of the moving point.  This is the\nmotion of a frame with fixed orientation following a circular path.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Delta2Tr\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Delta2Tr</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Delta2Tr\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Delta2Tr\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    DELTA2TR\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/delta2tr.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 39%\" />\n<col style=\"width: 32%\" />\n<col style=\"width: 29%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray(6)</p></td>\n<td><p>SE3</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Delta2Tr.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Delta2Tr.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Delta2Tr.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a DELTA2TR block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Delta2Tr instance</p>\n</dd>\n</dl>\n<p>Delta to SE(3)</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>delta as an ndarray(6,n)</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>T as an SE3</p></li>\n</ol>\n</div></blockquote>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">spatialmath.base.delta2tr()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.FDyn\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">FDyn</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#FDyn\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.FDyn\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    FDYN\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/fdyn.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>3</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>ndarray,\nndarray,\nndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.FDyn.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span></em>, <em class=\"sig-param\"><span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#FDyn.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.FDyn.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>q0</strong> (<em>array_like</em><em>(</em><em>n</em><em>)</em>) – Initial joint configuration</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a FORWARD_DYNAMICS block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Foward_Dynamics instance</p>\n</dd>\n</dl>\n<p>Robot arm forward dynamics model.</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint force/torque as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n<p>and three output ports:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>joint configuration</p></li>\n<li><p>joint velocity</p></li>\n<li><p>joint acceleration</p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.FDyn_X\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">FDyn_X</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#FDyn_X\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.FDyn_X\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    FDYN_X\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/fdyn_x.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>3</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>ndarray,\nndarray,\nndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.FDyn_X.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span></em>, <em class=\"sig-param\"><span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">gravcomp</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"n\">velcomp</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"n\">representation</span><span class=\"o\">=</span><span class=\"default_value\">'rpy/xyz'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#FDyn_X.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.FDyn_X.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>end</strong> (<em>Link</em><em> or </em><em>str</em>) – Link to compute pose of, defaults to end-effector</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a FDYN_X block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>FDyn_X instance</p>\n</dd>\n</dl>\n<p>Robot arm forward dynamics model.</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Applied end-effector wrench as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n<p>and three output ports:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>task space pose</p></li>\n<li><p>task space velocity</p></li>\n<li><p>task space acceleration</p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.FKine\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">FKine</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#FKine\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.FKine\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    FKINE\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/fkine.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>SE3</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.FKine.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">args</span><span class=\"o\">=</span><span class=\"default_value\">{}</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#FKine.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.FKine.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>*inputs</strong> (<a class=\"reference internal\" href=\"internals.html#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"internals.html#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – Optional incoming connections</p></li>\n<li><p><strong>robot</strong> (<em>Robot subclass</em><em>, </em><em>optional</em>) – Robot model, defaults to None</p></li>\n<li><p><strong>args</strong> (<em>dict</em><em>, </em><em>optional</em>) – Options for fkine, defaults to {}</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a FORWARD_KINEMATICS block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Foward_Kinematics instance</p>\n</dd>\n</dl>\n<p>Robot arm forward kinematic model.</p>\n<p><strong>Block ports</strong></p>\n<blockquote>\n<div><dl class=\"field-list simple\">\n<dt class=\"field-odd\">input q</dt>\n<dd class=\"field-odd\"><p>Joint configuration vector as an ndarray.</p>\n</dd>\n<dt class=\"field-even\">output T</dt>\n<dd class=\"field-even\"><p>End-effector pose as an SE(3) object</p>\n</dd>\n</dl>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Gravload\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Gravload</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Gravload\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Gravload\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    GRAVLOAD\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/gravload.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>ndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Gravload.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span></em>, <em class=\"sig-param\"><span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Gravload.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Gravload.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>gravity</strong> (<em>float</em>) – gravitational acceleration</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a GRAVLOAD block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Gravload instance</p>\n</dd>\n</dl>\n<p>Robot arm gravity torque.</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint configuration vector as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>joint torque/force due to gravity</p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Gravload_X\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Gravload_X</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Gravload_X\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Gravload_X\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    GRAVLOAD_X\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/gravload_x.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>ndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Gravload_X.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span></em>, <em class=\"sig-param\"><span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Gravload_X.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Gravload_X.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>gravity</strong> (<em>float</em>) – gravitational acceleration</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a GRAVLOAD block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Gravload instance</p>\n</dd>\n</dl>\n<p>Robot arm gravity torque.</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint configuration vector as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>joint torque/force due to gravity</p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.IDyn\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">IDyn</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#IDyn\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.IDyn\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    IDYN\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/idyn.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>3</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray,\nndarray,\nndarray</p></td>\n<td><p>ndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.IDyn.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span></em>, <em class=\"sig-param\"><span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#IDyn.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.IDyn.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>gravity</strong> (<em>float</em>) – gravitational acceleration</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>an INVERSE_DYNAMICS block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Inverse_Dynamics instance</p>\n</dd>\n</dl>\n<p>Robot arm forward dynamics model.</p>\n<p>The block has three input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint configuration vector as an ndarray.</p></li>\n<li><p>Joint velocity vector as an ndarray.</p></li>\n<li><p>Joint acceleration vector as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>joint torque/force</p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.IKine\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">IKine</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#IKine\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.IKine\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    IKINE\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/ikine.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>SE3</p></td>\n<td><p>ndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.IKine.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">q0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">useprevious</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em>, <em class=\"sig-param\"><span class=\"n\">ik</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#IKine.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.IKine.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em><em>, </em><em>optional</em>) – Robot model, defaults to None</p></li>\n<li><p><strong>q0</strong> (<em>array_like</em><em>(</em><em>n</em><em>)</em><em>, </em><em>optional</em>) – Initial joint angles, defaults to None</p></li>\n<li><p><strong>useprevious</strong> (<em>bool</em><em>, </em><em>optional</em>) – Use previous IK solution as q0, defaults to True</p></li>\n<li><p><strong>ik</strong> (<em>callable f</em><em>(</em><em>T</em><em>)</em>) – Specify an IK function, defaults to ‘ikine_LM’</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>an INVERSE_KINEMATICS block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Inverse_Kinematics instance</p>\n</dd>\n</dl>\n<p>Robot arm inverse kinematic model.</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>End-effector pose as an SE(3) object</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint configuration vector as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Inertia\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Inertia</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Inertia\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Inertia\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    INERTIA\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/inertia.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>ndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Inertia.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span></em>, <em class=\"sig-param\"><span class=\"n\">gravity</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Inertia.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Inertia.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>an INERTIA block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Inertia instance</p>\n</dd>\n</dl>\n<p>Robot arm inertia matrix.</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint configuration vector as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint-space inertia matrix <span class=\"math notranslate nohighlight\">\\(\\mat{M}(q)\\)</span></p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Inertia_X\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Inertia_X</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Inertia_X\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Inertia_X\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    INERTIA_X\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/inertia_x.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>ndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Inertia_X.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span></em>, <em class=\"sig-param\"><span class=\"n\">representation</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">pinv</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Inertia_X.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Inertia_X.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>an INERTIA_X block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Inertia_X instance</p>\n</dd>\n</dl>\n<p>Robot arm task-space inertia matrix.</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint configuration vector as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Task-space inertia matrix <span class=\"math notranslate nohighlight\">\\(\\mat{M}_x(q)\\)</span></p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.JTraj\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">JTraj</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#JTraj\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.JTraj\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    JTRAJ\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/jtraj.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 36%\" />\n<col style=\"width: 36%\" />\n<col style=\"width: 27%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>3</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>ndarray(n)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.JTraj.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">q0</span></em>, <em class=\"sig-param\"><span class=\"n\">qf</span></em>, <em class=\"sig-param\"><span class=\"n\">qd0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">qdf</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#JTraj.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.JTraj.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Compute a joint-space trajectory</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>q0</strong> (<em>array_like</em><em>(</em><em>n</em><em>)</em>) – initial joint coordinate</p></li>\n<li><p><strong>qf</strong> (<em>array_like</em><em>(</em><em>n</em><em>)</em>) – final joint coordinate</p></li>\n<li><p><strong>T</strong> (<em>array_like</em><em> or </em><em>int</em><em>, </em><em>optional</em>) – time vector or number of steps, defaults to None</p></li>\n<li><p><strong>qd0</strong> (<em>array_like</em><em>(</em><em>n</em><em>)</em><em>, </em><em>optional</em>) – initial velocity, defaults to None</p></li>\n<li><p><strong>qdf</strong> (<em>array_like</em><em>(</em><em>n</em><em>)</em><em>, </em><em>optional</em>) – final velocity, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>TRAJ block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Traj instance</p>\n</dd>\n</dl>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">tg</span> <span class=\"pre\">=</span> <span class=\"pre\">jtraj(q0,</span> <span class=\"pre\">qf,</span> <span class=\"pre\">N)</span></code> is a joint space trajectory where the joint</p></li>\n</ul>\n<p>coordinates vary from <code class=\"docutils literal notranslate\"><span class=\"pre\">q0</span></code> (M) to <code class=\"docutils literal notranslate\"><span class=\"pre\">qf</span></code> (M).  A quintic (5th order)\npolynomial is used with default zero boundary conditions for velocity and\nacceleration.  Time is assumed to vary from 0 to 1 in <code class=\"docutils literal notranslate\"><span class=\"pre\">N</span></code> steps.</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">tg</span> <span class=\"pre\">=</span> <span class=\"pre\">jtraj(q0,</span> <span class=\"pre\">qf,</span> <span class=\"pre\">t)</span></code> as above but <code class=\"docutils literal notranslate\"><span class=\"pre\">t</span></code> is a uniformly-spaced time</p></li>\n</ul>\n<p>vector</p>\n<p>The return value is an object that contains position, velocity and\nacceleration data.</p>\n<p>Notes:</p>\n<ul class=\"simple\">\n<li><p>The time vector, if given, scales the velocity and acceleration outputs</p></li>\n</ul>\n<p>assuming that the time vector starts at zero and increases\nlinearly.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">ctraj()</span></code>, <code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">qplot()</span></code>, <code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">jtraj()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Jacobian\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Jacobian</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Jacobian\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Jacobian\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    JACOBIAN\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/jacobian.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td><p>ndarray</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Jacobian.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">robot</span></em>, <em class=\"sig-param\"><span class=\"n\">frame</span><span class=\"o\">=</span><span class=\"default_value\">'0'</span></em>, <em class=\"sig-param\"><span class=\"n\">inverse</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"n\">pinv</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"n\">transpose</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Jacobian.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Jacobian.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>robot</strong> (<em>Robot subclass</em>) – Robot model</p></li>\n<li><p><strong>frame</strong> (<em>str</em><em>, </em><em>optional</em>) – Frame to compute Jacobian for, one of: ‘0’ [default], ‘e’</p></li>\n<li><p><strong>inverse</strong> (<em>bool</em><em>, </em><em>optional</em>) – output inverse of Jacobian, defaults to False</p></li>\n<li><p><strong>pinv</strong> (<em>bool</em><em>, </em><em>optional</em>) – output pseudo-inverse of Jacobian, defaults to False</p></li>\n<li><p><strong>transpose</strong> (<em>bool</em><em>, </em><em>optional</em>) – output transpose of Jacobian, defaults to False</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a JACOBIAN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Jacobian instance</p>\n</dd>\n</dl>\n<p>Robot arm Jacobian.</p>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Joint configuration vector as an ndarray.</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>Jacobian matrix as an ndarray(6,n)</p></li>\n</ol>\n</div></blockquote>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.LSPB\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">LSPB</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#LSPB\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.LSPB\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SourceBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    LSPB\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/lspb.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 36%\" />\n<col style=\"width: 36%\" />\n<col style=\"width: 27%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0</p></td>\n<td><p>3</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.LSPB.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">q0</span></em>, <em class=\"sig-param\"><span class=\"n\">qf</span></em>, <em class=\"sig-param\"><span class=\"n\">V</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#LSPB.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.LSPB.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Compute a joint-space trajectory</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>q0</strong> (<em>array_like</em><em>(</em><em>n</em><em>)</em>) – initial joint coordinate</p></li>\n<li><p><strong>qf</strong> (<em>array_like</em><em>(</em><em>n</em><em>)</em>) – final joint coordinate</p></li>\n<li><p><strong>T</strong> (<em>array_like</em><em> or </em><em>int</em><em>, </em><em>optional</em>) – time vector or number of steps, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>LSPB block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>LSPB instance</p>\n</dd>\n</dl>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">tg</span> <span class=\"pre\">=</span> <span class=\"pre\">jtraj(q0,</span> <span class=\"pre\">qf,</span> <span class=\"pre\">N)</span></code> is a joint space trajectory where the joint</p></li>\n</ul>\n<p>coordinates vary from <code class=\"docutils literal notranslate\"><span class=\"pre\">q0</span></code> (M) to <code class=\"docutils literal notranslate\"><span class=\"pre\">qf</span></code> (M).  A quintic (5th order)\npolynomial is used with default zero boundary conditions for velocity and\nacceleration.  Time is assumed to vary from 0 to 1 in <code class=\"docutils literal notranslate\"><span class=\"pre\">N</span></code> steps.</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">tg</span> <span class=\"pre\">=</span> <span class=\"pre\">jtraj(q0,</span> <span class=\"pre\">qf,</span> <span class=\"pre\">t)</span></code> as above but <code class=\"docutils literal notranslate\"><span class=\"pre\">t</span></code> is a uniformly-spaced time</p></li>\n</ul>\n<p>vector</p>\n<p>The return value is an object that contains position, velocity and\nacceleration data.</p>\n<p>Notes:</p>\n<ul class=\"simple\">\n<li><p>The time vector, if given, scales the velocity and acceleration outputs</p></li>\n</ul>\n<p>assuming that the time vector starts at zero and increases\nlinearly.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">ctraj()</span></code>, <code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">qplot()</span></code>, <code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">jtraj()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Point2Tr\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Point2Tr</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Point2Tr\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Point2Tr\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    POINT2TR\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/point2tr.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 39%\" />\n<col style=\"width: 32%\" />\n<col style=\"width: 29%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray(3)</p></td>\n<td><p>SE3</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Point2Tr.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">T</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Point2Tr.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Point2Tr.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>T</strong> (<em>SE3</em>) – the transform</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a POINT2TR block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Point2Tr instance</p>\n</dd>\n</dl>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>a 3D point as an ndarray(3)</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>T as an SE3 with its position part replaced by the input</p></li>\n</ol>\n</div></blockquote>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">spatialmath.base.delta2tr()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.TR2T\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">TR2T</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#TR2T\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.TR2T\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    TR2T\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/tr2t.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 39%\" />\n<col style=\"width: 32%\" />\n<col style=\"width: 29%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>3</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>SE3</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.TR2T.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#TR2T.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.TR2T.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>T</strong> (<em>SE3</em>) – the transform</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a POINT2TR block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Point2Tr instance</p>\n</dd>\n</dl>\n<p>The block has one input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>a 3D point as an ndarray(3)</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>T as an SE3 with its position part replaced by the input</p></li>\n</ol>\n</div></blockquote>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">spatialmath.base.delta2tr()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Tr2Delta\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Tr2Delta</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Tr2Delta\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Tr2Delta\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    TR2DELTA\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/tr2delta.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 36%\" />\n<col style=\"width: 36%\" />\n<col style=\"width: 27%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>2</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>SE3, SE3</p></td>\n<td><p>ndarray(6)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Tr2Delta.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Tr2Delta.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Tr2Delta.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a TR2DELTA block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Tr2Delta instance</p>\n</dd>\n</dl>\n<p>Difference between T1 and T2 as a 6-vector</p>\n<p>The block has two input port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>T1 as an SE3.</p></li>\n<li><p>T2 as an SE3.</p></li>\n</ol>\n</div></blockquote>\n<p>and one output port:</p>\n<blockquote>\n<div><ol class=\"arabic simple\">\n<li><p>delta as an ndarray(6,n)</p></li>\n</ol>\n</div></blockquote>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">spatialmath.base.tr2delta()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.arm.Traj\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.arm.</code><code class=\"sig-name descname\">Traj</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Traj\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Traj\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    TRAJ\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/traj.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>0 or 1</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.arm.Traj.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">y0</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">yf</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">time</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"n\">traj</span><span class=\"o\">=</span><span class=\"default_value\">'lspb'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/arm.html#Traj.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.arm.Traj.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>y0</strong> (<em>array_like</em><em>(</em><em>m</em><em>)</em><em>, </em><em>optional</em>) – initial value, defaults to 0</p></li>\n<li><p><strong>yf</strong> (<em>array_like</em><em>(</em><em>m</em><em>)</em><em>, </em><em>optional</em>) – final value, defaults to 1</p></li>\n<li><p><strong>T</strong> (<em>array_like</em><em> or </em><em>int</em><em>, </em><em>optional</em>) – time vector or number of steps, defaults to None</p></li>\n<li><p><strong>time</strong> (<em>bool</em><em>, </em><em>optional</em>) – x is simulation time, defaults to False</p></li>\n<li><p><strong>traj</strong> (<em>str</em><em>, </em><em>optional</em>) – trajectory type, one of: ‘lspb’ [default], ‘tpoly’</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>TRAJ block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Traj instance</p>\n</dd>\n</dl>\n<p>Create a trajectory block.</p>\n<p>A block that generates a trajectory using a trapezoidal or quintic\npolynomial profile.</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-roboticstoolbox.blocks.mobile\">\n<span id=\"mobile-robots\"></span><h4>Mobile robots<a class=\"headerlink\" href=\"#module-roboticstoolbox.blocks.mobile\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.mobile.Bicycle\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.mobile.</code><code class=\"sig-name descname\">Bicycle</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/mobile.html#Bicycle\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.mobile.Bicycle\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    BICYCLE\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/bicycle.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 36%\" />\n<col style=\"width: 36%\" />\n<col style=\"width: 27%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>2</p></td>\n<td><p>1</p></td>\n<td><p>3</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float</p></td>\n<td><p>ndarray(3)</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.mobile.Bicycle.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">L</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"default_value\">inf</span></em>, <em class=\"sig-param\"><span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"default_value\">inf</span></em>, <em class=\"sig-param\"><span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"default_value\">1.413716694115407</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/mobile.html#Bicycle.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.mobile.Bicycle.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a vehicle model with Bicycle kinematics.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>L</strong> (<em>float</em><em>, </em><em>optional</em>) – Wheelbase, defaults to 1</p></li>\n<li><p><strong>speed_max</strong> (<em>float</em><em>, </em><em>optional</em>) – Velocity limit, defaults to 1</p></li>\n<li><p><strong>accel_max</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum acceleration, defaults to math.inf</p></li>\n<li><p><strong>steer_max</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum steering angle, defaults to math.pi*0.45</p></li>\n<li><p><strong>x0</strong> (<em>array_like</em><em>, </em><em>optional</em>) – Inital state, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a BICYCLE block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Bicycle instance</p>\n</dd>\n</dl>\n<p>Bicycle kinematic model with state <span class=\"math notranslate nohighlight\">\\([x, y, \\theta]\\)</span>.</p>\n<p><strong>Block ports</strong></p>\n<blockquote>\n<div><dl class=\"field-list simple\">\n<dt class=\"field-odd\">input v</dt>\n<dd class=\"field-odd\"><p>Vehicle speed (metres/sec).  The velocity limit <code class=\"docutils literal notranslate\"><span class=\"pre\">vlim</span></code> is\napplied to the magnitude of this input.</p>\n</dd>\n<dt class=\"field-even\">input γ</dt>\n<dd class=\"field-even\"><p>Steering wheel angle (radians).  The steering limit <code class=\"docutils literal notranslate\"><span class=\"pre\">slim</span></code>\nis applied to the magnitude of this input.</p>\n</dd>\n<dt class=\"field-odd\">output q</dt>\n<dd class=\"field-odd\"><p>configuration (x, y, θ)</p>\n</dd>\n</dl>\n</div></blockquote>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">mobile.Bicycle</span></code> <a class=\"reference internal\" href=\"#roboticstoolbox.blocks.mobile.DiffSteer\" title=\"roboticstoolbox.blocks.mobile.DiffSteer\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">DiffSteer</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.mobile.DiffSteer\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.mobile.</code><code class=\"sig-name descname\">DiffSteer</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/mobile.html#DiffSteer\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.mobile.DiffSteer\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    DIFFSTEER\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/diffsteer.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>2</p></td>\n<td><p>3</p></td>\n<td><p>3</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.mobile.DiffSteer.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">w</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">R</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"default_value\">inf</span></em>, <em class=\"sig-param\"><span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"default_value\">inf</span></em>, <em class=\"sig-param\"><span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">a</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/mobile.html#DiffSteer.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.mobile.DiffSteer.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a differential steer vehicle model</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>w</strong> (<em>float</em><em>, </em><em>optional</em>) – vehicle width, defaults to 1</p></li>\n<li><p><strong>R</strong> (<em>float</em><em>, </em><em>optional</em>) – Wheel radius, defaults to 1</p></li>\n<li><p><strong>speed_max</strong> (<em>float</em><em>, </em><em>optional</em>) – Velocity limit, defaults to 1</p></li>\n<li><p><strong>accel_max</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum acceleration, defaults to math.inf</p></li>\n<li><p><strong>steer_max</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum steering rate, defaults to 1</p></li>\n<li><p><strong>x0</strong> (<em>array_like</em><em>, </em><em>optional</em>) – Inital state, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict        :return: a DIFFSTEER block</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>DifSteer instance</p>\n</dd>\n</dl>\n<p>Unicycle kinematic model with state <span class=\"math notranslate nohighlight\">\\([x, y,       heta]\\)</span>, with\nwith inputs given as wheel angular velocity.</p>\n<p><strong>Block ports</strong></p>\n<blockquote>\n<div><dl class=\"field-list simple\">\n<dt class=\"field-odd\">input ωL</dt>\n<dd class=\"field-odd\"><p>Left-wheel angular velocity (radians/sec).</p>\n</dd>\n<dt class=\"field-even\">input ωR</dt>\n<dd class=\"field-even\"><p>Right-wheel angular velocity (radians/sec).</p>\n</dd>\n<dt class=\"field-odd\">output q</dt>\n<dd class=\"field-odd\"><p>configuration (x, y, θ)</p>\n</dd>\n</dl>\n</div></blockquote>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Wheel velocity is defined such that if both are positive the vehicle\nmoves forward.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#roboticstoolbox.blocks.mobile.Bicycle\" title=\"roboticstoolbox.blocks.mobile.Bicycle\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Bicycle</span></code></a> <a class=\"reference internal\" href=\"#roboticstoolbox.blocks.mobile.Unicycle\" title=\"roboticstoolbox.blocks.mobile.Unicycle\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Unicycle</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.mobile.Unicycle\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.mobile.</code><code class=\"sig-name descname\">Unicycle</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/mobile.html#Unicycle\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.mobile.Unicycle\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    UNICYCLE\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/unicycle.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>2</p></td>\n<td><p>1</p></td>\n<td><p>3</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float</p></td>\n<td><p>float</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.mobile.Unicycle.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">w</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">speed_max</span><span class=\"o\">=</span><span class=\"default_value\">inf</span></em>, <em class=\"sig-param\"><span class=\"n\">accel_max</span><span class=\"o\">=</span><span class=\"default_value\">inf</span></em>, <em class=\"sig-param\"><span class=\"n\">steer_max</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">a</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/mobile.html#Unicycle.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.mobile.Unicycle.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a vehicle model with Unicycle kinematics.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>w</strong> (<em>float</em><em>, </em><em>optional</em>) – vehicle width, defaults to 1</p></li>\n<li><p><strong>speed_max</strong> (<em>float</em><em>, </em><em>optional</em>) – Velocity limit, defaults to 1</p></li>\n<li><p><strong>accel_max</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum acceleration, defaults to math.inf</p></li>\n<li><p><strong>steer_max</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum steering rate, defaults to 1</p></li>\n<li><p><strong>x0</strong> (<em>array_like</em><em>, </em><em>optional</em>) – Inital state, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict        :return: a UNICYCLE block</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>Unicycle instance</p>\n</dd>\n</dl>\n<p>Unicycle kinematic model with state <span class=\"math notranslate nohighlight\">\\([x, y, \\theta]\\)</span>.</p>\n<p><strong>Block ports</strong></p>\n<blockquote>\n<div><dl class=\"field-list simple\">\n<dt class=\"field-odd\">input v</dt>\n<dd class=\"field-odd\"><p>Vehicle speed (metres/sec).  The velocity limit <code class=\"docutils literal notranslate\"><span class=\"pre\">vlim</span></code> is\napplied to the magnitude of this input.</p>\n</dd>\n<dt class=\"field-even\">input ω</dt>\n<dd class=\"field-even\"><p>Angular velocity (radians/sec).  The steering limit <code class=\"docutils literal notranslate\"><span class=\"pre\">slim</span></code>\nis applied to the magnitude of this input.</p>\n</dd>\n<dt class=\"field-odd\">output q</dt>\n<dd class=\"field-odd\"><p>configuration (x, y, θ)</p>\n</dd>\n</dl>\n</div></blockquote>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#roboticstoolbox.blocks.mobile.Bicycle\" title=\"roboticstoolbox.blocks.mobile.Bicycle\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">Bicycle</span></code></a> <a class=\"reference internal\" href=\"#roboticstoolbox.blocks.mobile.DiffSteer\" title=\"roboticstoolbox.blocks.mobile.DiffSteer\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">DiffSteer</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.mobile.VehiclePlot\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.mobile.</code><code class=\"sig-name descname\">VehiclePlot</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/mobile.html#VehiclePlot\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.mobile.VehiclePlot\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.graphics.GraphicsBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    VEHICLEPLOT\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/vehicleplot.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>0</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>ndarray</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.mobile.VehiclePlot.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">animation</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">path</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">labels</span><span class=\"o\">=</span><span class=\"default_value\">['X', 'Y']</span></em>, <em class=\"sig-param\"><span class=\"n\">square</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em>, <em class=\"sig-param\"><span class=\"n\">init</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">scale</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/mobile.html#VehiclePlot.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.mobile.VehiclePlot.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a vehicle animation</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>animation</strong> (<em>VehicleAnimation subclass</em><em>, </em><em>optional</em>) – Graphical animation of vehicle, defaults to None</p></li>\n<li><p><strong>path</strong> (<em>str</em><em> or </em><em>dict</em><em>, </em><em>optional</em>) – linestyle to plot path taken by vehicle, defaults to None</p></li>\n<li><p><strong>labels</strong> (<em>array_like</em><em>(</em><em>2</em><em>) or </em><em>list</em>) – axis labels (xlabel, ylabel), defaults to [“X”,”Y”]</p></li>\n<li><p><strong>square</strong> (<em>bool</em><em>, </em><em>optional</em>) – Set aspect ratio to 1, defaults to True</p></li>\n<li><p><strong>init</strong> (<em>callable</em><em>, </em><em>optional</em>) – initialize graphics, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict        :return: A VEHICLEPLOT block</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>VehiclePlot instance</p>\n</dd>\n</dl>\n<p>Create a vehicle animation similar to the figure below.</p>\n<p><strong>Block ports</strong></p>\n<blockquote>\n<div><dl class=\"field-list simple\">\n<dt class=\"field-odd\">input q</dt>\n<dd class=\"field-odd\"><p>configuration (x, y, θ)</p>\n</dd>\n</dl>\n</div></blockquote>\n<p>Notes:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">init</span></code> function is called after the axes are initialized\nand can be used to draw application specific detail on the\nplot. In the example below, this is the dot and star.</p></li>\n<li><p>A dynamic trail, showing path to date can be animated if\nthe option <code class=\"docutils literal notranslate\"><span class=\"pre\">path</span></code> is set to a linestyle.</p></li>\n</ul>\n</div></blockquote>\n<div class=\"figure align-default\" id=\"id9\">\n<a class=\"reference internal image-reference\" href=\"_images/rvc4_4.gif\"><img alt=\"example of generated graphic\" src=\"_images/rvc4_4.gif\" style=\"width: 500px;\" /></a>\n<p class=\"caption\"><span class=\"caption-text\">Example of vehicle display (animated).  The label at the top is the\nblock name.</span><a class=\"headerlink\" href=\"#id9\" title=\"Permalink to this image\">¶</a></p>\n</div>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"module-roboticstoolbox.blocks.uav\">\n<span id=\"multi-rotor-flying-robots\"></span><h4>Multi rotor flying robots<a class=\"headerlink\" href=\"#module-roboticstoolbox.blocks.uav\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.uav.MultiRotor\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.uav.</code><code class=\"sig-name descname\">MultiRotor</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/uav.html#MultiRotor\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.uav.MultiRotor\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.TransferBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    MULTIROTOR\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/multirotor.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-left\">\n<colgroup>\n<col style=\"width: 40%\" />\n<col style=\"width: 30%\" />\n<col style=\"width: 30%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>1</p></td>\n<td><p>16</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>A(4,)</p></td>\n<td><p>dict</p></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.uav.MultiRotor.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">model</span></em>, <em class=\"sig-param\"><span class=\"n\">groundcheck</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em>, <em class=\"sig-param\"><span class=\"n\">speedcheck</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/uav.html#MultiRotor.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.uav.MultiRotor.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a a multi-rotor dynamic model block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>model</strong> (<em>dict</em>) – Vehicle geometric and inertial parameters</p></li>\n<li><p><strong>groundcheck</strong> (<em>bool</em>) – Prevent vehicle moving below ground, defaults to True</p></li>\n<li><p><strong>speedcheck</strong> (<em>bool</em>) – Check for zero rotor speed, defaults to True</p></li>\n<li><p><strong>x0</strong> (<em>float</em><em>, </em><em>optional</em>) – Initial state, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a MULTIROTOR block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>MultiRotor instance</p>\n</dd>\n</dl>\n<p><strong>Block ports</strong></p>\n<blockquote>\n<div><dl class=\"field-list simple\">\n<dt class=\"field-odd\">input ω</dt>\n<dd class=\"field-odd\"><p>a vector of input rotor speeds in (radians/sec).  These are,\nlooking down, clockwise from the front rotor which lies on the x-axis.</p>\n</dd>\n<dt class=\"field-even\">output x</dt>\n<dd class=\"field-even\"><p>a dictionary signal with the following items:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> pose in the world frame as <span class=\"math notranslate nohighlight\">\\([x, y, z, \\theta_Y, \\theta_P, \\theta_R]\\)</span></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">vb</span></code> translational velocity in the world frame (metres/sec)</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">w</span></code> angular rates in the world frame as yaw-pitch-roll rates (radians/second)</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">a1s</span></code> longitudinal flapping angles (radians)</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">b1s</span></code> lateral flapping angles (radians)</p></li>\n</ul>\n</dd>\n</dl>\n</div></blockquote>\n<p>Based on MATLAB code developed by Pauline Pounds 2004.</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.uav.MultiRotorMixer\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.uav.</code><code class=\"sig-name descname\">MultiRotorMixer</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/uav.html#MultiRotorMixer\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.uav.MultiRotorMixer\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.FunctionBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    MULTIROTORMIXER\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/multirotormixer.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-left\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>4</p></td>\n<td><p>1</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>float</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.uav.MultiRotorMixer.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">maxw</span><span class=\"o\">=</span><span class=\"default_value\">1000</span></em>, <em class=\"sig-param\"><span class=\"n\">minw</span><span class=\"o\">=</span><span class=\"default_value\">5</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/uav.html#MultiRotorMixer.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.uav.MultiRotorMixer.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a block that displays/animates a multi-rotor flying vehicle.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>maxw</strong> (<em>float</em>) – maximum rotor speed in rad/s, defaults to 1000</p></li>\n<li><p><strong>minw</strong> (<em>float</em>) – minimum rotor speed in rad/s, defaults to 5</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a MULTIROTORMIXER block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>MultiRotorMixer instance</p>\n</dd>\n</dl>\n<p><strong>Block ports</strong></p>\n<blockquote>\n<div><dl class=\"field-list simple\">\n<dt class=\"field-odd\">input 𝛕r</dt>\n<dd class=\"field-odd\"><p>roll torque</p>\n</dd>\n<dt class=\"field-even\">input 𝛕p</dt>\n<dd class=\"field-even\"><p>pitch torque</p>\n</dd>\n<dt class=\"field-odd\">input 𝛕y</dt>\n<dd class=\"field-odd\"><p>yaw torque</p>\n</dd>\n<dt class=\"field-even\">input T</dt>\n<dd class=\"field-even\"><p>total thrust</p>\n</dd>\n<dt class=\"field-odd\">output ω</dt>\n<dd class=\"field-odd\"><p>1D array of rotor speeds</p>\n</dd>\n</dl>\n</div></blockquote>\n<p>Derived from Simulink model by Pauline Pounds 2004</p>\n</dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"roboticstoolbox.blocks.uav.MultiRotorPlot\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">roboticstoolbox.blocks.uav.</code><code class=\"sig-name descname\">MultiRotorPlot</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/uav.html#MultiRotorPlot\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.uav.MultiRotorPlot\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.graphics.GraphicsBlock</span></code></p>\n<p>\n    <table width=\"100%\">\n    \t<col style=\"width:80%\">\n\t    <col style=\"width:20%\">\n    <tr>\n    <td>\n    <p style=\"border:10px; background-color:#000000; padding: 1em; color: white; font-size: 30px; font-weight: bold;\">\n    MULTIROTORPLOT\n    </p>\n    </td>\n    <td>\n    <img src=\"https://github.com/petercorke/bdsim/raw/master/bdsim/blocks/Icons/multirotorplot.png\" width=80 height=80>\n    </td>\n    </tr>\n    </table>\n    </p>\n<table class=\"docutils align-left\">\n<colgroup>\n<col style=\"width: 31%\" />\n<col style=\"width: 35%\" />\n<col style=\"width: 35%\" />\n</colgroup>\n<tbody>\n<tr class=\"row-odd\"><td><p>inputs</p></td>\n<td><p>outputs</p></td>\n<td><p>states</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>1</p></td>\n<td><p>0</p></td>\n<td><p>0</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>dict</p></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<dl class=\"py method\">\n<dt id=\"roboticstoolbox.blocks.uav.MultiRotorPlot.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">model</span></em>, <em class=\"sig-param\"><span class=\"n\">scale</span><span class=\"o\">=</span><span class=\"default_value\">[- 2, 2, - 2, 2, 10]</span></em>, <em class=\"sig-param\"><span class=\"n\">flapscale</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"n\">projection</span><span class=\"o\">=</span><span class=\"default_value\">'ortho'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/roboticstoolbox/blocks/uav.html#MultiRotorPlot.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#roboticstoolbox.blocks.uav.MultiRotorPlot.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a block that displays/animates a multi-rotor flying vehicle.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>model</strong> (<em>dict</em>) – A dictionary of vehicle geometric and inertial properties</p></li>\n<li><p><strong>scale</strong> (<em>array_like</em><em>, </em><em>optional</em>) – dimensions of workspace: xmin, xmax, ymin, ymax, zmin, zmax, defaults to [-2,2,-2,2,10]</p></li>\n<li><p><strong>flapscale</strong> (<em>float</em>) – exagerate flapping angle by this factor, defaults to 1</p></li>\n<li><p><strong>projection</strong> (<em>str</em>) – 3D projection, one of: ‘ortho’ [default], ‘perspective’</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>a MULTIROTORPLOT block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>MultiRotorPlot instance</p>\n</dd>\n</dl>\n<p><strong>Block ports</strong></p>\n<blockquote>\n<div><dl class=\"field-list simple\">\n<dt class=\"field-odd\">input y</dt>\n<dd class=\"field-odd\"><p>a dictionary signal that includes the item:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> pose in the world frame as <span class=\"math notranslate nohighlight\">\\([x, y, z,     heta_Y,         heta_P,         heta_R]\\)</span></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> pose in the world frame as <span class=\"math notranslate nohighlight\">\\([x, y, z,     heta_Y,         heta_P,         heta_R]\\)</span></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">a1s</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">b1s</span></code></p></li>\n</ul>\n</dd>\n</dl>\n</div></blockquote>\n<div class=\"figure align-default\" id=\"id10\">\n<a class=\"reference internal image-reference\" href=\"_images/multirotorplot.png\"><img alt=\"example of generated graphic\" src=\"_images/multirotorplot.png\" style=\"width: 500px;\" /></a>\n<p class=\"caption\"><span class=\"caption-text\">Example of quad-rotor display.</span><a class=\"headerlink\" href=\"#id10\" title=\"Permalink to this image\">¶</a></p>\n</div>\n<p>Written by Pauline Pounds 2004</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n</div>\n<div class=\"section\" id=\"vision-blocks\">\n<h3>Vision blocks<a class=\"headerlink\" href=\"#vision-blocks\" title=\"Permalink to this headline\">¶</a></h3>\n<p>These blocks are defined within the Machine Vision Toolbox for Python.</p>\n<span class=\"target\" id=\"module-machinevisiontoolbox.blocks\"></span></div>\n</div>\n</div>\n\n\n           </div>\n          </div>\n          <footer><div class=\"rst-footer-buttons\" role=\"navigation\" aria-label=\"Footer\">\n        <a href=\"bdsim.html\" class=\"btn btn-neutral float-left\" title=\"Overview\" accesskey=\"p\" rel=\"prev\"><span class=\"fa fa-arrow-circle-left\" aria-hidden=\"true\"></span> Previous</a>\n        <a href=\"internals.html\" class=\"btn btn-neutral float-right\" title=\"Supporting classes\" accesskey=\"n\" rel=\"next\">Next <span class=\"fa fa-arrow-circle-right\" aria-hidden=\"true\"></span></a>\n    </div>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/bdsim.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>Overview &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n        <script src=\"_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n    <link rel=\"next\" title=\"Block library\" href=\"bdsim.blocks.html\" />\n    <link rel=\"prev\" title=\"Block diagrams for Python\" href=\"index.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul class=\"current\">\n<li class=\"toctree-l1 current\"><a class=\"current reference internal\" href=\"#\">Overview</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#getting-started\">Getting started</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#using-operator-overloading\">Using operator overloading</a></li>\n</ul>\n</li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>Overview</li>\n      <li class=\"wy-breadcrumbs-aside\">\n            <a href=\"_sources/bdsim.rst.txt\" rel=\"nofollow\"> View page source</a>\n      </li>\n  </ul><div class=\"rst-breadcrumbs-buttons\" role=\"navigation\" aria-label=\"Sequential page navigation\">\n        <a href=\"index.html\" class=\"btn btn-neutral float-left\" title=\"Block diagrams for Python\" accesskey=\"p\"><span class=\"fa fa-arrow-circle-left\" aria-hidden=\"true\"></span> Previous</a>\n        <a href=\"bdsim.blocks.html\" class=\"btn btn-neutral float-right\" title=\"Block library\" accesskey=\"n\">Next <span class=\"fa fa-arrow-circle-right\" aria-hidden=\"true\"></span></a>\n  </div>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <div class=\"section\" id=\"overview\">\n<h1>Overview<a class=\"headerlink\" href=\"#overview\" title=\"Permalink to this headline\">¶</a></h1>\n<div class=\"section\" id=\"getting-started\">\n<h2>Getting started<a class=\"headerlink\" href=\"#getting-started\" title=\"Permalink to this headline\">¶</a></h2>\n<p>We first sketch the dynamic system we want to simulate as a block diagram, for example this simple first-order system</p>\n<a class=\"reference internal image-reference\" href=\"_images/bd1-sketch.png\"><img alt=\"_images/bd1-sketch.png\" src=\"_images/bd1-sketch.png\" style=\"width: 800px;\" /></a>\n<p>which we can express concisely with <cite>bdsim</cite> as (see <a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/blob/master/examples/eg1.py\">bdsim/examples/eg1.py</a>)</p>\n<div class=\"highlight-python notranslate\"><table class=\"highlighttable\"><tr><td class=\"linenos\"><div class=\"linenodiv\"><pre> 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28</pre></div></td><td class=\"code\"><div class=\"highlight\"><pre><span></span><span class=\"kn\">import</span> <span class=\"nn\">bdsim</span>\n\n<span class=\"n\">sim</span> <span class=\"o\">=</span> <span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">BDSim</span><span class=\"p\">()</span>  <span class=\"c1\"># create simulator</span>\n<span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">blockdiagram</span><span class=\"p\">()</span>  <span class=\"c1\"># create an empty block diagram</span>\n\n<span class=\"c1\"># define the blocks</span>\n<span class=\"n\">demand</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">STEP</span><span class=\"p\">(</span><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;demand&#39;</span><span class=\"p\">)</span>\n<span class=\"nb\">sum</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SUM</span><span class=\"p\">(</span><span class=\"s1\">&#39;+-&#39;</span><span class=\"p\">)</span>\n<span class=\"n\">gain</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">GAIN</span><span class=\"p\">(</span><span class=\"mi\">10</span><span class=\"p\">)</span>\n<span class=\"n\">plant</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">LTI_SISO</span><span class=\"p\">(</span><span class=\"mf\">0.5</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;plant&#39;</span><span class=\"p\">)</span>\n<span class=\"n\">scope</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SCOPE</span><span class=\"p\">(</span><span class=\"n\">styles</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;k&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;r--&#39;</span><span class=\"p\">],</span> <span class=\"n\">movie</span><span class=\"o\">=</span><span class=\"s1\">&#39;eg1.mp4&#39;</span><span class=\"p\">)</span>\n\n<span class=\"c1\"># connect the blocks</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">demand</span><span class=\"p\">,</span> <span class=\"nb\">sum</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"n\">scope</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">plant</span><span class=\"p\">,</span> <span class=\"nb\">sum</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"nb\">sum</span><span class=\"p\">,</span> <span class=\"n\">gain</span><span class=\"p\">)</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">gain</span><span class=\"p\">,</span> <span class=\"n\">plant</span><span class=\"p\">)</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">plant</span><span class=\"p\">,</span> <span class=\"n\">scope</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">compile</span><span class=\"p\">()</span>   <span class=\"c1\"># check the diagram</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">report</span><span class=\"p\">()</span>    <span class=\"c1\"># list all blocks and wires</span>\n\n<span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">run</span><span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"mi\">5</span><span class=\"p\">)</span>  <span class=\"c1\"># simulate for 5s</span>\n\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">)</span>\n\n<span class=\"c1\"># sim.savefig(scope, &#39;scope0&#39;) # save scope figure as scope0.pdf</span>\n<span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">done</span><span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">)</span>  <span class=\"c1\"># keep figures open on screen</span>\n</pre></div>\n</td></tr></table></div>\n<p>which is just 16 lines of executable code.</p>\n<p>The red block annotations on the hand-drawn diagram are used as the names of the variables holding references to the block instance. The blocks can also have user-assigned names, see lines 8 and 11, which are used in diagnostics and as labels in plots.</p>\n<p>After the blocks are created their input and output ports need to be connected. In <cite>bdsim</cite> all wires are point to point, a <em>one-to-many</em> connection is implemented by <em>many</em> wires,\nfor example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">source</span><span class=\"p\">,</span> <span class=\"n\">dest1</span><span class=\"p\">,</span> <span class=\"n\">dest2</span><span class=\"p\">,</span> <span class=\"o\">...</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>creates individual wires from <cite>source</cite> -&gt; <cite>dest1</cite>, <cite>source</cite> -&gt; <cite>dest2</cite> and so on.\nPorts are designated using Python indexing notation, for example <cite>block[2]</cite> is port 2 (the third port) of <cite>block</cite>.  Whether it is an input or output port depends on context.\nIn the example above an index on the first argument refers to an output port, while on the second (or subsequent) arguments it refers to an input port.  If a block has only a single input or output port then no index is required, 0 is assumed.</p>\n<p>A group of ports can be denoted using slice notation, for example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">source</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">:</span><span class=\"mi\">5</span><span class=\"p\">],</span> <span class=\"n\">dest</span><span class=\"p\">[</span><span class=\"mi\">3</span><span class=\"p\">:</span><span class=\"mi\">6</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>will connect <code class=\"docutils literal notranslate\"><span class=\"pre\">source[2]</span></code> -&gt; <code class=\"docutils literal notranslate\"><span class=\"pre\">dest[3]</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">source[3]</span></code> -&gt; <code class=\"docutils literal notranslate\"><span class=\"pre\">dest[4]</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">source[4]</span></code> -&gt; <code class=\"docutils literal notranslate\"><span class=\"pre\">dest[5]</span></code>.\nThe number of wires in each slice must be consistent.  You could even do a cross over by connecting <code class=\"docutils literal notranslate\"><span class=\"pre\">source[2:5]</span></code> to <code class=\"docutils literal notranslate\"><span class=\"pre\">dest[6:3:-1]</span></code>.</p>\n<p>Line 20 assembles all the blocks and wires, instantiates subsystems, checks connectivity to create a flat wire list, and then builds the dataflow execution plan.</p>\n<p>Line 21 generates a report, in tabular form, showing a summary of the block diagram:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span>Blocks::\n\n┌───┬─────────┬─────┬──────┬────────┬─────────┬───────┐\n│id │    name │ nin │ nout │ nstate │ ndstate │ type  │\n├───┼─────────┼─────┼──────┼────────┼─────────┼───────┤\n│ 0 │  demand │   0 │    1 │      0 │       0 │ step  │\n│ 1 │   sum.0 │   2 │    1 │      0 │       0 │ sum   │\n│ 2 │  gain.0 │   1 │    1 │      0 │       0 │ gain  │\n│ 3 │   plant │   1 │    1 │      1 │       0 │ LTI   │\n│ 4 │ scope.0 │   2 │    0 │      0 │       0 │ scope │\n└───┴─────────┴─────┴──────┴────────┴─────────┴───────┘\n\nWires::\n\n┌───┬──────┬──────┬──────────────────────────┬─────────┐\n│id │ from │  to  │       description        │  type   │\n├───┼──────┼──────┼──────────────────────────┼─────────┤\n│ 0 │ 0[0] │ 1[0] │ demand[0] --&gt; sum.0[0]   │ int     │\n│ 1 │ 0[0] │ 4[1] │ demand[0] --&gt; scope.0[1] │ int     │\n│ 2 │ 3[0] │ 1[1] │ plant[0] --&gt; sum.0[1]    │ float64 │\n│ 3 │ 1[0] │ 2[0] │ sum.0[0] --&gt; gain.0[0]   │ float64 │\n│ 4 │ 2[0] │ 3[0] │ gain.0[0] --&gt; plant[0]   │ float64 │\n│ 5 │ 3[0] │ 4[0] │ plant[0] --&gt; scope.0[0]  │ float64 │\n└───┴──────┴──────┴──────────────────────────┴─────────┘\n</pre></div>\n</div>\n<a class=\"reference internal image-reference\" href=\"_images/Figure_1.png\"><img alt=\"_images/Figure_1.png\" src=\"_images/Figure_1.png\" style=\"width: 600px;\" /></a>\n<p>The simulation results are returned in a simple container object:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">out</span>\n<span class=\"go\">results:</span>\n<span class=\"go\">t           | ndarray (67,)</span>\n<span class=\"go\">x           | ndarray (67, 1)</span>\n<span class=\"go\">xnames      | list</span>\n</pre></div>\n</div>\n<p>where</p>\n<ul class=\"simple\">\n<li><p><cite>t</cite> the time vector: ndarray, shape=(M,)</p></li>\n<li><p><cite>x</cite> is the state vector: ndarray, shape=(M,N), one row per timestep</p></li>\n<li><p><cite>xnames</cite> is a list of the names of the states corresponding to columns of <cite>x</cite>, eg. “plant.x0”</p></li>\n</ul>\n<p>To record additional simulation variables we “watch” them. This can be specified by\nwiring the signal to a WATCH block, or more conveniently by an additional option to\n<code class=\"docutils literal notranslate\"><span class=\"pre\">run</span></code>:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">run</span><span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"mi\">5</span><span class=\"p\">,</span> <span class=\"n\">watch</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"n\">plant</span><span class=\"p\">,</span><span class=\"n\">demand</span><span class=\"p\">])</span>  <span class=\"c1\"># simulate for 5s</span>\n</pre></div>\n</div>\n<p>and now the result <code class=\"docutils literal notranslate\"><span class=\"pre\">out</span></code> has additional elements:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">out</span>\n<span class=\"go\">results:</span>\n<span class=\"go\">t           | ndarray (67,)</span>\n<span class=\"go\">x           | ndarray (67, 1)</span>\n<span class=\"go\">xnames      | list</span>\n<span class=\"go\">y0          | ndarray (67,)</span>\n<span class=\"go\">y1          | ndarray (67,)</span>\n<span class=\"go\">ynames      | list</span>\n</pre></div>\n</div>\n<p>where</p>\n<ul class=\"simple\">\n<li><p><cite>y0</cite> is the time history of the first watched signal</p></li>\n<li><p><cite>y1</cite> is the time history of the second watched signal</p></li>\n<li><p><cite>ynames</cite> is a list of the names of the states corresponding to columns of <cite>x</cite>, eg. “plant[0]”</p></li>\n</ul>\n<p>Line 27 saves the content of the scope to be saved in the file called <cite>scope0.pdf</cite>.</p>\n<p>Line 28 blocks the script until all figure windows are closed, or the script is killed with SIGINT.</p>\n<p>Line 29 saves the scope graphics as a PDF file.</p>\n<p>Line 30 blocks until the last figure is dismissed.</p>\n<p>A list of available blocks can be obtained by:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"p\">()</span>\n<span class=\"go\">   73  blocks loaded</span>\n<span class=\"go\">   bdsim.blocks.functions..................: Sum Prod Gain Clip Function Interpolate</span>\n<span class=\"go\">   bdsim.blocks.sources....................: Constant Time WaveForm Piecewise Step Ramp</span>\n<span class=\"go\">   bdsim.blocks.sinks......................: Print Stop Null Watch</span>\n<span class=\"go\">   bdsim.blocks.transfers..................: Integrator PoseIntegrator LTI_SS LTI_SISO</span>\n<span class=\"go\">   bdsim.blocks.discrete...................: ZOH DIntegrator DPoseIntegrator</span>\n<span class=\"go\">   bdsim.blocks.linalg.....................: Inverse Transpose Norm Flatten Slice2 Slice1 Det Cond</span>\n<span class=\"go\">   bdsim.blocks.displays...................: Scope ScopeXY ScopeXY1</span>\n<span class=\"go\">   bdsim.blocks.connections................: Item Dict Mux DeMux Index SubSystem InPort OutPort</span>\n<span class=\"go\">   roboticstoolbox.blocks.arm..............: FKine IKine Jacobian Tr2Delta Delta2Tr Point2Tr TR2T FDyn IDyn Gravload</span>\n<span class=\"go\">   ........................................: Inertia Inertia_X FDyn_X ArmPlot Traj JTraj LSPB CTraj CirclePath</span>\n<span class=\"go\">   roboticstoolbox.blocks.mobile...........: Bicycle Unicycle DiffSteer VehiclePlot</span>\n<span class=\"go\">   roboticstoolbox.blocks.uav..............: MultiRotor MultiRotorMixer MultiRotorPlot</span>\n<span class=\"go\">   machinevisiontoolbox.blocks.camera......: Camera Visjac_p EstPose_p ImagePlane</span>\n</pre></div>\n</div>\n<p>More details can be found at:</p>\n<ul class=\"simple\">\n<li><dl class=\"simple\">\n<dt><a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/wiki\">Wiki page</a></dt><dd><ul>\n<li><p><a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/wiki/Adding-blocks\">Adding blocks</a></p></li>\n<li><p><a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/wiki/Connecting-blocks\">Connecting blocks</a></p></li>\n<li><p><a class=\"reference external\" href=\"https://github.com/petercorke/bdsim/wiki/Running\">Running the simulation</a></p></li>\n</ul>\n</dd>\n</dl>\n</li>\n<li><p><a class=\"reference internal\" href=\"bdsim.blocks.html#block-library\"><span class=\"std std-ref\">Block library</span></a></p></li>\n</ul>\n</div>\n<div class=\"section\" id=\"using-operator-overloading\">\n<h2>Using operator overloading<a class=\"headerlink\" href=\"#using-operator-overloading\" title=\"Permalink to this headline\">¶</a></h2>\n<p>Wiring, and some simple arithmetic blocks like GAIN, SUM and PROD can be implicitly generated by overloaded Python operators.  This strikes a nice balance between block diagram coding and Pythonic programming.</p>\n<div class=\"highlight-python notranslate\"><table class=\"highlighttable\"><tr><td class=\"linenos\"><div class=\"linenodiv\"><pre> 1\n 2\n 3\n 4\n 5\n 6\n 7\n 8\n 9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24</pre></div></td><td class=\"code\"><div class=\"highlight\"><pre><span></span><span class=\"kn\">import</span> <span class=\"nn\">bdsim</span>\n\n<span class=\"n\">sim</span> <span class=\"o\">=</span> <span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">BDSim</span><span class=\"p\">()</span>  <span class=\"c1\"># create simulator</span>\n<span class=\"n\">bd</span> <span class=\"o\">=</span> <span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">blockdiagram</span><span class=\"p\">()</span>  <span class=\"c1\"># create an empty block diagram</span>\n\n<span class=\"c1\"># define the blocks</span>\n<span class=\"n\">demand</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">STEP</span><span class=\"p\">(</span><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;demand&#39;</span><span class=\"p\">)</span>\n<span class=\"n\">plant</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">LTI_SISO</span><span class=\"p\">(</span><span class=\"mf\">0.5</span><span class=\"p\">,</span> <span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">,</span> <span class=\"mi\">1</span><span class=\"p\">],</span> <span class=\"n\">name</span><span class=\"o\">=</span><span class=\"s1\">&#39;plant&#39;</span><span class=\"p\">)</span>\n<span class=\"n\">scope</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">SCOPE</span><span class=\"p\">(</span><span class=\"n\">styles</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;k&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;r--&#39;</span><span class=\"p\">],</span> <span class=\"n\">movie</span><span class=\"o\">=</span><span class=\"s1\">&#39;eg1.mp4&#39;</span><span class=\"p\">)</span>\n\n<span class=\"c1\"># connect the blocks</span>\n<span class=\"n\">scope</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">plant</span>\n<span class=\"n\">scope</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">demand</span>\n<span class=\"n\">plant</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">10</span> <span class=\"o\">*</span> <span class=\"p\">(</span><span class=\"n\">demand</span> <span class=\"o\">-</span> <span class=\"n\">plant</span><span class=\"p\">)</span>\n\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">compile</span><span class=\"p\">()</span>   <span class=\"c1\"># check the diagram</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">report</span><span class=\"p\">()</span>    <span class=\"c1\"># list all blocks and wires</span>\n\n<span class=\"n\">out</span> <span class=\"o\">=</span> <span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">run</span><span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"mi\">5</span><span class=\"p\">)</span>  <span class=\"c1\"># simulate for 5s</span>\n<span class=\"c1\"># out = sim.run(bd, 5 watch=[plant,demand])  # simulate for 5s</span>\n<span class=\"nb\">print</span><span class=\"p\">(</span><span class=\"n\">out</span><span class=\"p\">)</span>\n\n<span class=\"c1\"># sim.savefig(scope, &#39;scope0&#39;) # save scope figure as scope0.pdf</span>\n<span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">done</span><span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"p\">,</span> <span class=\"n\">block</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">)</span>  <span class=\"c1\"># keep figures open on screen</span>\n</pre></div>\n</td></tr></table></div>\n<p>This requires fewer lines of code and the code is more readable.\nImportantly, it results in in <em>exactly the same</em> block diagram in terms of blocks and wires:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span>┌───┬──────┬──────┬──────────────────────────────┬─────────┐\n│id │ from │  to  │         description          │  type   │\n├───┼──────┼──────┼──────────────────────────────┼─────────┤\n│ 0 │ 1[0] │ 2[0] │ plant[0] --&gt; scope.0[0]      │ float64 │\n│ 1 │ 0[0] │ 2[1] │ demand[0] --&gt; scope.0[1]     │ int     │\n│ 2 │ 0[0] │ 3[0] │ demand[0] --&gt; _sum.0[0]      │ int     │\n│ 3 │ 1[0] │ 3[1] │ plant[0] --&gt; _sum.0[1]       │ float64 │\n│ 4 │ 3[0] │ 4[0] │ _sum.0[0] --&gt; _gain.0(10)[0] │ float64 │\n│ 5 │ 4[0] │ 1[0] │ _gain.0(10)[0] --&gt; plant[0]  │ float64 │\n└───┴──────┴──────┴──────────────────────────────┴─────────┘\n</pre></div>\n</div>\n<p>The implicitly created blocks have names prefixed with an underscore.</p>\n</div>\n</div>\n\n\n           </div>\n          </div>\n          <footer><div class=\"rst-footer-buttons\" role=\"navigation\" aria-label=\"Footer\">\n        <a href=\"index.html\" class=\"btn btn-neutral float-left\" title=\"Block diagrams for Python\" accesskey=\"p\" rel=\"prev\"><span class=\"fa fa-arrow-circle-left\" aria-hidden=\"true\"></span> Previous</a>\n        <a href=\"bdsim.blocks.html\" class=\"btn btn-neutral float-right\" title=\"Block library\" accesskey=\"n\" rel=\"next\">Next <span class=\"fa fa-arrow-circle-right\" aria-hidden=\"true\"></span></a>\n    </div>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/genindex.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>Index &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n        <script src=\"_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"#\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>Index</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n\n<h1 id=\"index\">Index</h1>\n\n<div class=\"genindex-jumpbox\">\n <a href=\"#_\"><strong>_</strong></a>\n | <a href=\"#A\"><strong>A</strong></a>\n | <a href=\"#B\"><strong>B</strong></a>\n | <a href=\"#C\"><strong>C</strong></a>\n | <a href=\"#D\"><strong>D</strong></a>\n | <a href=\"#F\"><strong>F</strong></a>\n | <a href=\"#G\"><strong>G</strong></a>\n | <a href=\"#I\"><strong>I</strong></a>\n | <a href=\"#J\"><strong>J</strong></a>\n | <a href=\"#L\"><strong>L</strong></a>\n | <a href=\"#M\"><strong>M</strong></a>\n | <a href=\"#N\"><strong>N</strong></a>\n | <a href=\"#O\"><strong>O</strong></a>\n | <a href=\"#P\"><strong>P</strong></a>\n | <a href=\"#R\"><strong>R</strong></a>\n | <a href=\"#S\"><strong>S</strong></a>\n | <a href=\"#T\"><strong>T</strong></a>\n | <a href=\"#U\"><strong>U</strong></a>\n | <a href=\"#V\"><strong>V</strong></a>\n | <a href=\"#W\"><strong>W</strong></a>\n | <a href=\"#Z\"><strong>Z</strong></a>\n \n</div>\n<h2 id=\"_\">_</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Block.__add__\">__add__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__add__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__getitem__\">__getitem__() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.__init__\">__init__() (bdsim.BDSim method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.BDSimState.__init__\">(bdsim.BDSimState method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.Block.__init__\">(bdsim.Block method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.DeMux.__init__\">(bdsim.blocks.connections.DeMux method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.Dict.__init__\">(bdsim.blocks.connections.Dict method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.Index.__init__\">(bdsim.blocks.connections.Index method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.InPort.__init__\">(bdsim.blocks.connections.InPort method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.Item.__init__\">(bdsim.blocks.connections.Item method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.Mux.__init__\">(bdsim.blocks.connections.Mux method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.OutPort.__init__\">(bdsim.blocks.connections.OutPort method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.SubSystem.__init__\">(bdsim.blocks.connections.SubSystem method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.DIntegrator.__init__\">(bdsim.blocks.discrete.DIntegrator method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.DPoseIntegrator.__init__\">(bdsim.blocks.discrete.DPoseIntegrator method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.ZOH.__init__\">(bdsim.blocks.discrete.ZOH method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Clip.__init__\">(bdsim.blocks.functions.Clip method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Function.__init__\">(bdsim.blocks.functions.Function method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Gain.__init__\">(bdsim.blocks.functions.Gain method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Interpolate.__init__\">(bdsim.blocks.functions.Interpolate method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Prod.__init__\">(bdsim.blocks.functions.Prod method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Sum.__init__\">(bdsim.blocks.functions.Sum method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Cond.__init__\">(bdsim.blocks.linalg.Cond method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Det.__init__\">(bdsim.blocks.linalg.Det method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Flatten.__init__\">(bdsim.blocks.linalg.Flatten method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Inverse.__init__\">(bdsim.blocks.linalg.Inverse method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Norm.__init__\">(bdsim.blocks.linalg.Norm method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Slice1.__init__\">(bdsim.blocks.linalg.Slice1 method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Slice2.__init__\">(bdsim.blocks.linalg.Slice2 method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Transpose.__init__\">(bdsim.blocks.linalg.Transpose method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sinks.Null.__init__\">(bdsim.blocks.sinks.Null method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sinks.Print.__init__\">(bdsim.blocks.sinks.Print method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sinks.Stop.__init__\">(bdsim.blocks.sinks.Stop method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sinks.Watch.__init__\">(bdsim.blocks.sinks.Watch method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Constant.__init__\">(bdsim.blocks.sources.Constant method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Piecewise.__init__\">(bdsim.blocks.sources.Piecewise method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Ramp.__init__\">(bdsim.blocks.sources.Ramp method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Step.__init__\">(bdsim.blocks.sources.Step method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Time.__init__\">(bdsim.blocks.sources.Time method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.WaveForm.__init__\">(bdsim.blocks.sources.WaveForm method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.transfers.Integrator.__init__\">(bdsim.blocks.transfers.Integrator method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.transfers.LTI_SISO.__init__\">(bdsim.blocks.transfers.LTI_SISO method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.transfers.LTI_SS.__init__\">(bdsim.blocks.transfers.LTI_SS method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.transfers.PoseIntegrator.__init__\">(bdsim.blocks.transfers.PoseIntegrator method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.Clock.__init__\">(bdsim.Clock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.ClockedBlock.__init__\">(bdsim.ClockedBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.FunctionBlock.__init__\">(bdsim.FunctionBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.GraphicsBlock.__init__\">(bdsim.GraphicsBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.Plug.__init__\">(bdsim.Plug method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.PriorityQ.__init__\">(bdsim.PriorityQ method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SinkBlock.__init__\">(bdsim.SinkBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SourceBlock.__init__\">(bdsim.SourceBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.Struct.__init__\">(bdsim.Struct method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SubsystemBlock.__init__\">(bdsim.SubsystemBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.TransferBlock.__init__\">(bdsim.TransferBlock method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.ArmPlot.__init__\">(roboticstoolbox.blocks.arm.ArmPlot method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.CirclePath.__init__\">(roboticstoolbox.blocks.arm.CirclePath method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.CTraj.__init__\">(roboticstoolbox.blocks.arm.CTraj method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Delta2Tr.__init__\">(roboticstoolbox.blocks.arm.Delta2Tr method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.FDyn.__init__\">(roboticstoolbox.blocks.arm.FDyn method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.FDyn_X.__init__\">(roboticstoolbox.blocks.arm.FDyn_X method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.FKine.__init__\">(roboticstoolbox.blocks.arm.FKine method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Gravload.__init__\">(roboticstoolbox.blocks.arm.Gravload method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Gravload_X.__init__\">(roboticstoolbox.blocks.arm.Gravload_X method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.IDyn.__init__\">(roboticstoolbox.blocks.arm.IDyn method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.IKine.__init__\">(roboticstoolbox.blocks.arm.IKine method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Inertia.__init__\">(roboticstoolbox.blocks.arm.Inertia method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Inertia_X.__init__\">(roboticstoolbox.blocks.arm.Inertia_X method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Jacobian.__init__\">(roboticstoolbox.blocks.arm.Jacobian method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.JTraj.__init__\">(roboticstoolbox.blocks.arm.JTraj method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.LSPB.__init__\">(roboticstoolbox.blocks.arm.LSPB method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Point2Tr.__init__\">(roboticstoolbox.blocks.arm.Point2Tr method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Tr2Delta.__init__\">(roboticstoolbox.blocks.arm.Tr2Delta method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.TR2T.__init__\">(roboticstoolbox.blocks.arm.TR2T method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Traj.__init__\">(roboticstoolbox.blocks.arm.Traj method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.mobile.Bicycle.__init__\">(roboticstoolbox.blocks.mobile.Bicycle method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.mobile.DiffSteer.__init__\">(roboticstoolbox.blocks.mobile.DiffSteer method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.mobile.Unicycle.__init__\">(roboticstoolbox.blocks.mobile.Unicycle method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.mobile.VehiclePlot.__init__\">(roboticstoolbox.blocks.mobile.VehiclePlot method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotor.__init__\">(roboticstoolbox.blocks.uav.MultiRotor method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotorMixer.__init__\">(roboticstoolbox.blocks.uav.MultiRotorMixer method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotorPlot.__init__\">(roboticstoolbox.blocks.uav.MultiRotorPlot method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.FunctionBlock.__module__\">__module__ (bdsim.FunctionBlock attribute)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.GraphicsBlock.__module__\">(bdsim.GraphicsBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SinkBlock.__module__\">(bdsim.SinkBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SourceBlock.__module__\">(bdsim.SourceBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SubsystemBlock.__module__\">(bdsim.SubsystemBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.TransferBlock.__module__\">(bdsim.TransferBlock attribute)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__mul__\">__mul__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__mul__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__neg__\">__neg__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__neg__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__new__\">__new__() (bdsim.Block static method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.__radd__\">__radd__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__radd__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__repr__\">__repr__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__repr__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__rmul__\">__rmul__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__rmul__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__rshift__\">__rshift__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__rshift__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__rsub__\">__rsub__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__rsub__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__rtruediv__\">__rtruediv__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__rtruediv__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__setattr__\">__setattr__() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.__setitem__\">__setitem__() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.__str__\">__str__() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.__sub__\">__sub__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__sub__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.__truediv__\">__truediv__() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Plug.__truediv__\">(bdsim.Plug method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"A\">A</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Struct.add\">add() (bdsim.Struct method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Clock.add_block\">add_block() (bdsim.Clock method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.add_inport\">add_inport() (bdsim.Block method)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Block.add_outport\">add_outport() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.add_param\">add_param() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.ArmPlot\">ArmPlot (class in roboticstoolbox.blocks.arm)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"B\">B</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.BDSim\">BDSim (class in bdsim)</a>\n</li>\n      <li>\n    bdsim.blocks.connections\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.connections\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdsim.blocks.discrete\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.discrete\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdsim.blocks.functions\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.functions\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdsim.blocks.linalg\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.linalg\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdsim.blocks.sinks\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.sinks\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdsim.blocks.sources\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.sources\">module</a>\n</li>\n      </ul></li>\n      <li>\n    bdsim.blocks.transfers\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.transfers\">module</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.BDSimState\">BDSimState (class in bdsim)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.mobile.Bicycle\">Bicycle (class in roboticstoolbox.blocks.mobile)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block\">Block (class in bdsim)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.ClockedBlock.blockclass\">blockclass (bdsim.ClockedBlock attribute)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.FunctionBlock.blockclass\">(bdsim.FunctionBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.GraphicsBlock.blockclass\">(bdsim.GraphicsBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SinkBlock.blockclass\">(bdsim.SinkBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SourceBlock.blockclass\">(bdsim.SourceBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.SubsystemBlock.blockclass\">(bdsim.SubsystemBlock attribute)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.TransferBlock.blockclass\">(bdsim.TransferBlock attribute)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.blockdiagram\">blockdiagram (in module bdsim)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.blockdiagram\">blockdiagram() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.blocks\">blocks() (bdsim.BDSim method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"C\">C</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Block.check\">check() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.ClockedBlock.check\">(bdsim.ClockedBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.TransferBlock.check\">(bdsim.TransferBlock method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.CirclePath\">CirclePath (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Clip\">Clip (class in bdsim.blocks.functions)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Clock\">Clock (class in bdsim)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.ClockedBlock\">ClockedBlock (class in bdsim)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.closefigs\">closefigs() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Cond\">Cond (class in bdsim.blocks.linalg)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Constant\">Constant (class in bdsim.blocks.sources)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.GraphicsBlock.create_figure\">create_figure() (bdsim.GraphicsBlock method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.CTraj\">CTraj (class in roboticstoolbox.blocks.arm)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"D\">D</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.BDSimState.declare_event\">declare_event() (bdsim.BDSimState method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Delta2Tr\">Delta2Tr (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.DeMux\">DeMux (class in bdsim.blocks.connections)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Det\">Det (class in bdsim.blocks.linalg)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.Dict\">Dict (class in bdsim.blocks.connections)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.mobile.DiffSteer\">DiffSteer (class in roboticstoolbox.blocks.mobile)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.DIntegrator\">DIntegrator (class in bdsim.blocks.discrete)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.done\">done() (bdsim.BDSim method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Block.done\">(bdsim.Block method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.GraphicsBlock.done\">(bdsim.GraphicsBlock method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.DPoseIntegrator\">DPoseIntegrator (class in bdsim.blocks.discrete)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"F\">F</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.FDyn\">FDyn (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.FDyn_X\">FDyn_X (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.FKine\">FKine (class in roboticstoolbox.blocks.arm)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Flatten\">Flatten (class in bdsim.blocks.linalg)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Wire.fullname\">fullname() (bdsim.Wire property)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Function\">Function (class in bdsim.blocks.functions)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.FunctionBlock\">FunctionBlock (class in bdsim)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"G\">G</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Gain\">Gain (class in bdsim.blocks.functions)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.get_options\">get_options() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Clock.getstate\">getstate() (bdsim.Clock method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Clock.getstate0\">getstate0() (bdsim.Clock method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.ClockedBlock.getstate0\">(bdsim.ClockedBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.TransferBlock.getstate0\">(bdsim.TransferBlock method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.GraphicsBlock\">GraphicsBlock (class in bdsim)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Gravload\">Gravload (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Gravload_X\">Gravload_X (class in roboticstoolbox.blocks.arm)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"I\">I</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.IDyn\">IDyn (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.IKine\">IKine (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.Index\">Index (class in bdsim.blocks.connections)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Inertia\">Inertia (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Inertia_X\">Inertia_X (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.info\">info() (bdsim.Block property)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Wire.info\">(bdsim.Wire property)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.InPort\">InPort (class in bdsim.blocks.connections)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Block.inport_names\">inport_names() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.transfers.Integrator\">Integrator (class in bdsim.blocks.transfers)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Interpolate\">Interpolate (class in bdsim.blocks.functions)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Inverse\">Inverse (class in bdsim.blocks.linalg)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.isclocked\">isclocked() (bdsim.Block property)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.isgraphics\">isgraphics() (bdsim.Block property)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Plug.isslice\">isslice() (bdsim.Plug property)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.Item\">Item (class in bdsim.blocks.connections)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"J\">J</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Jacobian\">Jacobian (class in roboticstoolbox.blocks.arm)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.JTraj\">JTraj (class in roboticstoolbox.blocks.arm)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"L\">L</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.BDSim.load_blocks\">load_blocks() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.LSPB\">LSPB (class in roboticstoolbox.blocks.arm)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.transfers.LTI_SISO\">LTI_SISO (class in bdsim.blocks.transfers)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.transfers.LTI_SS\">LTI_SS (class in bdsim.blocks.transfers)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"M\">M</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li>\n    machinevisiontoolbox.blocks\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-machinevisiontoolbox.blocks\">module</a>\n</li>\n      </ul></li>\n      <li>\n    module\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.connections\">bdsim.blocks.connections</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.discrete\">bdsim.blocks.discrete</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.functions\">bdsim.blocks.functions</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.linalg\">bdsim.blocks.linalg</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.sinks\">bdsim.blocks.sinks</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.sources\">bdsim.blocks.sources</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-bdsim.blocks.transfers\">bdsim.blocks.transfers</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-machinevisiontoolbox.blocks\">machinevisiontoolbox.blocks</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.arm\">roboticstoolbox.blocks.arm</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.mobile\">roboticstoolbox.blocks.mobile</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.uav\">roboticstoolbox.blocks.uav</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotor\">MultiRotor (class in roboticstoolbox.blocks.uav)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotorMixer\">MultiRotorMixer (class in roboticstoolbox.blocks.uav)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.uav.MultiRotorPlot\">MultiRotorPlot (class in roboticstoolbox.blocks.uav)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.Mux\">Mux (class in bdsim.blocks.connections)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"N\">N</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.DIntegrator.next\">next() (bdsim.blocks.discrete.DIntegrator method)</a>\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.DPoseIntegrator.next\">(bdsim.blocks.discrete.DPoseIntegrator method)</a>\n</li>\n        <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.ZOH.next\">(bdsim.blocks.discrete.ZOH method)</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Clock.next_event\">next_event() (bdsim.Clock method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Norm\">Norm (class in bdsim.blocks.linalg)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sinks.Null\">Null (class in bdsim.blocks.sinks)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"O\">O</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Inverse.onames\">onames (bdsim.blocks.linalg.Inverse attribute)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.options\">options (bdsim.BDSim attribute)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.OutPort\">OutPort (class in bdsim.blocks.connections)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.outport_names\">outport_names() (bdsim.Block method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"P\">P</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Piecewise\">Piecewise (class in bdsim.blocks.sources)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Plug\">Plug (class in bdsim)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Point2Tr\">Point2Tr (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.PriorityQ.pop\">pop() (bdsim.PriorityQ method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.PriorityQ.pop_until\">pop_until() (bdsim.PriorityQ method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Plug.portlist\">portlist() (bdsim.Plug property)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.transfers.PoseIntegrator\">PoseIntegrator (class in bdsim.blocks.transfers)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sinks.Print\">Print (class in bdsim.blocks.sinks)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.PriorityQ\">PriorityQ (class in bdsim)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Prod\">Prod (class in bdsim.blocks.functions)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.progress\">progress() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.progress_done\">progress_done() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.PriorityQ.push\">push() (bdsim.PriorityQ method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"R\">R</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Ramp\">Ramp (class in bdsim.blocks.sources)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.reset\">reset() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.ClockedBlock.reset\">(bdsim.ClockedBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.TransferBlock.reset\">(bdsim.TransferBlock method)</a>\n</li>\n      </ul></li>\n      <li>\n    roboticstoolbox.blocks.arm\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.arm\">module</a>\n</li>\n      </ul></li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li>\n    roboticstoolbox.blocks.mobile\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.mobile\">module</a>\n</li>\n      </ul></li>\n      <li>\n    roboticstoolbox.blocks.uav\n\n      <ul>\n        <li><a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.uav\">module</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.BDSim.run\">run() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.run_interval\">run_interval() (bdsim.BDSim method)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"S\">S</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.BDSim.savefig\">savefig() (bdsim.BDSim method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Block.savefig\">(bdsim.Block method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.GraphicsBlock.savefig\">(bdsim.GraphicsBlock method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.BDSim.savefigs\">savefigs() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Clock.savestate\">savestate() (bdsim.Clock method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Wire.send\">send() (bdsim.Wire method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.BDSim.set_options\">set_options() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.set_param\">set_param() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.setinput\">setinput() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.setinputs\">setinputs() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Clock.setstate\">setstate() (bdsim.Clock method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.ClockedBlock.setstate\">(bdsim.ClockedBlock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.TransferBlock.setstate\">(bdsim.TransferBlock method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.BDSim.showgraph\">showgraph() (bdsim.BDSim method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.SinkBlock\">SinkBlock (class in bdsim)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Slice1\">Slice1 (class in bdsim.blocks.linalg)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Slice2\">Slice2 (class in bdsim.blocks.linalg)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.SourceBlock\">SourceBlock (class in bdsim)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.sourcename\">sourcename() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.start\">start() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.Clock.start\">(bdsim.Clock method)</a>\n</li>\n        <li><a href=\"internals.html#bdsim.GraphicsBlock.start\">(bdsim.GraphicsBlock method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"internals.html#bdsim.Block.state_names\">state_names() (bdsim.Block method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Step\">Step (class in bdsim.blocks.sources)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Block.step\">step() (bdsim.Block method)</a>\n\n      <ul>\n        <li><a href=\"internals.html#bdsim.GraphicsBlock.step\">(bdsim.GraphicsBlock method)</a>\n</li>\n      </ul></li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sinks.Stop\">Stop (class in bdsim.blocks.sinks)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Struct\">Struct (class in bdsim)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.connections.SubSystem\">SubSystem (class in bdsim.blocks.connections)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.SubsystemBlock\">SubsystemBlock (class in bdsim)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.functions.Sum\">Sum (class in bdsim.blocks.functions)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"T\">T</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.Time\">Time (class in bdsim.blocks.sources)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Clock.time\">time() (bdsim.Clock method)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Tr2Delta\">Tr2Delta (class in roboticstoolbox.blocks.arm)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.TR2T\">TR2T (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.arm.Traj\">Traj (class in roboticstoolbox.blocks.arm)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.TransferBlock\">TransferBlock (class in bdsim)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.linalg.Transpose\">Transpose (class in bdsim.blocks.linalg)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"U\">U</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.mobile.Unicycle\">Unicycle (class in roboticstoolbox.blocks.mobile)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"V\">V</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Block.varinputs\">varinputs (bdsim.Block attribute)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Block.varoutputs\">varoutputs (bdsim.Block attribute)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#roboticstoolbox.blocks.mobile.VehiclePlot\">VehiclePlot (class in roboticstoolbox.blocks.mobile)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"W\">W</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sinks.Watch\">Watch (class in bdsim.blocks.sinks)</a>\n</li>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.sources.WaveForm\">WaveForm (class in bdsim.blocks.sources)</a>\n</li>\n  </ul></td>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"internals.html#bdsim.Plug.width\">width() (bdsim.Plug property)</a>\n</li>\n      <li><a href=\"internals.html#bdsim.Wire\">Wire (class in bdsim)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n<h2 id=\"Z\">Z</h2>\n<table style=\"width: 100%\" class=\"indextable genindextable\"><tr>\n  <td style=\"width: 33%; vertical-align: top;\"><ul>\n      <li><a href=\"bdsim.blocks.html#bdsim.blocks.discrete.ZOH\">ZOH (class in bdsim.blocks.discrete)</a>\n</li>\n  </ul></td>\n</tr></table>\n\n\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/index.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>Block diagrams for Python &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n        <script src=\"_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n    <link rel=\"next\" title=\"Overview\" href=\"bdsim.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"#\" class=\"icon icon-home\"> Block diagram simulation<img src=\"_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"#\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"#\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>Block diagrams for Python</li>\n      <li class=\"wy-breadcrumbs-aside\">\n            <a href=\"_sources/index.rst.txt\" rel=\"nofollow\"> View page source</a>\n      </li>\n  </ul><div class=\"rst-breadcrumbs-buttons\" role=\"navigation\" aria-label=\"Sequential page navigation\">\n        <a href=\"bdsim.html\" class=\"btn btn-neutral float-right\" title=\"Overview\" accesskey=\"n\">Next <span class=\"fa fa-arrow-circle-right\" aria-hidden=\"true\"></span></a>\n  </div>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <div class=\"section\" id=\"block-diagrams-for-python\">\n<h1>Block diagrams for Python<a class=\"headerlink\" href=\"#block-diagrams-for-python\" title=\"Permalink to this headline\">¶</a></h1>\n<table>\n<tr>\n<td>\n<img width=350 src=\"https://github.com/petercorke/bdsim/raw/master/figs/bd1-sketch.png\">\n</td>\n<td style=\"padding-left: 20px;\">\n<pre style=\"font-size:10px;\">\n# define the blocks\ndemand = bd.STEP(T=1, name='demand')\nsum = bd.SUM('+-')\ngain = bd.GAIN(10)\nplant = bd.LTI_SISO(0.5, [2, 1])\nscope = bd.SCOPE(styles=['k', 'r--'])\n\n# connect the blocks\nbd.connect(demand, sum[0], scope[1])\nbd.connect(plant, sum[1])\nbd.connect(sum, gain)\nbd.connect(gain, plant)\nbd.connect(plant, scope[0])\n</pre>\n</td>\n</tr>\n</table><p>This Python package enables modelling and simulation of dynamic systems\nconceptualized in block diagram form, but represented in terms of Python class\nand method calls.</p>\n<p>Unlike Simulink® or LabView®, we write Python code rather than drawing boxes and\nwires.  Wires can communicate any Python type such as scalars, strings, lists,\ndictionaries, numpy arrays, other objects, and even functions.</p>\n<div class=\"toctree-wrapper compound\">\n<p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.html#getting-started\">Getting started</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.html#using-operator-overloading\">Using operator overloading</a></li>\n</ul>\n</li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.blocks.html\">Block library</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.blocks.html#module-bdsim.blocks.sources\">Source blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.blocks.html#module-bdsim.blocks.sinks\">Sink blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.blocks.html#module-bdsim.blocks.functions\">Function blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.blocks.html#module-bdsim.blocks.transfers\">Transfer blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.blocks.html#module-bdsim.blocks.discrete\">Discrete-time blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.blocks.html#module-bdsim.blocks.linalg\">Linear algebra blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.blocks.html#module-bdsim.blocks.connections\">Connection blocks</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.blocks.html#external-toolbox-blocksets\">External Toolbox blocksets</a></li>\n</ul>\n</li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"internals.html\">Supporting classes</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"internals.html#bdsim-class\">BDSim class</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"internals.html#blockdiagram-class\">BlockDiagram class</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"internals.html#components\">Components</a></li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n\n\n           </div>\n          </div>\n          <footer><div class=\"rst-footer-buttons\" role=\"navigation\" aria-label=\"Footer\">\n        <a href=\"bdsim.html\" class=\"btn btn-neutral float-right\" title=\"Overview\" accesskey=\"n\" rel=\"next\">Next <span class=\"fa fa-arrow-circle-right\" aria-hidden=\"true\"></span></a>\n    </div>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/internals.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>Supporting classes &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n        <script src=\"_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n    <link rel=\"prev\" title=\"Block library\" href=\"bdsim.blocks.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul class=\"current\">\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1 current\"><a class=\"current reference internal\" href=\"#\">Supporting classes</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#bdsim-class\">BDSim class</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#blockdiagram-class\">BlockDiagram class</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"#components\">Components</a><ul>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#wire\">Wire</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#plug\">Plug</a></li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#blocks\">Blocks</a><ul>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#source-block\">Source block</a></li>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#sink-block\">Sink block</a></li>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#function-block\">Function block</a></li>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#transfer-function-block\">Transfer function block</a></li>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#subsystem-block\">Subsystem block</a></li>\n<li class=\"toctree-l4\"><a class=\"reference internal\" href=\"#graphics-block\">Graphics block</a></li>\n</ul>\n</li>\n<li class=\"toctree-l3\"><a class=\"reference internal\" href=\"#discrete-time-systems\">Discrete-time systems</a></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>Supporting classes</li>\n      <li class=\"wy-breadcrumbs-aside\">\n            <a href=\"_sources/internals.rst.txt\" rel=\"nofollow\"> View page source</a>\n      </li>\n  </ul><div class=\"rst-breadcrumbs-buttons\" role=\"navigation\" aria-label=\"Sequential page navigation\">\n        <a href=\"bdsim.blocks.html\" class=\"btn btn-neutral float-left\" title=\"Block library\" accesskey=\"p\"><span class=\"fa fa-arrow-circle-left\" aria-hidden=\"true\"></span> Previous</a>\n  </div>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <div class=\"section\" id=\"supporting-classes\">\n<h1>Supporting classes<a class=\"headerlink\" href=\"#supporting-classes\" title=\"Permalink to this headline\">¶</a></h1>\n<div class=\"graphviz\"><img src=\"_images/inheritance-774aaf2025d5b3e9eeeab44c7ebc25daa485eef8.png\" alt=\"Inheritance diagram of bdsim.components\" class=\"inheritance graphviz\" /></div>\n<div class=\"section\" id=\"bdsim-class\">\n<h2>BDSim class<a class=\"headerlink\" href=\"#bdsim-class\" title=\"Permalink to this headline\">¶</a></h2>\n<p>This class describes the run-time environment for executing a block diagram.</p>\n<dl class=\"py class\">\n<dt id=\"bdsim.BDSim\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">BDSim</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">packages</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">packages</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>sysargs</strong> (<em>bool</em><em>, </em><em>optional</em>) – process options from sys.argv, defaults to True</p></li>\n<li><p><strong>graphics</strong> (<em>bool</em><em>, </em><em>optional</em>) – enable graphics, defaults to True</p></li>\n<li><p><strong>animation</strong> (<em>bool</em><em>, </em><em>optional</em>) – enable animation, defaults to False</p></li>\n<li><p><strong>progress</strong> (<em>bool</em><em>, </em><em>optional</em>) – enable progress bar, defaults to True</p></li>\n<li><p><strong>debug</strong> (<em>str</em><em>, </em><em>optional</em>) – debug options, defaults to None</p></li>\n<li><p><strong>backend</strong> (<em>str</em><em>, </em><em>optional</em>) – matplotlib backend, defaults to ‘Qt5Agg’’</p></li>\n<li><p><strong>tiles</strong> (<em>str</em><em>, </em><em>optional</em>) – figure tile layout on monitor, defaults to ‘3x4’</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Raises</dt>\n<dd class=\"field-even\"><p><strong>ImportError</strong> – syntax error in block</p>\n</dd>\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>parent object for blockdiagram simulation</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p><a class=\"reference internal\" href=\"#bdsim.BDSim\" title=\"bdsim.BDSim\">BDSim</a></p>\n</dd>\n</dl>\n<p>If <code class=\"docutils literal notranslate\"><span class=\"pre\">sysargs</span></code> is True, process command line arguments and passed\noptions.  Command line arguments have precedence.</p>\n<table class=\"docutils align-default\">\n<colgroup>\n<col style=\"width: 24%\" />\n<col style=\"width: 11%\" />\n<col style=\"width: 10%\" />\n<col style=\"width: 54%\" />\n</colgroup>\n<thead>\n<tr class=\"row-odd\"><th class=\"head\"><p>Command line switch</p></th>\n<th class=\"head\"><p>Argument</p></th>\n<th class=\"head\"><p>Default</p></th>\n<th class=\"head\"><p>Behaviour</p></th>\n</tr>\n</thead>\n<tbody>\n<tr class=\"row-even\"><td><p>++nographics, +g</p></td>\n<td><p>graphics</p></td>\n<td><p>True</p></td>\n<td><p>enable graphical display</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>++animation, +a</p></td>\n<td><p>animation</p></td>\n<td><p>True</p></td>\n<td><p>update graphics at each time step</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>–nographics, -g</p></td>\n<td><p>graphics</p></td>\n<td><p>True</p></td>\n<td><p>disable graphical display</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>–animation, -a</p></td>\n<td><p>animation</p></td>\n<td><p>True</p></td>\n<td><p>don’t update graphics at each time step</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>–noprogress, -p</p></td>\n<td><p>progress</p></td>\n<td><p>True</p></td>\n<td><p>do not display simulation progress bar</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>–backend BE</p></td>\n<td><p>backend</p></td>\n<td><p>‘Qt5Agg’</p></td>\n<td><p>matplotlib backend</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>–tiles RxC, -t RxC</p></td>\n<td><p>tiles</p></td>\n<td><p>‘3x4’</p></td>\n<td><p>arrangement of figure tiles on the display</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>–shape WxH</p></td>\n<td><p>shape</p></td>\n<td><p>None</p></td>\n<td><p>window size, default matplotlib size</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>–altscreen</p></td>\n<td><p>altscreen</p></td>\n<td><p>True</p></td>\n<td><p>use secondary monitor if it exists</p></td>\n</tr>\n<tr class=\"row-odd\"><td><p>–verbose, -v</p></td>\n<td><p>verbose</p></td>\n<td><p>False</p></td>\n<td><p>be verbose</p></td>\n</tr>\n<tr class=\"row-even\"><td><p>–debug F, -d F</p></td>\n<td><p>debug</p></td>\n<td><p>‘’</p></td>\n<td><p>debug flag string</p></td>\n</tr>\n</tbody>\n</table>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">animation</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">graphics</span></code> options are coupled.  If \n<code class=\"docutils literal notranslate\"><span class=\"pre\">graphics=False</span></code>, all graphics is suppressed.  If\n<code class=\"docutils literal notranslate\"><span class=\"pre\">graphics=True</span></code> then graphics are shown and the behaviour depends\non <code class=\"docutils literal notranslate\"><span class=\"pre\">animation</span></code>.  <code class=\"docutils literal notranslate\"><span class=\"pre\">animation=False</span></code> shows graphs at the end of\nthe simulation, while <a href=\"#id1\"><span class=\"problematic\" id=\"id2\">``</span></a>animation=True` will animate the graphs\nduring simulation.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.BDSim.set_options\" title=\"bdsim.BDSim.set_options\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">set_options()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.blockdiagram\">\n<code class=\"sig-name descname\">blockdiagram</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">name</span><span class=\"o\">=</span><span class=\"default_value\">'main'</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.blockdiagram\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.blockdiagram\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Instantiate a new block diagram object.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>name</strong> (<em>str</em><em>, </em><em>optional</em>) – diagram name, defaults to ‘main’</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>parent object for blockdiagram</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>BlockDiagram</p>\n</dd>\n</dl>\n<p>This object describes the connectivity of a set of blocks and wires.</p>\n<p>It is an instantiation of the <code class=\"docutils literal notranslate\"><span class=\"pre\">BlockDiagram</span></code> class with a factory\nmethod for every dynamically loaded block which returns\nan instance of the block.  These factory methods have names\nwhich are all upper case, for example, the method <code class=\"docutils literal notranslate\"><span class=\"pre\">.GAIN</span></code> invokes\nthe constructor for the <code class=\"docutils literal notranslate\"><span class=\"pre\">Gain</span></code> class.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><code class=\"xref py py-func docutils literal notranslate\"><span class=\"pre\">BlockDiagram()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.blocks\">\n<code class=\"sig-name descname\">blocks</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.blocks\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.blocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>List all loaded blocks.</p>\n<p>Example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"mi\">73</span>  <span class=\"n\">blocks</span> <span class=\"n\">loaded</span>\n<span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">functions</span><span class=\"o\">..................</span><span class=\"p\">:</span> <span class=\"n\">Sum</span> <span class=\"n\">Prod</span> <span class=\"n\">Gain</span> <span class=\"n\">Clip</span> <span class=\"n\">Function</span> <span class=\"n\">Interpolate</span> \n<span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">sources</span><span class=\"o\">....................</span><span class=\"p\">:</span> <span class=\"n\">Constant</span> <span class=\"n\">Time</span> <span class=\"n\">WaveForm</span> <span class=\"n\">Piecewise</span> <span class=\"n\">Step</span> <span class=\"n\">Ramp</span> \n<span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">sinks</span><span class=\"o\">......................</span><span class=\"p\">:</span> <span class=\"n\">Print</span> <span class=\"n\">Stop</span> <span class=\"n\">Null</span> <span class=\"n\">Watch</span> \n<span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">transfers</span><span class=\"o\">..................</span><span class=\"p\">:</span> <span class=\"n\">Integrator</span> <span class=\"n\">PoseIntegrator</span> <span class=\"n\">LTI_SS</span> <span class=\"n\">LTI_SISO</span> \n<span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">discrete</span><span class=\"o\">...................</span><span class=\"p\">:</span> <span class=\"n\">ZOH</span> <span class=\"n\">DIntegrator</span> <span class=\"n\">DPoseIntegrator</span> \n<span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">linalg</span><span class=\"o\">.....................</span><span class=\"p\">:</span> <span class=\"n\">Inverse</span> <span class=\"n\">Transpose</span> <span class=\"n\">Norm</span> <span class=\"n\">Flatten</span> <span class=\"n\">Slice2</span> <span class=\"n\">Slice1</span> <span class=\"n\">Det</span> <span class=\"n\">Cond</span> \n<span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">displays</span><span class=\"o\">...................</span><span class=\"p\">:</span> <span class=\"n\">Scope</span> <span class=\"n\">ScopeXY</span> <span class=\"n\">ScopeXY1</span> \n<span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">connections</span><span class=\"o\">................</span><span class=\"p\">:</span> <span class=\"n\">Item</span> <span class=\"n\">Dict</span> <span class=\"n\">Mux</span> <span class=\"n\">DeMux</span> <span class=\"n\">Index</span> <span class=\"n\">SubSystem</span> <span class=\"n\">InPort</span> <span class=\"n\">OutPort</span> \n<span class=\"n\">roboticstoolbox</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">arm</span><span class=\"o\">..............</span><span class=\"p\">:</span> <span class=\"n\">FKine</span> <span class=\"n\">IKine</span> <span class=\"n\">Jacobian</span> <span class=\"n\">Tr2Delta</span> <span class=\"n\">Delta2Tr</span> <span class=\"n\">Point2Tr</span> <span class=\"n\">TR2T</span> <span class=\"n\">FDyn</span> <span class=\"n\">IDyn</span> <span class=\"n\">Gravload</span> \n<span class=\"o\">........................................</span><span class=\"p\">:</span> <span class=\"n\">Inertia</span> <span class=\"n\">Inertia_X</span> <span class=\"n\">FDyn_X</span> <span class=\"n\">ArmPlot</span> <span class=\"n\">Traj</span> <span class=\"n\">JTraj</span> <span class=\"n\">LSPB</span> <span class=\"n\">CTraj</span> <span class=\"n\">CirclePath</span> \n<span class=\"n\">roboticstoolbox</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">mobile</span><span class=\"o\">...........</span><span class=\"p\">:</span> <span class=\"n\">Bicycle</span> <span class=\"n\">Unicycle</span> <span class=\"n\">DiffSteer</span> <span class=\"n\">VehiclePlot</span> \n<span class=\"n\">roboticstoolbox</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">uav</span><span class=\"o\">..............</span><span class=\"p\">:</span> <span class=\"n\">MultiRotor</span> <span class=\"n\">MultiRotorMixer</span> <span class=\"n\">MultiRotorPlot</span> \n<span class=\"n\">machinevisiontoolbox</span><span class=\"o\">.</span><span class=\"n\">blocks</span><span class=\"o\">.</span><span class=\"n\">camera</span><span class=\"o\">......</span><span class=\"p\">:</span> <span class=\"n\">Camera</span> <span class=\"n\">Visjac_p</span> <span class=\"n\">EstPose_p</span> <span class=\"n\">ImagePlane</span> \n</pre></div>\n</div>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.closefigs\">\n<code class=\"sig-name descname\">closefigs</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.closefigs\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.closefigs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.done\">\n<code class=\"sig-name descname\">done</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">bd</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.done\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.done\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.get_options\">\n<code class=\"sig-name descname\">get_options</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">sysargs</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.get_options\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.get_options\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.load_blocks\">\n<code class=\"sig-name descname\">load_blocks</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">verbose</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.load_blocks\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.load_blocks\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Dynamically load all block definitions.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Raises</dt>\n<dd class=\"field-odd\"><p><strong>ImportError</strong> – module could not be imported</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>dictionary of block metadata</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>dict of dict</p>\n</dd>\n</dl>\n<p>Reads blocks from .py files found in bdsim/bdsim/blocks, folders\ngiven by colon separated list in envariable BDSIMPATH, and the \ncommand line option <code class=\"docutils literal notranslate\"><span class=\"pre\">packages</span></code>.</p>\n<p>The result is a dict indexed by the upper-case block name with elements:\n- <code class=\"docutils literal notranslate\"><span class=\"pre\">path</span></code> to the folder holding the Python file defining the block\n- <code class=\"docutils literal notranslate\"><span class=\"pre\">classname</span></code>\n- <code class=\"docutils literal notranslate\"><span class=\"pre\">blockname</span></code>, upper case version of <code class=\"docutils literal notranslate\"><span class=\"pre\">classname</span></code>\n- <code class=\"docutils literal notranslate\"><span class=\"pre\">url</span></code> of online documentation for the block\n- <code class=\"docutils literal notranslate\"><span class=\"pre\">package</span></code> containing the block\n- <cite>doc</cite> is the docstring from the class constructor</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.BDSim.options\">\n<code class=\"sig-name descname\">options</code><em class=\"property\"> = None</em><a class=\"headerlink\" href=\"#bdsim.BDSim.options\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.progress\">\n<code class=\"sig-name descname\">progress</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">t</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.progress\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.progress\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Update progress bar</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>t</strong> (<em>float</em><em>, </em><em>optional</em>) – current simulation time, defaults to None</p>\n</dd>\n</dl>\n<p>Update progress bar as a percentage of the maximum simulation time,\ngiven as an argument to <code class=\"docutils literal notranslate\"><span class=\"pre\">run</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.BDSim.run\" title=\"bdsim.BDSim.run\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">run()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.BDSim.progress_done\" title=\"bdsim.BDSim.progress_done\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">progress_done()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.progress_done\">\n<code class=\"sig-name descname\">progress_done</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.progress_done\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.progress_done\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Clean up progress bar</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.run\">\n<code class=\"sig-name descname\">run</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">bd</span></em>, <em class=\"sig-param\"><span class=\"n\">T</span><span class=\"o\">=</span><span class=\"default_value\">10.0</span></em>, <em class=\"sig-param\"><span class=\"n\">dt</span><span class=\"o\">=</span><span class=\"default_value\">0.1</span></em>, <em class=\"sig-param\"><span class=\"n\">solver</span><span class=\"o\">=</span><span class=\"default_value\">'RK45'</span></em>, <em class=\"sig-param\"><span class=\"n\">solver_args</span><span class=\"o\">=</span><span class=\"default_value\">{}</span></em>, <em class=\"sig-param\"><span class=\"n\">debug</span><span class=\"o\">=</span><span class=\"default_value\">''</span></em>, <em class=\"sig-param\"><span class=\"n\">block</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"n\">checkfinite</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em>, <em class=\"sig-param\"><span class=\"n\">minstepsize</span><span class=\"o\">=</span><span class=\"default_value\">1e-12</span></em>, <em class=\"sig-param\"><span class=\"n\">watch</span><span class=\"o\">=</span><span class=\"default_value\">[]</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.run\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.run\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Run the block diagram</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>T</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum integration time, defaults to 10.0</p></li>\n<li><p><strong>dt</strong> (<em>float</em><em>, </em><em>optional</em>) – maximum time step, defaults to 0.1</p></li>\n<li><p><strong>solver</strong> (<em>str</em><em>, </em><em>optional</em>) – integration method, defaults to <code class=\"docutils literal notranslate\"><span class=\"pre\">RK45</span></code></p></li>\n<li><p><strong>block</strong> (<em>bool</em>) – matplotlib block at end of run, default False</p></li>\n<li><p><strong>checkfinite</strong> (<em>bool</em>) – error if inf or nan on any wire, default True</p></li>\n<li><p><strong>minstepsize</strong> (<em>float</em>) – minimum step length, default 1e-6</p></li>\n<li><p><strong>watch</strong> (<em>list</em>) – list of input ports to log</p></li>\n<li><p><strong>solver_args</strong> (<em>dict</em>) – arguments passed to <code class=\"docutils literal notranslate\"><span class=\"pre\">scipy.integrate</span></code></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>time history of signals and states</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Sim class</p>\n</dd>\n</dl>\n<p>Assumes that the network has been compiled.</p>\n<p>Results are returned in a class with attributes:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">t</span></code> the time vector: ndarray, shape=(M,)</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> is the state vector: ndarray, shape=(M,N)</p></li>\n<li><dl class=\"simple\">\n<dt><code class=\"docutils literal notranslate\"><span class=\"pre\">xnames</span></code> is a list of the names of the states corresponding to columns of <cite>x</cite>, eg. “plant.x0”,</dt><dd><p>defined for the block using the <code class=\"docutils literal notranslate\"><span class=\"pre\">snames</span></code> argument</p>\n</dd>\n</dl>\n</li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">yN</span></code> for a watched input where N is the index of the port mentioned in the <code class=\"docutils literal notranslate\"><span class=\"pre\">watch</span></code> argument</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">ynames</span></code> is a list of the names of the input ports being watched, same order as in <code class=\"docutils literal notranslate\"><span class=\"pre\">watch</span></code> argument</p></li>\n</ul>\n<p>If there are no dynamic elements in the diagram, ie. no states, then <code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">xnames</span></code> are not\npresent.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">watch</span></code> argument is a list of one or more input ports whose value during simulation\nwill be recorded.  The elements of the list can be:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> reference, which is interpretted as input port 0</p></li>\n<li><p>a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code> reference, ie. a block with an index or attribute</p></li>\n<li><p>a string of the form “block[i]” which is port i of the block named block.</p></li>\n</ul>\n</div></blockquote>\n<p>The debug string comprises single letter flags:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>‘p’ debug network value propagation</p></li>\n<li><p>‘s’ debug state vector</p></li>\n<li><p>‘d’ debug state derivative</p></li>\n</ul>\n</div></blockquote>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Simulation stops if the step time falls below <code class=\"docutils literal notranslate\"><span class=\"pre\">minsteplength</span></code>\nwhich typically indicates that the solver is struggling with a very\nharsh non-linearity.</p>\n</div>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.run_interval\">\n<code class=\"sig-name descname\">run_interval</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">bd</span></em>, <em class=\"sig-param\"><span class=\"n\">t0</span></em>, <em class=\"sig-param\"><span class=\"n\">T</span></em>, <em class=\"sig-param\"><span class=\"n\">x0</span></em>, <em class=\"sig-param\"><span class=\"n\">state</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.run_interval\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.run_interval\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Integrate system over interval</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>bd</strong> (<em>BlockDiagram</em>) – the system blockdiagram</p></li>\n<li><p><strong>t0</strong> (<em>float</em>) – initial time</p></li>\n<li><p><strong>tf</strong> (<em>float</em>) – final time</p></li>\n<li><p><strong>x0</strong> (<em>ndarray</em><em>(</em><em>n</em><em>)</em>) – initial state vector</p></li>\n<li><p><strong>simstate</strong> (<em>SimState</em>) – simulation state object</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>final state vector xf</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>ndarray(n)</p>\n</dd>\n</dl>\n<p>The system is integrated from from <code class=\"docutils literal notranslate\"><span class=\"pre\">x0</span></code> to <code class=\"docutils literal notranslate\"><span class=\"pre\">xf</span></code> over the interval <code class=\"docutils literal notranslate\"><span class=\"pre\">t0</span></code> to <code class=\"docutils literal notranslate\"><span class=\"pre\">tf</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.savefig\">\n<code class=\"sig-name descname\">savefig</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">block</span></em>, <em class=\"sig-param\"><span class=\"n\">filename</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">format</span><span class=\"o\">=</span><span class=\"default_value\">'pdf'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.savefig\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.savefig\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.savefigs\">\n<code class=\"sig-name descname\">savefigs</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">bd</span></em>, <em class=\"sig-param\"><span class=\"n\">format</span><span class=\"o\">=</span><span class=\"default_value\">'pdf'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.savefigs\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.savefigs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.set_options\">\n<code class=\"sig-name descname\">set_options</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">options</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.set_options\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.set_options\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Set simulation options at run time</p>\n<p>The options are the same as those for the constructor.</p>\n<p>Example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">sim</span> <span class=\"o\">=</span> <span class=\"n\">bdsim</span><span class=\"o\">.</span><span class=\"n\">BDsim</span><span class=\"p\">()</span>\n<span class=\"n\">sim</span><span class=\"o\">.</span><span class=\"n\">set_options</span><span class=\"p\">(</span><span class=\"n\">graphics</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.BDSim.__init__\" title=\"bdsim.BDSim.__init__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">__init__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSim.showgraph\">\n<code class=\"sig-name descname\">showgraph</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">bd</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSim.showgraph\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSim.showgraph\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.Struct\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">Struct</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">name</span><span class=\"o\">=</span><span class=\"default_value\">'Struct'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Struct\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Struct\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">collections.UserDict</span></code></p>\n<p>A dict like object that allows items to be added by attribute or by key.</p>\n<p>For example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">d</span> <span class=\"o\">=</span> <span class=\"n\">Struct</span><span class=\"p\">(</span><span class=\"s1\">&#39;thing&#39;</span><span class=\"p\">)</span>\n<span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">d</span><span class=\"o\">.</span><span class=\"n\">a</span> <span class=\"o\">=</span> <span class=\"mi\">1</span>\n<span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">d</span><span class=\"p\">[</span><span class=\"s1\">&#39;b&#39;</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"mi\">2</span>\n<span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">d</span><span class=\"o\">.</span><span class=\"n\">a</span>\n<span class=\"go\">1</span>\n<span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">d</span><span class=\"p\">[</span><span class=\"s1\">&#39;a&#39;</span><span class=\"p\">]</span>\n<span class=\"go\">1</span>\n<span class=\"gp\">&gt;&gt;&gt; </span><span class=\"n\">d</span><span class=\"o\">.</span><span class=\"n\">b</span>\n<span class=\"go\">2</span>\n<span class=\"gp\">&gt;&gt;&gt; </span><span class=\"nb\">str</span><span class=\"p\">(</span><span class=\"n\">d</span><span class=\"p\">)</span>\n<span class=\"go\">&quot;thing {&#39;a&#39;: 1, &#39;b&#39;: 2}&quot;</span>\n</pre></div>\n</div>\n<dl class=\"py method\">\n<dt id=\"bdsim.Struct.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">name</span><span class=\"o\">=</span><span class=\"default_value\">'Struct'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Struct.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Struct.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Initialize self.  See help(type(self)) for accurate signature.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Struct.add\">\n<code class=\"sig-name descname\">add</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">name</span></em>, <em class=\"sig-param\"><span class=\"n\">value</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Struct.add\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Struct.add\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.BDSimState\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">BDSimState</code><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSimState\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSimState\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Variables</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>x</strong> (<em>np.ndarray</em>) – state vector</p></li>\n<li><p><strong>T</strong> (<em>float</em>) – maximum simulation time (seconds)</p></li>\n<li><p><strong>t</strong> (<em>float</em>) – current simulation time (seconds)</p></li>\n<li><p><strong>fignum</strong> (<em>int</em>) – number of next matplotlib figure to create</p></li>\n<li><p><strong>stop</strong> (<em>Block subclass</em>) – reference to block wanting to stop simulation, else None</p></li>\n<li><p><strong>checkfinite</strong> (<em>bool</em>) – halt simulation if any wire has inf or nan</p></li>\n<li><p><strong>graphics</strong> (<em>bool</em>) – enable graphics</p></li>\n</ul>\n</dd>\n</dl>\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSimState.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSimState.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSimState.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Initialize self.  See help(type(self)) for accurate signature.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.BDSimState.declare_event\">\n<code class=\"sig-name descname\">declare_event</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">block</span></em>, <em class=\"sig-param\"><span class=\"n\">t</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/bdsim.html#BDSimState.declare_event\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.BDSimState.declare_event\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"blockdiagram-class\">\n<h2>BlockDiagram class<a class=\"headerlink\" href=\"#blockdiagram-class\" title=\"Permalink to this headline\">¶</a></h2>\n<p>This class describes a block diagram, a collection of blocks and wires that\ncan be “executed”.</p>\n<dl class=\"py attribute\">\n<dt id=\"bdsim.blockdiagram\">\n<code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">blockdiagram</code><a class=\"headerlink\" href=\"#bdsim.blockdiagram\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>alias of <a class=\"reference internal\" href=\"#bdsim.blockdiagram\" title=\"bdsim.blockdiagram\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.blockdiagram</span></code></a></p>\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"components\">\n<h2>Components<a class=\"headerlink\" href=\"#components\" title=\"Permalink to this headline\">¶</a></h2>\n<div class=\"section\" id=\"wire\">\n<h3>Wire<a class=\"headerlink\" href=\"#wire\" title=\"Permalink to this headline\">¶</a></h3>\n<dl class=\"py class\">\n<dt id=\"bdsim.Wire\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">Wire</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">start</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">end</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">name</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Wire\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Wire\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<p>Create a wire.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>start</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a><em>, </em><em>optional</em>) – Plug at the start of a wire, defaults to None</p></li>\n<li><p><strong>end</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a><em>, </em><em>optional</em>) – Plug at the end of a wire, defaults to None</p></li>\n<li><p><strong>name</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of wire, defaults to None</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A wire object</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Wire\" title=\"bdsim.Wire\">Wire</a></p>\n</dd>\n</dl>\n<p>A Wire object connects two block ports.  A Wire has a reference to the\nstart and end ports.</p>\n<p>A wire records all the connections defined by the user.  At compile time\nwires are used to build inter-block references.</p>\n<p>Between two blocks, a wire can connect one or more ports, ie. it can connect\na set of output ports on one block to a same sized set of input ports on \nanother block.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.Wire.fullname\">\n<em class=\"property\">property </em><code class=\"sig-name descname\">fullname</code><a class=\"headerlink\" href=\"#bdsim.Wire.fullname\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Display wire connection details.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>Wire name</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>str</p>\n</dd>\n</dl>\n<p>String format:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">d2goal</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">--&gt;</span> <span class=\"n\">Kv</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Wire.info\">\n<em class=\"property\">property </em><code class=\"sig-name descname\">info</code><a class=\"headerlink\" href=\"#bdsim.Wire.info\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Interactive display of wire properties.</p>\n<p>Displays all attributes of the wire for debugging purposes.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Wire.send\">\n<code class=\"sig-name descname\">send</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">value</span></em>, <em class=\"sig-param\"><span class=\"n\">sinks</span><span class=\"o\">=</span><span class=\"default_value\">True</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Wire.send\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Wire.send\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Send a value to the port at end of this wire.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>value</strong> (<em>float</em><em>, </em><em>numpy.ndarray</em><em>, </em><em>etc.</em>) – A port value</p>\n</dd>\n</dl>\n<p>The value is sent to the input port connected to the end of this wire.</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"plug\">\n<h3>Plug<a class=\"headerlink\" href=\"#plug\" title=\"Permalink to this headline\">¶</a></h3>\n<dl class=\"py class\">\n<dt id=\"bdsim.Plug\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">Plug</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">block</span></em>, <em class=\"sig-param\"><span class=\"n\">port</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">type</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<p>Create a plug.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>block</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – The block being plugged into</p></li>\n<li><p><strong>port</strong> (<em>int</em><em>, </em><em>optional</em>) – The port on the block, defaults to 0</p></li>\n<li><p><strong>type</strong> (<em>str</em><em>, </em><em>optional</em>) – ‘start’ or ‘end’, defaults to None</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>Plug object</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\">Plug</a></p>\n</dd>\n</dl>\n<p>Plugs are the interface between a wire and block and have information\nabout port number and wire end. Plugs are on the end of each wire, and connect a \nWire to a specific port on a Block.</p>\n<dl class=\"simple\">\n<dt>The <code class=\"docutils literal notranslate\"><span class=\"pre\">type</span></code> argument indicates if the <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code> is at:</dt><dd><ul class=\"simple\">\n<li><p>the start of a wire, ie. the port is an output port</p></li>\n<li><p>the end of a wire, ie. the port is an input port</p></li>\n</ul>\n</dd>\n</dl>\n<p>A plug can specify a set of ports on a block.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__add__\">\n<code class=\"sig-name descname\">__add__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__add__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__add__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded + operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be added</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be added</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the + operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"n\">C</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM(&quot;++&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_sum.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new <code class=\"docutils literal notranslate\"><span class=\"pre\">CONSTANT(C)</span></code> block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__radd__\" title=\"bdsim.Plug.__radd__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__radd__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Block.__add__\" title=\"bdsim.Block.__add__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__add__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">block</span></em>, <em class=\"sig-param\"><span class=\"n\">port</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">type</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Initialize self.  See help(type(self)) for accurate signature.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__mul__\">\n<code class=\"sig-name descname\">__mul__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__mul__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__mul__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded * operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be multiplied</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be multiplied</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>PROD or GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the * operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">C</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD(&quot;**&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_prod.N</span></code> whose inputs are the \nleft and right operands.</p>\n<p>For the third case, create a <code class=\"docutils literal notranslate\"><span class=\"pre\">GAIN(C)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_gain.N</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Signals are assumed to be scalars, but if <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a NumPy\narray then the option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> is set to True.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__rmul__\" title=\"bdsim.Plug.__rmul__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__rmul__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Block.__mul__\" title=\"bdsim.Block.__mul__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__mul__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__neg__\">\n<code class=\"sig-name descname\">__neg__</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__neg__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__neg__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded unary minus operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be negated</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the - operator for unary minus when the operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> is a block.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">GAIN(-1)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_gain.N</span></code> whose input is the \noperand.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__neg__\" title=\"bdsim.Block.__neg__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__neg__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__radd__\">\n<code class=\"sig-name descname\">__radd__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__radd__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__radd__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded + operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be added</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be added</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the + operator when the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>\nand the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">+</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">C</span> <span class=\"o\">+</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM(&quot;++&quot;)</span> <span class=\"pre\">block</span> <span class=\"pre\">named</span> <span class=\"pre\">``_sum.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new <code class=\"docutils literal notranslate\"><span class=\"pre\">CONSTANT(C)</span></code> block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The inputs to the summing junction are reversed: right then left operand.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__add__\" title=\"bdsim.Plug.__add__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__add__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Block.__radd__\" title=\"bdsim.Block.__radd__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__radd__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__repr__\">\n<code class=\"sig-name descname\">__repr__</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__repr__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__repr__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Display plug details.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>Plug description</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>str</p>\n</dd>\n</dl>\n<p>String format:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">bicycle</span><span class=\"o\">.</span><span class=\"mi\">0</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__rmul__\">\n<code class=\"sig-name descname\">__rmul__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__rmul__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__rmul__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded * operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be multiplied</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be multiplied</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>PROD or GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the * operator when the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>\nand the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">*</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">C</span> <span class=\"o\">*</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>For the first two cases, a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD(&quot;**&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_prod.N</span></code> whose inputs are the \nleft and right operands.</p>\n<p>For the third case, create a <code class=\"docutils literal notranslate\"><span class=\"pre\">GAIN(C)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_gain.N</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Signals are assumed to be scalars, but if <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a NumPy\narray then the option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> is set to True.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__mul__\" title=\"bdsim.Plug.__mul__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__mul__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Block.__rmul__\" title=\"bdsim.Block.__rmul__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__rmul__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__rshift__\">\n<code class=\"sig-name descname\">__rshift__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">right</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__rshift__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__rshift__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded &gt;&gt; operator for implicit wiring.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>left</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A plug to be wired from</p></li>\n<li><p><strong>right</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A block or plug to be wired to</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p><code class=\"docutils literal notranslate\"><span class=\"pre\">right</span></code></p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\">Block</a> or <a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\">Plug</a></p>\n</dd>\n</dl>\n<p>Implements implicit wiring, where the left-hand operator is a Plug, for example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">a</span> <span class=\"o\">=</span> <span class=\"n\">bike</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">&gt;&gt;</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">GAIN</span><span class=\"p\">(</span><span class=\"mi\">3</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>will connect port 2 of <code class=\"docutils literal notranslate\"><span class=\"pre\">bike</span></code> to the input of the GAIN block.</p>\n<p>Note that:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">a</span> <span class=\"o\">=</span> <span class=\"n\">bike</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">&gt;&gt;</span> <span class=\"n\">func</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>will connect port 2 of <code class=\"docutils literal notranslate\"><span class=\"pre\">bike</span></code> to port 1 of <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>, and port 1 of <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>\nwill be assigned to <code class=\"docutils literal notranslate\"><span class=\"pre\">a</span></code>.  To specify a different outport port on <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>\nwe need to use parentheses:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">a</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">bike</span><span class=\"p\">[</span><span class=\"mi\">2</span><span class=\"p\">]</span> <span class=\"o\">&gt;&gt;</span> <span class=\"n\">func</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>which will connect port 2 of <code class=\"docutils literal notranslate\"><span class=\"pre\">bike</span></code> to port 1 of <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>, and port 0 of <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>\nwill be assigned to <code class=\"docutils literal notranslate\"><span class=\"pre\">a</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p>Block.__mul__</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__rsub__\">\n<code class=\"sig-name descname\">__rsub__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__rsub__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__rsub__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded - operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be added (minuend)</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be subtracted (subtrahend)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the - operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">-</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">C</span> <span class=\"o\">-</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM(&quot;+-&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_sum.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new <code class=\"docutils literal notranslate\"><span class=\"pre\">CONSTANT(C)</span></code> block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The inputs to the summing junction are reversed: right then left operand.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__sub__\" title=\"bdsim.Plug.__sub__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__sub__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Block.__rsub__\" title=\"bdsim.Block.__rsub__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__rsub__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__rtruediv__\">\n<code class=\"sig-name descname\">__rtruediv__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__rtruediv__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__rtruediv__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded / operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be multiplied (dividend)</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be divided (divisor)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>PROD block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the / operator when the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>\nand the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">/</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">C</span> <span class=\"o\">/</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>For the first two cases, a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD(&quot;*/&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_prod.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new CONSTANT block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Signals are assumed to be scalars, but if <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a NumPy\narray then the option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> is set to True.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__truediv__\" title=\"bdsim.Plug.__truediv__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__truediv__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Block.__rtruediv__\" title=\"bdsim.Block.__rtruediv__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__rtruediv__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__sub__\">\n<code class=\"sig-name descname\">__sub__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__sub__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__sub__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded - operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be added (minuend)</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be subtracted (subtrahend)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the - operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"n\">C</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM(&quot;+-&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_sum.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new <code class=\"docutils literal notranslate\"><span class=\"pre\">CONSTANT(C)</span></code> block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__rsub__\" title=\"bdsim.Plug.__rsub__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__rsub__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Block.__sub__\" title=\"bdsim.Block.__sub__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__sub__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.__truediv__\">\n<code class=\"sig-name descname\">__truediv__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Plug.__truediv__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Plug.__truediv__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded / operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (plug) to be multiplied (dividend)</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be divided (divisor)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>PROD or GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the / operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"n\">C</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD(&quot;**&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_prod.N</span></code> whose inputs are the \nleft and right operands.</p>\n<p>For the third case, create a <code class=\"docutils literal notranslate\"><span class=\"pre\">GAIN(1/C)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_gain.N</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Signals are assumed to be scalars, but if <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a NumPy\narray then the option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> is set to True.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__rtruediv__\" title=\"bdsim.Plug.__rtruediv__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__rtruediv__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Block.__truediv__\" title=\"bdsim.Block.__truediv__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__truediv__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.isslice\">\n<em class=\"property\">property </em><code class=\"sig-name descname\">isslice</code><a class=\"headerlink\" href=\"#bdsim.Plug.isslice\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Test if port number is a slice.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>Whether the port is a slice</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>bool</p>\n</dd>\n</dl>\n<p>Returns <code class=\"docutils literal notranslate\"><span class=\"pre\">True</span></code> if the port is a slice, eg. <code class=\"docutils literal notranslate\"><span class=\"pre\">[0:3]</span></code>, and <code class=\"docutils literal notranslate\"><span class=\"pre\">False</span></code>\nfor a simple index, eg. <code class=\"docutils literal notranslate\"><span class=\"pre\">[2]</span></code>.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.portlist\">\n<em class=\"property\">property </em><code class=\"sig-name descname\">portlist</code><a class=\"headerlink\" href=\"#bdsim.Plug.portlist\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Return port numbers.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>Port numbers</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>list of int</p>\n</dd>\n</dl>\n<p>If the port is a simple index, eg. <code class=\"docutils literal notranslate\"><span class=\"pre\">[2]</span></code> returns [2].</p>\n<p>If the port is a slice, eg. <code class=\"docutils literal notranslate\"><span class=\"pre\">[0:3]</span></code>, returns [0, 1, 2].\nFor the case <code class=\"docutils literal notranslate\"><span class=\"pre\">[2:]</span></code> the upper bound is the maximum number of input\nor output ports of the block.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Plug.width\">\n<em class=\"property\">property </em><code class=\"sig-name descname\">width</code><a class=\"headerlink\" href=\"#bdsim.Plug.width\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Return number of ports connected.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Returns</dt>\n<dd class=\"field-odd\"><p>Number of ports</p>\n</dd>\n<dt class=\"field-even\">Return type</dt>\n<dd class=\"field-even\"><p>int</p>\n</dd>\n</dl>\n<p>If the port is a simple index, eg. <code class=\"docutils literal notranslate\"><span class=\"pre\">[2]</span></code> returns 1.</p>\n<p>If the port is a slice, eg. <code class=\"docutils literal notranslate\"><span class=\"pre\">[0:3]</span></code>, returns 3.</p>\n</dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"blocks\">\n<h3>Blocks<a class=\"headerlink\" href=\"#blocks\" title=\"Permalink to this headline\">¶</a></h3>\n<dl class=\"py class\">\n<dt id=\"bdsim.Block\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">Block</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__add__\">\n<code class=\"sig-name descname\">__add__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__add__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__add__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded + operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be added</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be added</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the + operator\nwhen the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nand the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">+</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">+</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">+</span> <span class=\"n\">C</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Creates a <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM(&quot;++&quot;)</span> <span class=\"pre\">block</span> <span class=\"pre\">named</span> <span class=\"pre\">``_sum.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new <code class=\"docutils literal notranslate\"><span class=\"pre\">CONSTANT(C)</span></code> block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The inputs to the summing junction are reversed: right then left operand.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__radd__\" title=\"bdsim.Block.__radd__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__radd__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Plug.__add__\" title=\"bdsim.Plug.__add__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__add__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__getitem__\">\n<code class=\"sig-name descname\">__getitem__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">port</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__getitem__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__getitem__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Convert a block slice reference to a plug.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>port</strong> (<em>int</em>) – Port number</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A port plug</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\">Plug</a></p>\n</dd>\n</dl>\n<p>Invoked whenever a block is referenced as a slice, for example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">c</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)</span>\n\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">x</span><span class=\"p\">,</span> <span class=\"n\">c</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">])</span>\n<span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">c</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">],</span> <span class=\"n\">x</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>In both cases <code class=\"docutils literal notranslate\"><span class=\"pre\">c[0]</span></code> is converted to a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code> by this method.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">name</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">nin</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">nout</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">inputs</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">type</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">inames</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">onames</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">snames</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">pos</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">blockclass</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">verbose</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Construct a new block object.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>name</strong> (<em>str</em><em>, </em><em>optional</em>) – Name of the block, defaults to None</p></li>\n<li><p><strong>nin</strong> (<em>int</em><em>, </em><em>optional</em>) – Number of inputs, defaults to None</p></li>\n<li><p><strong>nout</strong> (<em>int</em><em>, </em><em>optional</em>) – Number of outputs, defaults to None</p></li>\n<li><p><strong>inputs</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em>, </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a><em> or </em><em>list of Block</em><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – Optional incoming connections</p></li>\n<li><p><strong>inames</strong> (<em>list of str</em><em>, </em><em>optional</em>) – Names of input ports, defaults to None</p></li>\n<li><p><strong>onames</strong> (<em>list of str</em><em>, </em><em>optional</em>) – Names of output ports, defaults to None</p></li>\n<li><p><strong>snames</strong> (<em>list of str</em><em>, </em><em>optional</em>) – Names of states, defaults to None</p></li>\n<li><p><strong>pos</strong> (<em>2-element tuple</em><em> or </em><em>list</em><em>, </em><em>optional</em>) – Position of block on the canvas, defaults to None</p></li>\n<li><p><strong>bd</strong> (<em>BlockDiagram</em><em>, </em><em>optional</em>) – Parent block diagram, defaults to None</p></li>\n<li><p><strong>verbose</strong> (<em>bool</em><em>, </em><em>optional</em>) – enable diagnostic prints, defaults to False</p></li>\n<li><p><strong>kwargs</strong> (<em>dict</em>) – Unused arguments</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>A Block superclass</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\">Block</a></p>\n</dd>\n</dl>\n<p>A block object is the superclass of all blocks in the simulation environment.</p>\n<p>This is the top-level initializer, and handles most options passed to\nthe superclass initializer for each block in the library.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__mul__\">\n<code class=\"sig-name descname\">__mul__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__mul__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__mul__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded * operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be multiplied</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be multiplied</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>PROD or GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the * operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">*</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">*</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">*</span> <span class=\"n\">C</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD(&quot;**&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_prod.N</span></code> whose inputs are the \nleft and right operands.</p>\n<p>For the third case, create a <code class=\"docutils literal notranslate\"><span class=\"pre\">GAIN(C)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_gain.N</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Signals are assumed to be scalars, but if <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a NumPy\narray then the option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> is set to True.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__rmul__\" title=\"bdsim.Block.__rmul__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__rmul__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Plug.__mul__\" title=\"bdsim.Plug.__mul__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__mul__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__neg__\">\n<code class=\"sig-name descname\">__neg__</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__neg__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__neg__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded unary minus operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be negated</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the - operator for unary minus when the operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"o\">-</span><span class=\"n\">X</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> is a block.</p>\n<p>Creates a <code class=\"docutils literal notranslate\"><span class=\"pre\">GAIN(-1)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_gain.N</span></code> whose input is the \noperand.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Plug.__neg__\" title=\"bdsim.Plug.__neg__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__neg__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__new__\">\n<em class=\"property\">static </em><code class=\"sig-name descname\">__new__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">cls</span></em>, <em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__new__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__new__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Construct a new Block object.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>cls</strong> (<em>class type</em>) – The class to construct</p></li>\n<li><p><strong>*args</strong> – <p>positional args passed to constructor</p>\n</p></li>\n<li><p><strong>**kwargs</strong> – <p>keyword args passed to constructor</p>\n</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>new Block instance</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block instance</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__radd__\">\n<code class=\"sig-name descname\">__radd__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__radd__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__radd__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded + operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be added</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be added</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the + operator\nwhen the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nand the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">+</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">+</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">C</span> <span class=\"o\">+</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Creates a <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM(&quot;++&quot;)</span> <span class=\"pre\">block</span> <span class=\"pre\">named</span> <span class=\"pre\">``_sum.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new <code class=\"docutils literal notranslate\"><span class=\"pre\">CONSTANT(C)</span></code> block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The inputs to the summing junction are reversed: right then left operand.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__add__\" title=\"bdsim.Block.__add__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__add__()</span></code></a> <code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug._r_add__()</span></code></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__repr__\">\n<code class=\"sig-name descname\">__repr__</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__repr__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__repr__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Return repr(self).</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__rmul__\">\n<code class=\"sig-name descname\">__rmul__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__rmul__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__rmul__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded * operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be multiplied</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be multiplied</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>PROD or GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the * operator when the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nand the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">*</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">*</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">C</span> <span class=\"o\">*</span> <span class=\"n\">Y</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>For the first two cases, a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD(&quot;**&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_prod.N</span></code> whose inputs are the \nleft and right operands.</p>\n<p>For the third case, create a <code class=\"docutils literal notranslate\"><span class=\"pre\">GAIN(C)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_gain.N</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Signals are assumed to be scalars, but if <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a NumPy\narray then the option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> is set to True.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__mul__\" title=\"bdsim.Block.__mul__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__mul__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Plug.__rmul__\" title=\"bdsim.Plug.__rmul__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__rmul__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__rshift__\">\n<code class=\"sig-name descname\">__rshift__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">right</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__rshift__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__rshift__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Operator for implicit wiring.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>left</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A block to be wired from</p></li>\n<li><p><strong>right</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A block or plugto be wired to</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p><code class=\"docutils literal notranslate\"><span class=\"pre\">right</span></code></p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\">Block</a> or <a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\">Plug</a></p>\n</dd>\n</dl>\n<p>Implements implicit wiring, for example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">a</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"o\">&gt;&gt;</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">GAIN</span><span class=\"p\">(</span><span class=\"mi\">2</span><span class=\"p\">)</span>\n</pre></div>\n</div>\n<p>will connect the output of the CONSTANT block to the input of the\nGAIN block.  The result will be GAIN block, whose output in this case\nwill be assigned to <code class=\"docutils literal notranslate\"><span class=\"pre\">a</span></code>.</p>\n<p>Note that:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">a</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"o\">&gt;&gt;</span> <span class=\"n\">func</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>will connect port 0 of CONSTANT to port 1 of <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>, and port 1 of <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>\nwill be assigned to <code class=\"docutils literal notranslate\"><span class=\"pre\">a</span></code>.  To specify a different outport port on <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>\nwe need to use parentheses:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">a</span> <span class=\"o\">=</span> <span class=\"p\">(</span><span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">)</span> <span class=\"o\">&gt;&gt;</span> <span class=\"n\">func</span><span class=\"p\">[</span><span class=\"mi\">1</span><span class=\"p\">])[</span><span class=\"mi\">0</span><span class=\"p\">]</span>\n</pre></div>\n</div>\n<p>which will connect port 0 of CONSTANT ` to port 1 of <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>, and port 0 of <code class=\"docutils literal notranslate\"><span class=\"pre\">func</span></code>\nwill be assigned to <code class=\"docutils literal notranslate\"><span class=\"pre\">a</span></code>.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p>Plug.__rshift__</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__rsub__\">\n<code class=\"sig-name descname\">__rsub__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__rsub__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__rsub__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded - operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be added (minuend)</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be subtracted (subtrahend)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the - operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">-</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">-</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">C</span> <span class=\"o\">-</span> <span class=\"n\">Y</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Creates a <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM(&quot;+-&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_sum.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new <code class=\"docutils literal notranslate\"><span class=\"pre\">CONSTANT(C)</span></code> block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The inputs to the summing junction are reversed: right then left operand.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__sub__\" title=\"bdsim.Block.__sub__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__sub__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Plug.__rsub__\" title=\"bdsim.Plug.__rsub__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__rsub__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__rtruediv__\">\n<code class=\"sig-name descname\">__rtruediv__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__rtruediv__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__rtruediv__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded / operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be multiplied (dividend)</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be divided (divisor)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>PROD block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the / operator when the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nand the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">/</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span><span class=\"p\">[</span><span class=\"n\">i</span><span class=\"p\">]</span> <span class=\"o\">/</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">C</span> <span class=\"o\">/</span> <span class=\"n\">Y</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>For the first two cases, a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD(&quot;*/&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_prod.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new CONSTANT block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Signals are assumed to be scalars, but if <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a NumPy\narray then the option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> is set to True.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__truediv__\" title=\"bdsim.Block.__truediv__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__truediv__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Plug.__rtruediv__\" title=\"bdsim.Plug.__rtruediv__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__rtruediv__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__setattr__\">\n<code class=\"sig-name descname\">__setattr__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">name</span></em>, <em class=\"sig-param\"><span class=\"n\">value</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__setattr__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__setattr__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Convert a LHS block name reference to a wire.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>name</strong> – Port name</p></li>\n<li><p><strong>value</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – the RHS</p></li>\n</ul>\n</dd>\n</dl>\n<p>Used to create a wired connection by assignment, for example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">c</span> <span class=\"o\">=</span> <span class=\"n\">bd</span><span class=\"o\">.</span><span class=\"n\">CONSTANT</span><span class=\"p\">(</span><span class=\"mi\">1</span><span class=\"p\">,</span> <span class=\"n\">inames</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;u&#39;</span><span class=\"p\">])</span>\n\n<span class=\"n\">c</span><span class=\"o\">.</span><span class=\"n\">u</span> <span class=\"o\">=</span> <span class=\"n\">x</span>\n</pre></div>\n</div>\n<p>Ths method is invoked to create a wire from <code class=\"docutils literal notranslate\"><span class=\"pre\">x</span></code> to port ‘u’ of\nthe constant block <code class=\"docutils literal notranslate\"><span class=\"pre\">c</span></code>.</p>\n<p>Notes:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>this overloaded method handles all instances of <code class=\"docutils literal notranslate\"><span class=\"pre\">setattr</span></code> and\nimplements normal functionality as well, only creating a wire\nif <code class=\"docutils literal notranslate\"><span class=\"pre\">name</span></code> is a known port name.</p></li>\n</ul>\n</div></blockquote>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__setitem__\">\n<code class=\"sig-name descname\">__setitem__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">port</span></em>, <em class=\"sig-param\"><span class=\"n\">src</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__setitem__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__setitem__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Convert a LHS block slice reference to a wire.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>port</strong> (<em>int</em>) – Port number</p></li>\n<li><p><strong>src</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – the RHS</p></li>\n</ul>\n</dd>\n</dl>\n<p>Used to create a wired connection by assignment, for example:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">X</span><span class=\"p\">[</span><span class=\"mi\">0</span><span class=\"p\">]</span> <span class=\"o\">=</span> <span class=\"n\">Y</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks. This method is implicitly invoked and\ncreates a wire from <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> to input port 0 of <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>The square brackets on the left-hand-side is critical, and\n<code class=\"docutils literal notranslate\"><span class=\"pre\">X</span> <span class=\"pre\">=</span> <span class=\"pre\">Y</span></code> will simply overwrite the reference to <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code>.</p>\n</div>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__str__\">\n<code class=\"sig-name descname\">__str__</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__str__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__str__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Return str(self).</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__sub__\">\n<code class=\"sig-name descname\">__sub__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__sub__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__sub__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded - operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be added (minuend)</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be subtracted (subtrahend)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>SUM block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the - operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">-</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">-</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">-</span> <span class=\"n\">C</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Creates a <code class=\"docutils literal notranslate\"><span class=\"pre\">SUM(&quot;+-&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_sum.N</span></code> whose inputs are the \nleft and right operands.  For the third case, a new <code class=\"docutils literal notranslate\"><span class=\"pre\">CONSTANT(C)</span></code> block\nnamed <code class=\"docutils literal notranslate\"><span class=\"pre\">_const.N</span></code> is also created.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__rsub__\" title=\"bdsim.Block.__rsub__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__rsub__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Plug.__sub__\" title=\"bdsim.Plug.__sub__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__sub__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.__truediv__\">\n<code class=\"sig-name descname\">__truediv__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">other</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.__truediv__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.__truediv__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Overloaded / operator for implicit block creation.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a>) – A signal (block) to be multiplied (dividend)</p></li>\n<li><p><strong>other</strong> (<a class=\"reference internal\" href=\"#bdsim.Block\" title=\"bdsim.Block\"><em>Block</em></a><em> or </em><a class=\"reference internal\" href=\"#bdsim.Plug\" title=\"bdsim.Plug\"><em>Plug</em></a>) – A signal (block or plug) to be divided (divisor)</p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>PROD or GAIN block</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>Block subclass</p>\n</dd>\n</dl>\n<p>This method is implicitly invoked by the / operator when the left operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code>\nand the right operand is a <code class=\"docutils literal notranslate\"><span class=\"pre\">Plug</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">Block</span></code> or constant:</p>\n<div class=\"highlight-default notranslate\"><div class=\"highlight\"><pre><span></span><span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">/</span> <span class=\"n\">Y</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">/</span> <span class=\"n\">Y</span><span class=\"p\">[</span><span class=\"n\">j</span><span class=\"p\">]</span>\n<span class=\"n\">result</span> <span class=\"o\">=</span> <span class=\"n\">X</span> <span class=\"o\">/</span> <span class=\"n\">C</span>\n</pre></div>\n</div>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">X</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">Y</span></code> are blocks and <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a Python or NumPy constant.</p>\n<p>Create a <code class=\"docutils literal notranslate\"><span class=\"pre\">PROD(&quot;**&quot;)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_prod.N</span></code> whose inputs are the \nleft and right operands.</p>\n<p>For the third case, create a <code class=\"docutils literal notranslate\"><span class=\"pre\">GAIN(1/C)</span></code> block named <code class=\"docutils literal notranslate\"><span class=\"pre\">_gain.N</span></code>.</p>\n<div class=\"admonition note\">\n<p class=\"admonition-title\">Note</p>\n<p>Signals are assumed to be scalars, but if <code class=\"docutils literal notranslate\"><span class=\"pre\">C</span></code> is a NumPy\narray then the option <code class=\"docutils literal notranslate\"><span class=\"pre\">matrix</span></code> is set to True.</p>\n</div>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.Block.__rtruediv__\" title=\"bdsim.Block.__rtruediv__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Block.__rtruediv__()</span></code></a> <a class=\"reference internal\" href=\"#bdsim.Plug.__truediv__\" title=\"bdsim.Plug.__truediv__\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">Plug.__truediv__()</span></code></a></p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.add_inport\">\n<code class=\"sig-name descname\">add_inport</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">w</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.add_inport\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.add_inport\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.add_outport\">\n<code class=\"sig-name descname\">add_outport</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">w</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.add_outport\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.add_outport\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.add_param\">\n<code class=\"sig-name descname\">add_param</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">param</span></em>, <em class=\"sig-param\"><span class=\"n\">handler</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.add_param\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.add_param\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.check\">\n<code class=\"sig-name descname\">check</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.check\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.check\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.done\">\n<code class=\"sig-name descname\">done</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.done\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.done\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.info\">\n<em class=\"property\">property </em><code class=\"sig-name descname\">info</code><a class=\"headerlink\" href=\"#bdsim.Block.info\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Interactive display of block properties.</p>\n<p>Displays all attributes of the block for debugging purposes.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.inport_names\">\n<code class=\"sig-name descname\">inport_names</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">names</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.inport_names\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.inport_names\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Set the names of block input ports.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>names</strong> (<em>list of str</em>) – List of port names</p>\n</dd>\n</dl>\n<p>Invoked by the <code class=\"docutils literal notranslate\"><span class=\"pre\">inames</span></code> argument to the Block constructor.</p>\n<p>The names can include LaTeX math markup.  The LaTeX version is used\nwhere appropriate, but the port names are a de-LaTeXd version of the\ngiven string with backslash, caret, braces and dollar signs\nremoved.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.isclocked\">\n<em class=\"property\">property </em><code class=\"sig-name descname\">isclocked</code><a class=\"headerlink\" href=\"#bdsim.Block.isclocked\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.isgraphics\">\n<em class=\"property\">property </em><code class=\"sig-name descname\">isgraphics</code><a class=\"headerlink\" href=\"#bdsim.Block.isgraphics\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.outport_names\">\n<code class=\"sig-name descname\">outport_names</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">names</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.outport_names\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.outport_names\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Set the names of block output ports.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>names</strong> (<em>list of str</em>) – List of port names</p>\n</dd>\n</dl>\n<p>Invoked by the <code class=\"docutils literal notranslate\"><span class=\"pre\">onames</span></code> argument to the Block constructor.</p>\n<p>The names can include LaTeX math markup.  The LaTeX version is used\nwhere appropriate, but the port names are a de-LaTeXd version of the\ngiven string with backslash, caret, braces and dollar signs\nremoved.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.reset\">\n<code class=\"sig-name descname\">reset</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.reset\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.reset\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.savefig\">\n<code class=\"sig-name descname\">savefig</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">pos</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.savefig\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.savefig\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.set_param\">\n<code class=\"sig-name descname\">set_param</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">name</span></em>, <em class=\"sig-param\"><span class=\"n\">newvalue</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.set_param\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.set_param\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.setinput\">\n<code class=\"sig-name descname\">setinput</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">port</span></em>, <em class=\"sig-param\"><span class=\"n\">value</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.setinput\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.setinput\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Receive input from a wire</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>self</strong> – Block to be updated</p></li>\n<li><p><strong>port</strong> (<em>int</em>) – Input port to be updated</p></li>\n<li><p><strong>value</strong> – Input value</p></li>\n</ul>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.setinputs\">\n<code class=\"sig-name descname\">setinputs</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">pos</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.setinputs\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.setinputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.sourcename\">\n<code class=\"sig-name descname\">sourcename</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">port</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.sourcename\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.sourcename\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Get the name of output port driving this input port.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>port</strong> (<em>int</em>) – Input port</p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>Port name</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p>str</p>\n</dd>\n</dl>\n<p>Return the name of the output port that drives the specified input\nport. The name can be:</p>\n<blockquote>\n<div><ul class=\"simple\">\n<li><p>a LaTeX string if provided</p></li>\n<li><p>block name with port number given in square brackets.  The block\nname will the one optionally assigned by the user using the <code class=\"docutils literal notranslate\"><span class=\"pre\">name</span></code>\nkeyword, otherwise a systematic default name.</p></li>\n</ul>\n</div></blockquote>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Seealso</dt>\n<dd class=\"field-odd\"><p>outport_names</p>\n</dd>\n</dl>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.start\">\n<code class=\"sig-name descname\">start</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.start\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.start\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.state_names\">\n<code class=\"sig-name descname\">state_names</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">names</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.state_names\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.state_names\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Block.step\">\n<code class=\"sig-name descname\">step</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Block.step\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Block.step\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.Block.varinputs\">\n<code class=\"sig-name descname\">varinputs</code><em class=\"property\"> = False</em><a class=\"headerlink\" href=\"#bdsim.Block.varinputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.Block.varoutputs\">\n<code class=\"sig-name descname\">varoutputs</code><em class=\"property\"> = False</em><a class=\"headerlink\" href=\"#bdsim.Block.varoutputs\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n<div class=\"section\" id=\"source-block\">\n<h4>Source block<a class=\"headerlink\" href=\"#source-block\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"bdsim.SourceBlock\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">SourceBlock</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#SourceBlock\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.SourceBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.Block</span></code></p>\n<p>A SourceBlock is a subclass of Block that represents a block that has outputs\nbut no inputs.  Its output is a function of parameters and time.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.SourceBlock.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#SourceBlock.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.SourceBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a source block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>source block base class</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.SourceBlock\" title=\"bdsim.SourceBlock\">SourceBlock</a></p>\n</dd>\n</dl>\n<p>This is the parent class of all source blocks.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.SourceBlock.__module__\">\n<code class=\"sig-name descname\">__module__</code><em class=\"property\"> = 'bdsim.components'</em><a class=\"headerlink\" href=\"#bdsim.SourceBlock.__module__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.SourceBlock.blockclass\">\n<code class=\"sig-name descname\">blockclass</code><em class=\"property\"> = 'source'</em><a class=\"headerlink\" href=\"#bdsim.SourceBlock.blockclass\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"sink-block\">\n<h4>Sink block<a class=\"headerlink\" href=\"#sink-block\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"bdsim.SinkBlock\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">SinkBlock</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#SinkBlock\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.SinkBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.Block</span></code></p>\n<p>A SinkBlock is a subclass of Block that represents a block that has inputs\nbut no outputs. Typically used to save data to a variable, file or \ngraphics.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.SinkBlock.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#SinkBlock.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.SinkBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a sink block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>sink block base class</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.SinkBlock\" title=\"bdsim.SinkBlock\">SinkBlock</a></p>\n</dd>\n</dl>\n<p>This is the parent class of all sink blocks.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.SinkBlock.__module__\">\n<code class=\"sig-name descname\">__module__</code><em class=\"property\"> = 'bdsim.components'</em><a class=\"headerlink\" href=\"#bdsim.SinkBlock.__module__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.SinkBlock.blockclass\">\n<code class=\"sig-name descname\">blockclass</code><em class=\"property\"> = 'sink'</em><a class=\"headerlink\" href=\"#bdsim.SinkBlock.blockclass\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"function-block\">\n<h4>Function block<a class=\"headerlink\" href=\"#function-block\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"bdsim.FunctionBlock\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">FunctionBlock</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#FunctionBlock\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.FunctionBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.Block</span></code></p>\n<p>A FunctionBlock is a subclass of Block that represents a block that has inputs\nand outputs but no state variables.  Typically used to describe operations\nsuch as gain, summation or various mappings.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.FunctionBlock.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#FunctionBlock.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.FunctionBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a function block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>function block base class</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.FunctionBlock\" title=\"bdsim.FunctionBlock\">FunctionBlock</a></p>\n</dd>\n</dl>\n<p>This is the parent class of all function blocks.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.FunctionBlock.__module__\">\n<code class=\"sig-name descname\">__module__</code><em class=\"property\"> = 'bdsim.components'</em><a class=\"headerlink\" href=\"#bdsim.FunctionBlock.__module__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.FunctionBlock.blockclass\">\n<code class=\"sig-name descname\">blockclass</code><em class=\"property\"> = 'function'</em><a class=\"headerlink\" href=\"#bdsim.FunctionBlock.blockclass\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"transfer-function-block\">\n<h4>Transfer function block<a class=\"headerlink\" href=\"#transfer-function-block\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"bdsim.TransferBlock\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">TransferBlock</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#TransferBlock\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.TransferBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.Block</span></code></p>\n<p>A TransferBlock is a subclass of Block that represents a block with inputs\noutputs and states. Typically used to describe a continuous time dynamic\nsystem, either linear or nonlinear.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.TransferBlock.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">nstates</span><span class=\"o\">=</span><span class=\"default_value\">1</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#TransferBlock.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.TransferBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a transfer function block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>transfer function block base class</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.TransferBlock\" title=\"bdsim.TransferBlock\">TransferBlock</a></p>\n</dd>\n</dl>\n<p>This is the parent class of all transfer function blocks.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.TransferBlock.__module__\">\n<code class=\"sig-name descname\">__module__</code><em class=\"property\"> = 'bdsim.components'</em><a class=\"headerlink\" href=\"#bdsim.TransferBlock.__module__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.TransferBlock.blockclass\">\n<code class=\"sig-name descname\">blockclass</code><em class=\"property\"> = 'transfer'</em><a class=\"headerlink\" href=\"#bdsim.TransferBlock.blockclass\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.TransferBlock.check\">\n<code class=\"sig-name descname\">check</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#TransferBlock.check\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.TransferBlock.check\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.TransferBlock.getstate0\">\n<code class=\"sig-name descname\">getstate0</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#TransferBlock.getstate0\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.TransferBlock.getstate0\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.TransferBlock.reset\">\n<code class=\"sig-name descname\">reset</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#TransferBlock.reset\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.TransferBlock.reset\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.TransferBlock.setstate\">\n<code class=\"sig-name descname\">setstate</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">x</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#TransferBlock.setstate\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.TransferBlock.setstate\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"subsystem-block\">\n<h4>Subsystem block<a class=\"headerlink\" href=\"#subsystem-block\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"bdsim.SubsystemBlock\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">SubsystemBlock</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#SubsystemBlock\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.SubsystemBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.Block</span></code></p>\n<p>A SubSystem  s a subclass of Block that represents a block that has inputs\nand outputs but no state variables.  Typically used to describe operations\nsuch as gain, summation or various mappings.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.SubsystemBlock.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#SubsystemBlock.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.SubsystemBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a subsystem block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>subsystem block base class</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.SubsystemBlock\" title=\"bdsim.SubsystemBlock\">SubsystemBlock</a></p>\n</dd>\n</dl>\n<p>This is the parent class of all subsystem blocks.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.SubsystemBlock.__module__\">\n<code class=\"sig-name descname\">__module__</code><em class=\"property\"> = 'bdsim.components'</em><a class=\"headerlink\" href=\"#bdsim.SubsystemBlock.__module__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.SubsystemBlock.blockclass\">\n<code class=\"sig-name descname\">blockclass</code><em class=\"property\"> = 'subsystem'</em><a class=\"headerlink\" href=\"#bdsim.SubsystemBlock.blockclass\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n<div class=\"section\" id=\"graphics-block\">\n<h4>Graphics block<a class=\"headerlink\" href=\"#graphics-block\" title=\"Permalink to this headline\">¶</a></h4>\n<dl class=\"py class\">\n<dt id=\"bdsim.GraphicsBlock\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">GraphicsBlock</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/graphics.html#GraphicsBlock\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.SinkBlock</span></code></p>\n<p>A GraphicsBlock is a subclass of SinkBlock that represents a block that has inputs\nbut no outputs and creates/updates a graphical display.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.GraphicsBlock.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">movie</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/graphics.html#GraphicsBlock.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a graphical display block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>movie</strong> (<em>str</em><em>, </em><em>optional</em>) – Save animation in this file in MP4 format, defaults to None</p></li>\n<li><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p></li>\n</ul>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>transfer function block base class</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.TransferBlock\" title=\"bdsim.TransferBlock\">TransferBlock</a></p>\n</dd>\n</dl>\n<p>This is the parent class of all graphic display blocks.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.GraphicsBlock.__module__\">\n<code class=\"sig-name descname\">__module__</code><em class=\"property\"> = 'bdsim.graphics'</em><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock.__module__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.GraphicsBlock.blockclass\">\n<code class=\"sig-name descname\">blockclass</code><em class=\"property\"> = 'graphics'</em><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock.blockclass\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.GraphicsBlock.create_figure\">\n<code class=\"sig-name descname\">create_figure</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">state</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/graphics.html#GraphicsBlock.create_figure\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock.create_figure\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.GraphicsBlock.done\">\n<code class=\"sig-name descname\">done</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">block</span><span class=\"o\">=</span><span class=\"default_value\">False</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/graphics.html#GraphicsBlock.done\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock.done\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.GraphicsBlock.savefig\">\n<code class=\"sig-name descname\">savefig</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">filename</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"n\">format</span><span class=\"o\">=</span><span class=\"default_value\">'pdf'</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/graphics.html#GraphicsBlock.savefig\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock.savefig\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Save the figure as an image file</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><ul class=\"simple\">\n<li><p><strong>fname</strong> (<em>str</em>) – Name of file to save graphics to</p></li>\n<li><p><strong>**kwargs</strong> – Options passed to <a class=\"reference external\" href=\"https://matplotlib.org/3.2.2/api/_as_gen/matplotlib.pyplot.savefig.html\">savefig</a></p></li>\n</ul>\n</dd>\n</dl>\n<p>The file format is taken from the file extension and can be\njpeg, png or pdf.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.GraphicsBlock.start\">\n<code class=\"sig-name descname\">start</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/graphics.html#GraphicsBlock.start\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock.start\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.GraphicsBlock.step\">\n<code class=\"sig-name descname\">step</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/graphics.html#GraphicsBlock.step\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.GraphicsBlock.step\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n</div>\n<div class=\"section\" id=\"discrete-time-systems\">\n<h3>Discrete-time systems<a class=\"headerlink\" href=\"#discrete-time-systems\" title=\"Permalink to this headline\">¶</a></h3>\n<dl class=\"py class\">\n<dt id=\"bdsim.ClockedBlock\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">ClockedBlock</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"o\">*</span><span class=\"n\">args</span></em>, <em class=\"sig-param\"><span class=\"n\">bd</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">kwargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#ClockedBlock\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.ClockedBlock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">bdsim.components.Block</span></code></p>\n<p>A ClockedBlock is a subclass of Block that represents a block with inputs\noutputs and discrete states. Typically used to describe a discrete time dynamic\nsystem, either linear or nonlinear.</p>\n<dl class=\"py method\">\n<dt id=\"bdsim.ClockedBlock.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">clock</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em>, <em class=\"sig-param\"><span class=\"o\">**</span><span class=\"n\">blockargs</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#ClockedBlock.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.ClockedBlock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Create a clocked block.</p>\n<dl class=\"field-list simple\">\n<dt class=\"field-odd\">Parameters</dt>\n<dd class=\"field-odd\"><p><strong>blockargs</strong> (<em>dict</em>) – <span class=\"raw-html\"><a href=\"https://petercorke.github.io/bdsim/internals.html?highlight=block%20__init__#bdsim.Block.__init__\">common Block options</a></span></p>\n</dd>\n<dt class=\"field-even\">Returns</dt>\n<dd class=\"field-even\"><p>clocked block base class</p>\n</dd>\n<dt class=\"field-odd\">Return type</dt>\n<dd class=\"field-odd\"><p><a class=\"reference internal\" href=\"#bdsim.ClockedBlock\" title=\"bdsim.ClockedBlock\">ClockedBlock</a></p>\n</dd>\n</dl>\n<p>This is the parent class of all clocked blocks.</p>\n</dd></dl>\n\n<dl class=\"py attribute\">\n<dt id=\"bdsim.ClockedBlock.blockclass\">\n<code class=\"sig-name descname\">blockclass</code><em class=\"property\"> = 'clocked'</em><a class=\"headerlink\" href=\"#bdsim.ClockedBlock.blockclass\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.ClockedBlock.check\">\n<code class=\"sig-name descname\">check</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#ClockedBlock.check\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.ClockedBlock.check\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.ClockedBlock.getstate0\">\n<code class=\"sig-name descname\">getstate0</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#ClockedBlock.getstate0\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.ClockedBlock.getstate0\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.ClockedBlock.reset\">\n<code class=\"sig-name descname\">reset</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#ClockedBlock.reset\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.ClockedBlock.reset\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.ClockedBlock.setstate\">\n<code class=\"sig-name descname\">setstate</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">x</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#ClockedBlock.setstate\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.ClockedBlock.setstate\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.Clock\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">Clock</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">arg</span></em>, <em class=\"sig-param\"><span class=\"n\">unit</span><span class=\"o\">=</span><span class=\"default_value\">'s'</span></em>, <em class=\"sig-param\"><span class=\"n\">offset</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">name</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">arg</span></em>, <em class=\"sig-param\"><span class=\"n\">unit</span><span class=\"o\">=</span><span class=\"default_value\">'s'</span></em>, <em class=\"sig-param\"><span class=\"n\">offset</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em>, <em class=\"sig-param\"><span class=\"n\">name</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Initialize self.  See help(type(self)) for accurate signature.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.add_block\">\n<code class=\"sig-name descname\">add_block</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">block</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.add_block\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.add_block\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.getstate\">\n<code class=\"sig-name descname\">getstate</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.getstate\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.getstate\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.getstate0\">\n<code class=\"sig-name descname\">getstate0</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.getstate0\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.getstate0\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.next_event\">\n<code class=\"sig-name descname\">next_event</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.next_event\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.next_event\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.savestate\">\n<code class=\"sig-name descname\">savestate</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">t</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.savestate\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.savestate\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.setstate\">\n<code class=\"sig-name descname\">setstate</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.setstate\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.setstate\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.start\">\n<code class=\"sig-name descname\">start</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">state</span><span class=\"o\">=</span><span class=\"default_value\">None</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.start\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.start\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.Clock.time\">\n<code class=\"sig-name descname\">time</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">i</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#Clock.time\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.Clock.time\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n<dl class=\"py class\">\n<dt id=\"bdsim.PriorityQ\">\n<em class=\"property\">class </em><code class=\"sig-prename descclassname\">bdsim.</code><code class=\"sig-name descname\">PriorityQ</code><a class=\"reference internal\" href=\"_modules/bdsim/components.html#PriorityQ\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.PriorityQ\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Bases: <code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">object</span></code></p>\n<dl class=\"py method\">\n<dt id=\"bdsim.PriorityQ.__init__\">\n<code class=\"sig-name descname\">__init__</code><span class=\"sig-paren\">(</span><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#PriorityQ.__init__\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.PriorityQ.__init__\" title=\"Permalink to this definition\">¶</a></dt>\n<dd><p>Initialize self.  See help(type(self)) for accurate signature.</p>\n</dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.PriorityQ.pop\">\n<code class=\"sig-name descname\">pop</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">dt</span><span class=\"o\">=</span><span class=\"default_value\">0</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#PriorityQ.pop\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.PriorityQ.pop\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.PriorityQ.pop_until\">\n<code class=\"sig-name descname\">pop_until</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">t</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#PriorityQ.pop_until\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.PriorityQ.pop_until\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n<dl class=\"py method\">\n<dt id=\"bdsim.PriorityQ.push\">\n<code class=\"sig-name descname\">push</code><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\">value</span></em><span class=\"sig-paren\">)</span><a class=\"reference internal\" href=\"_modules/bdsim/components.html#PriorityQ.push\"><span class=\"viewcode-link\">[source]</span></a><a class=\"headerlink\" href=\"#bdsim.PriorityQ.push\" title=\"Permalink to this definition\">¶</a></dt>\n<dd></dd></dl>\n\n</dd></dl>\n\n</div>\n</div>\n</div>\n\n\n           </div>\n          </div>\n          <footer><div class=\"rst-footer-buttons\" role=\"navigation\" aria-label=\"Footer\">\n        <a href=\"bdsim.blocks.html\" class=\"btn btn-neutral float-left\" title=\"Block library\" accesskey=\"p\" rel=\"prev\"><span class=\"fa fa-arrow-circle-left\" aria-hidden=\"true\"></span> Previous</a>\n    </div>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/modules.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>bdsim &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n        <script src=\"_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>bdsim</li>\n      <li class=\"wy-breadcrumbs-aside\">\n            <a href=\"_sources/modules.rst.txt\" rel=\"nofollow\"> View page source</a>\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <div class=\"section\" id=\"bdsim\">\n<h1>bdsim<a class=\"headerlink\" href=\"#bdsim\" title=\"Permalink to this headline\">¶</a></h1>\n<div class=\"toctree-wrapper compound\">\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a><ul>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.html#getting-started\">Getting started</a></li>\n<li class=\"toctree-l2\"><a class=\"reference internal\" href=\"bdsim.html#using-operator-overloading\">Using operator overloading</a></li>\n</ul>\n</li>\n</ul>\n</div>\n</div>\n\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/py-modindex.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>Python Module Index &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"_static/graphviz.css\" type=\"text/css\" />\n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n        <script src=\"_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"_static/js/theme.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"search.html\" />\n \n\n\n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"search.html\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>Python Module Index</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n\n   <h1>Python Module Index</h1>\n\n   <div class=\"modindex-jumpbox\">\n   <a href=\"#cap-b\"><strong>b</strong></a> | \n   <a href=\"#cap-m\"><strong>m</strong></a> | \n   <a href=\"#cap-r\"><strong>r</strong></a>\n   </div>\n\n   <table class=\"indextable modindextable\">\n     <tr class=\"pcap\"><td></td><td>&#160;</td><td></td></tr>\n     <tr class=\"cap\" id=\"cap-b\"><td></td><td>\n       <strong>b</strong></td><td></td></tr>\n     <tr>\n       <td><img src=\"_static/minus.png\" class=\"toggler\"\n              id=\"toggle-1\" style=\"display: none\" alt=\"-\" /></td>\n       <td>\n       <code class=\"xref\">bdsim</code></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-bdsim.blocks.connections\"><code class=\"xref\">bdsim.blocks.connections</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-bdsim.blocks.discrete\"><code class=\"xref\">bdsim.blocks.discrete</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-bdsim.blocks.functions\"><code class=\"xref\">bdsim.blocks.functions</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-bdsim.blocks.linalg\"><code class=\"xref\">bdsim.blocks.linalg</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-bdsim.blocks.sinks\"><code class=\"xref\">bdsim.blocks.sinks</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-bdsim.blocks.sources\"><code class=\"xref\">bdsim.blocks.sources</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-1\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-bdsim.blocks.transfers\"><code class=\"xref\">bdsim.blocks.transfers</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"pcap\"><td></td><td>&#160;</td><td></td></tr>\n     <tr class=\"cap\" id=\"cap-m\"><td></td><td>\n       <strong>m</strong></td><td></td></tr>\n     <tr>\n       <td><img src=\"_static/minus.png\" class=\"toggler\"\n              id=\"toggle-2\" style=\"display: none\" alt=\"-\" /></td>\n       <td>\n       <code class=\"xref\">machinevisiontoolbox</code></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-2\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-machinevisiontoolbox.blocks\"><code class=\"xref\">machinevisiontoolbox.blocks</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"pcap\"><td></td><td>&#160;</td><td></td></tr>\n     <tr class=\"cap\" id=\"cap-r\"><td></td><td>\n       <strong>r</strong></td><td></td></tr>\n     <tr>\n       <td><img src=\"_static/minus.png\" class=\"toggler\"\n              id=\"toggle-3\" style=\"display: none\" alt=\"-\" /></td>\n       <td>\n       <code class=\"xref\">roboticstoolbox</code></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-3\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.arm\"><code class=\"xref\">roboticstoolbox.blocks.arm</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-3\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.mobile\"><code class=\"xref\">roboticstoolbox.blocks.mobile</code></a></td><td>\n       <em></em></td></tr>\n     <tr class=\"cg-3\">\n       <td></td>\n       <td>&#160;&#160;&#160;\n       <a href=\"bdsim.blocks.html#module-roboticstoolbox.blocks.uav\"><code class=\"xref\">roboticstoolbox.blocks.uav</code></a></td><td>\n       <em></em></td></tr>\n   </table>\n\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script> \n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/search.html",
    "content": "<!DOCTYPE html>\n<html class=\"writer-html5\" lang=\"en\" >\n<head>\n  <meta charset=\"utf-8\" />\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n  <title>Search &mdash; Block diagram simulation 0.7 documentation</title><link rel=\"stylesheet\" href=\"_static/css/theme.css\" type=\"text/css\" />\n    <link rel=\"stylesheet\" href=\"_static/pygments.css\" type=\"text/css\" />\n      <link rel=\"stylesheet\" href=\"_static/graphviz.css\" type=\"text/css\" />\n    \n  <!--[if lt IE 9]>\n    <script src=\"_static/js/html5shiv.min.js\"></script>\n  <![endif]-->\n  <script id=\"documentation_options\" data-url_root=\"./\" src=\"_static/documentation_options.js\"></script>\n        <script src=\"_static/jquery.js\"></script>\n        <script src=\"_static/underscore.js\"></script>\n        <script src=\"_static/doctools.js\"></script>\n        <script src=\"_static/language_data.js\"></script>\n        <script async=\"async\" src=\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML\"></script>\n    <script src=\"_static/js/theme.js\"></script>\n    <script src=\"_static/searchtools.js\"></script>\n    <script src=\"_static/language_data.js\"></script>\n    <link rel=\"index\" title=\"Index\" href=\"genindex.html\" />\n    <link rel=\"search\" title=\"Search\" href=\"#\" /> \n</head>\n\n<body class=\"wy-body-for-nav\"> \n  <div class=\"wy-grid-for-nav\">\n    <nav data-toggle=\"wy-nav-shift\" class=\"wy-nav-side\">\n      <div class=\"wy-side-scroll\">\n        <div class=\"wy-side-nav-search\" >\n            <a href=\"index.html\" class=\"icon icon-home\"> Block diagram simulation<img src=\"_static/BDSimLogo_NoBackgnd@2x.png\" class=\"logo\" alt=\"Logo\"/>\n          </a>\n<div role=\"search\">\n  <form id=\"rtd-search-form\" class=\"wy-form\" action=\"#\" method=\"get\">\n    <input type=\"text\" name=\"q\" placeholder=\"Search docs\" />\n    <input type=\"hidden\" name=\"check_keywords\" value=\"yes\" />\n    <input type=\"hidden\" name=\"area\" value=\"default\" />\n  </form>\n</div>\n        </div><div class=\"wy-menu wy-menu-vertical\" data-spy=\"affix\" role=\"navigation\" aria-label=\"Navigation menu\">\n              <p class=\"caption\"><span class=\"caption-text\">Code documentation:</span></p>\n<ul>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.html\">Overview</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"bdsim.blocks.html\">Block library</a></li>\n<li class=\"toctree-l1\"><a class=\"reference internal\" href=\"internals.html\">Supporting classes</a></li>\n</ul>\n\n        </div>\n      </div>\n    </nav>\n\n    <section data-toggle=\"wy-nav-shift\" class=\"wy-nav-content-wrap\"><nav class=\"wy-nav-top\" aria-label=\"Mobile navigation menu\" >\n          <i data-toggle=\"wy-nav-top\" class=\"fa fa-bars\"></i>\n          <a href=\"index.html\">Block diagram simulation</a>\n      </nav>\n\n      <div class=\"wy-nav-content\">\n        <div class=\"rst-content\">\n          <div role=\"navigation\" aria-label=\"Page navigation\">\n  <ul class=\"wy-breadcrumbs\">\n      <li><a href=\"index.html\" class=\"icon icon-home\"></a> &raquo;</li>\n      <li>Search</li>\n      <li class=\"wy-breadcrumbs-aside\">\n      </li>\n  </ul>\n  <hr/>\n</div>\n          <div role=\"main\" class=\"document\" itemscope=\"itemscope\" itemtype=\"http://schema.org/Article\">\n           <div itemprop=\"articleBody\">\n             \n  <noscript>\n  <div id=\"fallback\" class=\"admonition warning\">\n    <p class=\"last\">\n      Please activate JavaScript to enable the search functionality.\n    </p>\n  </div>\n  </noscript>\n\n  \n  <div id=\"search-results\">\n  \n  </div>\n\n           </div>\n          </div>\n          <footer>\n\n  <hr/>\n\n  <div role=\"contentinfo\">\n    <p>&#169; Copyright 2020, Peter Corke.\n      <span class=\"lastupdated\">Last updated on 29-Dec-2021.\n      </span></p>\n  </div>\n\n  Built with <a href=\"https://www.sphinx-doc.org/\">Sphinx</a> using a\n    <a href=\"https://github.com/readthedocs/sphinx_rtd_theme\">theme</a>\n    provided by <a href=\"https://readthedocs.org\">Read the Docs</a>.\n   \n\n</footer>\n        </div>\n      </div>\n    </section>\n  </div>\n  <script>\n      jQuery(function () {\n          SphinxRtdTheme.Navigation.enable(true);\n      });\n  </script>\n    <!-- Theme Analytics -->\n    <script async src=\"https://www.googletagmanager.com/gtag/js?id=G-11Q6WJM565\"></script>\n    <script>\n      window.dataLayer = window.dataLayer || [];\n      function gtag(){dataLayer.push(arguments);}\n      gtag('js', new Date());\n\n      gtag('config', 'G-11Q6WJM565', {\n          'anonymize_ip': false,\n      });\n    </script>\n  <script>\n    jQuery(function() { Search.loadIndex(\"searchindex.js\"); });\n  </script>\n  \n  <script id=\"searchindexloader\"></script>\n   \n\n\n</body>\n</html>"
  },
  {
    "path": "docs-aside/searchindex.js",
    "content": "Search.setIndex({docnames:[\"bdsim\",\"bdsim.blocks\",\"index\",\"internals\",\"modules\"],envversion:{\"sphinx.domains.c\":2,\"sphinx.domains.changeset\":1,\"sphinx.domains.citation\":1,\"sphinx.domains.cpp\":3,\"sphinx.domains.index\":1,\"sphinx.domains.javascript\":2,\"sphinx.domains.math\":2,\"sphinx.domains.python\":2,\"sphinx.domains.rst\":2,\"sphinx.domains.std\":1,\"sphinx.ext.todo\":2,\"sphinx.ext.viewcode\":1,sphinx:56},filenames:[\"bdsim.rst\",\"bdsim.blocks.rst\",\"index.rst\",\"internals.rst\",\"modules.rst\"],objects:{\"bdsim.BDSim\":{__init__:[3,1,1,\"\"],blockdiagram:[3,1,1,\"\"],blocks:[3,1,1,\"\"],closefigs:[3,1,1,\"\"],done:[3,1,1,\"\"],get_options:[3,1,1,\"\"],load_blocks:[3,1,1,\"\"],options:[3,2,1,\"\"],progress:[3,1,1,\"\"],progress_done:[3,1,1,\"\"],run:[3,1,1,\"\"],run_interval:[3,1,1,\"\"],savefig:[3,1,1,\"\"],savefigs:[3,1,1,\"\"],set_options:[3,1,1,\"\"],showgraph:[3,1,1,\"\"]},\"bdsim.BDSimState\":{__init__:[3,1,1,\"\"],declare_event:[3,1,1,\"\"]},\"bdsim.Block\":{__add__:[3,1,1,\"\"],__getitem__:[3,1,1,\"\"],__init__:[3,1,1,\"\"],__mul__:[3,1,1,\"\"],__neg__:[3,1,1,\"\"],__new__:[3,1,1,\"\"],__radd__:[3,1,1,\"\"],__repr__:[3,1,1,\"\"],__rmul__:[3,1,1,\"\"],__rshift__:[3,1,1,\"\"],__rsub__:[3,1,1,\"\"],__rtruediv__:[3,1,1,\"\"],__setattr__:[3,1,1,\"\"],__setitem__:[3,1,1,\"\"],__str__:[3,1,1,\"\"],__sub__:[3,1,1,\"\"],__truediv__:[3,1,1,\"\"],add_inport:[3,1,1,\"\"],add_outport:[3,1,1,\"\"],add_param:[3,1,1,\"\"],check:[3,1,1,\"\"],done:[3,1,1,\"\"],info:[3,1,1,\"\"],inport_names:[3,1,1,\"\"],isclocked:[3,1,1,\"\"],isgraphics:[3,1,1,\"\"],outport_names:[3,1,1,\"\"],reset:[3,1,1,\"\"],savefig:[3,1,1,\"\"],set_param:[3,1,1,\"\"],setinput:[3,1,1,\"\"],setinputs:[3,1,1,\"\"],sourcename:[3,1,1,\"\"],start:[3,1,1,\"\"],state_names:[3,1,1,\"\"],step:[3,1,1,\"\"],varinputs:[3,2,1,\"\"],varoutputs:[3,2,1,\"\"]},\"bdsim.Clock\":{__init__:[3,1,1,\"\"],add_block:[3,1,1,\"\"],getstate0:[3,1,1,\"\"],getstate:[3,1,1,\"\"],next_event:[3,1,1,\"\"],savestate:[3,1,1,\"\"],setstate:[3,1,1,\"\"],start:[3,1,1,\"\"],time:[3,1,1,\"\"]},\"bdsim.ClockedBlock\":{__init__:[3,1,1,\"\"],blockclass:[3,2,1,\"\"],check:[3,1,1,\"\"],getstate0:[3,1,1,\"\"],reset:[3,1,1,\"\"],setstate:[3,1,1,\"\"]},\"bdsim.FunctionBlock\":{__init__:[3,1,1,\"\"],__module__:[3,2,1,\"\"],blockclass:[3,2,1,\"\"]},\"bdsim.GraphicsBlock\":{__init__:[3,1,1,\"\"],__module__:[3,2,1,\"\"],blockclass:[3,2,1,\"\"],create_figure:[3,1,1,\"\"],done:[3,1,1,\"\"],savefig:[3,1,1,\"\"],start:[3,1,1,\"\"],step:[3,1,1,\"\"]},\"bdsim.Plug\":{__add__:[3,1,1,\"\"],__init__:[3,1,1,\"\"],__mul__:[3,1,1,\"\"],__neg__:[3,1,1,\"\"],__radd__:[3,1,1,\"\"],__repr__:[3,1,1,\"\"],__rmul__:[3,1,1,\"\"],__rshift__:[3,1,1,\"\"],__rsub__:[3,1,1,\"\"],__rtruediv__:[3,1,1,\"\"],__sub__:[3,1,1,\"\"],__truediv__:[3,1,1,\"\"],isslice:[3,1,1,\"\"],portlist:[3,1,1,\"\"],width:[3,1,1,\"\"]},\"bdsim.PriorityQ\":{__init__:[3,1,1,\"\"],pop:[3,1,1,\"\"],pop_until:[3,1,1,\"\"],push:[3,1,1,\"\"]},\"bdsim.SinkBlock\":{__init__:[3,1,1,\"\"],__module__:[3,2,1,\"\"],blockclass:[3,2,1,\"\"]},\"bdsim.SourceBlock\":{__init__:[3,1,1,\"\"],__module__:[3,2,1,\"\"],blockclass:[3,2,1,\"\"]},\"bdsim.Struct\":{__init__:[3,1,1,\"\"],add:[3,1,1,\"\"]},\"bdsim.SubsystemBlock\":{__init__:[3,1,1,\"\"],__module__:[3,2,1,\"\"],blockclass:[3,2,1,\"\"]},\"bdsim.TransferBlock\":{__init__:[3,1,1,\"\"],__module__:[3,2,1,\"\"],blockclass:[3,2,1,\"\"],check:[3,1,1,\"\"],getstate0:[3,1,1,\"\"],reset:[3,1,1,\"\"],setstate:[3,1,1,\"\"]},\"bdsim.Wire\":{fullname:[3,1,1,\"\"],info:[3,1,1,\"\"],send:[3,1,1,\"\"]},\"bdsim.blocks\":{connections:[1,3,0,\"-\"],discrete:[1,3,0,\"-\"],functions:[1,3,0,\"-\"],linalg:[1,3,0,\"-\"],sinks:[1,3,0,\"-\"],sources:[1,3,0,\"-\"],transfers:[1,3,0,\"-\"]},\"bdsim.blocks.connections\":{DeMux:[1,0,1,\"\"],Dict:[1,0,1,\"\"],InPort:[1,0,1,\"\"],Index:[1,0,1,\"\"],Item:[1,0,1,\"\"],Mux:[1,0,1,\"\"],OutPort:[1,0,1,\"\"],SubSystem:[1,0,1,\"\"]},\"bdsim.blocks.connections.DeMux\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.connections.Dict\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.connections.InPort\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.connections.Index\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.connections.Item\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.connections.Mux\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.connections.OutPort\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.connections.SubSystem\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.discrete\":{DIntegrator:[1,0,1,\"\"],DPoseIntegrator:[1,0,1,\"\"],ZOH:[1,0,1,\"\"]},\"bdsim.blocks.discrete.DIntegrator\":{__init__:[1,1,1,\"\"],next:[1,1,1,\"\"]},\"bdsim.blocks.discrete.DPoseIntegrator\":{__init__:[1,1,1,\"\"],next:[1,1,1,\"\"]},\"bdsim.blocks.discrete.ZOH\":{__init__:[1,1,1,\"\"],next:[1,1,1,\"\"]},\"bdsim.blocks.functions\":{Clip:[1,0,1,\"\"],Function:[1,0,1,\"\"],Gain:[1,0,1,\"\"],Interpolate:[1,0,1,\"\"],Prod:[1,0,1,\"\"],Sum:[1,0,1,\"\"]},\"bdsim.blocks.functions.Clip\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.functions.Function\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.functions.Gain\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.functions.Interpolate\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.functions.Prod\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.functions.Sum\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.linalg\":{Cond:[1,0,1,\"\"],Det:[1,0,1,\"\"],Flatten:[1,0,1,\"\"],Inverse:[1,0,1,\"\"],Norm:[1,0,1,\"\"],Slice1:[1,0,1,\"\"],Slice2:[1,0,1,\"\"],Transpose:[1,0,1,\"\"]},\"bdsim.blocks.linalg.Cond\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.linalg.Det\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.linalg.Flatten\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.linalg.Inverse\":{__init__:[1,1,1,\"\"],onames:[1,2,1,\"\"]},\"bdsim.blocks.linalg.Norm\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.linalg.Slice1\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.linalg.Slice2\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.linalg.Transpose\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sinks\":{Null:[1,0,1,\"\"],Print:[1,0,1,\"\"],Stop:[1,0,1,\"\"],Watch:[1,0,1,\"\"]},\"bdsim.blocks.sinks.Null\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sinks.Print\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sinks.Stop\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sinks.Watch\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sources\":{Constant:[1,0,1,\"\"],Piecewise:[1,0,1,\"\"],Ramp:[1,0,1,\"\"],Step:[1,0,1,\"\"],Time:[1,0,1,\"\"],WaveForm:[1,0,1,\"\"]},\"bdsim.blocks.sources.Constant\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sources.Piecewise\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sources.Ramp\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sources.Step\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sources.Time\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.sources.WaveForm\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.transfers\":{Integrator:[1,0,1,\"\"],LTI_SISO:[1,0,1,\"\"],LTI_SS:[1,0,1,\"\"],PoseIntegrator:[1,0,1,\"\"]},\"bdsim.blocks.transfers.Integrator\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.transfers.LTI_SISO\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.transfers.LTI_SS\":{__init__:[1,1,1,\"\"]},\"bdsim.blocks.transfers.PoseIntegrator\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks\":{arm:[1,3,0,\"-\"],mobile:[1,3,0,\"-\"],uav:[1,3,0,\"-\"]},\"roboticstoolbox.blocks.arm\":{ArmPlot:[1,0,1,\"\"],CTraj:[1,0,1,\"\"],CirclePath:[1,0,1,\"\"],Delta2Tr:[1,0,1,\"\"],FDyn:[1,0,1,\"\"],FDyn_X:[1,0,1,\"\"],FKine:[1,0,1,\"\"],Gravload:[1,0,1,\"\"],Gravload_X:[1,0,1,\"\"],IDyn:[1,0,1,\"\"],IKine:[1,0,1,\"\"],Inertia:[1,0,1,\"\"],Inertia_X:[1,0,1,\"\"],JTraj:[1,0,1,\"\"],Jacobian:[1,0,1,\"\"],LSPB:[1,0,1,\"\"],Point2Tr:[1,0,1,\"\"],TR2T:[1,0,1,\"\"],Tr2Delta:[1,0,1,\"\"],Traj:[1,0,1,\"\"]},\"roboticstoolbox.blocks.arm.ArmPlot\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.CTraj\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.CirclePath\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Delta2Tr\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.FDyn\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.FDyn_X\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.FKine\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Gravload\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Gravload_X\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.IDyn\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.IKine\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Inertia\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Inertia_X\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.JTraj\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Jacobian\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.LSPB\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Point2Tr\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.TR2T\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Tr2Delta\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.arm.Traj\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.mobile\":{Bicycle:[1,0,1,\"\"],DiffSteer:[1,0,1,\"\"],Unicycle:[1,0,1,\"\"],VehiclePlot:[1,0,1,\"\"]},\"roboticstoolbox.blocks.mobile.Bicycle\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.mobile.DiffSteer\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.mobile.Unicycle\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.mobile.VehiclePlot\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.uav\":{MultiRotor:[1,0,1,\"\"],MultiRotorMixer:[1,0,1,\"\"],MultiRotorPlot:[1,0,1,\"\"]},\"roboticstoolbox.blocks.uav.MultiRotor\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.uav.MultiRotorMixer\":{__init__:[1,1,1,\"\"]},\"roboticstoolbox.blocks.uav.MultiRotorPlot\":{__init__:[1,1,1,\"\"]},bdsim:{BDSim:[3,0,1,\"\"],BDSimState:[3,0,1,\"\"],Block:[3,0,1,\"\"],Clock:[3,0,1,\"\"],ClockedBlock:[3,0,1,\"\"],FunctionBlock:[3,0,1,\"\"],GraphicsBlock:[3,0,1,\"\"],Plug:[3,0,1,\"\"],PriorityQ:[3,0,1,\"\"],SinkBlock:[3,0,1,\"\"],SourceBlock:[3,0,1,\"\"],Struct:[3,0,1,\"\"],SubsystemBlock:[3,0,1,\"\"],TransferBlock:[3,0,1,\"\"],Wire:[3,0,1,\"\"],blockdiagram:[3,2,1,\"\"]},machinevisiontoolbox:{blocks:[1,3,0,\"-\"]}},objnames:{\"0\":[\"py\",\"class\",\"Python class\"],\"1\":[\"py\",\"method\",\"Python method\"],\"2\":[\"py\",\"attribute\",\"Python attribute\"],\"3\":[\"py\",\"module\",\"Python module\"]},objtypes:{\"0\":\"py:class\",\"1\":\"py:method\",\"2\":\"py:attribute\",\"3\":\"py:module\"},terms:{\"100\":1,\"1000\":1,\"123\":[],\"125\":[],\"2004\":1,\"2hz\":1,\"2rad\":1,\"3x4\":3,\"413716694115407\":1,\"5th\":1,\"\\u03b3\":1,\"\\u03b8\":1,\"\\u03c9\":1,\"\\u03c9l\":1,\"\\u03c9r\":1,\"\\ud835\\uded5p\":1,\"\\ud835\\uded5p\":[],\"\\ud835\\uded5r\":1,\"\\ud835\\uded5r\":[],\"\\ud835\\uded5y\":1,\"\\ud835\\uded5y\":[],\"case\":[1,3],\"class\":[1,2],\"default\":[1,3],\"final\":[1,3],\"float\":[1,3],\"function\":[0,2],\"import\":[0,1,3],\"int\":[0,1,3],\"new\":[1,3],\"null\":[0,1,3],\"return\":[0,1,3],\"static\":[1,3],\"switch\":3,\"true\":[0,1,3],\"while\":[0,3],Adding:0,For:[1,3],Its:3,LHS:3,NOT:1,RHS:3,The:[0,1,3],There:1,These:[1,3],Ths:3,Use:1,Used:3,Useful:1,Uses:1,Using:[2,4],__add__:3,__array_ufunc__:[],__dict__:[],__doc__:[],__getitem__:3,__init__:[1,3],__module__:3,__mul__:3,__neg__:3,__new__:3,__radd__:3,__repr__:3,__rmul__:3,__rshift__:3,__rsub__:3,__rtruediv__:3,__setattr__:3,__setitem__:3,__str__:3,__sub__:3,__truediv__:3,__weakref__:[],_autoconst:[],_autogain:[],_const:3,_eval:[],_fixnam:[],_gain:[0,3],_latex_remov:[],_prod:[1,3],_r_add__:3,_sum:[0,1,3],a1s:1,abc:3,about:[1,3],abov:[0,1],accel_max:1,acceler:1,accept:1,access:1,accord:1,accur:3,activ:1,add:[1,3],add_block:3,add_inport:3,add_outport:3,add_param:3,added:3,adding:1,addit:[0,1],after:[0,1],algebra:2,alia:3,all:[0,1,3],allow:[1,3],along:1,also:[0,1,3],altern:1,altscreen:3,amplitud:1,angl:1,angular:1,ani:[1,2,3],anim:[1,3],annot:0,anoth:3,appear:1,appli:1,applic:1,appropri:[1,3],arbitrari:1,arg:[1,3],argument:[0,1,3],argv:3,arithmet:0,arm:[0,3],armplot:[0,1,3],arrai:[1,2,3],arrang:3,array_lik:1,aspect:1,assembl:0,assign:[0,1,3],associ:1,assum:[0,1,3],attribut:3,automat:1,avail:0,axes:1,axi:1,b1s:1,backend:[1,3],backslash:3,balanc:0,bar:[1,3],base:[1,3],bdedit:1,bdsim:[0,1,2],bdsimpath:3,bdsimstat:3,becom:1,been:3,behaviour:3,being:3,belong:1,below:[1,3],between:[0,1,3],bicycl:[0,1,3],bike:3,black:1,blob:[],block1:1,block2:1,block:0,blockarg:[1,3],blockclass:3,blockdiagram:[0,1,2],blocknam:3,blockset:2,bool:[1,3],both:[1,3],bound:3,boundari:1,box:2,brace:3,bracket:3,build:[0,3],bus:1,call:[0,1,2],callabl:1,camera:[0,3],can:[0,1,2,3],canon:1,canva:3,caret:3,cartesian:1,categori:1,caus:1,center:1,centr:1,charact:1,check:[0,1,3],checkfinit:3,circl:1,circlepath:[0,1,3],circular:1,classnam:3,clean:3,cleaner:1,clip:[0,1,3],clock:[1,3],clockedblock:[1,3],clockwis:1,clone:1,close:0,closefig:3,cls:3,code:[0,1,2],coeffici:1,col:1,collect:3,colon:3,column:[0,1,3],com:[],combin:1,come:1,command:3,common:[1,3],commun:2,compat:1,compil:[0,1,3],compon:[1,2],compris:[1,3],comput:1,concaten:1,conceptu:2,concis:0,cond:[0,1,3],condit:1,condition:1,configur:1,conform:1,connect:[0,2,3],consist:[0,1],consol:1,constant:[0,1,3],construct:3,constructor:3,contain:[0,1,3],content:0,context:0,continu:3,control:1,conveni:0,convert:3,coordin:1,coordinat:1,copi:1,correspond:[0,1,3],could:[0,3],coupl:3,cours:1,creat:[0,1,3],create_figur:3,creation:3,critic:3,cross:0,ctraj:[0,1,3],current:[1,3],cycl:1,d2goal:3,data:[1,3],dataflow:0,date:1,debug:3,deceler:1,declar:1,declare_ev:[1,3],def:1,defin:[0,1,2,3],definit:[1,3],delta2tr:[0,1,3],delta:1,demand:[0,2],demultiplex:1,demux:[0,1,3],denomin:1,denot:0,depend:[0,3],deriv:[1,3],describ:[1,3],descript:[0,1,3],design:0,dest1:0,dest2:0,dest:0,det:[0,1,3],detail:[0,1,3],determin:1,develop:1,diagnost:[0,3],diagram:[0,1,3],dict:[0,1,3],dictionari:[1,2,3],differ:[1,3],differenti:1,diffsteer:[0,1,3],difsteer:1,dimens:1,dimension:1,dintegr:[0,1,3],disabl:[1,3],discard:1,discontinu:1,discret:[0,2],dismiss:0,displai:[0,1,3],divid:[1,3],dividend:3,divis:[],divisor:3,doc:3,docstr:3,document:[2,3],dollar:3,domain:1,don:3,done:[0,3],dot:1,down:1,dposeintegr:[0,1,3],draw:[1,2],drawn:0,drive:3,due:1,dure:[1,3],duti:1,dynam:[0,1,2,3],each:[0,1,3],effector:1,eg1:0,either:[1,3],element:[0,1,3],elementwis:1,elimin:1,els:3,empti:0,enabl:[2,3],enclos:1,end:[1,3],envari:3,environ:3,equal:1,equival:1,error:3,estpose_p:[0,3],etc:[1,3],evalu:1,even:[0,2],event:1,everi:[1,3],exactli:0,exager:1,exampl:[0,1,3],execut:[0,3],exist:3,expect:1,explicit:1,express:[0,1],extens:3,extern:2,extra:1,factor:1,factori:3,fall:3,fals:[1,3],fanci:1,fdyn:[0,1,3],fdyn_x:[0,1,3],fewer:0,fignum:3,figur:[0,1,3],file:[0,1,3],filenam:[1,3],finish:1,first:[0,1,3],fix:1,fkine:[0,1,3],flag:[1,3],flap:1,flapscal:1,flat:0,flatten:[0,1,3],float64:0,fmt:1,fname:3,folder:3,follow:1,forc:1,form:[0,1,2,3],format:[1,3],forward:1,forward_dynam:1,forward_kinemat:1,found:[0,3],foward_dynam:1,foward_kinemat:1,frac:1,frame:1,freq:1,frequenc:1,from:[0,1,3],front:1,fullnam:3,func1:1,func:[1,3],functionblock:[1,3],gain:[0,1,2,3],gener:[0,1],geometr:1,get:[2,3,4],get_opt:3,getstat:3,getstate0:3,github:1,given:[1,3],gradient:1,graph:3,graphic:[0,1],graphicsblock:[1,3],gravcomp:1,gravit:1,graviti:1,gravload:[0,1,3],gravload_x:1,greater:1,ground:1,groundcheck:1,group:0,halt:3,hand:[0,3],handl:3,handler:3,harsh:3,has:[0,1,3],have:[0,1,3],header:1,help:3,heta:1,heta_i:1,heta_p:1,heta_r:1,heterogen:1,hierarch:1,highest:1,highlight:1,histori:[0,3],hold:[0,1,3],html:1,http:1,icon:1,idyn:[0,1,3],ikin:[0,1,3],ikine_lm:1,imag:3,imageplan:[0,3],implement:[0,1,3],implicit:[1,3],implicitli:[0,3],importantli:0,importerror:[1,3],inam:3,includ:[1,3],inclus:1,incom:[1,3],increas:1,index:[0,1,3],indic:3,individu:[0,1],inerti:1,inertia:[0,1,3],inertia_x:[0,1,3],inf:[1,3],info:3,inform:3,init:1,initi:[1,3],inport:[0,1,3],inport_nam:3,input:[0,1,3],instanc:[0,1,3],instanti:[0,1,3],instead:1,integ:1,integr:[0,1,3],inter:3,interact:3,interfac:3,interp:1,interpol:[0,1,3],interpret:3,interv:3,inv:1,invari:1,invers:[0,1,3],inverse_dynam:1,inverse_kinemat:1,invok:3,isclock:3,isgraph:3,isslic:3,item:[0,1,3],iter:[1,3],its:1,jacobian:[0,1,3],joint:1,jpeg:3,jtraj:[0,1,3],junction:[1,3],just:0,keep:[0,1],kei:[1,3],kept:1,keyword:[1,3],kill:0,kind:1,kinemat:1,known:3,kwarg:[1,3],label:[0,1],labview:2,lambda:1,last:[0,1],later:1,latest:1,latex:3,latexd:3,layout:3,left:[1,3],len:1,length:[1,3],less:1,letter:3,level:[1,3],librari:[0,2,3],lies:1,like:[0,1,3],limit:1,linalg:[0,1,3],line:[0,3],linear:[2,3],linearli:1,linestyl:1,link:1,list:[0,1,2,3],load:[0,3],load_block:3,log:[1,3],longitudin:1,look:1,lost:1,lspb:[0,1,3],lti:[0,1],lti_siso:[0,1,2,3],lti_ss:[0,1,3],machin:1,machinevisiontoolbox:[0,1,3],macro:1,made:1,magnitud:1,main:3,major:1,mani:0,manipul:1,map:3,mappingproxi:[],markup:3,master:[],mat:1,match:1,math:[1,3],matlab:1,matplotlib:3,matric:1,matrix:[1,3],max:1,maximum:[1,3],maxw:1,mean:1,mention:3,metadata:3,method:[1,2,3],metr:1,might:1,min:1,minimum:[1,3],minsteplength:3,minsteps:3,minu:3,minuend:3,minw:1,mix:1,mobil:[0,3],model:[1,2],modul:[1,3],monitor:3,monoton:1,more:[0,3],most:3,motion:1,move:1,movi:[0,3],mp4:[0,3],multipl:1,multiplex:1,multipli:[1,3],multirotor:[0,1,3],multirotormix:[0,1,3],multirotorplot:[0,1,3],must:[0,1],mutablemap:3,mux:[0,1,3],myfun:1,name:[0,1,2,3],nan:3,ndarrai:[0,1,3],ndstate:0,need:[0,1,3],negat:3,network:3,newvalu:3,next:[1,3],next_ev:3,nice:0,nin:[0,1,3],nograph:3,non:[1,3],none:[1,3],nonlinear:3,noprogress:3,norm:[0,1,3],normal:3,notat:[0,1],note:[1,3],nout:[0,1,3],now:0,nstate:[0,3],number:[0,1,3],numer:1,numpi:[1,2,3],object:[0,1,2,3],obtain:0,off:1,offset:[1,3],omega_i:1,omega_x:1,omega_z:1,onam:[1,3],one:[0,1,3],onli:[0,1,3],onlin:3,ope:[],open:0,oper:[1,2,3,4],operand:3,ops:1,option:[0,1,3],ord:1,order:[0,1,3],orient:1,ortho:1,osit:1,other:[2,3],otherwis:[1,3],out:[0,1],outport:[0,1,3],outport_nam:3,output:[0,1,3],over:[0,1,3],overload:[2,3,4],overrid:1,overview:[2,4],overwrit:3,packag:[1,2,3],page:0,pair:1,parallel:1,param1:1,param2:1,param3:1,param4:1,param:3,paramet:[1,3],parent:[1,3],parenthes:3,part:1,pass:[1,3],path:[1,3],paulin:1,payload:1,pdf:[0,3],per:0,percentag:3,perform:1,persist:1,perspect:1,petercork:1,phase:1,piecewis:[0,1,3],pinv:1,pitch:1,plan:0,plane:1,plant:[0,2,3],plot:[0,1],plug:1,plugto:3,png:3,point2tr:[0,1,3],point:[0,1],polynomi:1,pop:3,pop_until:3,port0:1,port1:1,port2:1,port:[0,1,3],portlist:3,pos:3,pose:1,poseintegr:[0,1,3],posit:[1,3],postmultipli:1,pound:1,preced:3,prefix:0,premul:1,premultipli:1,present:3,prevent:1,previou:1,print:[0,1,3],priorityq:3,process:3,prod:[0,1,3],product:1,profil:1,program:0,programmat:1,progress:[1,3],progress_don:3,project:1,propag:3,proper:1,properti:[1,3],provid:[1,3],pseudo:1,purpos:[1,3],push:3,pyplot:1,python:[0,1,3],qd0:1,qdf:1,qplot:1,qt5agg:3,quad:1,quintic:1,rad:1,radian:1,radiu:1,rais:[1,3],ramp:[0,1,3],rand:[],rang:1,rate:1,rather:2,ratio:1,read:3,readabl:0,receiv:3,record:[0,3],red:0,refer:[0,1,3],referenc:[1,3],remov:3,replac:1,report:0,repr:3,repres:[1,2,3],represent:1,requir:[0,1],reset:3,respect:1,result:[0,1,3],revers:[1,3],right:[1,3],rise:1,rk45:3,roboticstoolbox:[0,1,3],roll:1,rotat:1,rout:1,row:[0,1],rps:1,rpy:1,rtb:1,rtype:[],run:[0,1,3],run_interv:3,rxc:3,same:[0,1,3],save:[0,3],savefig:[0,3],savest:3,scalar:[1,2,3],scale:1,scipi:3,scope0:0,scope:[0,1,2,3],scopexi:[0,3],scopexy1:[0,3],screen:0,script:0,se3:1,sec:1,second:[0,1,3],secondari:3,see:[0,3],seealso:[1,3],segment:1,select:1,selector:1,self:3,send:3,sent:3,separ:[1,3],seq:1,sequenc:1,sequenti:1,seri:1,serv:1,set:[1,3],set_opt:3,set_param:3,setattr:3,setinput:3,setstat:3,shape:[0,1,3],shift:1,should:1,show:[0,1,3],showgraph:3,shown:[1,3],side:3,sigint:0,sign:[1,3],signal:[0,1,3],signatur:3,sim:[0,3],similar:1,simpl:[0,1,3],simpli:3,simstat:3,simul:[0,1,2,3],simulink:[1,2],sine:1,singl:[0,1,3],sink:[0,2],sinkblock:[1,3],siso:1,size:3,sketch:0,slice1:[0,1,3],slice2:[0,1,3],slice:[0,1,3],slim:1,slope:1,smoothli:1,sname:3,solut:1,solver:3,solver_arg:3,some:[0,1],somewhat:1,sourc:[0,2],sourceblock:[1,3],sourcenam:3,space:1,spatial:1,spatialmath:1,specif:[1,3],specifi:[0,1,3],speed:1,speed_max:1,speedcheck:1,squar:[1,3],src:3,star:1,start:[1,2,3,4],state:[0,1,3],state_nam:3,staticmethod:[],stdout:1,steer:1,steer_max:1,step:[0,1,2,3],stop:[0,1,3],str:[1,3],strike:0,string:[1,2,3],struct:3,structur:1,struggl:3,style:[0,2],subarrai:1,subclass:[1,3],subsequ:0,subsi:1,subsystem:[0,1],subsystemblock:[1,3],subsysytemblock:1,subtract:[1,3],subtrahend:3,sum3:1,sum:[0,1,2,3],summari:[0,1],summat:[1,3],superclass:3,support:[1,2],suppress:3,symmetr:1,syntax:3,sys:3,sysarg:3,system:[0,1,2],systemat:3,tabular:0,take:1,taken:[1,3],task:1,term:[0,1,2],test:[1,3],text:1,than:[1,2],thei:1,them:[0,1],thereof:1,theta:1,theta_i:1,theta_p:1,theta_r:1,thi:[0,1,2,3],thing:3,third:[0,3],those:3,three:1,thrust:1,tile:3,time:[0,2],timestep:0,toolbox:2,top:[1,3],torqu:1,total:1,tpoli:1,tr2delta:[0,1,3],tr2t:[0,1,3],trail:1,traj:[0,1,3],trajectori:1,transfer:[0,2],transferblock:[1,3],transform:1,transit:1,translat:1,transpos:[0,1,3],trapezoid:1,treat:1,triangl:1,tupl:[1,3],turn:1,twist:1,two:[1,3],type:[0,1,2,3],typic:3,uav:[0,1,3],unari:3,undefin:1,underscor:0,unicycl:[0,1,3],uniformli:1,unit:[1,3],unless:1,unlik:2,until:0,unus:3,updat:3,upper:3,url:3,use:[1,3],used:[0,1,3],useprevi:1,user:[0,3],userdict:3,using:[0,1,3],v_x:1,v_y:1,v_z:1,valu:[1,3],valueerror:1,vari:1,variabl:[0,1,3],varinput:3,variou:3,varoutput:3,vector:[0,1,3],vehicl:1,vehicleanim:1,vehicleplot:[0,1,3],velcomp:1,veloc:1,verbos:3,veri:3,version:3,visjac_p:[0,3],vlim:1,want:[0,3],watch:[0,1,3],wave:1,waveform:[0,1,3],weak:[],well:3,wheel:1,wheelbas:1,when:[1,3],whenev:3,where:[0,1,3],whether:[0,3],which:[0,1,3],whose:[1,3],width:[1,3],wiki:0,window:[0,3],wire:[0,1,2],wise:1,within:1,work:1,workspac:1,world:1,would:1,wrap:1,wrench:1,write:[1,2],written:1,wxh:3,x_t:1,xdd:1,xlabel:1,xmax:1,xmin:1,xname:[0,3],xyz:1,yaw:1,yet:1,ylabel:1,ymax:1,ymin:1,yname:[0,3],you:0,zero:1,zeroth:1,zmax:1,zmin:1,zoh:[0,1,3]},titles:[\"Overview\",\"Block library\",\"Block diagrams for Python\",\"Supporting classes\",\"bdsim\"],titleterms:{\"class\":3,\"function\":[1,3],Using:0,algebra:1,arm:1,bdsim:[3,4],block:[1,2,3],blockdiagram:3,blockset:1,compon:3,connect:1,diagram:2,discret:[1,3],extern:1,fly:1,get:0,graphic:3,librari:1,linear:1,mobil:1,multi:1,oper:0,overload:0,overview:0,plug:3,python:2,robot:1,rotor:1,simulink:[],sink:[1,3],sourc:[1,3],start:0,subsystem:3,support:3,system:3,time:[1,3],todo:1,toolbox:1,transfer:[1,3],vision:1,wire:3}})"
  },
  {
    "path": "examples/README.md",
    "content": "# Running the examples\n\nFrom the command line:\n\n```\n% pip install bdsim\n```\n\nThen you can run the examples from the command line, for example\n\n```\n% ./eg1.py\n```\n\nwhich will display a graph in a new figure window.  Close the figure to allow the program to exit.\n\nExamples provided in this folder include:\n\n- `eg1.py` the example given above\n- `waveform.py` two signal generators connected to two scopes\n- `vanderpol.py` a classic non-linear oscillator\n- `sine+sampler.py` a sine wave generator connected to a scope via a ZOH\n- `subsys.py` a block diagram with a subystem\n\n- `RVC2` is a folder holding some examples from Chapter four of [_Robotics, Vision & Control (2017)_](https://petercorke.com/rvc/home):\n\n  - `rvc4_2.py` Fig 4.2 - a car-like vehicle with bicycle kinematics driven by a rectangular pulse steering signal\n  - `rvc4_4.py` Fig 4.4 - a car-like vehicle driving to a point\n\n  - `rvc4_6.py` Fig 4.6 - a car-like vehicle driving to/along a line\n\n\n  - `rvc4_11.py` Fig 4.11 a car-like vehicle driving to a pose\n\nAll `bdsim` programs support a number of [command line switches](https://github.com/petercorke/bdsim/wiki/Runtime-options).\n\nMore examples can be found in the [support package for the book _Robotics, Vision & Control (2023) 3e_](https://github.com/petercorke/RVC3-python/tree/main/RVC3/models)."
  },
  {
    "path": "examples/RVC2/README.md",
    "content": "# Running the examples\n\nExamples from Chapter four of [_Robotics, Vision & Control (2017)_](https://petercorke.com/rvc/home):\n\n- `rvc4_2.py` Fig 4.2 - a car-like vehicle with bicycle kinematics driven by a rectangular pulse steering signal\n- `rvc4_4.py` Fig 4.4 - a car-like vehicle driving to a point\n\n- `rvc4_6.py` Fig 4.6 - a car-like vehicle driving to/along a line\n\n\n- `rvc4_11.py` Fig 4.11 a car-like vehicle driving to a pose\n\n\nFigs 4.8 (pure pursuit) and Fig 4.21 (quadrotor control) are yet to be done.\n"
  },
  {
    "path": "examples/RVC2/rvc4_11.py",
    "content": "#!/usr/bin/env python3\n\n# run with command line -a switch to show animation\n\nimport bdsim\nfrom math import pi, sqrt, atan, atan2\n\nsim = bdsim.BDSim()\nbd = sim.blockdiagram()\n\n# parameters\nxg = [5, 5, pi / 2]\nKrho = bd.GAIN(1, name=\"Krho\")\nKalpha = bd.GAIN(5, name=\"Kalpha\")\nKbeta = bd.GAIN(-2, name=\"Kbeta\")\n\nxg = [5, 5, pi / 2]\nx0 = [5, 2, 0]\nx0 = [5, 9, 0]\n\nx0 = [8, 5, pi / 2]\n\n# annotate the graphics\ndef background_graphics(ax):\n    ax.plot(*xg[:2], \"*\")\n    ax.plot(*x0[:2], \"o\")\n\n\n# convert x,y,theta state to polar form\ndef polar(x, dict):\n    rho = sqrt(x[0] ** 2 + x[1] ** 2)\n\n    if not \"direction\" in dict:\n        # direction not yet set, set it\n        beta = -atan2(-x[1], -x[0])\n        alpha = -x[2] - beta\n        print(\"alpha\", alpha)\n        if -pi / 2 <= alpha <= pi / 2:\n            dict[\"direction\"] = 1\n        else:\n            dict[\"direction\"] = -1\n        print(\"set direction to \", dict[\"direction\"])\n\n    if dict[\"direction\"] == -1:\n        beta = -atan2(x[1], x[0])\n    else:\n        beta = -atan2(-x[1], -x[0])\n    alpha = -x[2] - beta\n\n    # clip alpha\n    if alpha > pi / 2:\n        alpha = pi / 2\n    elif alpha < -pi / 2:\n        alpha = -pi / 2\n\n    return [\n        dict[\"direction\"],\n        rho,\n        alpha,\n        beta,\n    ]\n\n\n# constants\ngoal0 = bd.CONSTANT([xg[0], xg[1], 0], name=\"goal_pos\")\ngoalh = bd.CONSTANT(xg[2], name=\"goal_heading\")\n\n# stateful blocks\nbike = bd.BICYCLE(x0=x0, vlim=2, slim=1.3, name=\"vehicle\")\n\n# functions\nfabs = bd.FUNCTION(lambda x: abs(x), name=\"abs\")\npolar = bd.FUNCTION(\n    polar,\n    nout=4,\n    persistent=True,\n    name=\"polar\",\n    inames=(\"x\",),\n    onames=(\"direction\", r\"$\\rho$\", r\"$\\alpha$\", r\"$\\beta\"),\n)\nstop = bd.STOP(lambda x: x < 0.01, name=\"close enough\")\nsteer_rate = bd.FUNCTION(lambda u: atan(u), name=\"atan\")\n\n# arithmetic\nvprod = bd.PROD(\"**\", name=\"vprod\")\nwprod = bd.PROD(\"**/\", name=\"aprod\")\nxerror = bd.SUM(\"+-\")\nheading_sum = bd.SUM(\"++\")\ngsum = bd.SUM(\"++\")\n\n# displays\nvplot = bd.VEHICLEPLOT(scale=[0, 10], size=0.7, shape=\"box\", init=background_graphics)\n# , movie=\"rvc4_11.mp4\")\nascope = bd.SCOPE(name=r\"$\\alpha$\")\nbscope = bd.SCOPE(name=r\"$\\beta$\")\n\n# connections\n\nbd.connect(bike, vplot)\nbd.connect(bike, xerror[0])\nbd.connect(goal0, xerror[1])\n\nbd.connect(xerror, polar)\nbd.connect(polar[1], Krho, stop)  # rho\nbd.connect(Krho, vprod[1])\nbd.connect(polar[2], Kalpha, ascope)  # alpha\nbd.connect(Kalpha, gsum[0])\nbd.connect(polar[3], heading_sum[0])  # beta\nbd.connect(goalh, heading_sum[1])\nbd.connect(heading_sum, Kbeta, bscope)\n\nbd.connect(polar[0], vprod[0], wprod[1])\nbd.connect(vprod, fabs, bike.v)\nbd.connect(fabs, wprod[2])\nbd.connect(wprod, steer_rate)\nbd.connect(steer_rate, bike.gamma)\n\nbd.connect(Kbeta, gsum[1])\nbd.connect(gsum, wprod[0])\n\nbd.compile()\n\nbd.report_summary()\nout = sim.run(bd, T=10)\n"
  },
  {
    "path": "examples/RVC2/rvc4_2.py",
    "content": "#!/usr/bin/env python3\n\n# run with command line -a switch to show animation\n\nimport bdsim\n\nsim = bdsim.BDSim(animation=True)\nbd = sim.blockdiagram()\n\nsteer = bd.PIECEWISE((0, 0), (3, 0.5), (4, 0), (5, -0.5), (6, 0), name=\"steering\")\nspeed = bd.CONSTANT(1, name=\"speed\")\nbike = bd.BICYCLE(x0=[0, 0, 0], name=\"bicycle\")\nq = bd.DEMUX(3)\n\ntscope = bd.SCOPE(name=\"theta\")\nvplot = bd.VEHICLEPLOT(\n    scale=[0, 10, -5, 5], size=0.7, shape=\"box\"\n)  # , movie='rvc4_2.mp4')\n\nbd.connect(bike, q, vplot)\nbd.connect(speed, bike[0])\nbd.connect(steer, bike[1])\nbd.connect(q[2], tscope)\n\nbd.compile()\nbd.report()\n\nout = sim.run(bd, 10, dt=0.05)\n"
  },
  {
    "path": "examples/RVC2/rvc4_4.py",
    "content": "#!/usr/bin/env python3\n\n# run with command line -a switch to show animation\n\nimport bdsim\nimport math\n\nsim = bdsim.BDSim(animation=True)\nbd = sim.blockdiagram()\n\n\ndef background_graphics(ax):\n    ax.plot(5, 5, \"*\")\n    ax.plot(5, 2, \"o\")\n\n\ngoal = bd.CONSTANT([5, 5])\nerror = bd.SUM(\"+-\", name=\"error\")\nd2goal = bd.FUNCTION(lambda d: math.sqrt(d[0] ** 2 + d[1] ** 2))\nh2goal = bd.FUNCTION(lambda d: math.atan2(d[1], d[0]))\nheading_error = bd.SUM(\"+-\", angles=True)\nKv = bd.GAIN(0.5)\nKh = bd.GAIN(4)\nbike = bd.BICYCLE(x0=[5, 2, 0])\nvplot = bd.VEHICLEPLOT(scale=[0, 10], size=0.7, init=background_graphics)\n# movie=\"rvc4_4.mp4\")\nvscope = bd.SCOPE(name=\"velocity\")\nhscope = bd.SCOPE(name=\"heading\")\nxy = bd.SLICE1([0, 1])\ntheta = bd.SLICE1([2])\n\nbd.connect(bike, xy, theta, vplot)\nbd.connect(goal, error[0])\nbd.connect(xy, error[1])\nbd.connect(error, d2goal, h2goal)\nbd.connect(d2goal, Kv)\nbd.connect(Kv, bike[0], vscope)\nbd.connect(h2goal, heading_error[0])\nbd.connect(theta, heading_error[1])\nbd.connect(heading_error, hscope)\nbd.connect(heading_error, Kh)\nbd.connect(Kh, bike[1])\n\n\nbd.compile()\nbd.report()\n\nout = sim.run(bd)\n"
  },
  {
    "path": "examples/RVC2/rvc4_6.py",
    "content": "#!/usr/bin/env python3\n\n# run with command line -a switch to show animation\n\nimport bdsim\nimport math\nimport numpy as np\n\nsim = bdsim.BDSim(animation=True)\nbd = sim.blockdiagram()\n\n# x0 = [8, 5, math.pi/2]\nx0 = [5, 2, 0]\nL = [1, -2, 4]\n\n\ndef plot_homline(ax, line, *args, xlim, ylim, **kwargs):\n    if abs(line[1]) > abs(line[0]):\n        y = (-line[2] - line[0] * xlim) / line[1]\n        ax.plot(xlim, y, *args, **kwargs)\n    else:\n        x = (-line[2] - line[1] * ylim) / line[0]\n        ax.plot(x, ylim, *args, **kwargs)\n\n\ndef background_graphics(ax):\n    plot_homline(ax, L, \"r--\", xlim=np.r_[0, 10], ylim=np.r_[0, 10])\n    ax.plot(x0[0], x0[1], \"o\")\n\nspeed = bd.CONSTANT(0.5)\nslope = bd.CONSTANT(math.atan2(-L[0], L[1]))\nd2line = bd.FUNCTION(\n    lambda u: (u[0] * L[0] + u[1] * L[1] + L[2]) / math.sqrt(L[0] ** 2 + L[1] ** 2)\n)\nheading_error = bd.SUM(\"+-\", angles=True)\nsteer_sum = bd.SUM(\"+-\")\nKd = bd.GAIN(0.5)\nKh = bd.GAIN(1)\nbike = bd.BICYCLE(x0=x0)\nvplot = bd.VEHICLEPLOT(scale=[0, 10], size=0.7, shape=\"box\", init=background_graphics)\n# , movie=\"rvc4_6.mp4\")\nhscope = bd.SCOPE(name=\"heading\")\nxy = bd.INDEX([0, 1], name=\"xy\")\ntheta = bd.INDEX([2], name=\"theta\")\n\nbd.connect(d2line, Kd)\nbd.connect(Kd, steer_sum[1])\nbd.connect(steer_sum, bike.gamma)\nbd.connect(speed, bike.v)\n\nbd.connect(slope, heading_error[0])\nbd.connect(theta, heading_error[1])\n\nbd.connect(heading_error, Kh)\nbd.connect(Kh, steer_sum[0])\n\nbd.connect(xy, d2line)\n\nbd.connect(bike, xy, theta, vplot)\nbd.connect(theta, hscope)\n\nbd.compile()\nbd.report_summary()\n\nout = sim.run(bd, 20)\n"
  },
  {
    "path": "examples/RVC2/rvc4_8.py",
    "content": "#!/usr/bin/env python3\n\n# run with command line -a switch to show animation\n\nimport bdsim\nimport numpy as np\nimport math\nimport roboticstoolbox as rtb\n\n\n# parameters for the path\nlook_ahead = 5\nspeed = 1\ndt = 0.1\ntacc = 1\n\n# create the path\npath = np.array([[10, 10], [10, 60], [80, 80], [50, 10]])\n\nrobot_traj = rtb.mstraj(path[1:, :], qdmax=speed, q0=path[0, :], dt=0.1, tacc=tacc).q\ntotal_time = robot_traj.shape[0] * dt + look_ahead / speed\n\nsim = bdsim.BDSim(graphics=True)\nbd = sim.blockdiagram()\n\n\ndef background_graphics(ax):\n    ax.plot(path[:, 0], path[:, 1], \"r\", linewidth=3, alpha=0.7)\n\n\ndef pure_pursuit(cp, R=None, traj=None):\n    # find closest point on the path to current point\n    d = np.linalg.norm(traj - cp, axis=1)  # rely on implicit expansion\n    i = np.argmin(d)\n\n    # find all points on the path at least R away\n    (k,) = np.where(d[i + 1 :] >= R)  # find all points beyond horizon\n    if len(k) == 0:\n        # no such points, we must be near the end, goal is the end\n        pstar = traj[-1, :]\n    else:\n        # many such points, take the first one\n        k = k[0]  # first point beyond look ahead distance\n        pstar = traj[k + i, :]\n    return pstar.flatten()\n\n\nspeed = bd.CONSTANT(speed, name=\"speed\")\nerror = bd.SUM(\"+-\", name=\"err\")\n# d2goal = bd.FUNCTION(lambda d: math.sqrt(d[0]**2 + d[1]**2), name='d2goal')\nh2goal = bd.FUNCTION(lambda d: math.atan2(d[1], d[0]), name=\"h2goal\")\nheading_error = bd.SUM(\"+-\", mode=\"c\", name=\"herr\")\nKh = bd.GAIN(0.5, name=\"Kh\")\nbike = bd.BICYCLE(x0=[2, 2, 0])\nvplot = bd.VEHICLEPLOT(\n    scale=[0, 80, 0, 80], size=0.7, shape=\"box\", init=background_graphics\n)  # , movie='rvc4_8.mp4')\nsscope = bd.SCOPE(name=\"steer angle\")\nhscope = bd.SCOPE(name=\"heading angle\")\n# stop = bd.STOP(lambda x: np.linalg.norm(x - np.r_[50,10]) < 0.1, name='close_enough')\npp = bd.FUNCTION(\n    pure_pursuit, fkwargs={\"R\": look_ahead, \"traj\": robot_traj}, name=\"pure_pursuit\"\n)\nxy = bd.INDEX([0, 1], name=\"xy\")\ntheta = bd.INDEX([2], name=\"theta\")\n\nbd.connect(pp, error[0])\nbd.connect(error, h2goal)\n# bd.connect(d2goal, stop)\n\nbd.connect(h2goal, heading_error[0])\nbd.connect(theta, heading_error[1], hscope)\nbd.connect(heading_error, Kh)\nbd.connect(Kh, bike[1], sscope)\nbd.connect(speed, bike[0])\n\nbd.connect(bike, xy, theta, vplot)\nbd.connect(xy, pp, error[1])\n\nbd.compile()\nbd.report_summary()\n\nprint(\"\\nSimulating for \", total_time, \" seconds\")\n\nout = sim.run(bd, T=total_time)\n"
  },
  {
    "path": "examples/deriv.py",
    "content": "#!/usr/bin/env python\n'''\nDemonstrate derivative block\n'''\nimport bdsim\n\nsim = bdsim.BDSim()\nbd = sim.blockdiagram()\n\nu = bd.WAVEFORM(\"sine\", freq=1, unit=\"rad/s\")\ndu = bd.DERIV(0.1, y0=1)\nscope = bd.SCOPE(styles=['k','r--'])\n\n# connect\n\nbd.connect(u, scope[0], du)\nbd.connect(du, scope[1])\n\nbd.compile()\nsim.report(bd)\nout = sim.run(bd, 10)\n"
  },
  {
    "path": "examples/eg1.bd",
    "content": "{\n    \"id\": 140192902056064,\n    \"created_by\": \"corkep\",\n    \"creation_time\": 1632824708,\n    \"scene_width\": 7207.200000000001,\n    \"scene_height\": 3595.2000000000003,\n    \"blocks\": [\n        {\n            \"id\": 140596124728768,\n            \"block_type\": \"GAIN\",\n            \"title\": \"Gain Block\",\n            \"pos_x\": -80.0,\n            \"pos_y\": -120.0,\n            \"width\": 100,\n            \"height\": 100,\n            \"flipped\": false,\n            \"inputsNum\": 1,\n            \"outputsNum\": 1,\n            \"inputs\": [\n                {\n                    \"id\": 140596124784720,\n                    \"index\": 0,\n                    \"multi_wire\": true,\n                    \"position\": 1,\n                    \"socket_type\": 1\n                }\n            ],\n            \"outputs\": [\n                {\n                    \"id\": 140596124784768,\n                    \"index\": 0,\n                    \"multi_wire\": true,\n                    \"position\": 3,\n                    \"socket_type\": 2\n                }\n            ],\n            \"parameters\": [\n                [\n                    \"K\",\n                    10\n                ],\n                [\n                    \"premul\",\n                    false\n                ]\n            ]\n        },\n        {\n            \"id\": 140596130326608,\n            \"block_type\": \"SUM\",\n            \"title\": \"Sum Block\",\n            \"pos_x\": -260.0,\n            \"pos_y\": -120.0,\n            \"width\": 100,\n            \"height\": 100,\n            \"flipped\": false,\n            \"inputsNum\": 2,\n            \"outputsNum\": 1,\n            \"inputs\": [\n                {\n                    \"id\": 140596130326800,\n                    \"index\": 0,\n                    \"multi_wire\": true,\n                    \"position\": 1,\n                    \"socket_type\": 1\n                },\n                {\n                    \"id\": 140596130326656,\n                    \"index\": 1,\n                    \"multi_wire\": true,\n                    \"position\": 1,\n                    \"socket_type\": 1\n                }\n            ],\n            \"outputs\": [\n                {\n                    \"id\": 140596130326896,\n                    \"index\": 0,\n                    \"multi_wire\": true,\n                    \"position\": 3,\n                    \"socket_type\": 2\n                }\n            ],\n            \"parameters\": [\n                [\n                    \"signs\",\n                    \"+-\"\n                ],\n                [\n                    \"mode\",\n                    null\n                ]\n            ]\n        },\n        {\n            \"id\": 140596130327856,\n            \"block_type\": \"LTI_SISO\",\n            \"title\": \"Lti_siso Block\",\n            \"pos_x\": 80.0,\n            \"pos_y\": -120.0,\n            \"width\": 100,\n            \"height\": 100,\n            \"flipped\": false,\n            \"inputsNum\": 1,\n            \"outputsNum\": 1,\n            \"inputs\": [\n                {\n                    \"id\": 140596130327424,\n                    \"index\": 0,\n                    \"multi_wire\": true,\n                    \"position\": 1,\n                    \"socket_type\": 1\n                }\n            ],\n            \"outputs\": [\n                {\n                    \"id\": 140596130327472,\n                    \"index\": 0,\n                    \"multi_wire\": true,\n                    \"position\": 3,\n                    \"socket_type\": 2\n                }\n            ],\n            \"parameters\": [\n                [\n                    \"N\",\n                    0.5\n                ],\n                [\n                    \"D\",\n                    [\n                        2,\n                        1\n                    ]\n                ],\n                [\n                    \"x0\",\n                    null\n                ]\n            ]\n        },\n        {\n            \"id\": 140596130327376,\n            \"block_type\": \"STEP\",\n            \"title\": \"Step Block\",\n            \"pos_x\": -460.0,\n            \"pos_y\": -120.0,\n            \"width\": 100,\n            \"height\": 100,\n            \"flipped\": false,\n            \"inputsNum\": 0,\n            \"outputsNum\": 1,\n            \"inputs\": [],\n            \"outputs\": [\n                {\n                    \"id\": 140596130327712,\n                    \"index\": 0,\n                    \"multi_wire\": true,\n                    \"position\": 3,\n                    \"socket_type\": 2\n                }\n            ],\n            \"parameters\": [\n                [\n                    \"T\",\n                    1.0\n                ],\n                [\n                    \"off\",\n                    0.0\n                ],\n                [\n                    \"on\",\n                    1.0\n                ]\n            ]\n        },\n        {\n            \"id\": 140596130328000,\n            \"block_type\": \"SCOPE\",\n            \"title\": \"Scope Block\",\n            \"pos_x\": 280.0,\n            \"pos_y\": 20.0,\n            \"width\": 100,\n            \"height\": 100,\n            \"flipped\": false,\n            \"inputsNum\": 2,\n            \"outputsNum\": 0,\n            \"inputs\": [\n                {\n                    \"id\": 140596130328480,\n                    \"index\": 0,\n                    \"multi_wire\": true,\n                    \"position\": 1,\n                    \"socket_type\": 1\n                },\n                {\n                    \"id\": 140596130400096,\n                    \"index\": 1,\n                    \"multi_wire\": true,\n                    \"position\": 1,\n                    \"socket_type\": 1\n                }\n            ],\n            \"outputs\": [],\n            \"parameters\": [\n                [\n                    \"nin\",\n                    2\n                ],\n                [\n                    \"vector\",\n                    null\n                ],\n                [\n                    \"styles\",\n                    null\n                ],\n                [\n                    \"stairs\",\n                    false\n                ],\n                [\n                    \"scale\",\n                    \"auto\"\n                ],\n                [\n                    \"labels\",\n                    null\n                ],\n                [\n                    \"grid\",\n                    true\n                ],\n                [\n                    \"watch\",\n                    false\n                ]\n            ]\n        }\n    ],\n    \"wires\": [\n        {\n            \"id\": 140596130377056,\n            \"start_socket\": 140596130326896,\n            \"end_socket\": 140596124784720,\n            \"wire_type\": 3,\n            \"custom_routing\": false,\n            \"wire_coordinates\": []\n        },\n        {\n            \"id\": 140596130449008,\n            \"start_socket\": 140596124784768,\n            \"end_socket\": 140596130327424,\n            \"wire_type\": 3,\n            \"custom_routing\": false,\n            \"wire_coordinates\": []\n        },\n        {\n            \"id\": 140596130449632,\n            \"start_socket\": 140596130327472,\n            \"end_socket\": 140596130328480,\n            \"wire_type\": 3,\n            \"custom_routing\": true,\n            \"wire_coordinates\": [\n                [\n                    280.0,\n                    60.0\n                ],\n                [\n                    240.0,\n                    60.0\n                ],\n                [\n                    240.0,\n                    -80.0\n                ],\n                [\n                    180.0,\n                    -80.0\n                ]\n            ]\n        },\n        {\n            \"id\": 140596130449680,\n            \"start_socket\": 140596130327712,\n            \"end_socket\": 140596130326800,\n            \"wire_type\": 3,\n            \"custom_routing\": false,\n            \"wire_coordinates\": []\n        },\n        {\n            \"id\": 140596130449920,\n            \"start_socket\": 140596130327472,\n            \"end_socket\": 140596130326656,\n            \"wire_type\": 3,\n            \"custom_routing\": true,\n            \"wire_coordinates\": [\n                [\n                    -260.0,\n                    -60.0\n                ],\n                [\n                    -300.0,\n                    -60.0\n                ],\n                [\n                    -300.0,\n                    60.0\n                ],\n                [\n                    240.0,\n                    60.0\n                ],\n                [\n                    240.0,\n                    -80.0\n                ],\n                [\n                    180.0,\n                    -80.0\n                ]\n            ]\n        },\n        {\n            \"id\": 140192961940304,\n            \"start_socket\": 140596130327712,\n            \"end_socket\": 140596130400096,\n            \"wire_type\": 3,\n            \"custom_routing\": true,\n            \"wire_coordinates\": [\n                [\n                    280.0,\n                    80.0\n                ],\n                [\n                    -330.0,\n                    80.0\n                ],\n                [\n                    -330.0,\n                    -80.0\n                ],\n                [\n                    -360.0,\n                    -80.0\n                ]\n            ]\n        }\n    ],\n    \"labels\": [],\n    \"grouping_boxes\": []\n}"
  },
  {
    "path": "examples/eg1.py",
    "content": "#!/usr/bin/env python3\n\n\"\"\"\nExample of continuous-time system\nCopyright (c) 2021- Peter Corke\n\"\"\"\nimport bdsim\n\nsim = bdsim.BDSim(animation=True)  # create simulator\nbd = sim.blockdiagram()  # create an empty block diagram\n\n# define the blocks\ndemand = bd.STEP(T=1, name=\"demand\")\nsum = bd.SUM(\"+-\")\ngain = bd.GAIN(10)\nplant = bd.LTI_SISO(0.5, [2, 1], name=\"plant\")\nscope = bd.SCOPE(styles=[\"k\", \"r--\"], loc=\"lower right\")  # , movie='eg1.mp4')\n\n# connect the blocks\nbd.connect(demand, sum[0], scope[1])\nbd.connect(plant, sum[1])\nbd.connect(sum, gain)\nbd.connect(gain, plant)\nbd.connect(plant, scope[0])\n\n\nbd.compile()  # check the diagram\nsim.report(bd)  # , format=\"latex\")\nsim.report(bd, \"schedule\")\n\n# bd.dotfile(\"eg1a.dot\")\n\nout = sim.run(bd, T=5)  # , watch=[demand, sum])  # simulate for 5s\n# out = sim.run(bd, watch=[plant, demand])  # simulate for 5s\nprint(out)\n\n# scope.savefig()  # save scope figure as scope0.pdf, need to set hold=False\n"
  },
  {
    "path": "examples/eg1_zoh.py",
    "content": "#!/usr/bin/env python3\n\nimport bdsim\n\nsim = bdsim.BDSim(animation=True)  # create simulator\nbd = sim.blockdiagram()  # create an empty block diagram\n\n# define the clocks\nclock1 = bd.clock(10, \"Hz\")\n\n# define the blocks\ndemand = bd.STEP(T=1, name=\"demand\")\nsum = bd.SUM(\"+-\")\ngain = bd.GAIN(10)\nplant = bd.LTI_SISO(0.5, [2, 1], name=\"plant\")\nscope = bd.SCOPE(styles=[\"k\", \"r--\"])\nzoh = bd.ZOH(clock=clock1)\n\n# connect the blocks\nbd.connect(demand, sum[0], scope[1])\nbd.connect(plant, sum[1])\nbd.connect(sum, gain)\n# bd.connect(gain, plant)\nbd.connect(gain, zoh)\nbd.connect(zoh, plant)\nbd.connect(plant, scope[0])\n\n\nbd.compile()  # check the diagram\nbd.report()\nbd.report_summary()  # list all blocks and wires\n\nout = sim.run(bd, watch=[demand, sum])  # simulate for 5s\n# out = sim.run(bd, 5 watch=[plant,demand])  # simulate for 5s\nprint(out)\n\n# sim.savefig(scope, 'scope0') # save scope figure as scope0.pdf\n"
  },
  {
    "path": "examples/pid.py",
    "content": "#!/usr/bin/env python\n'''\nExample of PID control system\nCopyright (c) 2021- Peter Corke\n'''\nimport bdsim\n\nsim = bdsim.BDSim(animation=True)  # create simulator\nbd = sim.blockdiagram()  # create an empty block diagram\n\n# define the blocks\ndmd = bd.STEP(T=1, on=1, name=\"demand\")\ncontroller = bd.PID(P=5, D=0, I=-5, I_band=0.3, name=\"PID\")\nplant = bd.LTI_SISO(0.5, [2, 1], name=\"plant\")\nscope = bd.SCOPE(styles=[\"k\", \"r--\"])\n\n# connect the blocks\n\nbd.connect(dmd, controller[1], scope[0])\nbd.connect(controller, plant)\nbd.connect(plant, controller[0], scope[1])\n\nbd.compile()\nsim.report(bd)\nout = sim.run(bd, 10)\nprint(out)"
  },
  {
    "path": "examples/rt_step.py",
    "content": "#!/usr/bin/env python3\n\n\"\"\"\nExample of real-time system using Arduino+Firmata\nCopyright (c) 2023- Peter Corke\n\"\"\"\n\nimport bdsim\nfrom bdsim.blocks.IO.Firmata import *\n\nsim = bdsim.BDRealTime(\n    toolboxes=False, graphics=True, animation=True\n)  # create RT model\nbd = sim.blockdiagram()  # create an empty block diagram\nscope = bd.SCOPE(scale=[0, 1])\n\n# define the blocks\n# demand = bd.WAVEFORM(wave=\"triangle\", name=\"demand\")\npot = AnalogIn(pin=0)\n# led = AnalogOut(pin=6, scale=0.5, offset=0.5, bd=bd)\nled = AnalogOut(pin=6)\n\n# connect the blocks\nbd.connect(pot, led, scope)\n\nbd.compile()  # check the diagram\nbd.report_summary()  # list all blocks and wires\n\nout = sim.run(bd, T=10, dt=0.2, samples=False, watch=[pot])  # simulate for 5s\nprint(out)\nprint(out.y0)\n"
  },
  {
    "path": "examples/sine+sampler.py",
    "content": "#!/usr/bin/env python3\n\n\"\"\"\nExample with one ZOH sampling a sine wave\nCopyright (c) 2021- Peter Corke\n\"\"\"\n\nimport bdsim\nimport time\n\nsim = bdsim.BDSim()\nbd = sim.blockdiagram()\n\nclock = bd.clock(5, \"Hz\")\n\n# define the blocks\n\nsine = bd.WAVEFORM(\"sine\", freq=0.2, unit=\"Hz\")\nzoh = bd.ZOH(clock)\n\nscope = bd.SCOPE(styles=[dict(color=\"b\"), dict(color=\"r\", drawstyle=\"steps\")])\n\n# connect the blocks\nbd.connect(sine, zoh, scope[0])\nbd.connect(zoh, scope[1])\n\nbd.compile()  # check the diagram\nbd.report()  # list all blocks and wires\n\nprint(clock)\n\nout = sim.run(bd, 5)  # simulate for 5s\n\nsim.done(bd, block=True)\n"
  },
  {
    "path": "examples/sine+sampler2.py",
    "content": "#!/usr/bin/env python3\n\n\"\"\"\nExample with two ZOHs sampling a sine wave\nCopyright (c) 2021- Peter Corke\n\"\"\"\n\nimport bdsim\nimport time\n\nsim = bdsim.BDSim()\nbd = sim.blockdiagram()\n\nclock1 = bd.clock(5, \"Hz\")\nclock2 = bd.clock(10, \"Hz\")\n\n# define the blocks\n\nsine = bd.WAVEFORM(\"sine\", freq=0.2, unit=\"Hz\")\nzoh1 = bd.ZOH(clock1)\nzoh2 = bd.ZOH(clock2)\n\nscope = bd.SCOPE(styles=[dict(color=\"k\", linestyle=\"--\"), dict(color=\"r\", drawstyle=\"steps\"), dict(color=\"b\", drawstyle=\"steps\")])\n\n# connect the blocks\nbd.connect(sine, zoh1, zoh2, scope[0])\nbd.connect(zoh1, scope[1])\nbd.connect(zoh2, scope[2])\n\nbd.compile()  # check the diagram\nbd.report()  # list all blocks and wires\n\nprint(clock1)\nprint(clock2)\n\nout = sim.run(bd, 5)  # simulate for 5s\n\nsim.done(bd, block=True)\n"
  },
  {
    "path": "examples/subsys.py",
    "content": "#!/usr/bin/env python3\n\nimport bdsim\n\nsim = bdsim.BDSim()\n\n# create simple subsystem as a blockdiagram\nss = sim.blockdiagram(name=\"subsystem1\")\n\nsquarer = ss.FUNCTION(lambda x: x**2)\nsum = ss.SUM(\"++\")\ninp = ss.INPORT(2)\noutp = ss.OUTPORT(1)\n\nss.connect(inp[0], squarer)\nss.connect(squarer, sum[0])\nss.connect(inp[1], sum[1])\nss.connect(sum, outp)\n\n# create main system as a blockdiagram\nmain = sim.blockdiagram()\n\nx = main.WAVEFORM(\"sine\", 1, \"Hz\")\nconst = main.CONSTANT(1)\nscope = main.SCOPE()\nsubsys = main.SUBSYSTEM(ss)  # instantiate the subsystem\n\nmain.connect(x, subsys[0])\nmain.connect(const, subsys[1])\nmain.connect(subsys, scope)\n\nmain.compile(verbose=False)\n\nsim.report(main)\nsim.run(main, T=5)\n"
  },
  {
    "path": "examples/vanderpol.py",
    "content": "#!/usr/bin/env python3\n\n\"\"\"\nExample of van der Pol oscillator\nCopyright (c) 2021- Peter Corke\n\"\"\"\n\nimport bdsim\n\nsim = bdsim.BDSim(animation=True, globs=globals())  # create simulator\nbd = sim.blockdiagram()  # create an empty block diagram\n\nλ = 0.3\n\n# define the blocks\nx = bd.INTEGRATOR(x0=1)  # integrator block\ny = bd.INTEGRATOR(x0=1)  # integrator block\nscope = bd.SCOPEXY(scale=[-2, 2, -2, 2])\n\n# we can write this two different ways\n\n## 1. Using a 2-input function block, probably computationally efficient\nf = bd.FUNCTION(lambda x, y: -x + λ * (1 - x**2) * y, nin=2)\nbd.connect(x, scope[0], f[0])\nbd.connect(y, x, scope[1], f[1])\nbd.connect(f, y)\n\n\n## 2. Using implicit block creation\n# x[0] = y\n# y[0] = -x + λ * (1 - x**2) * y\n# scope[0] = x\n# scope[1] = y\n\nbd.compile()  # check the diagram\nbd.report_summary()  # list all blocks and wires\n\n# probably needs a stiff integrator\nout = sim.run(bd, T=20, solver=\"BDF\")  # , watch=[demand, sum])  # simulate for 5s\n"
  },
  {
    "path": "examples/viewsim.py",
    "content": "import pickle\nfrom bdsim import BDStruct\nimport sys\n\nsys.setrecursionlimit(20_000)\n\nwith open(\"bd.out\", \"rb\") as f:\n    out = pickle.load(f)\n\nprint(out)\n"
  },
  {
    "path": "examples/waveform.py",
    "content": "#!/usr/bin/env python3\n\n\"\"\"\nExample with two waveform generators driving a scope\nCopyright (c) 2021- Peter Corke\n\"\"\"\n\nimport bdsim\n\nsim = bdsim.BDSim(animation=True)  # create simulator\nbd = sim.blockdiagram()\n\nwave1 = bd.WAVEFORM(wave=\"triangle\", freq=1, phase=0.25)\nwave2 = bd.WAVEFORM(wave=\"square\", freq=1, min=0, max=1)\nscope1 = bd.SCOPE()\nscope2 = bd.SCOPE()\n\nbd.connect(wave1, scope1)\nbd.connect(wave2, scope2)\n\nbd.compile()\nsim.report(bd)\nout = sim.run(bd, 4, dt=0.02)\n"
  },
  {
    "path": "figs/data_structures.ezdraw",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>AAAA_CurrentOSXVersion</key>\n\t<string>macOS Catalina: 1676.105000</string>\n\t<key>AAAA_DKDDocumentVersion</key>\n\t<string>9.0.0 : Mobile Friendly</string>\n\t<key>AAAA_EazyDrawVersion</key>\n\t<string>9.7.0</string>\n\t<key>AAAB_Build</key>\n\t<string>9087</string>\n\t<key>AAAB_Distribution</key>\n\t<string>Free Market</string>\n\t<key>AAA_DKDQuicklookData</key>\n\t<data>\n\tJVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmls\n\tdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGlmkmPHMcRhe/1K/JIHljKfblK8EUn\n\tCxrAB0EHe0RZtIekyaGgv+/vZS1dXd3VPaIgQJwJVmZkxvLiRSQ/mR/MJ2PHbN6Zb757\n\tdubx2Tjz/Ggs/7XmR+ezqTaNtbZqPr81vxpvvten3nz3Y//Kmh+/M58G1395oz/W7x/f\n\tG+fCGKx3JrrRRRsykjQW66qJefTVlqBtf+znuLLHwB4+cY4Yw9fuYdgjNDu2muONPYZb\n\t59Aeybex+ppv7DHfZfiEFWXCC3vkXMdcLLf/enusNvUeE+aAYRZTrj/cu4urfiw+eHO8\n\tx117rH453uOuPYJ3Y8op3DjH3fhYfXv3HMT6gV9itmO0Jd04x117rPFx9xyDH3PIPpg/\n\tyL0aSnSVaOk/hVLnn3xxPbWOjkxEu+yKIZWKK2NILhgyNmUX83JW9ESbfULR4dWXfbwN\n\tpLtvJtk22lovNnM6bv9PGX90LB/TGCrLXQhTopPBpY4uFTessqdVZlwso/XVIGpujJV4\n\tvibKaYw+Fn1WytiyH9yFyDgUtZidvtI5ivOHslJKnL/z1udBa3eyfgfdZd5uudYVUYe0\n\tJ/PbpJcPTnd93+FtgVc7wes7WRAATKnkGSqW394Ui0FCc6bGOnLnJBT89sFwmQlUSNvk\n\tMG4GTgncwMfm4b355uHB4ZaHX82r5y///PzltXn4j/nbA9g6IfxVn2nv4NwYpHD1D7IY\n\tR2cx0Sp72shWn4VUxhiE65No4KtVdHJQiGFsRBfnXf14kp281k/iXVq9pv10ukU2e0gy\n\tl4iajddOMiJvclFfulxMTpl3W0Sr184+7NLJa5bCeOyoWseaCnl67KjgiMgcOeh1R739\n\t8MvJTW5syTs+Fi7koaueXc4f27oK7I8EdzG4fizNFkOWXcgWybB+tUhO6x5ZR0XOUdin\n\tTQXGKY3N1ma8a2O2EoQRuHfGgw0utDCwjBCMlG+SB5FC0vMNq12LHClOErANhCJGSEvz\n\tuGSCF9GYsOT5cdDu1ttsQCr0Fq/LcITqcjAZA0YHzpGDiViPbCxZyNUjI+H2q4f30BTg\n\tvFYLANyCvnWpKw16AE5uFPdTl+qImVWxZJghnyverBaR2XiR0Ln0X+c0JZHumESeIcP6\n\tlS9k/r5EjgAPA47Bf2l0LfMD14kVhzqKSsv8UIkSm/jB4grXsL8J4D2VN3YH5hLqECgj\n\tKVm8LNYGXTJsC03gmJMxWppdqLLtG8i18RgoNOJt172DwtSTDQAr1BR5jJ0FzL+x6+Xq\n\tF3isI9WydGPzVbEOma1VWCjtumLJKEcKn5NisH7190s81hlkIPisMBLqloFtYiXMsmGV\n\tLZLTV5cSTO/raG3CrNiMrKtIwhhTpGpYkseRViGAv8mChPiJXIObg6x5TA4m7izFX+ET\n\tLdgIpnb4TfgdCRwAcjG0BBeoSKaskzyG1LlCjah8z6d8wvbISJdEwDwho/jEULqMoCLU\n\th9/6prvFL3CYzLaoBSptTK2SnKtaThiD66V/VYssV+ta99d+MWfu7jrK6Z5ZvsORp1h5\n\tUEUOyzhbYZHFGyxYeY8dR4i1dT7e2GNhWFczXBf3yzkyyVRziyf1u3MM5FiCpoG30081\n\tiwNKptpyk2yhBHMSB+JEsXnM66EPyePBRYYpT7JGilMzJYP42UZJjldkyUeiyHfwYz+2\n\tc/Q/k2zeb5LBEkIlXNmPs4RCcKYDGXWjCEwXw+g7yea11BDOAhXgg0U23+2abL5vrwB7\n\tK8xxQlVJXuj1h2CYHrK54CKAfGTSCWG4USS9V/OR5wUzZ3JmlYEwq+xkvgD/toG4WUwq\n\tCFxkG/NprSvUuauyk/nYiuxuUPJZpv22stl8klE2Q/9uL9uYtK+d7jaZdNnv7L4TUl5a\n\tYYeUV6J2juS7UQutrRSeHCBxdPa4y+9Ew15w8QWwJgZSaQkyRS2pYyEkCUEcnoHFWEh5\n\tDxWEpMQh1QydjUJDD2qnwo/8D7ABIWiEwfZsUqZhoqrp9xYSoQzjgHbNELreeL7neZ4y\n\tNZE2ijmciI1So1xyswCnEQyJ0XACRTsHkMUlsdmqUEJjrqx9IcauSxMsm7TuKLCo1RVK\n\t5S4nvf1WvilpN3qXxbvkGV6aPB30iuyORzOzkhgBA+HRTjZcSC6/kZvwTszdmVDoKloK\n\tyOUIS0sUdeiJGzzJlVUkE/MMAoASCdribzlXcyY6JBXSEvBF0scWIAsBMlKoezKEbXT9\n\tj8NUV7YggT/piaha9NWizV6ESH0R16kokPdyFaOh/aFc5MmhtfnJodcWy6ElE2p0ODda\n\t8nVpooal5hywvurVob2ifaM4RUpc6zAMy1lOvay+9Ohh1cJyGAtmHVuGs8N0pXkvWyTD\n\t+tUiOa3DekyjQlJxogDjttRPBtNkGsi9fATY+HsVDQTyRG7QWdganJNviOCE4fk7AsFz\n\tOQjkyJ3YkDhn9AFG058QTXFOUMn7kDHQgrgAnYJtcAogEFUgAFnfSQ4+pL5DspAlmFjP\n\thIvV3H3jMBLh0GzrUvgvhVt5v+rVGTX6REec9Q6SBSLlXO9p8R5qexNxq2r5CimF7WBQ\n\tEUI4PMFebIO/kRDZZkr+PdbjyaEEsR2CUqewFN9joOaYAqwyom6V0VVE8I1bLGv5y1UG\n\ttlzZUVc7tmMjz+h/AzEOCfbnt4C1tru8i0YT1yvvwQ94fhXvglESLbKE9limkn+aH/Q+\n\tgJaIAVOokKFGzcBGXTKskun30xf73wlxVgAhhDYMnKJVenbnIgLEmKBGIlftGUETac5p\n\t0gRtHYQcRY3KRvuLR0XraM+gZjkyCc7UOwqPTeSKamIG0mdo82zrwQynObhKHbicNDlI\n\tDhn46lKvTGizkTBykJoA1vYA3S8mqzZ5cQvIlpXMJBltEO8btQTl2KgVVD9NILrabEFm\n\tD2T0yjSfebN4lxc/GaiW+Zns+EUZMhwzO3kOPg1YAABUdkIEHLkmW74a1q8WyWndI3tB\n\tJ+hdQCmogpMrK47LCU5HmEH6ADAFcYthEA4ztxL3AMeYreIoeYzEmkIdh1Ay6b6peaSa\n\tYA6HUEQVsJ2z6OLTDUUzFOJWQzJlPXBKDGoNRBwRcVmoVOQpstzgWep2ne3tHTk5Lx5O\n\ti89pxk+TPQ9zdNmA4xF0lGIVp0V9pj9nltZb8EV9pptijjLTjeXsy2oOr8vN41Fc2F+f\n\tbk3dxK0sQ0bTyB6QjbnSNB5dZi1wLSwHOwMEcDWMqA3n49F3H/738fOX59Pkjdsu49dp\n\txLr89gZtFA3ShPElbLU5NQkaxu60RagdhRNeEnaz2I+/f3mxNof9GJMyfKeQMO/2l9pI\n\tT0JP1ZSIo/CXv6ROz2KQU5kSGlmuqePFKqsCYMpayJqvNiXjKXIJw1WIfw7+ijaig2ky\n\tLiW+qZq0XOfa/vX08fG/T++eN7PtY9dJH6CDPpKCXevl7dBH/Rdw1v4syfR8O0f/ybz6\n\t493n12SVefV2UvuzefieofrwgyLGJksK92ktg2IojGN4wWuOuk0CgeEKnedR3VbYivfQ\n\tsIQBX9rEGUkHNZnABcMh/gRkSOU5Q6ax6axl1YGKuznjqDgUitAn1eTOFVNo6MEwWyN6\n\tvoWFnZvi1d+ffv+3efeBl4UPj29PmQOT4mXHN+jRjVeGfldi20aSkgk3F6O4dScXSCan\n\tK9UywhRHwbS3x+6U92leXJmH0W5Q5PYpGUFGokx4qPClJdr79R+vzRs69Verezd3m30s\n\tzO1P44tjV5Pz3H3TqwXma/EcrENlgmMQzlbV4eymUjBN+Re42YGPbsoDb8VtnEHk9cpN\n\teVkRv0UPGZPq+U1ffauM2dztBU9C3VkMYihg+EhPAE5hwWQSuNHAf3LWQsU2eUAuqkxd\n\tvnvDJZhE65SwDsKvM2Q2ojGFlOjBiIIIE1CgH27CSxijGRU0jbP1skCysAn0Xj28LAxy\n\t9E2GzRBeB7rNDLzok3in5riQqj6RmGV9tttll19dSsTSNFSQ4RjyApxqFGlJM9gKsDPS\n\tpVvpLM3hTaYflFCyXuv04EFz6xjGMlZX08lfUrexvHqxqnX0NzymarZbMrVi7numG4oZ\n\t8AEMMfcpL71zw0LauPFAqCGvyxBj8S2MlumEJbNQhGkCcWXxOTU49Myql2yjaDUowaJW\n\tR9U/NNholajp3y1MLG8+8rx05gOL/zqsfPV4lM7RV/r7yMCgRB6gOdde9iIJpmVdlR3V\n\tzfKCknlUg4Yn6i9zbQib/EP4APqQUh5Dm/6Zh9bBfih2yNTzMojxegvFYr3DzfBChl16\n\tAOMTKCAMYxnZk2fUy6O5sNwtYimGF+jWeTiM/X6MJXiTgx6AsqH3th70AHTV7yom4Zjd\n\t8vvVmH7j71v97qo48h6YC8Eqw86K+y1SHy8timl4Ibe+9xhQ0EXxZnUnuF9T2ahaDPhg\n\tvrA8+JnLV4o8QUnLhZmYuzbl5lkxOITIi9J2UQfuVPfegwcmlCHD5pi7k9yQVz2v7EH0\n\tdsWD8sGsGVgwgyLUeB+4qAOO64MavHIQqDxU7SgvTObPVLyrmS7L6jWqvwgS0hOrPy5t\n\tN9/OuRIDUtKhiQ2A6pd+ExJSFuioNFSheJy77YCQgJ63Xs6dmoZAJML7CItDFkIh+uH/\n\tXin6FgplbmRzdHJlYW0KZW5kb2JqCjUgMCBvYmoKMzQ0NQplbmRvYmoKMiAwIG9iago8\n\tPCAvVHlwZSAvUGFnZSAvUGFyZW50IDMgMCBSIC9SZXNvdXJjZXMgNiAwIFIgL0NvbnRl\n\tbnRzIDQgMCBSIC9NZWRpYUJveCBbMCAwIDk5Mi4xMjYgODA1Ljg4OThdCj4+CmVuZG9i\n\tago2IDAgb2JqCjw8IC9Qcm9jU2V0IFsgL1BERiAvVGV4dCBdIC9Db2xvclNwYWNlIDw8\n\tIC9DczEgNyAwIFIgL0NzMiA4IDAgUiA+PiAvRm9udCA8PAovVFQxIDkgMCBSID4+ID4+\n\tCmVuZG9iagoxMCAwIG9iago8PCAvTGVuZ3RoIDExIDAgUiAvTiAxIC9BbHRlcm5hdGUg\n\tL0RldmljZUdyYXkgL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngBpVcHWJPX\n\tGj7/SMJK2FNG2MgyoOwZmQFkD0FUYhJIGCEGgoC4KMUK1i0OHBUtilK0WhEoLtTioG5Q\n\t67hQSwWlFqu4sHrPCaDQ9rn3Ps/N/xz+93xnfOs9338AQF3IlUiycQBAjjhfGhLLTp6Z\n\tnMKk3QMKQBeoAkegyuXlSdjR0RFwChDnigXoPfH3sgtgSHLDAe01cey/9ih8QR4PzjoF\n\tWxE/j5cDAOYNAK2PJ5HmA6BoAeXmC/IlCIdCrJUVHxsAcSoACiqja6EYmIQIxAKpiMcM\n\tkXKLmCHcnBwu09nRmRktzU0XZf+D1WjR//PLyZYhu9HPBDaVvKy4cPh2hPaX8bmBCLtD\n\tfJjHDYobxY8LRImREPsDgJtJ8qfHQhwG8TxZVgIbYnuI69OlwQkQ+0J8WygLRXgaAIRO\n\tsTA+CWJjiMPE8yKjIPaEWMjLC0iB2AbiGqGAg/IEY0ZcFOVz4iGG+oin0txYNN8WANKb\n\tLwgMGpGT6Vm54cgGMyj/Lq8gDsnlNhcLA5CdUBfZlckNi4bYCuIXguwQNB/uQzGQ5Eej\n\tPWGfEijOjkR6/SGuEuTJ/YV9Sle+MB7lzBkAqlm+NB6thbZR49NFwRyIgyEuFEpDkRz6\n\tSz0hyZbzDMaE+k4qi0W+Qx9pwQJxAooh4sVSrjQoBGIYK1orSMS4QABywTz4lwfEoAcw\n\tQR4QgQI5ygBckAMbE1pgD1sInCWGTQpn5IEsKM+AuPfjOOqjFWiNBI7kgnQ4MxuuG5My\n\tAR+uH1mH9siFDfXQvn3yfXmj+hyhvgDjr4EMjgvBABwXQjQDdMslhdC+HNgPgFIZHMuA\n\teLwWZ8gjZxAtt3XEBjSOtPSPasmFK/hyXSPrkJcjtgVAm8WgGI4h2+Sek7oki5wKmxcZ\n\tQfqQLLk2KZxRBBzkcm+5bEzrJ8+Rb/0ftc6Hto73fny8xmJ8GsYrH+6cDT0Uj8YnD1rz\n\tDtqdNbr6UzTlGtcYyGwkkqpVMZw5tXKLke/MUulcEe/K6sH/kLVP2RrT7jAhb1HjeSFn\n\tCv9vvIC6KNcpVykPKDcBE75/oXRS+iC6S7kHnzsf7YkexwcUe8QcEfwrgj6OMWCEWTy5\n\tBOUiGz4oL3+381PORvb5yw4YIdeLOMuW74IYlgMbyqxAntcQqJ8L85EHoy2DPEXccICM\n\tGZ+7ES3jTkB7SaseYHatPHUBMOvVms/Ltcij3Uk2pd5QaS9JF68xkEjm1JYMCySfRlEe\n\tBMsjX0aCUnvWIdYAaw+rnvWc9eDTDNYt1m+sTtYuOPKEWE8cJY4TzUQL0QGYsNdCnCaa\n\t5aieaIXPtx/XTWT4yDmayHDEN94oo5GP+aOcGs/9cR7K4zUWLTR/LFOZoyd1PPdQfMcz\n\tBmXsf7NofEYnVoSR7MhPHcOc4cSgMWwZLgw2A2OYwseZ4Q+ROcOMEcHQhaOhDGtGIGPS\n\tx3iMnHFkBzrviGFjdeFTFUuGo2NMQP4JIQ+k8prFHfX3rz4yJ3iJKppo/KnC6PBkjmga\n\tqQljOsfiKmfIhJOVADWJwAJohxTGFZ12MawlzAlzUCVGVQgyEpslz+E/nATSmHQiObAy\n\tRQEmySZdSP9RjKqVN3xQrRqp3g6kHxz1JQNJd1THxnsAdx+JF6po/2z9+JMhoHpSralB\n\tVGv53nLvqIHUUGowYFKdkJw6hRoGsQealS8ohHcPAAJyJUVSUYYwn8mGtxwBkyPmOdoz\n\tnVlO8OuG7kxoDgDPY+R3IUyngyeTFozISPSiACV4n9IC+vCrag6/1g7QKzfgBb+ZQfAO\n\tEAXiQTKYA/0QwkxKYWRLwDJQDirBGrARbAU7wR5QBxrAYXAMtILT4AdwCVwFneAu/J70\n\tgidgELwEwxiG0TA6ponpYyaYJWaHOWPumC8WhEVgsVgyloZlYGJMhpVgn2GV2DpsK7YL\n\tq8O+xZqx09gF7Bp2B+vB+rE/sLc4gavgWrgRboVPwd1xNh6Ox+Oz8Qx8Pl6Ml+Gr8M14\n\tDV6PN+Kn8Ut4J96NP8GHCEAoEzqEKeFAuBMBRBSRQqQTUmIxUUFUETVEA6wB7cQNopsY\n\tIN6QVFKTZJIOMIuhZALJI+eTi8mV5FZyH9lIniVvkD3kIPmeQqcYUuwonhQOZSYlg7KA\n\tUk6potRSjlLOwQrdS3lJpVJ1YH7cYN6SqZnUhdSV1O3Ug9RT1GvUh9QhGo2mT7Oj+dCi\n\taFxaPq2ctoVWTztJu07rpb1WUFYwUXBWCFZIURArlCpUKexXOKFwXeGRwrCimqKloqdi\n\tlCJfsUhxteIexRbFK4q9isNK6krWSj5K8UqZSsuUNis1KJ1Tuqf0XFlZ2UzZQzlGWaS8\n\tVHmz8iHl88o9ym9UNFRsVQJUUlVkKqtU9qqcUrmj8pxOp1vR/ekp9Hz6Knod/Qz9Af01\n\tQ5PhyOAw+IwljGpGI+M646mqoqqlKlt1jmqxapXqEdUrqgNqimpWagFqXLXFatVqzWq3\n\t1IbUNdWd1KPUc9RXqu9Xv6Dep0HTsNII0uBrlGns1jij8VCT0DTXDNDkaX6muUfznGav\n\tFlXLWoujlalVqfWN1mWtQW0N7WnaidqF2tXax7W7dQgdKx2OTrbOap3DOl06b3WNdNm6\n\tAt0Vug2613Vf6U3S89cT6FXoHdTr1Hurz9QP0s/SX6t/TP++AWlgaxBjsMBgh8E5g4FJ\n\tWpO8JvEmVUw6POknQ9zQ1jDWcKHhbsMOwyEjY6MQI4nRFqMzRgPGOsb+xpnGG4xPGPeb\n\taJr4mohMNpicNHnM1GaymdnMzcyzzEFTQ9NQU5npLtPLpsNm1mYJZqVmB83umyuZu5un\n\tm28wbzMftDCxmGFRYnHA4idLRUt3S6HlJst2y1dW1lZJVsutjln1WetZc6yLrQ9Y37Oh\n\t2/jZzLepsbk5mTrZfXLW5O2Tr9riti62Qttq2yt2uJ2rnchuu901e4q9h73Yvsb+loOK\n\tA9uhwOGAQ4+jjmOEY6njMcenUyympExZO6V9ynuWCysbft3uOmk4hTmVOrU4/eFs68xz\n\trna+OZU+NXjqkqlNU59Ns5smmLZj2m0XTZcZLstd2lz+dHVzlbo2uPa7WbiluW1zu+Wu\n\t5R7tvtL9vAfFY7rHEo9Wjzeerp75noc9f/dy8Mry2u/V523tLfDe4/3Qx8yH67PLp9uX\n\t6Zvm+5Vvt5+pH9evxu9nf3N/vn+t/yP2ZHYmu579dDprunT60emvAjwDFgWcCiQCQwIr\n\tAi8HaQQlBG0NehBsFpwRfCB4MMQlZGHIqVBKaHjo2tBbHCMOj1PHGQxzC1sUdjZcJTwu\n\tfGv4zxG2EdKIlhn4jLAZ62fci7SMFEceiwJRnKj1UfejraPnR38fQ42JjqmO+TXWKbYk\n\ttj1OM25u3P64l/HT41fH302wSZAltCWqJqYm1iW+SgpMWpfUPXPKzEUzLyUbJIuSm1Jo\n\tKYkptSlDs4JmbZzVm+qSWp7aNdt6duHsC3MM5mTPOT5XdS537pE0SlpS2v60d9wobg13\n\taB5n3rZ5g7wA3ibeE74/fwO/X+AjWCd4lO6Tvi69L8MnY31Gv9BPWCUcEAWItoqeZYZm\n\t7sx8lRWVtTfrQ3ZS9sEchZy0nGaxhjhLfDbXOLcw95rETlIu6Z7vOX/j/EFpuLQ2D8ub\n\tndeUrwX/weyQ2cg+l/UU+BZUF7xekLjgSKF6obiwo8i2aEXRo+Lg4q8Xkgt5C9tKTEuW\n\tlfQsYi/atRhbPG9x2xLzJWVLepeGLN23TGlZ1rIfS1ml60pffJb0WUuZUdnSsoefh3x+\n\toJxRLi2/tdxr+c4vyC9EX1xeMXXFlhXvK/gVFytZlVWV71byVl780unLzV9+WJW+6vJq\n\t19U71lDXiNd0rfVbu2+d+rridQ/Xz1jfuIG5oWLDi41zN16omla1c5PSJtmm7s0Rm5u2\n\tWGxZs+XdVuHWzurp1Qe3GW5bse3Vdv726zv8dzTsNNpZufPtV6Kvbu8K2dVYY1VTtZu6\n\tu2D3r3sS97R/7f51Xa1BbWXtn3vFe7v3xe47W+dWV7ffcP/qA/gB2YH++tT6q98EftPU\n\t4NCw66DOwcpD4JDs0ONv077tOhx+uO2I+5GG7yy/23ZU82hFI9ZY1Dh4THisuym56Vpz\n\tWHNbi1fL0e8dv9/batpafVz7+OoTSifKTnw4WXxy6JTk1MDpjNMP2+a23T0z88zNszFn\n\tL58LP3f+h+AfzrSz20+e9znfesHzQvNF94vHLrleauxw6Tj6o8uPRy+7Xm684nal6arH\n\t1ZZr3tdOXPe7fvpG4I0fbnJuXuqM7LzWldB1+1bqre7b/Nt9d7LvPPup4Kfhu0vhJb7i\n\tvtr9qgeGD2r+NflfB7tdu4/3BPZ0/Bz3892HvIdPfsn75V1v2a/0X6semTyq63Pua+0P\n\t7r/6eNbj3ieSJ8MD5b+p/7btqc3T7373/71jcOZg7zPpsw9/rHyu/3zvi2kv2oaihx68\n\tzHk5/Kritf7rfW/c37S/TXr7aHjBO9q7zX9O/rPlffj7ex9yPnz4Ny1d8BwKZW5kc3Ry\n\tZWFtCmVuZG9iagoxMSAwIG9iagozMzY3CmVuZG9iago3IDAgb2JqClsgL0lDQ0Jhc2Vk\n\tIDEwIDAgUiBdCmVuZG9iagoxMiAwIG9iago8PCAvTGVuZ3RoIDEzIDAgUiAvTiAzIC9B\n\tbHRlcm5hdGUgL0RldmljZVJHQiAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0K\n\teAGdlndUU9kWh8+9N73QEiIgJfQaegkg0jtIFQRRiUmAUAKGhCZ2RAVGFBEpVmRUwAFH\n\thyJjRRQLg4Ji1wnyEFDGwVFEReXdjGsJ7601896a/cdZ39nnt9fZZ+9917oAUPyCBMJ0\n\tWAGANKFYFO7rwVwSE8vE9wIYEAEOWAHA4WZmBEf4RALU/L09mZmoSMaz9u4ugGS72yy/\n\tUCZz1v9/kSI3QyQGAApF1TY8fiYX5QKUU7PFGTL/BMr0lSkyhjEyFqEJoqwi48SvbPan\n\t5iu7yZiXJuShGlnOGbw0noy7UN6aJeGjjAShXJgl4GejfAdlvVRJmgDl9yjT0/icTAAw\n\tFJlfzOcmoWyJMkUUGe6J8gIACJTEObxyDov5OWieAHimZ+SKBIlJYqYR15hp5ejIZvrx\n\ts1P5YjErlMNN4Yh4TM/0tAyOMBeAr2+WRQElWW2ZaJHtrRzt7VnW5mj5v9nfHn5T/T3I\n\tevtV8Sbsz55BjJ5Z32zsrC+9FgD2JFqbHbO+lVUAtG0GQOXhrE/vIADyBQC03pzzHoZs\n\tXpLE4gwnC4vs7GxzAZ9rLivoN/ufgm/Kv4Y595nL7vtWO6YXP4EjSRUzZUXlpqemS0TM\n\tzAwOl89k/fcQ/+PAOWnNycMsnJ/AF/GF6FVR6JQJhIlou4U8gViQLmQKhH/V4X8YNicH\n\tGX6daxRodV8AfYU5ULhJB8hvPQBDIwMkbj96An3rWxAxCsi+vGitka9zjzJ6/uf6Hwtc\n\tim7hTEEiU+b2DI9kciWiLBmj34RswQISkAd0oAo0gS4wAixgDRyAM3AD3iAAhIBIEAOW\n\tAy5IAmlABLJBPtgACkEx2AF2g2pwANSBetAEToI2cAZcBFfADXALDIBHQAqGwUswAd6B\n\taQiC8BAVokGqkBakD5lC1hAbWgh5Q0FQOBQDxUOJkBCSQPnQJqgYKoOqoUNQPfQjdBq6\n\tCF2D+qAH0CA0Bv0BfYQRmALTYQ3YALaA2bA7HAhHwsvgRHgVnAcXwNvhSrgWPg63whfh\n\tG/AALIVfwpMIQMgIA9FGWAgb8URCkFgkAREha5EipAKpRZqQDqQbuY1IkXHkAwaHoWGY\n\tGBbGGeOHWYzhYlZh1mJKMNWYY5hWTBfmNmYQM4H5gqVi1bGmWCesP3YJNhGbjS3EVmCP\n\tYFuwl7ED2GHsOxwOx8AZ4hxwfrgYXDJuNa4Etw/XjLuA68MN4SbxeLwq3hTvgg/Bc/Bi\n\tfCG+Cn8cfx7fjx/GvyeQCVoEa4IPIZYgJGwkVBAaCOcI/YQRwjRRgahPdCKGEHnEXGIp\n\tsY7YQbxJHCZOkxRJhiQXUiQpmbSBVElqIl0mPSa9IZPJOmRHchhZQF5PriSfIF8lD5I/\n\tUJQoJhRPShxFQtlOOUq5QHlAeUOlUg2obtRYqpi6nVpPvUR9Sn0vR5Mzl/OX48mtk6uR\n\ta5Xrl3slT5TXl3eXXy6fJ18hf0r+pvy4AlHBQMFTgaOwVqFG4bTCPYVJRZqilWKIYppi\n\tiWKD4jXFUSW8koGStxJPqUDpsNIlpSEaQtOledK4tE20Otpl2jAdRzek+9OT6cX0H+i9\n\t9AllJWVb5SjlHOUa5bPKUgbCMGD4M1IZpYyTjLuMj/M05rnP48/bNq9pXv+8KZX5Km4q\n\tfJUilWaVAZWPqkxVb9UU1Z2qbapP1DBqJmphatlq+9Uuq43Pp893ns+dXzT/5PyH6rC6\n\tiXq4+mr1w+o96pMamhq+GhkaVRqXNMY1GZpumsma5ZrnNMe0aFoLtQRa5VrntV4wlZnu\n\tzFRmJbOLOaGtru2nLdE+pN2rPa1jqLNYZ6NOs84TXZIuWzdBt1y3U3dCT0svWC9fr1Hv\n\toT5Rn62fpL9Hv1t/ysDQINpgi0GbwaihiqG/YZ5ho+FjI6qRq9Eqo1qjO8Y4Y7ZxivE+\n\t41smsImdSZJJjclNU9jU3lRgus+0zwxr5mgmNKs1u8eisNxZWaxG1qA5wzzIfKN5m/kr\n\tCz2LWIudFt0WXyztLFMt6ywfWSlZBVhttOqw+sPaxJprXWN9x4Zq42Ozzqbd5rWtqS3f\n\tdr/tfTuaXbDdFrtOu8/2DvYi+yb7MQc9h3iHvQ732HR2KLuEfdUR6+jhuM7xjOMHJ3sn\n\tsdNJp9+dWc4pzg3OowsMF/AX1C0YctFx4bgccpEuZC6MX3hwodRV25XjWuv6zE3Xjed2\n\txG3E3dg92f24+ysPSw+RR4vHlKeT5xrPC16Il69XkVevt5L3Yu9q76c+Oj6JPo0+E752\n\tvqt9L/hh/QL9dvrd89fw5/rX+08EOASsCegKpARGBFYHPgsyCRIFdQTDwQHBu4IfL9Jf\n\tJFzUFgJC/EN2hTwJNQxdFfpzGC4sNKwm7Hm4VXh+eHcELWJFREPEu0iPyNLIR4uNFksW\n\td0bJR8VF1UdNRXtFl0VLl1gsWbPkRoxajCCmPRYfGxV7JHZyqffS3UuH4+ziCuPuLjNc\n\tlrPs2nK15anLz66QX8FZcSoeGx8d3xD/iRPCqeVMrvRfuXflBNeTu4f7kufGK+eN8V34\n\tZfyRBJeEsoTRRJfEXYljSa5JFUnjAk9BteB1sl/ygeSplJCUoykzqdGpzWmEtPi000Il\n\tYYqwK10zPSe9L8M0ozBDuspp1e5VE6JA0ZFMKHNZZruYjv5M9UiMJJslg1kLs2qy3mdH\n\tZZ/KUcwR5vTkmuRuyx3J88n7fjVmNXd1Z752/ob8wTXuaw6thdauXNu5Tnddwbrh9b7r\n\tj20gbUjZ8MtGy41lG99uit7UUaBRsL5gaLPv5sZCuUJR4b0tzlsObMVsFWzt3WazrWrb\n\tlyJe0fViy+KK4k8l3JLr31l9V/ndzPaE7b2l9qX7d+B2CHfc3em681iZYlle2dCu4F2t\n\t5czyovK3u1fsvlZhW3FgD2mPZI+0MqiyvUqvakfVp+qk6oEaj5rmvep7t+2d2sfb17/f\n\tbX/TAY0DxQc+HhQcvH/I91BrrUFtxWHc4azDz+ui6rq/Z39ff0TtSPGRz0eFR6XHwo91\n\t1TvU1zeoN5Q2wo2SxrHjccdv/eD1Q3sTq+lQM6O5+AQ4ITnx4sf4H++eDDzZeYp9qukn\n\t/Z/2ttBailqh1tzWibakNml7THvf6YDTnR3OHS0/m/989Iz2mZqzymdLz5HOFZybOZ93\n\tfvJCxoXxi4kXhzpXdD66tOTSna6wrt7LgZevXvG5cqnbvfv8VZerZ645XTt9nX297Yb9\n\tjdYeu56WX+x+aem172296XCz/ZbjrY6+BX3n+l37L972un3ljv+dGwOLBvruLr57/17c\n\tPel93v3RB6kPXj/Mejj9aP1j7OOiJwpPKp6qP6391fjXZqm99Oyg12DPs4hnj4a4Qy//\n\tlfmvT8MFz6nPK0a0RupHrUfPjPmM3Xqx9MXwy4yX0+OFvyn+tveV0auffnf7vWdiycTw\n\ta9HrmT9K3qi+OfrW9m3nZOjk03dp76anit6rvj/2gf2h+2P0x5Hp7E/4T5WfjT93fAn8\n\t8ngmbWbm3/eE8/sKZW5kc3RyZWFtCmVuZG9iagoxMyAwIG9iagoyNjEyCmVuZG9iago4\n\tIDAgb2JqClsgL0lDQ0Jhc2VkIDEyIDAgUiBdCmVuZG9iagozIDAgb2JqCjw8IC9UeXBl\n\tIC9QYWdlcyAvTWVkaWFCb3ggWzAgMCA5OTIuMTI2IDgwNS44ODk4XSAvQ291bnQgMSAv\n\tS2lkcyBbIDIgMCBSIF0KPj4KZW5kb2JqCjE0IDAgb2JqCjw8IC9UeXBlIC9DYXRhbG9n\n\tIC9QYWdlcyAzIDAgUiA+PgplbmRvYmoKOSAwIG9iago8PCAvVHlwZSAvRm9udCAvU3Vi\n\tdHlwZSAvVHJ1ZVR5cGUgL0Jhc2VGb250IC9SRERZWUQrQXZlbmlyLUJvb2sgL0ZvbnRE\n\tZXNjcmlwdG9yCjE1IDAgUiAvRW5jb2RpbmcgL01hY1JvbWFuRW5jb2RpbmcgL0ZpcnN0\n\tQ2hhciAzMiAvTGFzdENoYXIgMTE5IC9XaWR0aHMgWyAyNzgKMCAwIDAgMCAwIDAgMCAw\n\tIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAg\n\tNjMwIDAgMAowIDAgMCAwIDAgMCAwIDAgMCAwIDAgNTc0IDAgMCAwIDAgMCAwIDk0NCAw\n\tIDAgMCAwIDAgMCAwIDAgMCA1MTkgNjExIDQ4MiA2MTEKNTU2IDAgNjExIDAgMjQwIDAg\n\tNDgyIDI0MCAwIDU1NiA1OTMgNjExIDAgMzMyIDQyNiAzMzIgNTU2IDAgNzIyIF0gPj4K\n\tZW5kb2JqCjE1IDAgb2JqCjw8IC9UeXBlIC9Gb250RGVzY3JpcHRvciAvRm9udE5hbWUg\n\tL1JERFlZRCtBdmVuaXItQm9vayAvRmxhZ3MgMzIgL0ZvbnRCQm94ClstMTY3IC0yODgg\n\tMTAwMCA5NDBdIC9JdGFsaWNBbmdsZSAwIC9Bc2NlbnQgMTAwMCAvRGVzY2VudCAtMzY2\n\tIC9DYXBIZWlnaHQKNzA4IC9TdGVtViA3MiAvWEhlaWdodCA0NjggL1N0ZW1IIDY2IC9B\n\tdmdXaWR0aCA1MjcgL01heFdpZHRoIDEwMDAgL0ZvbnRGaWxlMgoxNiAwIFIgPj4KZW5k\n\tb2JqCjE2IDAgb2JqCjw8IC9MZW5ndGggMTcgMCBSIC9MZW5ndGgxIDE1ODE2IC9GaWx0\n\tZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AbV7C3BVx5lmn3N0dfWWrt5v6epKuhJC\n\t7xfCMkhCCGFnjGIwSIwJODYYvHbAHj9wVVymaj22h9SuM5n4gWu3nMrGGLJba20qwUKu\n\tNdTExpCpcsjYgHG8gfXEGMjs4qp4MM5gab/v7/6vBM5s7c7USNXq7/zdpx9//6/uPnrw\n\tgYc2mwyzywRm4M777thh5CdUjOzonQ8/WG2fg37k1Vt23H2fe77dGO+bd9/76Bb7nJxj\n\tTO/w1s133GWfzVXkPVtBsM9eF/Larfc9uNM+Jx1GPn7v9jtdeegsnlvuu2On6998iOfq\n\tb91x32bk+LnxR/hTu2P7nz0oj+bGNcjHdjyw2dX3xjGejyYf2PqX/+vqqgFbB389pEJz\n\tlwmb20ySPBmTZoxvUl/GH08onhm6ZSZt28bs/n8wJcF5vvvtuh9Kuyceefb87MTM2eB8\n\t8F9ATsU79gftBudnvse/sxOzE3iLPc3/KZwypslMg+4bv8mbBnsDgjeQrTCDptvUmWKT\n\t0vQGxvUn1zyHzJp5z+YNNDGf8AYavN2MmB7XAPpINiETbkKH1csf21Y8PG02mRTj/dm0\n\teRyTZf6Syw+5/IzLZ11exfzBabPU5Rtd/ozLX3X5L11+yeXZzB+aNq0uX+Xy7S5/FYLF\n\t/i+5vIo5+ml1+UaXP+Pyl1x+yOW/dPmsy7OZS382X+qeV7l8u8svMUc/8h76l/eQn3H0\n\tHJMl4xpw+ZjLX3X5JZe3Mhe+IEe/s46+XehY7gIzZPrNLWYUuTG5s+Umw3vP5PpvIn1m\n\tMrAkC2+eMqlj4//N8/79xJQ3++dTZrjiICQp2PiN5injLayuXr5teNLbhAd/IQgLokDB\n\twuqRyaBu5Nbx2ET17urdK+/aXT1SvfWOuyaT6iRHwebdE63Vk2b1+Db8XTMenRyYKEvA\n\tzRMTi9FOEtvBK6i+ewIt3ONaQC6k1i9RKbTw5urJoH5s/Ovjk7uGyyYHhifKotHq5ZOH\n\tx8YnDw+XRScmUCs5MVKMmFJmxxzGmJMXoDzFtrIabaCJid272ebq8Vh08vDu3WW7MQ/3\n\tPOWZ6wkDjoCJ4xVMfPmUt2sM7yKLRctIiEVjUQxrYhhdpS68efX4cgwsOtFMXYaaFyJ/\n\t2Gzyl5hNwSRw2LT5d5pR7yPJG/yFkreZT4U2inwdaMv8r7t6XzM3ez82Ue9rJgv0Uf9v\n\tscC0HlarM6Bh03iuNuOOgod/wY9akT/WRHANMemaJ/sQwmjCUPBUPMKWmXSkDJOJv1kQ\n\t9BzkEZNr8kw+UAGSMfeYe7zzgZ/0m+R3wlfTWtJ3ZS7JfjgnJ7I78k7u4fxbC14sHC5+\n\touT20rayH6K29Amj9Q4sVczEYcVWTpmFrVOmGWlhzpSpP47UehCGNekqqKDUfXjQlOPJ\n\tvI53PFNrkppeh3nyTIkgWl4PqK29t7uzoNXr6l3i9S4JurvqYzXJ4fgSr7OjsCA/OYzf\n\tgqJINOIh/WZRt58ZLozk5KclNVdVNSd3hG/q6Rkpqa9LTj40c5f3zox5aNmyhyKLSjIr\n\tItlFeZHU2vaFnSmjgyv6q7tj0bz8ril/25fP+//hyw6ZySZIxWLoZZopMk3+rmkMr8kE\n\tTYOBaQPw7gfIETBlmnIOkg1XQfouZ7FBKgHYSgSYMiolmwAMMGBAOlhSh7wSeWUr6o+Z\n\tSrx4EEsRXJ02USxSXSS3DwU7zEIUGLy2fHzKlLSWHQSTMpZMOMICEhaY5CUTB8k0vJuO\n\t8gV4F52A52nGR5cl6LxQStlymm35ArrxNrS1e4Mhsw/rAG0yPsc+ykXh2L8gICWV/oGU\n\tFyEnoITMTojL00jywnkAqbdNwYsKzkOkXJEDPVh5aetJU2Xb2gJFeRhJ2loLIMWfELDz\n\tj03MgpMK3oPEuCIBYbMWlC1IDyMFGwZJiIMQByFOQmBOmAa8Y4DW6PR+ptNbrpS9Srms\n\tAEtmh5OmLDgHpZHOt+ocX7AgZB4F+AskmcgFLd6qLEjw4pxObauCEzq1j3VqpxS8LwPv\n\t7exY4kMBmrxui1oQG8Q7Oyp9KkJBpVeQnwXKvt3x4Y6K9ev+6i9LOxtLU6v6O3ePvrvw\n\t1oH6wf6bb4v0bLnt/aGcaEdsZLg/s7K1Jr2hoWIod8Fwx+LVWX7yhlsiQ4NtEHuEA8Yv\n\tguxnmCLv4jRksshKfg4AZblIxInKbI6DoUtRw9swZSJOxEE6BCEEk0IoKzGrkIQljwtV\n\tZTmLops1T5YLSSikLE+DZVmmUKS4gOpxRnm4SwD1zUP3WegxHYhCHJgrumgpumgNCo5p\n\tUYlS7lHKrxVsZcRHUWkgoLQ/qpQLCmCfbNFWioOt7FTjgqWEzHmoyxUkTNma3WI8NCAF\n\tts1U++IxUKSFp2BIBDwJM2xFtF5HeUoHhxWwHT+sQ7lbwaM6lEYV0XuUslP7aCS4H+vx\n\tAcBFJFmPMksNzJMyhLxrJIsWtsmLxPY92LasITe3YVnbg6Pv3PvYY/c+Oep9Jz/aXFrS\n\tXJM39I2NGzfOvAbTg59gEjKTHTzK2NW3EnMGQOZ2SABiFhi9zA/B22x4IBnR4wDPIMmI\n\tfkkq2bpUwEGIIO2hwVOGtVpXuPSsMa7gKQVHFBxWrp21IAS7HJgfcFgQ0wBDSOEQ2nTF\n\tdgDsQpIhHBaqhFzoOQksSrE9H7UMD5tFAKNI40hiW562JYH5XEGYgMsdF4AO0WmYnf4S\n\tvljGv0KAdQrTtNMmYD9hNJtmtiLtRAow3ky8msVXR6ET8uphAQfBw+Aq6D9QAdpIRWSv\n\tq0QjAbYreEbBYQVnBagyBtS9YJ4yZpCAQIbKyHhBBheYP1ce9yl4U8FHAsiyRO0nlB83\n\tKLD8wMjeVMpHAuyyJB+fMhmYbupxcgTDsZy/iAeZ+N8o6LEgDGuQZuqQupECmCYubvZx\n\taw8+15EVEZAvo0oZpbOkFEF5bdFlldRkAlb+BAOQOvPcoFPCXo6ZdSgKUmcRtlQCrihI\n\tIWCdBgU9IlmgXFHwFBWQw7hBwRU7MQ4Mc+brn6tKjCroU1BMV3Q/fZqdYW9nnvwGMfnt\n\t/IP/k7U/8feN/WrNT/yfrPnV2Bb/G1/+EKlfci6cb9pmP/Pe8M5ChLqCsWlEIa3Q3CnT\n\tCssasjHNrIQm6KSKADyuRFmuCcH+5mC9WsHxIuRFtNOX6CEgs7kgxugb2rAyMsMz2IAK\n\tmBWgcucCmrQ/EtC4CCdGQYxZQeyCA7GxTVcrjNlx02XOIvkInDAXDGgBhjYX8sATQ4UL\n\tEy8V2iEiEqJrakPJAJK/YdrUI4bqorCFzK/x8DskX0KjwDxkxSBkaIspE7ASIfMzaO9b\n\tSGIyLqtOM9DGorFuJuo6o/a0DZqoPBID8e0CvF1gm3oOYK99CMw5AGHTKQW/xxCFspqA\n\tEvGWpaQjniyU33r87UEaQQrZ7gvRPaeG6u/LmmBQz5kydFRmqXsZhrH4eQWnJNAA5bRp\n\ttkUXFTSAWeg6jOimzexB2o8kpq/ElgQ4m2jXKu2o0o4q7bZKoy0JYck7zFEkjCpsGgH6\n\tkFYiBSLDO1Xfzis4rSDB4A9U9H+nIMHcf1CGvWBBCBMvgDMWLgfmoBavA19kjU4DXFAm\n\tnbRMmscOG3eBHRcsX0LClwtgiXD1Sc6K/CvS6R3ATI4gSXEhgHd/XU0W4rNKn471xqAr\n\tVhOO9zBmq/DyC4tiLV53LMuL1bQgsFvid3q3lty8vD2vOp5f210b2XnrjQ1DT9QsbSkP\n\tBQNB4Fes6qta3Fx2w8TmBRdCeQ2xomhBanFjb1VNT8ajva3D+Y1Lmn5VdkNepCGvtTES\n\t66zpG6xOoX6Pzn7m34CzhTzT4p3gzqJF9DsKReGeZcq0ADWLNqdBi7k7K6DiTsIQyPzO\n\tcIU50aUKNsqaqwYXUD8RriU0uJyEcjOn0s0kNFODnUrXk1BvCeXoPiS6Ww+U7TS23NRb\n\t03+Sq2UVrlAEX7j7sVCnsf+qN+VWbfnwCyQpv8idGcd8WoDd4+wBN/YjoUYIohdA9Jwy\n\t7wHYrw/PQYf3Ws2myqTgQSIDPmTgIcM28BwEcK/VcLYWQWsRW7IHYL99CMwEgChtnwR3\n\t6HkPwH4kGegBa1tDphdgBZJP9T0AU3sESUZ6wMTwELMPvdgVrEDyRWMWYczehrquFj82\n\tT9C8zkjnksBuDbJQ0uLHYwUx7/clLYONjcMd5eUdw42Ngy0lM7cN+TkL2zqLev90qK5u\n\t6E97izrbFub4Qxe5hajoGI673G+f+V5xTWFa3dD67u71Q3VphTXFt9CRwnf83nvX+58m\n\tGnxOySqxMd92RvlwE9x0plgXsp1bTZqubAXfJYCjiELeIsdhD7Zjio8jPYMkluUSgKzh\n\tRgK+/KpSVingC3CATqwqKVaV8wQvn4R8jWEqTT5EBXVb0V01JoC9DhwA4laMgz4N0gB9\n\tyAeC4YbjyMG7lfJKDr3NUhBWIaljYFwkA/xHBX+vYDsBh7xP4wwe7Erliwp+reAiZBJF\n\tIZjwEEw4lIGS+wqAvLAXZl7AyxoadHPPwzojCvYq2MeIgEU8wxRwUcEfMHRQ6OBy4OA4\n\tD9TbTipH+nMKKotPApyz4huCrEXMOj7YKtyfoO4ayjIp56xQBzCzzknR3UqdPyhII2Dl\n\tmywIQU2LsA8psgNYaUpt8RfwTDKAaYBfqJtKI5Vv06RIw6cVfKEgjcD24EDiEOFt3WD/\n\tXOQN7axTCfxAKdnGydd2AQynZH/Jmb6vi3RBwY8V7NcF2qcLtEJXYa/yPHFW8IllPiNQ\n\tx2+aCwyaO7IIdmRiOxDwWmpgEqH8uPL6ouV1SHzWF+ClrF+C369Z9jFeFD5SOhw3XlNG\n\tnVLwuQUhWNRqnIxU27YSXFutPHpLefSxgpAWnRKK1+LF6q2P6+3o6S3K8sLJ1p0VVXpF\n\t3n+M3BiHqSkuhumJ3xjpiY239d0+WFMzeHtf23jM21Ja65V3LG9oWN5R7tWWNjbGPQ+G\n\tqLsbBsnz4o30Xw3wX2XWf/nV09DI6HX+i/pakPBfBbAnzTbwvN5/WbeFRT0kjkythnNG\n\tX3FXX3Foc/7LuTwh/F/9Vyr0sBDCXIhVLsQq4wQUwWbCa6UiEGzCGjRhDZpwztWEYuur\n\tnsXMeeMkHuBZWKaX1T31AIzowx74qf3qq/bA2u5XX7UHorRffdWzkKqXrYjRykTQgPNV\n\tz0KoXkYSWUo1FVaPUumVKJt9ACvVKx2ERzpmvRJPBHF4R527YqA9tBsM0o8huaacTvWx\n\tmPVGeZ5lFRmAuvWFnnClalGfgisGh6ask0oAX0e3mYkJuYh6EcYv5Yt1yEc5ng29Ltbq\n\tdi7RiyHCChIRFiKvIjjHHfSElDnKHj2h95//3zzhzKVbrneE3rewStxDXcUeKsXUBWnT\n\tmESp9YRndYaHFeBOEvOZMrUQWndkPEYDCA9UChLdJXe/mHmP7AhZE7up40jcu2wUYwCP\n\taY8v6i0TxhAFCTe2m7gFzyg4q+CwAJX5KjpGXOIlIrL5El2FgdAVTssiF4gDTGXvn8qQ\n\tAHiz6d3P4dJhFqB+ltSPQBGrpH6E9b8rq2T34nvVWq4goBy8omZzAgIslIT9fEUNaSEk\n\tWIpGFLxCQMmIK2UFhELqXFCru56A4jsOY7sVSbToaYAX7AMPj5wZfpSA7fVyA8CXsJPF\n\tLkW8E8OyYvjAYhuW0QUdQ5LmpiB5R5FE3PtUDM+pnbTmEe0aMp7zXWVXAGif8iLhv3t1\n\twomZM87EuKiuGVBXBJ0cWxEAJy7ueEQn/olOfJ2deIBI1c3qpIK1dsKp8H855m6kR5B4\n\t8ph0zeQPootjdvI0M8V26AkHcoTz5AuvKQjrzHstYPwQRVwQBWM83tfAOYQrEY2Kc5iv\n\tiRWe99Ox0er+5jI/KG/pj3X/SX7ngs2LuyYG6moH1nZ0r+mr9LKWrS5Z0FPRE1vSXNpe\n\tvaC7RWPQ+qW3tVWCt9S9HL8Iupdn+oOj0zgMwNkpb2lWUSmgadxVOE1bhVKSukAqT3iM\n\tcihYBxSsHnk/8n6raEvs1M8YAM54qYJDCqoJEsFnE1WqaZ5KdZDQMY8QJSE6bxvUR0Kf\n\tSaEWcj9mt0G8TbLboHwUNkGdsPBvwfGdQBJpOwAgY/qtBTzezMcpIIunTB/eh/RCfSvQ\n\tm7wf4OsIWbgQLtwqzN8gSUO/E+o03GGTibKjsPkpHt5Eeg8pcM7oObB5r3VGAY5zAts5\n\tnZCM4jkFr1gQgpqFIeTucOQFmAnUIzUDVLd9egHCu0/Nebea870KGHdK489bwM1XLgbh\n\tPNUK2kGuypO6q+8hoJrdrZRRld5R2Y+gaJFYWoBRjTlhXm07xxQc1UOQKZxQSBejBGy5\n\tT8EBKKXMaB3A3UjCzLeVegJW42MkUENQlF7ztn0IQ7P6sSPtRwTXD+bSq/WCZSuQpO7z\n\tAOShNPcKrSKnyC2oALp0NyLHHO4yhfKiggd19u8p2KzgYwXdBJyQYx73mwXYYrqDkm7l\n\t0oiCo8ocujbp74Ay520FZIUUvY85CTimYFrBQRxzujr9WscBckSKpgWoH487Px5U4soX\n\tRyje/PMS8ebdnRFcfMVq6uM7y1qX1tUOdpR5xS1DjXVLW8syKjb0dYw05fnVt3d2TgzV\n\t1y5d11XQ2tqS7w/l9X5z1ci3mj+tG2yvKG1FdeQV7YMz/y7eWtGxrH5NW0Pt0vHOzvGh\n\tupT8WNktM231a0fbWtqgBDxC3ufjchVK+o84mOfOkJ+F8JMQH8aFR9jJuPg2Hw5GcHlr\n\tcLFgoJ8G+mlwqGLMYaTjSGeRUjagUg5ANVIb0gDSGNImpB1Iu5BS0CovurJhsrBqu/AC\n\tWBVCHXbgNg4vqQTYY33UGyCF5imVo+HlcTbtDT7BSXj9uTN+NHcGTv0SkkjfUnX1ryrY\n\tLgCtwUwGH7a15+Ung+vdXTjPKgxikc59lbm5lUzZQ0P+0wVlZQVIX96Jr1s88sz7O8Tw\n\taf5buAkhx16FUB9i/ICT27CYYgO+eQxrYFWseMJYW5kYUZDYjcEv2Tq3Kfi3WufnCh4Q\n\tgBsnNgq7wRfCBvGp6URahiT3cbfZEgZc7qpqWMEPLQiDyz7Y7mMZ8dKGwVSso4919LGO\n\tPtbRhxO1Nzwh9vVjde+zFnCLF0Lw7zb239PibwrARzd86QG9SPiDBengQxKcWhJGnIQR\n\tJ2HESTzcDbDuSeRLNoaUhCElQbKSMKIkjCgJI0rCiJJMGPsMBh9J1n8cwMMRJFlcHmKL\n\tBN0N8IhSi0hl+9xqiC5+34IQOkpHR+l4WwPINIpS2rxDP48Eb55shUjApycJYQuTENbD\n\tGM+E7MhOYZCfIMnI1gPIGPB9jgV1AjgX9wYtvBufmwfvaR0lcc0LGbVTvMamIjSwrRYI\n\t4IdwiVbPazh6WkFiX19HCjmDoyQAyH5vZzgUixdA7Hf/jzsveP6W3w8Ned67J2cuX4aY\n\tc8iIs4zZg4fAQH09xhTPgCpsHwAYQ/IRQhur1AOUBUZ4zwC8hAR2UMNDkD0nN2cB5j4E\n\tcfd1c5tUQ/YasretvRMD2wM1/AydLMNgTiM+qvC+Mw1/687oXqVPhNDyjK7Y6R+GyLtY\n\tkjNBzrIjO869IP3QpIJZ2WqB8l0BKhKpHEDqPAlwI5ozN8WsUWwlgPeqxVYCTkJczyGJ\n\tBLwFIN39VAAsH+xCKoYDDXbX/EeFEeh/uV6RHdCTsbVKeVspyxlZc+3WKogr4GZAuuoj\n\tYJ0X1Ig+qmC3gh8rOCpulIdEb+s4jmhn3GJIi4ldxdP6Gg+FpYh+1tuQhw825JC2sCAS\n\ti9g4ucIjij/le356zYLWovVrh3pWhlo6G4YC33svry4vr7ooc+P4zCkvuGV1Su3owKfe\n\tfXmLS2F+sP/0o1jjPBP3/yvPSCptDFwNyICXRyQwBVcx6GquIkg870xTkgtwVmmA87h6\n\t9Y0Klio4q8AQJKJfd0k3t9buXk/UP4a+bGxLcWNs+5UDecZkTof7LOCO/586le+FHeH1\n\tuSjJP31E3wNp5ibJVZt3Xj/viD6EsDAXvUtkec3pPPdeBWgAcRE18wBOb44giZheBpDl\n\t5BWcKO4BBN1HdOd0GcAVu13lQZzKHUOSt91RJ4835HSThyeJrSUPRnBwR5VLJWDf3F+u\n\tZNRuH6rwgNsBPhzEih7TA7wvANyLALY4imJuxtDcFwCuGIDFB0wdBl2nc8JZC+slg+KK\n\t61HMq1BQL3NDZYsB+HYP9qIjSLyMIBvtIqIyH8LgqVuhXqwBd+nSTA84Lc3YGP76y4te\n\tiebcjRgiPO+0XFsMNpeUNOP6Aoc1o7yq6LFXFj28urj+viLOSwrdKCKH6ENHRmfO+jeI\n\tjrT4qf+cezC5/qKVEEBGnEHIJlPZSMCiagGwiPz0UWKur1yGuZOWOU35/7gMO6FSd07B\n\tzxT8tYLE1RfPGT1EAQuxbu6O7Bd4+ADJ3mBQ2P+VbsS413L2Ts65KRLzdI7FTgpWWnCN\n\t4gWQS3E619yE8TxCzhxJTVyJkYpNCZmP23+7HPgiE4Am2l6QAfRqf9dVul78vE5rlvlZ\n\tnd6dRf4Fd2de5CsnhvwvAPjlm/HnNshjkZfCbyf44Ru/qEiCuytCiC3fSB2G0oiAnRF3\n\tjXlk617WOnBQdkmROuF0ulh84ZmIupJISJpHmP+RXTKq8iM7NHNOo553BWB/A1MNb+Z8\n\t7qhuQhfBKMmQLitHkwnIf9pQKXJXnTQk+FpUbipH9P1ufX+FBSEcKOTCk9P85sH7Of4X\n\the3RUSS2KvAG/XBpXXtVeUFmZkl9T21kyBuqGuhclxcrjyQPhiqau4pnrghPoziH/Q54\n\t2h78b95/NaoXdP5tQH3XmPgu7PAxR3dD+QPUZ+TTCN4nvmbZSDMOZ5mNetVyNJuN4nYs\n\tUTsDugHe8dMQLEWA7tZJQCoOajtxtdaJgKoTIR3C90Tk3MIFaZm3INdeUrbMXVKyAwgJ\n\t+ucVPWJ3HOmk41V7i5neOo1YKt+0YP2mTDE3VZMgHEbiKRBdPrwNJCodQ67lFuMz2b3b\n\t49h6aRnE1wmonvz/Gd5fipEeh4BiTdMRWXv45sOD8no4fffgbhAwc8ruGjOEwyQPN4oI\n\tZtnIIxDYp6ylD+HDmSx88YJdMUsOAByxD4H5rRqHExbwmCSCeMrtZd+2gsQPOArlZlHG\n\tdN761JB5F1P8O5kmxnFENeM1BR/rscUBBScVnDI1dp32KRgloPDuUcoFC+jC4hBpeDc7\n\tXXeyvkg+x8YLPCCTNf9EQbdpt22dJpDjnWowlNt6Oa99DUDe2KngfQU7wUBZhRcAeGeM\n\tTsM4XvbkAvI8crkS50pIC1wGAesJrCdPBS9k937NMnCDJ18NksdZ4LGsR4CgAMrNmeEy\n\tQYFT32Oqx/xARurw4soBiWu4nCXCemHOuTn+8ioDjZ5XJpKt+5Gk3kpSyewPtHgej/l5\n\tTRwnY47hPcrnj5W9JxWcEPZCpuoAyHT/fl5DyhcQhVWe/RSaJ0K99tQIX023ei347wF8\n\tY9NRWOQNZHfURmA7WlqWtQ9WdQ7V9GyI9uXfuCC/oSqvq24gozFeXtG+JNq+psjbXFGT\n\tEinNi1am56Qv66jvjeU0dsSr61PzKvNjVanZQVZ5c7S2pyZS38KVNFmwP0v8cVPqfeN1\n\tPIa4f+dZ9Ke6XKwkyzUGsAlJ+HJYirFLhKbi2IgfzaEi+ZhDAAPAfxdIp8l5iZsXlnxK\n\t00pgxMaCG2MAm5BckyyeMnloMv9DmxeiEXZRwuulxzXG3CQAYlCsIctXPsnLpMnKtFt5\n\tRvAYNuwK94gI8IDYaB4aL0FeKN9ehqA5OXLJIqPZqcK2TcFfKJgggIsII5pMgy9Pw0aN\n\tX3KCoE1sRRWIPz+vz4ExysEMsVOSmz5cKuAUCtFiJNbdiX8V6fQWP5WWW5Idqc0O6rry\n\tGmsK77xz6CnvhZm/L43mhtNSboyklbfFvXj/E0+Asfw2yvsNTqiqvJX86CDT+ovHGZSD\n\td2WYYOnc3vhVlF+3N57UePu4glkNse33LeqW3afuc27ZbZbnTkfmtu8860g1WdYt/3c8\n\tYJlpZgOYWXeAc1Godl/Mbxx5PogLRMf6m8DA9UiyP7gJArMeSSzQI6rrvQQ0G9ecqj+l\n\tij8ufg9SMg4zy9UJ4f8oIjgvdgaab8moHgHgW7LKrwg1Kl+14c61vjuCs1n37Ru+ScIX\n\tb96L8/a2GRXtdW53m9jbeo0zX8b7GwtkdzvzV9zdcp3wv1X+m1inbP8/vY5gJoTpJ+Eb\n\tVX7rmwXhzqbO7BAHDjBGQCtzVijc+fITcrbivmHeiwfRnUcUPK/ghILfCkA8hj5SP5xG\n\tnzixsGvC0zx5/XcWMHYNwcq5Q5udAE/LA84EObLHNfbZSMCRXRIK1Yf/D8TTDW7F6d0x\n\tMfHnPO/NtNvzHdQQavpxXb1ZBYmPuuVrEdY5pEVLCdjXD5SSo5TEwbBsUL5ySjOn7WQa\n\t/k3MzprnuLLmEwDbkGTNH7LUsHkC4PtIP0ISX/WRlMCggYEBPucOzTX1IzzIjB6yIISv\n\t5EJo0x10PanF7ylIHJl+JBR8SX+c9mfKpKHhDCxwph3jFntDwmAmA8GMXDUF+E9ed5Xa\n\tBTAsVBsE8YhOeLSOYyWzxhn8WuDupBt0zfgPHFL0PhZLRs9vfAXEIVpSFBfRK/Ou/Qz7\n\t9nv9x4Yf8++95fs3fdv/9k3f996becL7tqSF3q6ZXRBs7MPkZ/ZnCCn/2A/PQwNTh0hy\n\tMaawHIZyBezjTeZr+F/SVebr5lazGvNci1PHcag7fzxqoyAG6ObW4eGJieGmwYc3f2vb\n\tA81D27f/m/8D72ZlsAplbmRzdHJlYW0KZW5kb2JqCjE3IDAgb2JqCjgwNDUKZW5kb2Jq\n\tCjEgMCBvYmoKPDwgL1Byb2R1Y2VyIChtYWNPUyBWZXJzaW9uIDEwLjE1LjUgXChCdWls\n\tZCAxOUYxMDFcKSBRdWFydHogUERGQ29udGV4dCkgL0NyZWF0aW9uRGF0ZQooRDoyMDIw\n\tMDcxNDA0NDI0NFowMCcwMCcpIC9Nb2REYXRlIChEOjIwMjAwNzE0MDQ0MjQ0WjAwJzAw\n\tJykgPj4KZW5kb2JqCnhyZWYKMCAxOAowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMTkw\n\tMjQgMDAwMDAgbiAKMDAwMDAwMzU2MSAwMDAwMCBuIAowMDAwMDEwMDgyIDAwMDAwIG4g\n\tCjAwMDAwMDAwMjIgMDAwMDAgbiAKMDAwMDAwMzU0MSAwMDAwMCBuIAowMDAwMDAzNjc0\n\tIDAwMDAwIG4gCjAwMDAwMDcyNzQgMDAwMDAgbiAKMDAwMDAxMDA0NiAwMDAwMCBuIAow\n\tMDAwMDEwMjI0IDAwMDAwIG4gCjAwMDAwMDM3ODIgMDAwMDAgbiAKMDAwMDAwNzI1MyAw\n\tMDAwMCBuIAowMDAwMDA3MzEwIDAwMDAwIG4gCjAwMDAwMTAwMjUgMDAwMDAgbiAKMDAw\n\tMDAxMDE3NCAwMDAwMCBuIAowMDAwMDEwNjE1IDAwMDAwIG4gCjAwMDAwMTA4NjcgMDAw\n\tMDAgbiAKMDAwMDAxOTAwMyAwMDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDE4IC9Sb290\n\tIDE0IDAgUiAvSW5mbyAxIDAgUiAvSUQgWyA8OTY2OTg5MzJlYTNiM2Y4ZjViOWFhYjJh\n\tNDk0OWQ4NjY+Cjw5NjY5ODkzMmVhM2IzZjhmNWI5YWFiMmE0OTQ5ZDg2Nj4gXSA+Pgpz\n\tdGFydHhyZWYKMTkxODkKJSVFT0YK\n\t</data>\n\t<key>ArchiveMatchStore</key>\n\t<dict>\n\t\t<key>Archive_Stores</key>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDLock</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict/>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDGraphicStyle</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837427</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837438</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837418</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>2.63623046875</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837427</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837438</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837418</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>2.640625</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1.9521484375</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.701961</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.754077</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.701961</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.754087</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.701961</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.754069</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.027434</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.007121</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.149131</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.986246</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>3.05224609375</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.701961</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.754077</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.701961</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.754087</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.701961</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.754069</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1.9521484375</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.998218</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.00176</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.198351</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.000111</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.016804</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1.205078125</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.998218</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.00176</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.198351</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.000111</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.016804</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1.05712890625</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1.9521484375</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDParagraph</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>FirstLineHeadIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>HeadIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>LineFragmentPadding</key>\n\t\t\t\t\t\t\t\t<string>5</string>\n\t\t\t\t\t\t\t\t<key>LineSpacing</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ParagraphSpacing</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ParagraphSpacingBefore</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>TailIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>TextAlignment</key>\n\t\t\t\t\t\t\t\t<string>Center</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>FirstLineHeadIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>HeadIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>LineFragmentPadding</key>\n\t\t\t\t\t\t\t\t<string>5</string>\n\t\t\t\t\t\t\t\t<key>LineSpacing</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ParagraphSpacing</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ParagraphSpacingBefore</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>TailIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>TextAlignment</key>\n\t\t\t\t\t\t\t\t<string>Left</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDFont</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Family</key>\n\t\t\t\t\t\t\t\t<string>Avenir</string>\n\t\t\t\t\t\t\t\t<key>Name</key>\n\t\t\t\t\t\t\t\t<string>Avenir-Book</string>\n\t\t\t\t\t\t\t\t<key>Size</key>\n\t\t\t\t\t\t\t\t<string>12</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Family</key>\n\t\t\t\t\t\t\t\t<string>Avenir</string>\n\t\t\t\t\t\t\t\t<key>Name</key>\n\t\t\t\t\t\t\t\t<string>Avenir-Book</string>\n\t\t\t\t\t\t\t\t<key>Size</key>\n\t\t\t\t\t\t\t\t<string>11</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDTextAttributes</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Font</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ForeColor</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedWhiteColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>White</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>Paragraph</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Font</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t\t<key>ForeColor</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedWhiteColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>White</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>Paragraph</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Font</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t\t<key>ForeColor</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.998218</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.00176</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.198351</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.000111</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.016804</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>Paragraph</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDArrow</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>ArrowAngle</key>\n\t\t\t\t\t\t\t\t<string>160</string>\n\t\t\t\t\t\t\t\t<key>ArrowArchiveVersion</key>\n\t\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t\t\t<key>ArrowBackEnd</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>ArrowForEachSegment</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ArrowForm</key>\n\t\t\t\t\t\t\t\t<string>solid</string>\n\t\t\t\t\t\t\t\t<key>ArrowFrontEnd</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ArrowLineWidthFraction</key>\n\t\t\t\t\t\t\t\t<string>0.25</string>\n\t\t\t\t\t\t\t\t<key>ArrowOffset</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ArrowSize</key>\n\t\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t\t\t<key>ReferenceArrow</key>\n\t\t\t\t\t\t\t\t<string>Relief</string>\n\t\t\t\t\t\t\t\t<key>UseCurveFillAndStroke</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDDashPattern</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DashName</key>\n\t\t\t\t\t\t\t\t<string>Short</string>\n\t\t\t\t\t\t\t\t<key>DashOn</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>DashSequence</key>\n\t\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t\t<string>4</string>\n\t\t\t\t\t\t\t\t\t<string>4</string>\n\t\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t</array>\n\t</dict>\n\t<key>DKDChangeTimeStamp</key>\n\t<string>2020-07-14 04:42:30 +0000</string>\n\t<key>DKDCreateTimeStamp</key>\n\t<string>2020-07-14 02:19:50 +0000</string>\n\t<key>DKDDisplayGraphicDetails</key>\n\t<dict>\n\t\t<key>AngleFormatDisplayDetails</key>\n\t\t<dict>\n\t\t\t<key>AngleDirection</key>\n\t\t\t<string>Right</string>\n\t\t\t<key>AngleForm</key>\n\t\t\t<string>degrees</string>\n\t\t\t<key>AngleRotation</key>\n\t\t\t<string>Counter Clockwise</string>\n\t\t\t<key>PrecisionAngles</key>\n\t\t\t<string>1</string>\n\t\t</dict>\n\t\t<key>AnglesDisplaySpec</key>\n\t\t<dict>\n\t\t\t<key>FormDisplaySpec</key>\n\t\t\t<string>Decimal</string>\n\t\t\t<key>PrecisionDisplaySpec</key>\n\t\t\t<string>2</string>\n\t\t\t<key>TextAlignDisplaySpec</key>\n\t\t\t<string>Left</string>\n\t\t\t<key>UnitsDisplaySpec</key>\n\t\t\t<string>Punctuation</string>\n\t\t</dict>\n\t\t<key>AreaForm</key>\n\t\t<string>Natural</string>\n\t\t<key>HelpTipDisplaySpec</key>\n\t\t<dict>\n\t\t\t<key>FormDisplaySpec</key>\n\t\t\t<string>Decimal</string>\n\t\t\t<key>PrecisionDisplaySpec</key>\n\t\t\t<string>3</string>\n\t\t\t<key>TextAlignDisplaySpec</key>\n\t\t\t<string>Left</string>\n\t\t\t<key>UnitsDisplaySpec</key>\n\t\t\t<string>Abbreviate</string>\n\t\t</dict>\n\t\t<key>InspectingSpecIndex</key>\n\t\t<string>0</string>\n\t\t<key>LengthsDisplaySpec</key>\n\t\t<dict>\n\t\t\t<key>FormDisplaySpec</key>\n\t\t\t<string>Decimal</string>\n\t\t\t<key>PrecisionDisplaySpec</key>\n\t\t\t<string>2</string>\n\t\t\t<key>TextAlignDisplaySpec</key>\n\t\t\t<string>Left</string>\n\t\t\t<key>UnitsDisplaySpec</key>\n\t\t\t<string>Nothing</string>\n\t\t</dict>\n\t\t<key>PercentDisplaySpec</key>\n\t\t<dict>\n\t\t\t<key>FormDisplaySpec</key>\n\t\t\t<string>Decimal</string>\n\t\t\t<key>PrecisionDisplaySpec</key>\n\t\t\t<string>1</string>\n\t\t\t<key>TextAlignDisplaySpec</key>\n\t\t\t<string>Left</string>\n\t\t\t<key>UnitsDisplaySpec</key>\n\t\t\t<string>Punctuation</string>\n\t\t</dict>\n\t\t<key>PercentFormatDisplayDetails</key>\n\t\t<dict>\n\t\t\t<key>PercentForm</key>\n\t\t\t<string>Percent</string>\n\t\t\t<key>PrecisionPercents</key>\n\t\t\t<string>1</string>\n\t\t</dict>\n\t</dict>\n\t<key>DKDExportDoc</key>\n\t<dict>\n\t\t<key>BMPExporBackground</key>\n\t\t<string>No (White) Background</string>\n\t\t<key>CSVStringEncoding</key>\n\t\t<string>Unicode (UTF8)</string>\n\t\t<key>DXFExportLayers</key>\n\t\t<string>All</string>\n\t\t<key>DXFExportRevision</key>\n\t\t<string>AutoCADLT 2010</string>\n\t\t<key>EPSColorSpace</key>\n\t\t<string>RGB</string>\n\t\t<key>EPSExporBackground</key>\n\t\t<string>No (Black) Background</string>\n\t\t<key>EPSLatexPsfrag</key>\n\t\t<string>NO</string>\n\t\t<key>ExporBackground</key>\n\t\t<string>No (Black) Background</string>\n\t\t<key>ExportColorTable</key>\n\t\t<string>256 Best</string>\n\t\t<key>ExportCompresion</key>\n\t\t<string>1</string>\n\t\t<key>ExportContent</key>\n\t\t<string>Just Graphics</string>\n\t\t<key>ExportExpand</key>\n\t\t<string>1</string>\n\t\t<key>ExportFileExtension</key>\n\t\t<string>svg</string>\n\t\t<key>ExportImageAntialias</key>\n\t\t<string>YES</string>\n\t\t<key>ExportImageInterpolation</key>\n\t\t<string>Automatic</string>\n\t\t<key>ExportPath</key>\n\t\t<string>/Users/corkep/code/bdsim/figs</string>\n\t\t<key>ExportTransparentColor</key>\n\t\t<string>Automatic</string>\n\t\t<key>GIFExporBackground</key>\n\t\t<string>White Background</string>\n\t\t<key>GIFFDither</key>\n\t\t<string>NO</string>\n\t\t<key>HideExtension</key>\n\t\t<string>NO</string>\n\t\t<key>ICOColorTable</key>\n\t\t<string>256 Best</string>\n\t\t<key>ICOExporBackground</key>\n\t\t<string>No (White) Background</string>\n\t\t<key>JPGColorSpace</key>\n\t\t<string>sRGB_ColorSpace</string>\n\t\t<key>JPGExporBackground</key>\n\t\t<string>White Background</string>\n\t\t<key>PDFExporBackground</key>\n\t\t<string>No (Black) Background</string>\n\t\t<key>PDFPagination</key>\n\t\t<string>Single Page</string>\n\t\t<key>PDFXMirror</key>\n\t\t<string>NO</string>\n\t\t<key>PDFYMirror</key>\n\t\t<string>NO</string>\n\t\t<key>PNGAlpha</key>\n\t\t<string>YES</string>\n\t\t<key>PNGColorSpace</key>\n\t\t<string>sRGB_ColorSpace</string>\n\t\t<key>PNGExporBackground</key>\n\t\t<string>White Background</string>\n\t\t<key>PNGInterlace</key>\n\t\t<string>NO</string>\n\t\t<key>SVGCompress</key>\n\t\t<string>NO</string>\n\t\t<key>SVGDOMIds</key>\n\t\t<string>YES</string>\n\t\t<key>SVGEmbedImages</key>\n\t\t<string>YES</string>\n\t\t<key>SVGFont</key>\n\t\t<string>SVG</string>\n\t\t<key>SVGGlyphs</key>\n\t\t<string>System Font</string>\n\t\t<key>SVGOverwriteImages</key>\n\t\t<string>NO</string>\n\t\t<key>SVGProfile</key>\n\t\t<string>SVG 1.1</string>\n\t\t<key>SVGTidyFormatting</key>\n\t\t<string>YES</string>\n\t\t<key>TIFExporBackground</key>\n\t\t<string>No (Black) Background</string>\n\t\t<key>TIFFColorSpace</key>\n\t\t<string>sRGB IEC61966-2.1</string>\n\t</dict>\n\t<key>DKDGrids</key>\n\t<dict>\n\t\t<key>DynamicSnapGrid</key>\n\t\t<string>YES</string>\n\t\t<key>GuidesLayer</key>\n\t\t<string>NO</string>\n\t\t<key>MajorGrid</key>\n\t\t<dict>\n\t\t\t<key>GridAboveGraphics</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>GridRGB</key>\n\t\t\t<dict>\n\t\t\t\t<key>Blue</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>BluePlus</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t<string>DKDP3ColorSpace</string>\n\t\t\t\t<key>Green</key>\n\t\t\t\t<string>0.651064</string>\n\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t<string>0.713725</string>\n\t\t\t\t<key>Opacity</key>\n\t\t\t\t<string>0.6</string>\n\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t<string>0.6</string>\n\t\t\t\t<key>Red</key>\n\t\t\t\t<string>0.432559</string>\n\t\t\t\t<key>RedPlus</key>\n\t\t\t\t<string>0.54902</string>\n\t\t\t</dict>\n\t\t\t<key>GridSpacingX</key>\n\t\t\t<string>72</string>\n\t\t\t<key>GridSpacingY</key>\n\t\t\t<string>72</string>\n\t\t\t<key>LinkGridToRulers</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>PrintLineWidth</key>\n\t\t\t<string>1</string>\n\t\t\t<key>PrintsGrid</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>ShowsGrid</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>SnapsToGrid</key>\n\t\t\t<string>NO</string>\n\t\t</dict>\n\t\t<key>MinorGrid</key>\n\t\t<dict>\n\t\t\t<key>GridAboveGraphics</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>GridRGB</key>\n\t\t\t<dict>\n\t\t\t\t<key>Blue</key>\n\t\t\t\t<string>0.848787</string>\n\t\t\t\t<key>BluePlus</key>\n\t\t\t\t<string>0.87451</string>\n\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t<string>DKDP3ColorSpace</string>\n\t\t\t\t<key>Green</key>\n\t\t\t\t<string>0.828351</string>\n\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t<string>0.854902</string>\n\t\t\t\t<key>Opacity</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>Red</key>\n\t\t\t\t<string>0.664186</string>\n\t\t\t\t<key>RedPlus</key>\n\t\t\t\t<string>0.745098</string>\n\t\t\t</dict>\n\t\t\t<key>GridSpacingX</key>\n\t\t\t<string>18</string>\n\t\t\t<key>GridSpacingY</key>\n\t\t\t<string>18</string>\n\t\t\t<key>LinkGridToRulers</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>PrintLineWidth</key>\n\t\t\t<string>0.5</string>\n\t\t\t<key>PrintsGrid</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>ShowsGrid</key>\n\t\t\t<string>YES</string>\n\t\t\t<key>SnapsToGrid</key>\n\t\t\t<string>YES</string>\n\t\t</dict>\n\t\t<key>SnapDrawing</key>\n\t\t<string>NO</string>\n\t\t<key>SnapEnds</key>\n\t\t<string>NO</string>\n\t\t<key>SnapGuidelines</key>\n\t\t<string>NO</string>\n\t\t<key>SnapRadiusGrid</key>\n\t\t<string>3</string>\n\t\t<key>SnapSound</key>\n\t\t<string>None</string>\n\t\t<key>SoftSnap</key>\n\t\t<string>NO</string>\n\t</dict>\n\t<key>DKDHideExtension</key>\n\t<string>YES</string>\n\t<key>DKDLayersList</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CloakLayerGuidelines</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>CloakLayerVertices</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>FullLayerScale</key>\n\t\t\t<dict>\n\t\t\t\t<key>ArchivePrecision</key>\n\t\t\t\t<string>12</string>\n\t\t\t\t<key>ScaleOriginX</key>\n\t\t\t\t<string>0</string>\n\t\t\t\t<key>ScaleOriginY</key>\n\t\t\t\t<string>0</string>\n\t\t\t\t<key>ScalePlusDown</key>\n\t\t\t\t<string>YES</string>\n\t\t\t\t<key>ScalePlusToRight</key>\n\t\t\t\t<string>YES</string>\n\t\t\t\t<key>ScaleScale</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>ScaleUnits</key>\n\t\t\t\t<string>Centimeters</string>\n\t\t\t</dict>\n\t\t\t<key>GraphicsList</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{89.4337593497, 18}, {718.079221614, 663.829445993}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>4DEB8857</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{113.30206836, 41.1403637535}, {115.701818767, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>236297C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{252.144250881, 41.1403637535}, {115.701818767, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>7055F7C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{390.986433401, 41.1403637535}, {115.701818767, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>335D08C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{529.828615922, 41.1403637535}, {115.701818767, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>77C918C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{668.670798443, 41.1403637535}, {115.701818767, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>45E328C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{113.30206836, 226.263273781}, {46.2807275069, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDSquare</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>0F6368C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{182.72315962, 226.263273781}, {46.2807275069, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDSquare</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>7AB2F8C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{252.144250881, 226.263273781}, {46.2807275069, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDSquare</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>9DAFF8C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{321.565342141, 226.263273781}, {46.2807275069, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDSquare</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>D18309C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{390.986433401, 226.263273781}, {46.2807275069, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDSquare</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>E86509C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{460.407524662, 226.263273781}, {46.2807275069, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDSquare</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>DA6099C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{529.828615922, 226.263273781}, {46.2807275069, 46.2807275069}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDSquare</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>7F0599C5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDPolygon</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>98A4EE07</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>24</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M90.1617046064,18 L807.512980964,18 L807.512980964,110.561455014 L90.1617046064,110.561455014 z</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{90.1617046064, 203.122910028}, {509.088002576, 92.5614550138}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>72698AC5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{245.202582916, 133.701818767}, {46.2807275069, 45.2442427975}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDKnotchRect</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius0</key>\n\t\t\t\t\t\t\t<string>0.186211073233</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius1</key>\n\t\t\t\t\t\t\t<string>13.3261658668</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius2</key>\n\t\t\t\t\t\t\t<string>13.5213499412</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius3</key>\n\t\t\t\t\t\t\t<string>0.168640205449</string>\n\t\t\t\t\t\t\t<key>DKDTransfer</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>AnnotationScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ArrowsScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>BrushScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ColorAndStyleScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>CrossOverScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DashesScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DimensionScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FillColorScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FormatTransfer</key>\n\t\t\t\t\t\t\t\t<string>Native</string>\n\t\t\t\t\t\t\t\t<key>GradientScoptTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>GraphicScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>HatchScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>InteractionTransfer</key>\n\t\t\t\t\t\t\t\t<string>Edit</string>\n\t\t\t\t\t\t\t\t<key>LineStyleScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>PatternScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>PositionTransfer</key>\n\t\t\t\t\t\t\t\t<string>Center</string>\n\t\t\t\t\t\t\t\t<key>ReferenceTransfer</key>\n\t\t\t\t\t\t\t\t<string>Screen</string>\n\t\t\t\t\t\t\t\t<key>ShadowScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>SizeTransfer</key>\n\t\t\t\t\t\t\t\t<string>Medium Screen</string>\n\t\t\t\t\t\t\t\t<key>UseInstructionsTransfer</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>D9E68DC5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t\t<key>NameGraphic</key>\n\t\t\t\t\t\t\t<string>Notch Rectangle</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>start</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{245.202582916, 148.323940166}, {46.2807275069, 16}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCenterText</string>\n\t\t\t\t\t\t\t<key>Containing DKDGraphic</key>\n\t\t\t\t\t\t\t<string>D9E68DC5</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>38FFF5E6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{311.152840194, 133.701818767}, {46.2807275069, 45.2442427975}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDKnotchRect</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius0</key>\n\t\t\t\t\t\t\t<string>0.186211073232</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius1</key>\n\t\t\t\t\t\t\t<string>13.3261658668</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius2</key>\n\t\t\t\t\t\t\t<string>13.5213499412</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius3</key>\n\t\t\t\t\t\t\t<string>0.16864020545</string>\n\t\t\t\t\t\t\t<key>DKDTransfer</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>AnnotationScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ArrowsScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>BrushScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ColorAndStyleScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>CrossOverScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DashesScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DimensionScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FillColorScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FormatTransfer</key>\n\t\t\t\t\t\t\t\t<string>Native</string>\n\t\t\t\t\t\t\t\t<key>GradientScoptTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>GraphicScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>HatchScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>InteractionTransfer</key>\n\t\t\t\t\t\t\t\t<string>Edit</string>\n\t\t\t\t\t\t\t\t<key>LineStyleScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>PatternScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>PositionTransfer</key>\n\t\t\t\t\t\t\t\t<string>Center</string>\n\t\t\t\t\t\t\t\t<key>ReferenceTransfer</key>\n\t\t\t\t\t\t\t\t<string>Screen</string>\n\t\t\t\t\t\t\t\t<key>ShadowScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>SizeTransfer</key>\n\t\t\t\t\t\t\t\t<string>Medium Screen</string>\n\t\t\t\t\t\t\t\t<key>UseInstructionsTransfer</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>607042D5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t\t<key>NameGraphic</key>\n\t\t\t\t\t\t\t<string>Notch Rectangle</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>end</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{311.152840194, 148.323940166}, {46.2807275069, 16}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCenterText</string>\n\t\t\t\t\t\t\t<key>Containing DKDGraphic</key>\n\t\t\t\t\t\t\t<string>607042D5</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>A91956E6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>E38816D5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M263.712661981,239.790737462 C263.712661981,239.790737462 263.712661981,239.790737462 263.712661981,239.790737462 C265.764521123,223.715320846 255.908868853,219.603043278 253.252129302,209.139302626 C250.860312179,199.718976104 253.097745528,189.701465058 253.02055364,179.982546274</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>E29FA6D5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M275.284614634,239.133177995 C275.284614634,239.133177995 275.284614634,239.133177997 275.284614634,239.133177996 C277.320884607,225.196880014 279.485040125,210.896471454 289.705462633,207.419245943 C304.847762026,202.267483412 319.929595155,215.348760908 321.297584,179.982546274</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>207DFDD5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M330.30911177,141.655744185 C330.30911177,141.655744185 330.30911177,141.655744185 330.30911177,141.655744185 C328.005614758,123.223763231 323.454824831,104.717250633 334.150543328,103.251051692 C357.513159511,100.048439065 405.339437733,151.832133609 402.435041382,88.0459759611</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{222.132172277, 342.029087345}, {169.900179324, 67.9600717296}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>5046D0E5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{426.012387466, 342.029087345}, {169.900179324, 67.9600717296}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>6046D0E5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{222.132172277, 613.869374263}, {67.9600717296, 67.9600717296}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDSquare</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>7046D0E5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{222.132172277, 477.949230804}, {67.9600717296, 66.438065076}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDKnotchRect</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius0</key>\n\t\t\t\t\t\t\t<string>0.273438179895</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius1</key>\n\t\t\t\t\t\t\t<string>19.5685598946</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius2</key>\n\t\t\t\t\t\t\t<string>19.8551743109</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius3</key>\n\t\t\t\t\t\t\t<string>0.247636566585</string>\n\t\t\t\t\t\t\t<key>DKDTransfer</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>AnnotationScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ArrowsScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>BrushScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ColorAndStyleScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>CrossOverScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DashesScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DimensionScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FillColorScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FormatTransfer</key>\n\t\t\t\t\t\t\t\t<string>Native</string>\n\t\t\t\t\t\t\t\t<key>GradientScoptTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>GraphicScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>HatchScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>InteractionTransfer</key>\n\t\t\t\t\t\t\t\t<string>Edit</string>\n\t\t\t\t\t\t\t\t<key>LineStyleScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>PatternScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>PositionTransfer</key>\n\t\t\t\t\t\t\t\t<string>Center</string>\n\t\t\t\t\t\t\t\t<key>ReferenceTransfer</key>\n\t\t\t\t\t\t\t\t<string>Screen</string>\n\t\t\t\t\t\t\t\t<key>ShadowScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>SizeTransfer</key>\n\t\t\t\t\t\t\t\t<string>Medium Screen</string>\n\t\t\t\t\t\t\t\t<key>UseInstructionsTransfer</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>8046D0E5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>72</string>\n\t\t\t\t\t\t\t<key>NameGraphic</key>\n\t\t\t\t\t\t\t<string>Notch Rectangle</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{324.072279872, 477.949230804}, {67.9600717296, 66.438065076}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDKnotchRect</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius0</key>\n\t\t\t\t\t\t\t<string>0.273438179895</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius1</key>\n\t\t\t\t\t\t\t<string>19.5685598946</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius2</key>\n\t\t\t\t\t\t\t<string>19.8551743109</string>\n\t\t\t\t\t\t\t<key>DKDRectRadius3</key>\n\t\t\t\t\t\t\t<string>0.247636566585</string>\n\t\t\t\t\t\t\t<key>DKDTransfer</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>AnnotationScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ArrowsScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>BrushScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ColorAndStyleScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>CrossOverScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DashesScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DimensionScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FillColorScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FormatTransfer</key>\n\t\t\t\t\t\t\t\t<string>Native</string>\n\t\t\t\t\t\t\t\t<key>GradientScoptTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>GraphicScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>HatchScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>InteractionTransfer</key>\n\t\t\t\t\t\t\t\t<string>Edit</string>\n\t\t\t\t\t\t\t\t<key>LineStyleScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>PatternScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>PositionTransfer</key>\n\t\t\t\t\t\t\t\t<string>Center</string>\n\t\t\t\t\t\t\t\t<key>ReferenceTransfer</key>\n\t\t\t\t\t\t\t\t<string>Screen</string>\n\t\t\t\t\t\t\t\t<key>ShadowScopeTransfer</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>SizeTransfer</key>\n\t\t\t\t\t\t\t\t<string>Medium Screen</string>\n\t\t\t\t\t\t\t\t<key>UseInstructionsTransfer</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>9046D0E5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>88</string>\n\t\t\t\t\t\t\t<key>NameGraphic</key>\n\t\t\t\t\t\t\t<string>Notch Rectangle</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>A046D0E5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>104</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M248.833955473,631.114444733 C248.833955473,631.114444733 248.833955473,631.114444733 248.833955473,631.114444733 C251.846969788,607.508798816 237.374620902,601.470201466 233.473381223,586.104916527 C229.961161948,572.271813623 233.246679247,557.561786232 233.13332826,543.290221086</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>B046D0E5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>88</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M271.474448872,629.449775811 C271.474448872,629.449775811 271.474448872,629.449775813 271.474448872,629.449775813 C274.464571561,608.985278786 277.642485396,587.986110364 292.650474341,582.880043374 C314.885901663,575.315033703 337.032538427,594.523991833 339.041336149,542.591133107</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>D046D0E5</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>88</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M349.738151121,496.491556657 C349.738151121,496.491556657 349.738151121,496.491556657 349.738151121,496.491556657 C346.355623864,469.425457758 339.673101214,442.249914259 355.379029694,440.09690175 C389.685427997,435.394084929 447.668555437,505.420604275 443.403648749,411.755009921</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{281.602940244, 351.310079624}, {92.7099603566, 13.6067845492}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>785BF7E6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{282.555738307, 375.779575086}, {104.361613661, 13.6438918533}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>9CDE48E6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{493.247965162, 350.173216093}, {92.7099603565, 13.6438918533}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>5DEEB8E6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{494.136610714, 374.179774944}, {67.8017683808, 13.6438918533}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>C546F8E6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>BB504AE6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>88</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M320.610016855,384.59058516 C320.610016855,384.59058516 320.610016856,384.590585159 320.610016856,384.590585159 C320.849269756,405.237718513 341.672156959,460.844842908 303.029969634,465.53484289 C260.795477864,470.660840649 271.809498798,575.98175828 260.28801035,614.959174427</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>DkBezDashPattern</key>\n\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>EA71EFE6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M540.279468611,358.132625036 C540.279468611,358.132625036 540.279468612,358.132625036 540.279468612,358.132625036 C546.1311819,432.91931498 480.865234394,513.392146019 450.194318435,542.777882312 C425.862618313,566.090030024 342.025160302,622.903491891 294.101532073,624.258740156</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>inports</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{218.868620603, 347.290894756}, {75.0121565422, 20.780090261}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>FE34C0F6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>outports</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{218.840397698, 371.983034041}, {75.0121565422, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>ACECA1F6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>outports</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{424.135457102, 369.549734075}, {75.0121565422, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>229EF1F6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>inports</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{423.667371526, 347.872563243}, {75.0121565422, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>5D5F12F6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>blocklist</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{89.4337593497, 90.1437830503}, {75.0121565422, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>20AB4EF6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>wirelist</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{89.5006235834, 274.701145749}, {75.0121565422, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>46A0BEF6</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDLine</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>F2191407</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>120</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M440.746341861,80.0533679036 L477.776984438,127.713061527</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>Plug instance</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>32</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{421.048603887, 148.710252509}, {101.171637747, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>2DC96507</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>136</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>Wire instance</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>32</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{476.303115817, 177.13167585}, {101.065228041, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>103AE607</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>136</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>Block instance</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>32</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{478.450301112, 119.617221454}, {104.549287768, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>A923F607</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>136</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDLine</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>AE96E807</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>120</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M364.898881334,159.578506524 L420.858822132,157.456432575</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDLine</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>D41CE807</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>120</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M475.343360159,189.77412284 L420.478081054,231.067594614</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>DA7BB017</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>56</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M264.224812328,141.270392897 C264.224812328,141.270392897 264.224812328,141.270392897 264.224812328,141.270392897 C264.680299021,128.667852362 253.763650807,122.151372665 262.019470676,114.253720735 C266.592694184,109.878900543 263.323608314,104.779483398 263.102594609,88.2428959191</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>9078D617</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>104</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M244.287500769,487.747128454 C244.287500769,487.747128454 244.287500769,487.747128454 244.287500769,487.747128454 C244.893925435,469.192550955 230.3597473,459.598411804 241.351358853,447.970788437 C247.440045032,441.529790285 243.08765816,434.021976257 242.793405521,409.67534606</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>Block instance</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>32</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{92.7034725343, 361.451732207}, {112.543745997, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>AD743A17</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>136</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>Wire instance</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>32</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{103.724608377, 632.781303854}, {101.065228041, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>FF236D17</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>136</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t\t\t<string>Plug instance</string>\n\t\t\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t\t\t<string>32</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{105.035436576, 500.230321091}, {101.171637747, 20.7800902609}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>7ADE9D17</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>136</string>\n\t\t\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t\t\t<string>1.285575764081</string>\n\t\t\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>HideDimensions</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>LayerColorMod</key>\n\t\t\t<dict>\n\t\t\t\t<key>DKDOnColorMod</key>\n\t\t\t\t<string>NO</string>\n\t\t\t\t<key>DKDOpacityColorMod</key>\n\t\t\t\t<string>0.5</string>\n\t\t\t\t<key>DKDOutlineColorMod</key>\n\t\t\t\t<string>NO</string>\n\t\t\t\t<key>DKDTintColorColorMod</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t<string>NSCalibratedWhiteColorSpace</string>\n\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>White</key>\n\t\t\t\t\t<string>0.5</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>DKDTintFractionColorMod</key>\n\t\t\t\t<string>0.5</string>\n\t\t\t</dict>\n\t\t\t<key>LayerLock</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>LayerName</key>\n\t\t\t<string>Paper</string>\n\t\t\t<key>LayerState</key>\n\t\t\t<string>Active</string>\n\t\t\t<key>OutlineLayer</key>\n\t\t\t<string>NO</string>\n\t\t</dict>\n\t</array>\n\t<key>DKDPagesSpec</key>\n\t<dict>\n\t\t<key>BackgroundDisplay</key>\n\t\t<string>Background</string>\n\t\t<key>CanvasBorder</key>\n\t\t<dict>\n\t\t\t<key>Blue</key>\n\t\t\t<string>0.45904</string>\n\t\t\t<key>BluePlus</key>\n\t\t\t<string>0.533333</string>\n\t\t\t<key>ColorSpace</key>\n\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t<key>ColorSpacePlus</key>\n\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t<key>Green</key>\n\t\t\t<string>0.458672</string>\n\t\t\t<key>GreenPlus</key>\n\t\t\t<string>0.533333</string>\n\t\t\t<key>Opacity</key>\n\t\t\t<string>1</string>\n\t\t\t<key>OpacityPlus</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Red</key>\n\t\t\t<string>0.475001</string>\n\t\t\t<key>RedPlus</key>\n\t\t\t<string>0.54902</string>\n\t\t</dict>\n\t\t<key>CanvasColor</key>\n\t\t<dict>\n\t\t\t<key>Catalog</key>\n\t\t\t<string>System</string>\n\t\t\t<key>Catalog-Color</key>\n\t\t\t<string>windowBackgroundColor</string>\n\t\t</dict>\n\t\t<key>CanvasMargin</key>\n\t\t<string>0</string>\n\t\t<key>DetailsDrawerWidth</key>\n\t\t<string>260</string>\n\t\t<key>DisplayAttributesBar</key>\n\t\t<string>YES</string>\n\t\t<key>DisplayRulers</key>\n\t\t<string>NO</string>\n\t\t<key>FullScreen</key>\n\t\t<string>NO</string>\n\t\t<key>FullScreenCanvasMargin</key>\n\t\t<string>141.73228</string>\n\t\t<key>LayersDrawerWidth</key>\n\t\t<string>266</string>\n\t\t<key>NonFullScreenCanvasMargin</key>\n\t\t<string>0</string>\n\t\t<key>NumberAcrossFirst</key>\n\t\t<string>YES</string>\n\t\t<key>PagesAcross</key>\n\t\t<string>1</string>\n\t\t<key>PagesDown</key>\n\t\t<string>1</string>\n\t\t<key>PagesSpecBackgroundRGB</key>\n\t\t<dict>\n\t\t\t<key>ColorSpace</key>\n\t\t\t<string>NSCalibratedWhiteColorSpace</string>\n\t\t\t<key>Opacity</key>\n\t\t\t<string>1</string>\n\t\t\t<key>White</key>\n\t\t\t<string>1</string>\n\t\t</dict>\n\t\t<key>PagesSpecPrintBackground</key>\n\t\t<string>NO</string>\n\t\t<key>ShowPageBreaks</key>\n\t\t<string>NO</string>\n\t\t<key>SizeChecker</key>\n\t\t<string>8</string>\n\t\t<key>aCheckerColor</key>\n\t\t<dict>\n\t\t\t<key>Blue</key>\n\t\t\t<string>0.926349</string>\n\t\t\t<key>BluePlus</key>\n\t\t\t<string>0.941176</string>\n\t\t\t<key>ColorSpace</key>\n\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t<key>ColorSpacePlus</key>\n\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t<key>Green</key>\n\t\t\t<string>0.926333</string>\n\t\t\t<key>GreenPlus</key>\n\t\t\t<string>0.941176</string>\n\t\t\t<key>Opacity</key>\n\t\t\t<string>1</string>\n\t\t\t<key>OpacityPlus</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Red</key>\n\t\t\t<string>0.926361</string>\n\t\t\t<key>RedPlus</key>\n\t\t\t<string>0.941176</string>\n\t\t</dict>\n\t\t<key>bCheckerColor</key>\n\t\t<dict>\n\t\t\t<key>Blue</key>\n\t\t\t<string>0.737155</string>\n\t\t\t<key>BluePlus</key>\n\t\t\t<string>0.784314</string>\n\t\t\t<key>ColorSpace</key>\n\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t<key>ColorSpacePlus</key>\n\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t<key>Green</key>\n\t\t\t<string>0.737142</string>\n\t\t\t<key>GreenPlus</key>\n\t\t\t<string>0.784314</string>\n\t\t\t<key>Opacity</key>\n\t\t\t<string>1</string>\n\t\t\t<key>OpacityPlus</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Red</key>\n\t\t\t<string>0.737164</string>\n\t\t\t<key>RedPlus</key>\n\t\t\t<string>0.784314</string>\n\t\t</dict>\n\t</dict>\n\t<key>DKDPrintInfo</key>\n\t<dict>\n\t\t<key>BottomMargin</key>\n\t\t<string>18</string>\n\t\t<key>Copies</key>\n\t\t<string>1</string>\n\t\t<key>FallBackPaperSizeHeight</key>\n\t\t<string>841.889770508</string>\n\t\t<key>FallBackPaperSizeWidth</key>\n\t\t<string>1028.12598425</string>\n\t\t<key>FirstPage</key>\n\t\t<string>1</string>\n\t\t<key>HorizontalPagination</key>\n\t\t<string>2</string>\n\t\t<key>HorizontallyCentered</key>\n\t\t<string>YES</string>\n\t\t<key>LastPage</key>\n\t\t<string>-1</string>\n\t\t<key>LeftMargin</key>\n\t\t<string>18</string>\n\t\t<key>MustCollate</key>\n\t\t<string>YES</string>\n\t\t<key>Orientation</key>\n\t\t<string>1</string>\n\t\t<key>PaperName</key>\n\t\t<string>Custom</string>\n\t\t<key>PaperSizeHeight</key>\n\t\t<string>841.889770508</string>\n\t\t<key>PaperSizeWidth</key>\n\t\t<string>1028.12598425</string>\n\t\t<key>PreviewPageNumber</key>\n\t\t<string>1</string>\n\t\t<key>PrintAllPages</key>\n\t\t<string>YES</string>\n\t\t<key>PrintJobDisposition</key>\n\t\t<string>NSPrintSpoolJob</string>\n\t\t<key>PrintSavePath</key>\n\t\t<string></string>\n\t\t<key>PrintScalingFactor</key>\n\t\t<string>1</string>\n\t\t<key>PrinterName</key>\n\t\t<string>Brother MFC-9340CDW</string>\n\t\t<key>ReversePageOrder</key>\n\t\t<string>NO</string>\n\t\t<key>RightMargin</key>\n\t\t<string>18</string>\n\t\t<key>TopMargin</key>\n\t\t<string>18</string>\n\t\t<key>VerticalPagination</key>\n\t\t<string>0</string>\n\t\t<key>VerticallyCentered</key>\n\t\t<string>YES</string>\n\t\t<key>XPrintMirror</key>\n\t\t<string>NO</string>\n\t\t<key>YPrintMirror</key>\n\t\t<string>NO</string>\n\t</dict>\n\t<key>DKDSaveTimeStamp</key>\n\t<string>2020-07-14 04:42:44 +0000</string>\n\t<key>DKDTablet</key>\n\t<dict>\n\t\t<key>BrushDynamic</key>\n\t\t<string>NO</string>\n\t\t<key>BrushFit</key>\n\t\t<string>6</string>\n\t\t<key>PenMax</key>\n\t\t<string>25</string>\n\t\t<key>PenMin</key>\n\t\t<string>0.5</string>\n\t\t<key>PenPressureFactor</key>\n\t\t<string>0.5</string>\n\t\t<key>PencilDynamic</key>\n\t\t<string>NO</string>\n\t\t<key>PencilFit</key>\n\t\t<string>7</string>\n\t</dict>\n\t<key>DKDTimeFormat</key>\n\t<dict>\n\t\t<key>Field 0 Include</key>\n\t\t<string>Weekday</string>\n\t\t<key>Field 0 Type</key>\n\t\t<string>Long</string>\n\t\t<key>Field 1 Include</key>\n\t\t<string>Month</string>\n\t\t<key>Field 1 Type</key>\n\t\t<string>Short</string>\n\t\t<key>Field 2 Include</key>\n\t\t<string>Day</string>\n\t\t<key>Field 2 Type</key>\n\t\t<string>Number</string>\n\t\t<key>Field 3 Include</key>\n\t\t<string>Year</string>\n\t\t<key>Field 3 Type</key>\n\t\t<string>Long</string>\n\t\t<key>Include GMT</key>\n\t\t<string>NO</string>\n\t\t<key>Include Title</key>\n\t\t<string>YES</string>\n\t\t<key>IncludeDate</key>\n\t\t<string>YES</string>\n\t\t<key>IncludeTime</key>\n\t\t<string>YES</string>\n\t\t<key>Seperator 0</key>\n\t\t<string> - </string>\n\t\t<key>Seperator 1</key>\n\t\t<string>. </string>\n\t\t<key>Seperator 2</key>\n\t\t<string>, </string>\n\t\t<key>Seperator 3</key>\n\t\t<string>  </string>\n\t\t<key>Time Seperator</key>\n\t\t<string>:</string>\n\t\t<key>TimeAfterDate</key>\n\t\t<string>YES</string>\n\t\t<key>Twelve Hour Clock</key>\n\t\t<string>YES</string>\n\t\t<key>Used Once</key>\n\t\t<string>YES</string>\n\t</dict>\n\t<key>DKDToolbarSelectedButtonPairs</key>\n\t<array>\n\t\t<string>ColorTextToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>HSB_0000FF</string>\n\t\t</array>\n\t\t<string>ColorFillToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>HSB_0000D0</string>\n\t\t</array>\n\t\t<string>ColorStrokeToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>HSB_000020</string>\n\t\t</array>\n\t\t<string>GradientToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>EndGradientColor</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t<string>0.999991</string>\n\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t<string>0.999974</string>\n\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t<string>0.999999</string>\n\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t<string>0.999996</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>GradientFillClass</key>\n\t\t\t\t<string>DKDHorizontalGradientFill</string>\n\t\t\t\t<key>StartGradientColor</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t</array>\n\t\t<string>PatternForToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>Toolbar_02</string>\n\t\t</array>\n\t\t<string>TextureForToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>Ancient</string>\n\t\t</array>\n\t</array>\n\t<key>DKDWindowState</key>\n\t<dict>\n\t\t<key>CursorMode</key>\n\t\t<string>Nothing</string>\n\t\t<key>DocCenter</key>\n\t\t<string>{496.062992126, 402.944885254}</string>\n\t\t<key>DocumentFileName</key>\n\t\t<string>/Users/corkep/code/bdsim/figs/data_structures.ezdraw</string>\n\t\t<key>DrawersOnMainView</key>\n\t\t<string>YES</string>\n\t\t<key>GDetailsLayersDrawerEdgePreference</key>\n\t\t<string>Auto</string>\n\t\t<key>GraphicDetailsOpen</key>\n\t\t<string>NO</string>\n\t\t<key>LayerActiveAbove</key>\n\t\t<string>NO</string>\n\t\t<key>LayerOpen</key>\n\t\t<string>NO</string>\n\t\t<key>LayerSelect</key>\n\t\t<string>Active Only</string>\n\t\t<key>LayersDrawerEdgePreference</key>\n\t\t<string>Auto</string>\n\t\t<key>OutlineDrawing</key>\n\t\t<string>NO</string>\n\t\t<key>WindowLocation</key>\n\t\t<string>661 263 1054 1027 0 0 2560 1417 </string>\n\t\t<key>ZoomPercent</key>\n\t\t<string>82.290627</string>\n\t</dict>\n\t<key>GroupEdit</key>\n\t<string>Fixed</string>\n\t<key>NumberColorsToListInContextMenu</key>\n\t<string>12</string>\n\t<key>NumberPairColorsToListInContextMenu</key>\n\t<string>6</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "figs/plugs_and_wires.ezdraw",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>AAAA_CurrentOSXVersion</key>\n\t<string>macOS Catalina: 1676.105000</string>\n\t<key>AAAA_DKDDocumentVersion</key>\n\t<string>9.0.0 : Mobile Friendly</string>\n\t<key>AAAA_EazyDrawVersion</key>\n\t<string>9.7.0</string>\n\t<key>AAAB_Build</key>\n\t<string>9087</string>\n\t<key>AAAB_Distribution</key>\n\t<string>Free Market</string>\n\t<key>AAA_DKDQuicklookData</key>\n\t<data>\n\tJVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmls\n\tdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGtncnSJEuRpffxFLEEkSYIn91r2Uhv\n\talfC3VG16RQo6E7GC8Lr93fUdDDz/DPvBVoQIFPTwgYdj6mpm/35+R/PPz/fr/35u+fP\n\tf/H99Pz0/XN6fv/p+eY/0zodr2VentO0ra9tm55/+fXzN8/9Ne/Xe12ef3/Oz3/Xz+bn\n\tL3750C/ez1/+gv4m++PP9H/500+/f9LD63i/p+e8vF/beh3Pj2jR6pGtglK/+/Tc39vr\n\t3I8D2vSap+167uv8mqZlfc7T/lrn6Xgyy9d7nabHvF6vaT+256fnsfDH5WIO5/w6puV5\n\tbNdrW6bnsmzq53ye8/S6zn2Gwh/e18qvfgmbJtb758dXljZN58ToJ+vVr987S5tY6kj7\n\tXLT9PKzdA1r8NmjPzzbgV/k4XcdrZ7n0djLOcrS/PvTXz/nX536u/DUbt79qJSYxBA13\n\tdv5nXfmf65TUFwSzz/v8uA4T+KTujXYtT5b1mo5tfS4zLGOhULbXcR0wb0ZRNoRwwfLr\n\tmmHZMsPP9749rmt/TSe/X+b59Z416zeNtu25TCfymS9R1hct+NW0MqnTGp3i/nN5X6/l\n\tLSV8T/z+Wh8Ljaf3JsL6mtHDT8/5ojF/F21/LSxmvpbXfMIBKAez3RF4cs0o/O4hJXgv\n\tl2YQrQ6UZ7IJRE8HCjYvNoEcb99Zyq6f2Zye806j/T0hg3eb97wdTABu1eLmbWEpu3py\n\tDswbLJ1Rm2TSvKIXx7wGJx8sbkXVp2Muds/r+tqZdUpEhOM9I5GQm37mjXYmhMViBdHP\n\trnlsM01isO1EU9/GypzSNsPT5ZmzvlYarUg7lva4GIKJyUKCAc9rZUkX7JqdR9dyvGAK\n\tIglGXsv6OjczrNnZ/bgWzBFlMLs0kVyY33Z2cmsETFfydulmo1CA6Ce1pBssVSmnlOqW\n\ts06drLU9QnGTAaHbz8t5VPpfjCwrCXaHJT0uF0naWy+3335A/T1ut/lXGekbD/yW0hwb\n\tHFrnB0ZqtAUdObCpDT4iYPybVAKz3Wb+SXZz7NsOZX6d73WXvb2XFw5PtO31Po8Zvs14\n\tTxzihb1M51u/wykc2Ot1SpNwkRKA/igVxOD3Q+LGzM9lFwWTOCb07ZIPwT4vpPWWi9bv\n\t5td8YPKiXTuqM58Xk1lEWV/rtmxmqMuSlHmSDZyozJ40azVj6EyqOkLxJv6lHw7XeGot\n\tOSdYdixHP++DiVz4l351B7NcVzgcPJiP9+tcCQrJJywK/2S/S27OkusGg5Lnoqz7epRc\n\tGgWGu/DkharRwhJkBNkR4+5wBUoMxz8t+2JCyEnJ1M5pecBanzg6x4LoKZe365/wWTAz\n\tmbDj/S/i+hx8Ihi+r10yaMx8XFLorf0MtTGOy7O9d4XQEMq2o2u95IyAp5PkmnzpyRul\n\tCmQ/qSjdYKlOOaVUOZ81qhqKWWsr9Q0OlIo7lzpDcF6iYGUuwfHOpFwqXxgey8NaPzDH\n\t3zw3osi1gkb+TnA9l4OY4n9AdI0yH99ES9HvY8Kkrx3L6sx8kt+8oOW8Jzz/ez5rcRPu\n\t9liRZVn5Y0KLUEcauZGDil7LYWHWeTntGxAAjZOxupFP8PI8DkVVN/IJjq/HhcaF7CYi\n\tINbbfudGPiGp7ZTrDyMX5X0JtmFZZuSNcg1G3rVqKtd15EbeD+fKW3MK/a55hxX0qwtb\n\tSR6kkQebwugQQfIyTTMYntabMmkU0EEIDla6iT+E9daF9YeFTyeW+sY5xmDP6RRgOiyq\n\thoVPuN5VIT8tfMLxbvuMm821YVjL+5TA08LRQcKBbDWYdKGZG74/LByAaIgJx2BwSBYu\n\tzLis8gth4aLg3RWeQ25GwUeWidvvWiu38Uf1lHqSw3XalJNKjYt5h43TU66utNd5gD57\n\tGEs+ZbDruBm2ghCc52njIZYwul52nYmnRH9vCD0s+/1of1owkbBt20UtuLhLDpaogAUJ\n\tVoIqNwUgdhmwCnxjeyois/Dr/vy7d0XkDX8xdPqt/RUIHGNeQcF47wtIKWAAbd2ElkU7\n\tQcaisOEB81qrEx8CZX8L4YpyAKNxGdjQtJ4HjCB4Az8fCyIhvtMTSrls0/pcwd+EBnqC\n\tAsKQ5q3Lgsnj90SbgClPopeCQ/vdRHePFcvbDvCn2AnAaPsrmEH/OKcLnwS0l7szkpCv\n\tzAfZGgWYQvzGk50z6r/Qmr2kAiq7rZmVMnnrAWcIktbvdihgJiwWysJaWTNuDlQPWsBv\n\tAtwP1H/ZwffLW8EaFhGvaMXi17d+JiNho4OXO4BHRrhmRKPRtIeyGH9gpBjbopi1vne2\n\tUQfNtWVCEfZFyMAoDXsREAFaKEe1IqCKoaJ4T7ATH0tPO4CrjQfo5HdtDjYp9tUMp5/F\n\tvAHx7xV1q9U9FzbBIMOFrpwF4HnQnH4WXGI/cMy2jSheQsNemLlznI6YynuFdS6VR6Mg\n\t0BAdTKlGUi5t/6oj2KzthyhtOKLJ9T7kgpacFJzmd+wSfd50Dp8nCSFXB5+BNPKUKKTz\n\tAAyxoouPJdlkvNcuFU0UM7FG1vS27c5CZqOxHGngT2kUUtEfToJ0yM4QzHyiMxquSZiu\n\tolVqQXSUqtKN5vpEV9IHzSl1zucNJTSzW12qb/LAVZy9RPApDSG5SV8YWDOX4HmZVMjF\n\tKDsqZl2KmXg8J6ZEbQfyjwOZB2kfczjwjfCg7eIiwzaPg8kY6WQ/YJQT2/FGYjtQHTdh\n\tlPmNRGE7Co73x3sCYN6WHlBcmRVQ2d2wk5nNK+0nZiUK+zp5M3klYD8IlV0Rqrc/5JXO\n\tnRRUo4Bb5JXYmeC5iGwOeVveB0e2shPGJb2VJGELTGeA24todezXiZs1mnar2pAC2C8y\n\tLyS48Dko0CU/uWCNn0mBEcUONE+0acORNVrbcdlv2YNBU5pK6Sn1d51ga9GAY6iMhmV3\n\tquTOb7+cDNxlr8jGa19WeCaHzhYY92tzn6b5fO2sJBMF5KkajXni/i3BAwX/YwkGT/BA\n\tgfMrSpIJHkjgYtuBeYIHCm5HSRhPb5AjYmPC/qtyIJCQHK4VEst4Xw/yDvDJUjAtlwJB\n\tfxgSLhO7kpeil4KkJXigkHLBZ2TqhvQXKr3N5GAiwcM/sibB4q4VDh/f3PeEZ5tRGNpE\n\tgmd6Y5f8VX35rMBobKDUk2d4yEFhqehzt7o3bsh0KFmAG2ZPh9Aak+iQNIzCVTGSXCpb\n\tYPxppNNoM7/IBnYSMYpctfbU9PeJUVujyiZA8Y5wM4AdZdF8MG2sWn4HUpuQpy5YRZty\n\tZDeYoa+rUiB05KvPRElwCA31/A6UxsdIuWCwyLZxO/IyUFwikboJsZmqE47a2ly43og5\n\tufyrn9CSGE0scVWqKYW21bRdJfvcVehtcEAW4aodTHL1x90XI91I4H9wOw0J76mUW5hW\n\tZ25yrnT/hRFafoccOv6FVeAbPJqT3sGinSSo4OkdSfPVFMSSO/wd9wXSiOSOmI/ykjk0\n\tvVJuRwSFUFE8twNfmYpAV+V2jNeXJSVbbkfcl3NVagVjILeDFPmT0kxdsgUaMBAXnikZ\n\tREuEJx0cuR16QsfJpzkFqCEdUT5K6IFRLAMEBYhJxOh6YuEs0SjKJTXdUkITRtWsgDYH\n\tyYrMSqEQ8p/j8gyt0rkzgUkhL2HWSO4wJWKhkFFlyiABe/C6mdsxinIzJRS1Ae4BsVpm\n\tzlZnNLXyNEL1xEQsuZPDWdS13A4kmxPa1XI7zCnmjb5ZbicXV+kPSM4BAQXtPKA4lwRZ\n\tyO2w3OCllLnldorjABNL7pRUwDNK7kBw0RlByR2J0wWcjUIHqp/QlH600CefE51j3+gc\n\ty815h2Z2q0v9TRaEiieX0g6cl80OzFaS3c3AZE0hkrvJNTMd7ZAwP+R1/vy1cy7MzAy4\n\t2y06CXF44kZhT5OKLAJ/bfbbpRqgmf1GOoK/N/PNjAVsM/MlsUPoa1mbYOUzsx9QmvlG\n\thkTsbubbpVGgmfnSl2dtUrqZj0kdaBT31W6+fSsz374nV7lhPFfMblauvN3Mm/nG8prV\n\ta7NJ1MVELXUVpgKlZbfCnHpWhvUmv5upLqR2PJPGr8x4bVdq+Ta5JjfeyA8YQV4gUwg5\n\tmGdtbIruTzIbgcn5pOGxsjb07CtDEJ60gdRsN5I2stRmu8CslrWB0vxgZW3oyr1lJlug\n\tNI8aaRsZajPeRrG0DbRmvNFKatE8eNdTKAr2ybnabssLdapZNes1qG7pJnpqcaVL25T6\n\tOhNkA03BI7sFwa2gcmDQzFAiZ8PfZV2YkqfSnFB50t54OxsUmHdgvPAHw8Wcf7aQ6xH5\n\tRN7CV9i6R+njSeS8wWJyoe3ckzYGi5+k2v3cM7EDeU8792SVDRafsJI8kMKww+JTbNMp\n\timK14+JL2Jm9PKsyWMxOW2AY/yve8KfHpYSzjk2ln/QgWHyBSRGP3H0gJ85NOfYUOkX0\n\twGLaiMJBkIVcg8X0la0CqFVPAef68Rospq+YlQNDevJ5B3rsFxcYs1jgKDSYxCwbUnVG\n\tmpo5mi1uBywuiTgsDrHZ0hw7n7gxO/ek6waLT3DtAItPnXWOsPjkSFOnngmLT51n6tQz\n\tYPGDtB36YKeeCYtPji/t1BN3YBsHyggItzr2hNJgMWmGOPZEtgaLH+esg1twFFJqG5UT\n\t6KmNZIqtEUZYXI1c/tGPTKptnvrRXJVqSqFsNe1UyVxc6W1yIGBxMinVv2Nk7B2L2w6L\n\tHyERVPlmbsitg8UpzeHYk5VZVKXqI049nTRhojBPcFTSJKpKQUZYTD49zjxpY15HejXA\n\t4geZknbkme7rRCp+5Gm2JlgsFbUjTygtrlJnMMLix4nN+ZEnrZpTFc2OPNPxnni5ALzN\n\tPTfKAIvpq1o1WNz15OFgGM+DRjerFljoKWfeos+wPA9RHRM8jBWjHBYHM1usa7C4WB4x\n\ts4QSkTVEZ2bqkfUEuejMkxAFRaGV2psRFktv/MiTRg2qn6BJHXliJzFvrLuHxQ+KL+LE\n\tk0YttLLNuMHiU4lDHXnSpoVW8wojLH6cJCFHWHyyjR5gcSPYmWcJOBuFDng/rNYD6zBa\n\t6FPNyQNrN28PrLE6ySBwoUyusSBUPLkUgbXnpdtKstsDK3baRKKOB5NzM70RZaV//goW\n\tlj+yLmaU2A8xndROl+wQE4qs1qpxlKuJyc7Yox9hQpPRctqlzDj4K9asoy6Hgc4ZHYjd\n\tsbBqT1BjeWPnsQ777AQzJaEDOD/BTJvVMZ2dYKZIRbETTHPQ2so2ip1gQmvAq2/VbLbr\n\tyfVsGM9ttpuVa2w382azw/Jc9zsmuH0kn5rJwrdiZRha8jssVsd9TSBhsSk2YYZmsZwS\n\tArPJuKbBzkAOO8KEYttmMmBxgpkGq6NjO8FMg9Xxsp1gQrFNus767lhYZ32OKJ1FOuuz\n\tE8w0WJ31CZu2DWljt8767AgzRSKKHU6m4BplxMLRSgba3HbXk5tsjVfq1M3KTTZmrp4a\n\tFu7Xl+rrTJBCW1QqPqUVJDdlTWYoyXA3WUzHZXI3tx4LpzA5vXz8MBbeCeqWa+ywMOVD\n\tNyzMeZdhYcEFsXx97vLjVgMIqeXRdkFo1QBCIVJPz13HWQMW3i3SCgvTk2NhShYHLLwD\n\tqQcsbCWedyy8I6YBCz92aoRGLNwoAxamr2zlWLjrqWE4ekIpAns70qtZRZI05x1YuBaH\n\txrR866NY4Fi4mORYuGNkQNjgNt04zA2JoGaiUAcbYpPJRiOhWktIZkccMKDZAp4NeHNc\n\t4FhYPREJERIobcDC1GuNWJgmOjIYsfDO7mbAwo994hh1wML7xDl5KwHEjFuKeGfnMWLh\n\tnS3QgIUbwV2tb3SqkWPh6iewcD8aw+m0IabUKVtOO7Bwv7jQ2+RAqnYwydX/UYyUtrdz\n\tFCrXnNuRIt5TIoGFO7kVFn4k9UMsvKNLqgDsU8Q7sKfHwlIQYWE5j7a53kEFXv8XXkd6\n\tNWBhrBjTVflfui/SxI6F5dKwX7CwVHTEwrvi45AipnTpCywsmrAwPXkSYlc8VvlfuudG\n\tGbAwfqNaNUff9eRxdRjPg0Y3K4+r3cxb9BmW53G1Y4LH1WKUx7qemRFYg+WsxWNmCSUi\n\ta4quIisl7Ow/VP+XoXXnGH1IEUtvhIUb9G5YWJXvIxaWvvVY+MkvvsDCO1s9pYiRQXCJ\n\tGvgRC5syj1iYvii+Vf1fhtZdxbtdihgbEGHEwtXIA2vXjwfWYbSG0+gq5xQ65/NmfA+s\n\t/eoisBYLPLAGlzo7cF5qO9ICa7EbH2hJphJJo+Be3eSIrOpKzYr4LSysQaz1hh3esPBj\n\tU2pXBX0+k5Wl2bllGC2SumFhDphBQj0W5pTasLDss0GOFVxwx8JU9dyw8KodJsfE4mjL\n\tC6/sVYWFTc1cXivReMTCooxYuFHGvHC0kq03m+16cpuN8Wxn6NrYzcptNmYujTXEOCzP\n\tbTaYICNq9pF8cpPtWekm+0h+u8U+SyBhsSm2zmKprBqx8EZ4ERZmig0Lb0Q6r+bLCW3g\n\tmxELU0415oWBK46Ftdi2ed30vYSK+dJgtwnYp2o+KG3zuhGQGxaG5uzeqDUTFpYA2vZE\n\tlBELN8qIhbtWrgJdT64ow3i+tepm5SbbzdwVM9bXb1+LCW6yxaewgp6bzWSD4WFdE6bk\n\tMrmbW4+FU5hRyWcFE7e8MPbtiaqDkHnHwgfxcCyXoBjklhc+wDaGhdVVw8IHUhmw8CGU\n\tO2Dhww5jx7wwx6g9Fn4csHbEwgesTWzKvyovfGpLNeSFT7YZAxZ+NMqIhbtWjs66nhoW\n\tfg7jNSzczSqwcM47sHC/uMgLFwscegaTUNkGT5ORqLWnc4vbAXNLIo6FU2yFhR8UHt6w\n\t8EEd2oCFqfBzLKzRDAtT8DNi4UMZX/LCzNDLJQ505Y6FgcYjFn4emN6IhQ/MWljYfK1z\n\tm+B5w8LE1xELN8KYF/ZGzMnlX/0EFo7RWtAzLFxTio1XTTvKJfrFORYODmB5odrBpNgK\n\t9oyMconidmDhksgX5jbkhVOajoXHcgn7kO+GhQ9yWz0WloKMeeEDgCYs3PyQ7cClVyMW\n\tPog2IxY+2NDe88JSUWFhcb/lhQ92uSMWPpRzbp/C0KolGEQb88IkqgwL0xNxWDmmRhmx\n\tcLQqR9/15OEgxmu61Q4Tu1l5YImZ01OLq8PyPK4GE5iUx9VilMe6YKZFcWUByAYUyyOy\n\tllA8smKSZN4kui6yUvp3w8JUt4xYWHpzywvTFfmFIS8sfRuwMBnFL7DwARQcyyUOvIyw\n\tMMsNXsor3LAw1dY3LHxwWtJj4WcjjOUS1Sh0oPrxwGqmE6OFPvmckFMLrI9u3h5Y+9UF\n\tFi4WeGAtLkVgDV42O1CSqdjd4ugEJUTSKO3b2SY3bVkbug1hWrnE1/LC2VpV5Tcs/Fxg\n\tQY+FF5gEFi7gvmjP2D5tYVQz2gVDGbAw5UO3vPDCeXHDwrLQtn+lEv+Ghanhv2FhfV97\n\tzwsvWLawsCy0HaKLMmLhRhmxcN+qYeGuJ9ezYbxIetas3Ga7mTebHZbnNtsxwW02+eQm\n\t27NS5iiTdX6jZb57LYG4xdLExdZZ7EK965AX5sPaMS+8svERFjZvFOAcrRmxMMWZIxZe\n\tdSSNJ2ybg4aFV2C1sLDMs7k16tpuWHgFZt+x8EoqaswLiyIsLFE2Z9soIxaOVjK95ra7\n\tntxkYzxbnptsNytXuZi5evJNWre+MNlggpTeFJyvEJxPYbLBzRbJZbLF8DDZlEkj2Ecc\n\tXttSFpvC/BYWVpRnupQOc876RY3EJpSk8kNatZTXps8+VK4MpeWF+TDynhfeBKHJCwsd\n\tW154QytGLLxZpB2x8KbscVcjsQGpByz82Njo3LEwEeaGhTftcocaiUYZsDB9ZStHZ11P\n\tjoWH8RoWftasokYi5x2QsV9cYOFigUPPYBIK07CwM9LUzLFwcTuwcEnEsXCIzawIEaq+\n\teBNgIy+M7kdH1JsPWJgQdMfC2vMNeWFt5sYaCe3c7lh4Q82HvDB7bHI7Q15Y27JbXthS\n\tI2NemNL0EQs3woiFq5FjYe3o1U+LI+gL49do+BHlhWtKqKQ8DJSYduSFa3Glt8mBwMLJ\n\tpFT/jpFpJMltx8KPkMiX5obcKi+cRtjK/e3j8K50mM98DFBZGZOF5YlfEKC6GgkpyIiF\n\tN7DTLS8svRqw8GNjtzNiYXbOX2BhqeiYF944xB+w8APv/QUWFm3EwpwQ3vLCjTJgYfqq\n\tVi2udj15XB3G86DRzarFVdaXM29xdViex9WOCR7GilGR93FmtljXAmux3CNrJ5SIrCE6\n\tM9MWf2mli0T6Ggl9CzLkhaU3NyyMdZOeG7Aw3/0NWBh1s/MsfRWOAbTQuuHnRyy84dOF\n\thdUGY+BQwLxCoNOWZnps+PkxL7ypuqnLC/MzEca8cDXywBr94JQ8sA6jeWDt5uSBtZt3\n\tJJl8dZJBBNZiQSSZkksRWHteepIp2e2B9REiUcctqesm52Z6I34rLyx/ZF3omOqOhXWY\n\t1WPhHXA05IX5cPOGhR98zjhi4Q1/OdZIbGC1e16YLx5vWJikxK1GYtMZafvKO4HQJinp\n\tK+/EwqKMWLhRxhqJvpXbbPUUetaPFzZbswqNrZm7zfbLC5stJrjNJp+aycK3YqXMUVg4\n\t+R0WWwIJi02xFRa2E88BC++kb4YaiZ2szz0vrAPHEQvv3Jkz1EjoCPaOhbmxx7CwzLNh\n\t4V0gbMgL6yy3YWHh3MZu6pBvWFiUMS/cKCMWjlYy0IaFu57cZGs8ZuUm283KTTZmrp5w\n\taJxl9OsLkw0myNYMCxefwmSLm7ImxMgBbzDcTdaOfE0md3Pr88IpzKiR+NoVSZSptVJh\n\tInBc7FKlwnn5SxSvcokMSUZdkVSlwnmNTFbBxk0zWSeb19FUNe2jLq0B0AgG1702+BHD\n\twapQIS9JmW6WCucVSVkqHJfoVBFwXpHUlQrnFUlZKhx39lTRcdzs05cm5/U/Mae6Icin\n\tHdcIPWttednQIzmQVyQlk/LWouJkXm0U7M7bj6JUmNuPVGkLaki5cXEBNF2qkIWp1Q8o\n\tx2BwDUY8l2pRn1JT4vcCwnlFUhYL19qIyw6EkwFZdes8ogrYa4WDkVQPZ61wsjtqfFud\n\tnG6tijLglFvUChPwQrrVCAuzO7Kyn9CSbrBUpZhSaVvOunSy1paKG7XCpdvOo9B/yjKD\n\tkXWRWNYKlyV59XZdhtTJra5IolYxrfCjK5Ky4hQjlS282dplXSoCBo1IJbxc2C6NsiuS\n\tosKVaJ53S2QZbN4/kaWycUsFxt3qhU0A8FvF/Vl1m7enZGWuCuXsiqSufjevSIoqXyu4\n\tsyuSshI4b+Ho6oXzro6ulfIfGxPAFeJYURyxftn68uS4GKTmRAyxK5Jq3oRZDrGWXB1c\n\tiXtIqmY6b09JPqnA0a5I6ripMkg2+JxMOc/rapSUi9pw+wFm2Sq9NZyR+GA8a1Oro6hf\n\treG8XlhCIPjbvU1ZLxwTf2axbF6gEiW1trxgghcMW+GprpLKeuFgJhS42rCwnKVxPMqF\n\tSyjstgSFQ3JUFItgUDhvx4ma4lKB7CcVpRtM+1pu5MCivIQ5L+zJcuFSzCqGLvWNcuFQ\n\tcXrihFk7BrmGZghVe13mEhwvk4qK4bg/BbtM2XX3pyT1W3jYLZXqoihYZBubQ2WNak4n\n\tylhzzl2ta6zM7r8hP1zXm2XJbLKoK6xNRmb1bdpuVuim7UrvHBOn4KSdholTtqIYJg4N\n\t6OuGU026Vk2Tuo6a7fKzGo7MtHSy5hS2W/MO2+1Xh+nZ9WbJgzSTKBsOW+rrhjUVM91g\n\tuAjwVIXbOj2heKVRdLkQ6Jk6rM5ys2y4uokq1hiMmKV04HjzUdbDpuFm3XAabldYqyWZ\n\t94ryW5O8mJQVumm4UhjHxGG4UipLD6dERDFInHJrFIPEKd1qBf5lptxLkz2F6dZwdfNR\n\tTUrRWdEi5x16adecOeRP0w0e2KrsAr/kU5lBcVOTUaTjui4SAKQje3tqlcNhub3sOstN\n\tiUaOmNtt2Kx8eXVon5nKaJ7JyMTFmbBMXOBZTVQmsUNmPgNeZG40MUiXQQ1c/Ig0a4KZ\n\tzMSKN8LFXbrWTJ19BTRPDydyisQvqutXh3bpYTMCgbBohaJRRaWrQ6sndqN2dWiMp4gE\n\tYNHVoTmnhIUx7cSO3doSYQYHCoQmkxKqFicTzya7A/KmRAIXk9FoaX3ZrOPiTEZWP5Gw\n\trMEqrRm4mExQSxDXrCM9WmurBHExIDKtySPUVvlhvFAwsjK2xW7P66K5pB0kkkj9ptwq\n\tP4wF+NWh2ShwceSHsQ3XkhqsVMmnlDfVkp72/HDpZK0tFTcYULrtPAr9byk1NhjoSFlJ\n\tsLssyTP2hYs7uRUuTiu0U9gvrw7NLGMXWTNBHN6CTjxFHD6F7GimiDO0ZuozvVOmR8OH\n\tce9N5ogjtlamNWNrZmMztnY524ytmdkN71vZ3/TRXY44PXnmiMPZdx15bI3hDDm22Fpz\n\tisiSGeKMP/3qIrYGD9Bdh6DJp4x3HTczKibPM7qGXPyeUFxHpRq7Ri1FbCHYonSmiGu4\n\tzBF3k4rsZ4bXTJDW8ipJnOE1kq305HyKHHGG1y5rmxyPFHEJxVPEITl8R6aIQ76eNgY8\n\te3CF4KnmUhS5IQfhgYszRRwqx+88tV2KWWsr9Y0seag4aXLPpIch2MmZ59vLXCJLnGA1\n\ts8QRXfGy7WQGL9tF16T+OFwcSaoeF2deMqcTqcucc5ffjJWR37RcceHizBUXiyqZWoyM\n\tjGvZLmhjvBG0yxWX4CLDW7KFMuLiLldcalKtGi5WIwfYYbuVKk6dzDml7ea8Axd3mfAy\n\tgUgVp+1Gqjhsqc8Vp+kGw9MoUyaNspOC9Ax/7WgzVVzdROYyBuNnmSuuGUWuOGcdaVJM\n\t0vfrXTI1DTdSromLMyubhlu5W5BPY3cmeFMikQQm6vqNoI0y4uJqhbwMF1dPgYtruMLF\n\tNanAxTnv0MtHt7o03eBB4eLMFZcZFDfDVhCCZ4vTdPWBkLLFYbm97DrLTYn+IC7uqhcz\n\tmmfBakb8LGoNXPCoytfEDlEdm1fqZ/1sYpCuyjZxcZTiJpjJGmLxRri4K+lNXJyFv4mc\n\toji4cHFXQpwgLFoVLq6eAs7FeB0uzjklLIxpJ3bs1pYIMzhQuDiZlFC1OJl4NtkdkDcl\n\tkrg45Va4OAtWq58oIa7BVC1o+WLSw7gobvl/RBFxzdqLiPNKfcqDMfX2QV0xgJA4XKkf\n\tBbtYuuPirqo3cXHW/qZIvDzYTJbDFspKUft25Vrh4mwUuDj7SS3xgmVt1eJ1hphS4eKs\n\tIS6drLUFLs4a4tJtAVxloOK8JGqIe1ycNcRlSVHV3Shc5NnJrcPFQf0KLo7iRR3qRL44\n\t61XDW1RNa/iUR1f5mqE1y2PTO0UJLX37bdtdoW3EVjN4q53I2JoVuwl3oq5XmzX3rNQI\n\tex1xxFZ6Au6Qmiof3dURpyfvWjVn33XksTWG63BxzSlia1YRZ/zpVxe4OHhQEDT5lPGu\n\t42ZGxawjzugacklcnMKr6Fo1q9VRlBHXcFlH3E0Km7VMaIbXLKKt5VUhcYbXKMilp4aL\n\to44YGQQz5RnGfHGWEZdQvIw4oiuVvqorHvPFUUZcKhBlxKUo3WCBi2tKEVxj1p1i1tpK\n\tfaOSOlS8qq3DEOA3OtSeJyhzCY6XSUUlcUTXvgS8i64p0R+Hi6OQscfFWbua04ny1pxz\n\tVwMbK3t6nWzh4iylTdutgltsMLJ3UU+cthv1xHVTflffm4KLKmC0pD2XwFW35Im4B7ps\n\tt1HGm/K7Vs12u45c3frhXCdrTmG7WU2cyt2vLmw3eZAoNMqJw5YeHS/T4oLhabkpk0bh\n\tnm2w4D1fHKWrXTdeThyDPbsK2JxR1smm4WYpba6tKyhOw82y3DDcrNxNw436Xh0BOy7O\n\tIuA03CwUDsvlQmIVGI+4uFoFLq6eAhfXcIWLa1KhcTnv0MtHt7o03eABBs5k9OBL8inN\n\toONm2Ar1ws7zNN0QS1huL7vOclOiP4iLuy/cM5rHpQaVCcuLDwIXPOp2hMQOeYNCwIu8\n\tYyExSHcTQ+LiuK4hwUze6CDeCBd31z4kLs7LIRIXxwUShYu7ayYShEWrwsXVU8C5GK/D\n\txTmnhIUx7cTF3doSYQYHChcnkxKqFicTzya7AxenRBIXp9wKF+elBtVPXHxQg5FKueNi\n\t7QCHOgpt7YanpvqLJooBSqr2T03lpQ6Ji7U9uz01RcrD75kokfg9EzJZw8Vxz4QsPfLF\n\tcc9EKUD0k1pSg5UqYfxW4lzaFrMunWQr75g/FTcYULrtPAr95zP8xsgeF+c9E2VJKr/A\n\tYVa+uJNbh4uD+hVcnF+9d7g47zQIb8Fn8BRj9E9NcX1FXjWRnievUEjvlNcshA/jXglN\n\te3hqygx+xMV5q0PCne7uh4ytcUNExlauXvFbJNJHd3dNpCfvWnkSRPUMfR0F02xXW3S4\n\tuOYUsTVvmsj4068uYmvwoCBo8injXcfNjIrJ84yuIZfExSm8DhfnvQbVEYjPSoprOHSn\n\tYbluUuDJERfnRQu1vLpsIsNrXjYR4TXvdcjw2t3+EOE1r4goofhVEyG5/qqJxE5x1USp\n\tQFxZUYoi67nli2tKEVxj1oWLu6smSn3jto1Q8UfcNcHvvI4i7u2wPXM7jOW6D+d4BteU\n\tSkRXDKium6A3lTDp2pWg/jhcHB+797g47zdI640rEHLO3T0JsbK4c6JwcV63kLbbXcqQ\n\tuDhubuiQjN85Ubi4uwMiBZc3RaRs4zaJwsWNMuLirlWz3a4jx8X9cI6L48YJ1N2rCGre\n\tkVPtVxe2mzwoFErU0OeIYUvcL0GP7ZPFtLhgeFpuyqRR9O2J3xRSlpvXG2Q3eQNCDPbs\n\tbknIGeVdComL47oFVuv54riUQVmF4EBe3RCGm7c7pOHWHRCJi+OiCKTEp9C4CI5eKN0d\n\tXpBqlBEXV6vAxdVT4OIarrSpJhWmm/MOvXx0q0vTDR4ULk4+pRl03AxbQQjtmg83SaoK\n\t49aJtNFOdh0uTmrg4vY2XDwgVe9H2XOsKoLUCybKPaBOugSYCPut56O+/kQtrw+9ePaJ\n\tQhjdFTdxgzaxXDR76Ei0N1fgi7KSkfFWvJQiCoeS/BNt2AHak0cklig05j0m3cF86YEj\n\tDomAOGzl+Ccqx3j3iUc4eFPFCHg6Pu5+rOT2OIKjNY22hd+vIIadcxOn8Cv0DgGT/5N/\n\tWEjA++tQQGPeSiJFzXR23ouVLzOavo6HT2++nzMKJZ4XFOalT7z47IEJUqOkbNHBl+ty\n\twIrjG5dBKqdEV3pEiouXFNmZOZCSO/31AM6k57mUi9LLU/oZnz8zPCS9nsC1P3qqhzcD\n\t9DPU4eApED3nw4d1CwlBVsgDyvY7PjnVZRyW6OJ8k1b6DIdvy0ThmWFOGVgBFSGauFH0\n\tMz6K53Lyia6iEVkTUmpdP3Bv5X0pKDWavs86yBPVnPiGS7cjxrTtZSReVlBHuTYCCi+G\n\t6VfBACi8oAOh8Yj5kLPc+aCzOElPOFOe2YUW/KZikctSNaWQiSgbEg3JaW3ZSokgFLDr\n\tifnzFhrvPuV4pI+4wkfFZHrlySbFkviZHjOLeZN3QgXgrRLBLI6Mkj4v4/kd/cw5oKSe\n\tPSOWTFKB5Wx6H6yk5gG564soPfwEv0m9oQsrz1GESMweeT2oExsGCqGpSQi30WgU8vd+\n\t7KExaQn91GCpSzml1Lecdiqlr03YP1U3OQClqXdyKY2gYyXG00zFGf4oc3KhuIF1RgdT\n\t8GV3U7RvED/80r89/ySPgrtRfoHb/PTqd/MpvL5kNDI/Rtn1GFprRQ2g2lCwr0wFH6ti\n\tnVosfoOdJBU+bLU2PWFr6Qh9yqr8CYLUP+nTJm5JsowKVRBMWo6HV6XpS6d6O33J8Zxs\n\tMZ3Cz3A8u2xppcJnA43zM90YL8s0Hyyc+7EPftgTfh8y4GnvX7nj1YNQd8drtN7xghTU\n\tirmm4xXl7ngFQ0bHK/AyOF4R5HjhWzpe0UbH2yid48Vbfuh4tUO8O16ulb853h2dGx2v\n\ttiN3x6tNy+h496ZznePVZufmeHe5xMHxijI6XqLJF47XdlKD4xVldLxOMbN3x1uNmiNg\n\tu4fNWD/hePvRwqfUnNztxLTL8XZrCwdWDIAiHxc8Qg/c8RYny10Wv8OllkxEkeMNyWlt\n\t2Yo/jI6XQt6b49X+5OZ4wSA3x6uNzeh4d0pcbo7X9kOD4911UjE43p0DjpvjFWl0vDLC\n\twfE6YXC81cgdb/RTjrcfLBxvTSkcb007HG+srXe8xYFwvMWlcLw9K8PxBsPL8dr2z+BY\n\tuNhOdJ3jTepXt3+D4xWAvTteow2Ot7XqHa8od8crWD06XgH00fEaZL85XtFGx9sonePl\n\tbYre8U680dHe3Ytn9/TPQA0udsGiLgCgPdnHEYR/NYg316t7uA0yXqT5BC1EUuEdRsSF\n\ttuyfT96NcRqBhasbybSB2fXmnrRNb6uJhIIsaoa+HZxCMargI8CwPbo3TsUCIIlGe+b5\n\tYyivr+cm8UQpBbZSXNn3MZT/MIxInHzqqDiiWwvMEdulr6LNizaKiJhHOVorvbbaKAAx\n\t+90b9GKU432gu3xZKQAO/mabRWDUY1iATD3OqMDCs/Y8/KgJq5gWwomvxHtceCJKGnj5\n\tFdox0xUl6/hfJmWUSQ+zcg2LHjiha8VhoH2Lo5RY63YVkh4WBPW8a5FIElI4zVegqkdg\n\tTCn4jHtQEyAquwDLeEz8kyYPjVANjesbyIZAoE/gmGW+3uwvoAA69oX0iSqIkan9jJAJ\n\t6BaNR3lpRN4Vw4RA5HTmgd3AAHLGJFrbhVRcbsZVInQliKd3bN+mH/qdcCEbWCj6AhfN\n\taRQbzT7BHRuxTBFaP6yW2kPegBxHo/awTTLnRMarzTKmTTILF8fPYm3qCpUFY3Uc4N7U\n\tlcv0i0kQ9A3/wEltyDxCOL+hoOtksJpMWFujlODEyqQpjuuVYFGsJ5WOC5hBsfHoCevj\n\tUV37mc9JScQ376vRyOeN7SFKMTdWJ0/fMsDQjAXk+piUPV3Mo5KNTVAY2n7nzOQ5Qkq7\n\t23hYhzjO3Hgm1YyDf5QKQEHtdXtQSK5Rmn6FfL0Vk2o6MPTkmuLDmVGFPtWk7H5OjZcT\n\tb4oJpVteqK8zQXbgGl6MCjvouBnGUiwPE0upGAERuM3Zl85fGuLX32/Q0lFyHKC8Mztc\n\tvSltNK4SbTQ9iNso+ojCWq0yXPQf72AUPl5sFojXWTBPuf6dPd5DXoeaBn4Hy1dKpMzt\n\tACe4mgYKHllyvMAq/BcPJsFsOBG5Hd6kbr/DDq4HX7Zq00PfMOpQm+Z29LUzaJrfYmz0\n\tx1xp8EEK5Vt+l0/ZGEvRg4SE8ia2Ou1yjTYzbKPgCFsrdjRG4Q3WRuHijOZ3BbJYHVGK\n\tt4zbu4s8cntCYf+hJweBGnxFwkIgbO0xbjGAnAHMhLZuR/O7vH7dfqbXXbV+uUmOd9m2\n\timv2dq1eNNUrsypE5ijQva5o/FQ4jYdypW4k6cRzNIm0qLldnDWvlG7gPdyB4BWtMGh8\n\tzIY2cYWArFe85h9Vs86Rm24+RJV50hkK+2oAVfudvnQkIsmpazK0QqD6DEfbWLYj4pVA\n\tL31DIY5pzwKN/aJ0CjdPksF4zD7efsdtL29WSRt9p836aNOUBRKT0jVVjXTIxlFhdKvv\n\tiFBAjIrhbJooSPtdTkp14MTUmDg94YhOia9fHg5Lr5YGE5iUnBp+p2MUvlDhLNhpy4NG\n\tKgVaMh1/84ZnIRj1JAoEl5673tYIblIQpEl5R3Iyux5MFsWGwzkhVvuVT4kO+ZVCVkyb\n\ttmiB/coW58XuOHX7nbOA1lzjYL9zNsEKvlcz23dmwi4W1O6SaSynL8H85g9cLLBZIbZE\n\t1whNxfCzJuBq5Drg/UiYrin9aKFPNSfcrOlczTs0E+HwSVFDQaG/xYPQ8eKTXKgsoXgZ\n\t1uL8Zk5mZbKDJhMWd7c797xfWONXXK8DPrltXWXBF5/c7RGOZ0FHjKbX7mEIF1fhoFur\n\tiHLabBkFkBuORxWfVljNx3wAPvyMCkF2eD3ZM/B4HmyWNlCAqJKIPA84jzlAo45nNsTH\n\tNSPtdwtOWZ5nVoRQ7fV6YcTue274XZ4YMEJXbG64FOsgkggV80y9Igm6w+VcwGv7EH3m\n\tKTslIkjVnKIpkAO/jcbhoJ7DNtrE1NpvKa+Fpni5o5R2RZfuqG80XsvWuCwUPy4E/8Vk\n\tfhSEZwsAtmlfjgtt/ROhBHPCj+vohBfAtyZRDkawEKO9maepOAlVbwVKNwr4Vk34mL/J\n\tE6dIBzrN4W1pvQSsG2mBhTrx4QM6BKOM9w42EoVUl152v/D5sEAUnARxlI3McVx2votz\n\t0yOB+vyG2K7jHp5WFiBqkQTxXUhPn3C/L/ydoqDR9KG+NoWMDUX6wgUD2gq/NXMIVBfy\n\tub/MlkAlpyKNQcB2BcCbqAUFn8ueiJwowMDwO4LUO27mtlroBFq8WdapRN3JP5qRUegC\n\tRblbRVxsFZcOQbfsAj5sMPZ8LEM0/s02Gei5/UwVmmZCGBjQ3dpw8UXzfPiZN+5Zv/NW\n\t0m9dS1A9wT4F1WE8IlL7XUyKeDSzoermLYtFdrE6TkaQsDZymmZwQHeCsNXqmARFOGRg\n\tpYwXUrJbZnpyJUBJxCisLeRmXt1aQYOVuuWIaOD98GQaVg4hBkOJuPuhucuYEmkwfmYQ\n\tx2etpBtX6+l3vjZd6cudZSaC4AC7o42zCa3WmaTEGhsP/c5ZCYV9gJwINGc4+zMgrAgu\n\tEwicxpgKmOS4uEAUvyIU32/y7Vq5DmRHoSj9aLhsfkZXOafQOJ83E9CdgKhlv7hQ3WJB\n\tqLezieWGETgzbXHNUpBBsjytKaVyszkMnysAm9UNlviVKKLsszGNvDBnpRb4wuWANe3o\n\tnRrTcDCszBuZaEFiZBZEmTj2anPGfXHqQUIejK5XteVhsBc7K9UdqvI5u+C2KNywYVkD\n\tfA5fQ3JYAw1X1dzOOmP4RjkIGXI7fMjMaFiumnx6mNf5IobIwGUD4GcO3i5WA15gokAT\n\tdoZ8+m8uHz8JQoVFyHTnsWCFBvYOuDt+KjnjbxuJqIIDsV8ya2gE9WnWnTBgCW742p2G\n\tb8QWqYbEMFa6Uwj5ci6/eWLrFO/R/d/tTsb385e/+OrjeABLIeqLjwLlEPH4vw9SgxIi\n\teZtvED4R6LFeJmuNSN4o78FMOW5ny8QQCtckfvCJSh+hzXytIYFC53faWOm0Xfc16LQP\n\tPK20AX/gFIK7icBtOs9V3uAtz9YCws9/8T3C/b7l5t7P3319lf/zO57qNW78jP+nPAwp\n\tMSYZHGLguTy++/3z5999N/GC4He/ef7kj3/765/+9tfnn/74l79+/9Pnd//n+b++4xTm\n\tw92Z1HvsnJu9cCyoxc5BEbfzXLfOf/eHf75vlYLwejQoD1dFdLz3/afPf/vvf3jC8ltA\n\tNTaSSjRSHHCb8D/V6arnIwScZqn6/v+jS12NA2LEYgWZ9ZbIKLV/ap47FiSbB2OSDRh7\n\t/NXzJ3//3V9+Ks35ya9/+vyv53f//g9pgvAqSAv7IWjNbC1/ZPeDWn9N6x5onU632Zx+\n\tR6lM+7z+Z/y/lsIBFdALSC2jaVwivplu/+/Pf/z0f6dSEg32CBtiMLqkZOByW3n+jBwX\n\tLoswN8F+c6am8B8OTZkyIZBdMj5qv2CtL3gYe66xv7Y2WdTHA+BJ1hn715PaB+mYjwaY\n\tfvX+r39lDCpIsC1FHe1pP17Dr6Z/ZQhCA86R9DRRiWr64+NVzP+2/iuDsDFQooZ9CJt7\n\t7lwJ5R6F8avl37ZulEkx47V/y5USynCe1IToMwtAuLaE7OFw9RyMGE0FGp9FI92v3ZSO\n\t2NqfFE8/FLrtNSdCkB2/S31IjwomkJtW3pRNF7QFW/osGglXnKA+mKWS3Ej8tCMRHDXU\n\tD4WED3VMpdmzsBsQkOib/jv49umPf/jDrz/99T9/0iwJZfsfT/vjjFL8509L877BRy13\n\tB8EcNg5y2nQFoEpyyGSyfVJCiZtXnhzq/9A6vuoHVjLBdgmDFfJzRnBzBPd1SN1yJdIK\n\t1vKI2PeNtSgCrkgCVUMkbOpIYHE6I5QKiMm1qEDhq+JXHzr65Jo09EbFQyfCV4ky9UtI\n\tQld8ssFB0nTxwGWBABT29R+unFYqnY9v8XlKKFFSqx9bchtUp0NeHUZ9ZgT+1fKbyqNw\n\tnZFhqI9+zDV+4HBs4UNltdnGkPh1mQOJhBhxBrIvC3CnG3Em88NRTzu6yxH9t8xWnJHt\n\tfTietEUf11JoROSnmPGiyk1LxNMDY+A6Wy8hjqb1B9iAzRQ2xy51XY0bHJSpEI5bSthJ\n\tKj/ymR5xc4tyojroxclD+y3f/n75429zw2ZXvyL4cN7GhNuIzJeN0056tB+R49OZHd5t\n\tQPspjBQz/uP/AeAgaFIKZW5kc3RyZWFtCmVuZG9iago1IDAgb2JqCjEzNzA2CmVuZG9i\n\tagoyIDAgb2JqCjw8IC9UeXBlIC9QYWdlIC9QYXJlbnQgMyAwIFIgL1Jlc291cmNlcyA2\n\tIDAgUiAvQ29udGVudHMgNCAwIFIgL01lZGlhQm94IFswIDAgMTQxNy4zMjMgMTE1NC41\n\tNTFdCj4+CmVuZG9iago2IDAgb2JqCjw8IC9Qcm9jU2V0IFsgL1BERiAvVGV4dCBdIC9D\n\tb2xvclNwYWNlIDw8IC9DczEgNyAwIFIgL0NzMiA4IDAgUiA+PiAvRm9udCA8PAovVFQy\n\tIDEwIDAgUiAvVFQxIDkgMCBSID4+ID4+CmVuZG9iagoxMSAwIG9iago8PCAvTGVuZ3Ro\n\tIDEyIDAgUiAvTiAxIC9BbHRlcm5hdGUgL0RldmljZUdyYXkgL0ZpbHRlciAvRmxhdGVE\n\tZWNvZGUgPj4Kc3RyZWFtCngBpVcHWJPXGj7/SMJK2FNG2MgyoOwZmQFkD0FUYhJIGCEG\n\tgoC4KMUK1i0OHBUtilK0WhEoLtTioG5Q67hQSwWlFqu4sHrPCaDQ9rn3Ps/N/xz+93xn\n\tfOs9338AQF3IlUiycQBAjjhfGhLLTp6ZnMKk3QMKQBeoAkegyuXlSdjR0RFwChDnigXo\n\tPfH3sgtgSHLDAe01cey/9ih8QR4PzjoFWxE/j5cDAOYNAK2PJ5HmA6BoAeXmC/IlCIdC\n\trJUVHxsAcSoACiqja6EYmIQIxAKpiMcMkXKLmCHcnBwu09nRmRktzU0XZf+D1WjR//PL\n\tyZYhu9HPBDaVvKy4cPh2hPaX8bmBCLtDfJjHDYobxY8LRImREPsDgJtJ8qfHQhwG8TxZ\n\tVgIbYnuI69OlwQkQ+0J8WygLRXgaAIROsTA+CWJjiMPE8yKjIPaEWMjLC0iB2AbiGqGA\n\tg/IEY0ZcFOVz4iGG+oin0txYNN8WANKbLwgMGpGT6Vm54cgGMyj/Lq8gDsnlNhcLA5Cd\n\tUBfZlckNi4bYCuIXguwQNB/uQzGQ5EejPWGfEijOjkR6/SGuEuTJ/YV9Sle+MB7lzBkA\n\tqlm+NB6thbZR49NFwRyIgyEuFEpDkRz6Sz0hyZbzDMaE+k4qi0W+Qx9pwQJxAooh4sVS\n\trjQoBGIYK1orSMS4QABywTz4lwfEoAcwQR4QgQI5ygBckAMbE1pgD1sInCWGTQpn5IEs\n\tKM+AuPfjOOqjFWiNBI7kgnQ4MxuuG5MyAR+uH1mH9siFDfXQvn3yfXmj+hyhvgDjr4EM\n\tjgvBABwXQjQDdMslhdC+HNgPgFIZHMuAeLwWZ8gjZxAtt3XEBjSOtPSPasmFK/hyXSPr\n\tkJcjtgVAm8WgGI4h2+Sek7oki5wKmxcZQfqQLLk2KZxRBBzkcm+5bEzrJ8+Rb/0ftc6H\n\tto73fny8xmJ8GsYrH+6cDT0Uj8YnD1rzDtqdNbr6UzTlGtcYyGwkkqpVMZw5tXKLke/M\n\tUulcEe/K6sH/kLVP2RrT7jAhb1HjeSFnCv9vvIC6KNcpVykPKDcBE75/oXRS+iC6S7kH\n\tnzsf7YkexwcUe8QcEfwrgj6OMWCEWTy5BOUiGz4oL3+381PORvb5yw4YIdeLOMuW74IY\n\tlgMbyqxAntcQqJ8L85EHoy2DPEXccICMGZ+7ES3jTkB7SaseYHatPHUBMOvVms/Ltcij\n\t3Uk2pd5QaS9JF68xkEjm1JYMCySfRlEeBMsjX0aCUnvWIdYAaw+rnvWc9eDTDNYt1m+s\n\tTtYuOPKEWE8cJY4TzUQL0QGYsNdCnCaa5aieaIXPtx/XTWT4yDmayHDEN94oo5GP+aOc\n\tGs/9cR7K4zUWLTR/LFOZoyd1PPdQfMczBmXsf7NofEYnVoSR7MhPHcOc4cSgMWwZLgw2\n\tA2OYwseZ4Q+ROcOMEcHQhaOhDGtGIGPSx3iMnHFkBzrviGFjdeFTFUuGo2NMQP4JIQ+k\n\t8prFHfX3rz4yJ3iJKppo/KnC6PBkjmgaqQljOsfiKmfIhJOVADWJwAJohxTGFZ12Mawl\n\tzAlzUCVGVQgyEpslz+E/nATSmHQiObAyRQEmySZdSP9RjKqVN3xQrRqp3g6kHxz1JQNJ\n\td1THxnsAdx+JF6po/2z9+JMhoHpSralBVGv53nLvqIHUUGowYFKdkJw6hRoGsQealS8o\n\thHcPAAJyJUVSUYYwn8mGtxwBkyPmOdoznVlO8OuG7kxoDgDPY+R3IUyngyeTFozISPSi\n\tACV4n9IC+vCrag6/1g7QKzfgBb+ZQfAOEAXiQTKYA/0QwkxKYWRLwDJQDirBGrARbAU7\n\twR5QBxrAYXAMtILT4AdwCVwFneAu/J70gidgELwEwxiG0TA6ponpYyaYJWaHOWPumC8W\n\thEVgsVgyloZlYGJMhpVgn2GV2DpsK7YLq8O+xZqx09gF7Bp2B+vB+rE/sLc4gavgWrgR\n\tboVPwd1xNh6Ox+Oz8Qx8Pl6Ml+Gr8M14DV6PN+Kn8Ut4J96NP8GHCEAoEzqEKeFAuBMB\n\tRBSRQqQTUmIxUUFUETVEA6wB7cQNopsYIN6QVFKTZJIOMIuhZALJI+eTi8mV5FZyH9lI\n\tniVvkD3kIPmeQqcYUuwonhQOZSYlg7KAUk6potRSjlLOwQrdS3lJpVJ1YH7cYN6SqZnU\n\thdSV1O3Ug9RT1GvUh9QhGo2mT7Oj+dCiaFxaPq2ctoVWTztJu07rpb1WUFYwUXBWCFZI\n\tURArlCpUKexXOKFwXeGRwrCimqKloqdilCJfsUhxteIexRbFK4q9isNK6krWSj5K8UqZ\n\tSsuUNis1KJ1Tuqf0XFlZ2UzZQzlGWaS8VHmz8iHl88o9ym9UNFRsVQJUUlVkKqtU9qqc\n\tUrmj8pxOp1vR/ekp9Hz6Knod/Qz9Af01Q5PhyOAw+IwljGpGI+M646mqoqqlKlt1jmqx\n\tapXqEdUrqgNqimpWagFqXLXFatVqzWq31IbUNdWd1KPUc9RXqu9Xv6Dep0HTsNII0uBr\n\tlGns1jij8VCT0DTXDNDkaX6muUfznGavFlXLWoujlalVqfWN1mWtQW0N7WnaidqF2tXa\n\tx7W7dQgdKx2OTrbOap3DOl06b3WNdNm6At0Vug2613Vf6U3S89cT6FXoHdTr1Hurz9QP\n\t0s/SX6t/TP++AWlgaxBjsMBgh8E5g4FJWpO8JvEmVUw6POknQ9zQ1jDWcKHhbsMOwyEj\n\tY6MQI4nRFqMzRgPGOsb+xpnGG4xPGPebaJr4mohMNpicNHnM1GaymdnMzcyzzEFTQ9NQ\n\tU5npLtPLpsNm1mYJZqVmB83umyuZu5unm28wbzMftDCxmGFRYnHA4idLRUt3S6HlJst2\n\ty1dW1lZJVsutjln1WetZc6yLrQ9Y37Oh2/jZzLepsbk5mTrZfXLW5O2Tr9riti62Qttq\n\t2yt2uJ2rnchuu901e4q9h73Yvsb+loOKA9uhwOGAQ4+jjmOEY6njMcenUyympExZO6V9\n\tynuWCysbft3uOmk4hTmVOrU4/eFs68xzrna+OZU+NXjqkqlNU59Ns5smmLZj2m0XTZcZ\n\tLstd2lz+dHVzlbo2uPa7WbiluW1zu+Wu5R7tvtL9vAfFY7rHEo9Wjzeerp75noc9f/dy\n\t8Mry2u/V523tLfDe4/3Qx8yH67PLp9uX6Zvm+5Vvt5+pH9evxu9nf3N/vn+t/yP2ZHYm\n\tu579dDprunT60emvAjwDFgWcCiQCQwIrAi8HaQQlBG0NehBsFpwRfCB4MMQlZGHIqVBK\n\taHjo2tBbHCMOj1PHGQxzC1sUdjZcJTwufGv4zxG2EdKIlhn4jLAZ62fci7SMFEceiwJR\n\tnKj1UfejraPnR38fQ42JjqmO+TXWKbYktj1OM25u3P64l/HT41fH302wSZAltCWqJqYm\n\t1iW+SgpMWpfUPXPKzEUzLyUbJIuSm1JoKYkptSlDs4JmbZzVm+qSWp7aNdt6duHsC3MM\n\t5mTPOT5XdS537pE0SlpS2v60d9wobg13aB5n3rZ5g7wA3ibeE74/fwO/X+AjWCd4lO6T\n\tvi69L8MnY31Gv9BPWCUcEAWItoqeZYZm7sx8lRWVtTfrQ3ZS9sEchZy0nGaxhjhLfDbX\n\tOLcw95rETlIu6Z7vOX/j/EFpuLQ2D8ubndeUrwX/weyQ2cg+l/UU+BZUF7xekLjgSKF6\n\tobiwo8i2aEXRo+Lg4q8Xkgt5C9tKTEuWlfQsYi/atRhbPG9x2xLzJWVLepeGLN23TGlZ\n\t1rIfS1ml60pffJb0WUuZUdnSsoefh3x+oJxRLi2/tdxr+c4vyC9EX1xeMXXFlhXvK/gV\n\tFytZlVWV71byVl780unLzV9+WJW+6vJq19U71lDXiNd0rfVbu2+d+rridQ/Xz1jfuIG5\n\toWLDi41zN16omla1c5PSJtmm7s0Rm5u2WGxZs+XdVuHWzurp1Qe3GW5bse3Vdv726zv8\n\tdzTsNNpZufPtV6Kvbu8K2dVYY1VTtZu6u2D3r3sS97R/7f51Xa1BbWXtn3vFe7v3xe47\n\tW+dWV7ffcP/qA/gB2YH++tT6q98EftPU4NCw66DOwcpD4JDs0ONv077tOhx+uO2I+5GG\n\t7yy/23ZU82hFI9ZY1Dh4THisuym56VpzWHNbi1fL0e8dv9/batpafVz7+OoTSifKTnw4\n\tWXxy6JTk1MDpjNMP2+a23T0z88zNszFnL58LP3f+h+AfzrSz20+e9znfesHzQvNF94vH\n\tLrleauxw6Tj6o8uPRy+7Xm684nal6arH1ZZr3tdOXPe7fvpG4I0fbnJuXuqM7LzWldB1\n\t+1bqre7b/Nt9d7LvPPup4Kfhu0vhJb7ivtr9qgeGD2r+NflfB7tdu4/3BPZ0/Bz3892H\n\tvIdPfsn75V1v2a/0X6semTyq63Pua+0P7r/6eNbj3ieSJ8MD5b+p/7btqc3T7373/71j\n\tcOZg7zPpsw9/rHyu/3zvi2kv2oaihx68zHk5/Kritf7rfW/c37S/TXr7aHjBO9q7zX9O\n\t/rPlffj7ex9yPnz4Ny1d8BwKZW5kc3RyZWFtCmVuZG9iagoxMiAwIG9iagozMzY3CmVu\n\tZG9iago3IDAgb2JqClsgL0lDQ0Jhc2VkIDExIDAgUiBdCmVuZG9iagoxMyAwIG9iago8\n\tPCAvTGVuZ3RoIDE0IDAgUiAvTiAzIC9BbHRlcm5hdGUgL0RldmljZVJHQiAvRmlsdGVy\n\tIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGdlndUU9kWh8+9N73QEiIgJfQaegkg0jtI\n\tFQRRiUmAUAKGhCZ2RAVGFBEpVmRUwAFHhyJjRRQLg4Ji1wnyEFDGwVFEReXdjGsJ7601\n\t896a/cdZ39nnt9fZZ+9917oAUPyCBMJ0WAGANKFYFO7rwVwSE8vE9wIYEAEOWAHA4WZm\n\tBEf4RALU/L09mZmoSMaz9u4ugGS72yy/UCZz1v9/kSI3QyQGAApF1TY8fiYX5QKUU7PF\n\tGTL/BMr0lSkyhjEyFqEJoqwi48SvbPan5iu7yZiXJuShGlnOGbw0noy7UN6aJeGjjASh\n\tXJgl4GejfAdlvVRJmgDl9yjT0/icTAAwFJlfzOcmoWyJMkUUGe6J8gIACJTEObxyDov5\n\tOWieAHimZ+SKBIlJYqYR15hp5ejIZvrxs1P5YjErlMNN4Yh4TM/0tAyOMBeAr2+WRQEl\n\tWW2ZaJHtrRzt7VnW5mj5v9nfHn5T/T3IevtV8Sbsz55BjJ5Z32zsrC+9FgD2JFqbHbO+\n\tlVUAtG0GQOXhrE/vIADyBQC03pzzHoZsXpLE4gwnC4vs7GxzAZ9rLivoN/ufgm/Kv4Y5\n\t95nL7vtWO6YXP4EjSRUzZUXlpqemS0TMzAwOl89k/fcQ/+PAOWnNycMsnJ/AF/GF6FVR\n\t6JQJhIlou4U8gViQLmQKhH/V4X8YNicHGX6daxRodV8AfYU5ULhJB8hvPQBDIwMkbj96\n\tAn3rWxAxCsi+vGitka9zjzJ6/uf6Hwtcim7hTEEiU+b2DI9kciWiLBmj34RswQISkAd0\n\toAo0gS4wAixgDRyAM3AD3iAAhIBIEAOWAy5IAmlABLJBPtgACkEx2AF2g2pwANSBetAE\n\tToI2cAZcBFfADXALDIBHQAqGwUswAd6BaQiC8BAVokGqkBakD5lC1hAbWgh5Q0FQOBQD\n\txUOJkBCSQPnQJqgYKoOqoUNQPfQjdBq6CF2D+qAH0CA0Bv0BfYQRmALTYQ3YALaA2bA7\n\tHAhHwsvgRHgVnAcXwNvhSrgWPg63whfhG/AALIVfwpMIQMgIA9FGWAgb8URCkFgkAREh\n\ta5EipAKpRZqQDqQbuY1IkXHkAwaHoWGYGBbGGeOHWYzhYlZh1mJKMNWYY5hWTBfmNmYQ\n\tM4H5gqVi1bGmWCesP3YJNhGbjS3EVmCPYFuwl7ED2GHsOxwOx8AZ4hxwfrgYXDJuNa4E\n\ttw/XjLuA68MN4SbxeLwq3hTvgg/Bc/BifCG+Cn8cfx7fjx/GvyeQCVoEa4IPIZYgJGwk\n\tVBAaCOcI/YQRwjRRgahPdCKGEHnEXGIpsY7YQbxJHCZOkxRJhiQXUiQpmbSBVElqIl0m\n\tPSa9IZPJOmRHchhZQF5PriSfIF8lD5I/UJQoJhRPShxFQtlOOUq5QHlAeUOlUg2obtRY\n\tqpi6nVpPvUR9Sn0vR5Mzl/OX48mtk6uRa5Xrl3slT5TXl3eXXy6fJ18hf0r+pvy4AlHB\n\tQMFTgaOwVqFG4bTCPYVJRZqilWKIYppiiWKD4jXFUSW8koGStxJPqUDpsNIlpSEaQtOl\n\tedK4tE20Otpl2jAdRzek+9OT6cX0H+i99AllJWVb5SjlHOUa5bPKUgbCMGD4M1IZpYyT\n\tjLuMj/M05rnP48/bNq9pXv+8KZX5Km4qfJUilWaVAZWPqkxVb9UU1Z2qbapP1DBqJmph\n\tatlq+9Uuq43Pp893ns+dXzT/5PyH6rC6iXq4+mr1w+o96pMamhq+GhkaVRqXNMY1GZpu\n\tmsma5ZrnNMe0aFoLtQRa5VrntV4wlZnuzFRmJbOLOaGtru2nLdE+pN2rPa1jqLNYZ6NO\n\ts84TXZIuWzdBt1y3U3dCT0svWC9fr1HvoT5Rn62fpL9Hv1t/ysDQINpgi0GbwaihiqG/\n\tYZ5ho+FjI6qRq9Eqo1qjO8Y4Y7ZxivE+41smsImdSZJJjclNU9jU3lRgus+0zwxr5mgm\n\tNKs1u8eisNxZWaxG1qA5wzzIfKN5m/krCz2LWIudFt0WXyztLFMt6ywfWSlZBVhttOqw\n\t+sPaxJprXWN9x4Zq42Ozzqbd5rWtqS3fdr/tfTuaXbDdFrtOu8/2DvYi+yb7MQc9h3iH\n\tvQ732HR2KLuEfdUR6+jhuM7xjOMHJ3snsdNJp9+dWc4pzg3OowsMF/AX1C0YctFx4bgc\n\tcpEuZC6MX3hwodRV25XjWuv6zE3Xjed2xG3E3dg92f24+ysPSw+RR4vHlKeT5xrPC16I\n\tl69XkVevt5L3Yu9q76c+Oj6JPo0+E752vqt9L/hh/QL9dvrd89fw5/rX+08EOASsCegK\n\tpARGBFYHPgsyCRIFdQTDwQHBu4IfL9JfJFzUFgJC/EN2hTwJNQxdFfpzGC4sNKwm7Hm4\n\tVXh+eHcELWJFREPEu0iPyNLIR4uNFksWd0bJR8VF1UdNRXtFl0VLl1gsWbPkRoxajCCm\n\tPRYfGxV7JHZyqffS3UuH4+ziCuPuLjNclrPs2nK15anLz66QX8FZcSoeGx8d3xD/iRPC\n\tqeVMrvRfuXflBNeTu4f7kufGK+eN8V34ZfyRBJeEsoTRRJfEXYljSa5JFUnjAk9BteB1\n\tsl/ygeSplJCUoykzqdGpzWmEtPi000IlYYqwK10zPSe9L8M0ozBDuspp1e5VE6JA0ZFM\n\tKHNZZruYjv5M9UiMJJslg1kLs2qy3mdHZZ/KUcwR5vTkmuRuyx3J88n7fjVmNXd1Z752\n\t/ob8wTXuaw6thdauXNu5Tnddwbrh9b7rj20gbUjZ8MtGy41lG99uit7UUaBRsL5gaLPv\n\t5sZCuUJR4b0tzlsObMVsFWzt3WazrWrblyJe0fViy+KK4k8l3JLr31l9V/ndzPaE7b2l\n\t9qX7d+B2CHfc3em681iZYlle2dCu4F2t5czyovK3u1fsvlZhW3FgD2mPZI+0MqiyvUqv\n\takfVp+qk6oEaj5rmvep7t+2d2sfb17/fbX/TAY0DxQc+HhQcvH/I91BrrUFtxWHc4azD\n\tz+ui6rq/Z39ff0TtSPGRz0eFR6XHwo911TvU1zeoN5Q2wo2SxrHjccdv/eD1Q3sTq+lQ\n\tM6O5+AQ4ITnx4sf4H++eDDzZeYp9qukn/Z/2ttBailqh1tzWibakNml7THvf6YDTnR3O\n\tHS0/m/989Iz2mZqzymdLz5HOFZybOZ93fvJCxoXxi4kXhzpXdD66tOTSna6wrt7LgZev\n\tXvG5cqnbvfv8VZerZ645XTt9nX297Yb9jdYeu56WX+x+aem172296XCz/ZbjrY6+BX3n\n\t+l37L972un3ljv+dGwOLBvruLr57/17cPel93v3RB6kPXj/Mejj9aP1j7OOiJwpPKp6q\n\tP6391fjXZqm99Oyg12DPs4hnj4a4Qy//lfmvT8MFz6nPK0a0RupHrUfPjPmM3Xqx9MXw\n\ty4yX0+OFvyn+tveV0auffnf7vWdiycTwa9HrmT9K3qi+OfrW9m3nZOjk03dp76anit6r\n\tvj/2gf2h+2P0x5Hp7E/4T5WfjT93fAn88ngmbWbm3/eE8/sKZW5kc3RyZWFtCmVuZG9i\n\tagoxNCAwIG9iagoyNjEyCmVuZG9iago4IDAgb2JqClsgL0lDQ0Jhc2VkIDEzIDAgUiBd\n\tCmVuZG9iagozIDAgb2JqCjw8IC9UeXBlIC9QYWdlcyAvTWVkaWFCb3ggWzAgMCAxNDE3\n\tLjMyMyAxMTU0LjU1MV0gL0NvdW50IDEgL0tpZHMgWyAyIDAgUiBdCj4+CmVuZG9iagox\n\tNSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMyAwIFIgPj4KZW5kb2JqCjkg\n\tMCBvYmoKPDwgL1R5cGUgL0ZvbnQgL1N1YnR5cGUgL1RydWVUeXBlIC9CYXNlRm9udCAv\n\tS1lTUU9TK0F2ZW5pci1Cb29rIC9Gb250RGVzY3JpcHRvcgoxNiAwIFIgL0VuY29kaW5n\n\tIC9NYWNSb21hbkVuY29kaW5nIC9GaXJzdENoYXIgMzIgL0xhc3RDaGFyIDExOSAvV2lk\n\tdGhzIFsgMjc4CjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw\n\tIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAKMCAwIDAgMCAwIDAgMCAwIDAg\n\tMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCA1NTYgMCA2\n\tMTEgMAoyNDAgMCAwIDI0MCAwIDU1NiA1OTMgNjExIDAgMzMyIDQyNiAzMzIgNTU2IDAg\n\tNzIyIF0gPj4KZW5kb2JqCjE2IDAgb2JqCjw8IC9UeXBlIC9Gb250RGVzY3JpcHRvciAv\n\tRm9udE5hbWUgL0tZU1FPUytBdmVuaXItQm9vayAvRmxhZ3MgMzIgL0ZvbnRCQm94Clst\n\tMTY3IC0yODggMTAwMCA5NDBdIC9JdGFsaWNBbmdsZSAwIC9Bc2NlbnQgMTAwMCAvRGVz\n\tY2VudCAtMzY2IC9DYXBIZWlnaHQKNzA4IC9TdGVtViA3MiAvWEhlaWdodCA0NjggL1N0\n\tZW1IIDY2IC9BdmdXaWR0aCA1MjcgL01heFdpZHRoIDEwMDAgL0ZvbnRGaWxlMgoxNyAw\n\tIFIgPj4KZW5kb2JqCjE3IDAgb2JqCjw8IC9MZW5ndGggMTggMCBSIC9MZW5ndGgxIDkz\n\tMjAgL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngBxVp7bJTXlT/f93k8Hr/H\n\tnvH7McN4ZjC2x4+xxzh1/BiMGaAFpyTgoaFAgQSyIUAKCZGShT9oSB11ibpZErorJdpN\n\tQ1KtFq+UwjCoAVUpj+2qRVsIIYsKyiYpSaMFadmq2QV7f+fce42D2r/X0eH+7rmP795z\n\tz+veyc4nd22iQtpLDg1t2Lp+O8lfzh9RnN3w1M6Aqjv9KAOPbH90q64/TGR959HHn3lE\n\t1V3XiBqaNm9av1HV6TbKxGYwVN3qRtm0eevO3aqecwrl/Me3bdDtLq43bF2/W3+frqAe\n\teGL91k0o8dc0wv9s3/bdnVKlphyUQ9uf3KT7W+NYz0c//svE3+65fmCo4Wf7Lr3xxItD\n\tZKFXMW0kNz1EOVIjyieyyfNj/GMJx6Lksqn8LWtL+v+bqp3rPP+z4b+XeS8+/TfXp9NT\n\t15zrzj+C7cEY9Yd5netTP+R/p9PTaYziL83+K84QtVAWfJvsFisL8ToM3kWxiIaph8JU\n\tRXkt72Jd3/hK3UUPzqrTu5hiNuNdTPgwjVJCT4Bv5JKL3C34YGDhc1uqRrK0jvLI+m6W\n\t9mCzXL6my5O6vKrLaV02crkzS4O6XKvLA7o8ostf6/KGLku43JWldl0u1+U2XR6BYvH3\n\tb+iykUt8p12Xa3V5QJev6fKkLn+ty2ldlnAp31PloK4v1+U2Xd7gEt+Rcfi+jEN5VfNL\n\toRS8riFdjunyiC5v6LKdS5ELSnx3WvO3CR/H7ack9dMySqEkKpuuo0LrApXZ74FuUSGO\n\tpHVphjxj4/9sWX+VzljT38vQSP1xaJKz9tttGbJaA4GFW0YmrXWo2K1gzAsCOa2B0Ukn\n\tPPrN8VA6MBGYWLxxIjAa2Lx+42ROWEo0bJpItwcmacX4Fvz74HhwcihdOwM3pdP3YZ4c\n\tngdD0H0ijRke0zOgFFb7HXRytS4NTDqRsfEHxif3jtRODo2ka4PBwMLJU2Pjk6dGaoPp\n\tNHrlzqwUK2YtU2t2Y82589Cep2ZZgTkwRXpigudcMR4KTp6amKidwD50PWPRvYwhzcDG\n\tMQQbX5ix9o5hLIpQsJYZoWAoiGWlR/ApT+vSFeMLsbBguo1tGZZfgbKVOuwN1EE3cRo3\n\taRXqC+wHhJeyvk5LrZ9QEGUx+Cn733CAGIb/+K8QFpRFGaBxzRH2//M/vDEHxJ6OYOGE\n\tVbph2OyH8qkAqyYqAhE9Ro/Zc3PW5fyPayC3w/1zT77nnYJbhf9a9HpJGVplPJzQrzBb\n\tiKLwSosz1NqeoTZQa2mGIudB7cepgnJugwtO+MpxqkONTmCMRU2U03IC7saiakHsSS2g\n\tjs7enri/3eruHbB6B5ye7khoTq47OmDFuyr8vlw3/vNXeoNeC/Tb+T12kbvCW+rLz2lr\n\tbGzL7XIvSSRGqyPh3NyTUxutX03RrgULdnnnVxfVe0sqy72eps7WeF5qeFF/oCcULPd1\n\tZ+wtd16x/+5OF3ZiU8f0Leu2dQ3yCDv5WSyxhpyWYYeuAVprAE4ZgLhB1o4MNZUeZ2nc\n\tRtsYeltrMlQDVp7s2nMe7AQky+wmiKAMQilrB3Mtlclw7xVUOiiiZh8zYBskKt87YMA1\n\tA04JIDiBheMZamyvPU5wtANpzfAzw0+5zGjEQhAebmexgkbye8v6oOb89ZuyJAA+dWsH\n\tL9fGIfnRv1j6ezFFo/T3cv+XyIvldHRawG9CaWRpixjsAOcwVEg4aWiScBZBkYRz2IAK\n\t9pHcedSAwwxYpFHDWQTFkz6fwbVK02oGO4ZdsKBS2gyy16DyAsCrquJIiwx6BhwZ1EuV\n\talAG4CxIBvUiLi4C2Twd6+E5kLRkqB7d6rniUB+ATPcpBdV0lwwgFjxvYbk6AaC3jCxG\n\tzT57DZjZ+Ztqny7oQaHsXlZQiQpvHBWWid7478zGV6mNO3TQ7Op9A1Yy2DHsoVUAj4Ke\n\tBu0H5fD6ZzZ/HBs/pzbPH6hSSz+GTYuQTvM+ecAxA9xm570KuOh97JzFYK+x2AaLbb+7\n\twYl3JXori63QnJjd0z1gx7sa7HrLemcsFehvq7Wdulh/qOcbvvi8Tfd1p4fCTUMru3oe\n\t7GuwihesqJ6XqE+EBtpqOgPzemLh5OqentXJcGTwoY4G6CHbXqldCdsrp37nbJa6YQti\n\te8vZKGBpkbuWthytzOoGq45cUN18GFYdDKwLZQRlP8p+ZWgDautXCYB3PGjASQMCDHYY\n\tk2phC2qZZVJdzOiaxQgyI6hsTKywjxl9lMdGF8SaXGJOLUAlYk4+NLbAnKB6vyAfXQSJ\n\tth0FkDV9rIALluaj16U5Q30YD+2F+dbjazLeQQYrB+eCE62nX4Jkot8LNwtP0kJB/pCb\n\t3kHlPdAFkCO264I22bBfeG2WQw97YQajBhw04LACLpiZG0ruVgNehZvAAOYWggvlVZUi\n\tVIrMnOwoMOeb4jEAFhnwigK8iDI0l6kBi9gP8oDn4XEEJBiwVTxqOCmjvSlECmmaL54W\n\tfVIMuDPcqxp+zoCzNFdxMtSsQIoBd+4z4CiMUna0CuBRkAjmjOFehDl9ApJ9HgM4oypu\n\tWFY/XQZ9BnLWEGTSC5EtAknfVwBYhjLdYfaKvMWDSn4OHYLshJMywnnbgB8ZsNPs/oIB\n\tmwz4xIAeBrwhLTwXHQXnNEg+3GOkNGrAWSMcDm2ygqNGOGcMYFFI0wfYk4BzBmQNOE5f\n\tM336TR8NWCIyKiug19cAHzFgR7tjNrsQpwFhfMC+3wp91YdUxnviXl8x+kSiu2vbB8NN\n\tw121VlUs2RwebK8trF/T1zXaUm4HHo7H08lI0+Cqbn97e8xnJ8t7v7N89Im2m+Hhzvqa\n\tdnRHWd85PPWDaHt914LIgx1zmwbH4/HxZDjPF6pdNtURWZnqiHXACFLwOm/ZGTjsEvrf\n\tDBW34xQ5dee03YZzyYULyUUyQ1eGvcQXt72gl0CvgyZBp0DnQddAeWvQqRQgAOoADYHG\n\tQOtA20F7QXmYtVicgovzhb0YAFG50Ic/4FWn9prRgGsGDDFg9+Th1XDUL2F/g2vSTNQv\n\tZAYSzoE0pruKoH4DJEowaEL9EQO2CcBscJPOlY7Ocl8upN7TnUB+5YS88bcaysoamEqS\n\tSfsFf22tH3RnA24gFmIO0SHcQRzCViz2rwc4a+NN8LV4DGQjnUBiyRscUhmCC51cuC3C\n\tK6rdurBbqXBixdmEcb0Ob8Oh4pl9ETOQog6kOzrjWNshLOkWPrIAafZlxIp668UsfE+1\n\tihRH2D8g06qGjKskLBAnYHs4vIJdBHaxWtl5auBVOzhHDaaRIQnnJQFmRR5eADLje1d0\n\tl1HFPap4iVkkxR6qUn7+fVQ+Bckh/AJAJn9HALQAuuXBcuAFb6u06qwIAitayLdcNuqj\n\tDHiNKw3njOEs5CyD+6w0IGoAJ0Yyqo8B93nV6NEzBkwY8BMDzopLIfQ+Y9Zx2nyM0y2Z\n\tcSbDesEMO2QA+xxrTXmD5Y8PIEWo8HtDXpUz1FuMovttyy6YM6+9cvXKZGKxKxafm3Rs\n\t60J5uLw8UFm0dnzqkuUsW5HXlBq6aW0tv68G9olc3A5KPhC1/ymLmNigTjnAsRLq54P8\n\tdOYd4FMEqwGsfJWMB4yPX27AHuPh1howaMA1A4jBTCYQ4qMNzTr8amZUq8AfwrdUnGd1\n\t4zjPB+mCc7fpbZAcfArarE9DADc7aNZx4iBCw5sqvHIEcSOCSKzlIJmHFqTlbDEHYdqc\n\tRkolAW3mhFG3FKFFV/g0OJBIy3zoVkpFWf5oGVok5HIe6scEiBGcCR/F/ew0CGMc+gOA\n\trDaXgWquRLOk0NyMxJr75TJQeXQtQmGtGv0lgDR7GNyTZjv0pUk9PQy4mXPtxZzBqEoj\n\tKo2qchxu9BxIVvUlgJ4XQM0bRDMnpljMlwC6GYCbj1IYiw6bPeGGqRYNoJojaI6YZn31\n\typUsE6MTyMtHQfYODuvzcVR8iFqmblT0CfVC7HxjkUUkIFz5ispnwjra+XX065XIdjdj\n\tti5Xx4abm4fbqqvbuIxVp8LJb/UmvpUMo0z0ovw8OtJVX981EjUlJ8smaUYJ1YeSpaau\n\t2V8TG4nZniwkEYONqByUTSNDMehm20yGzLdwP7vESTyWyXoHEawgFc6KAVhOVw1Ya5oC\n\tAuAR+Wov8aeO7aBulmHoW+ddrxjhHhFlKXUzlsIpvMqIKzA8wp7SQTaste5TA35qwM8N\n\t+Bx5rawuKyBLrZi8Tnnaf0HlQ5Ctk9xZBsg65kCt9Pn9edv78+Z2EEesLcyBNuj0drEC\n\tbFkzNsfNWgsWK/AVw2OHLrGGFbQRGghdZ3mPcrxRehkCN2S4/LyA5gzNUzvPyM7ZRbNO\n\tijB6zffu6XSv+llx5ZYbbL9WxGjIG7L+S5RwpKuurmtElHDqoaRd2toRr2QFZIWsjHe0\n\tltrJe3XR8i6rmlORb7Qxv2JOFb9aIy4vxT8PQR8rrTzcvuX1h29nOQh3ldC9In7tOAWJ\n\tak3jcA1OicnrVQAHZ69EchOEC1iZCmapWw4zcmYxKphRoYJwLrpWKNX61LxM/EYAcj0o\n\tIKKZjrkpk5DPN7nRH4xEcxmw/NmHyiL7DMjFDRUxAm2jZnyPGb9IARcuV2WI5OxxyxH9\n\ttPwr3eoa7Q0td6xh210T7mys8xcVVUcSTd6klWwciq8qD9V5c4dd9W3dVVN/FJkG8Sb1\n\tImTa6fwnvzk3myioLzNDJnaNSezCbQd75OcnLPB19OfMpxmyr+QzUDdi9t5IItEvIE6i\n\tBM2daO7k5iFcdWXDgxRX4KoCHjxaxWkbaA/oAChnJnGLsfxjsw7ExwyfOhBCiw8HAueh\n\tPgAlwffZNcEwcb0tmOlQ0J5FLuWjmHSv4pR8EoxTIBv74JCPaAONKsCSm1ibbslNRuVQ\n\tEZYXH9oJBhw5+feeL0BiafwMi+YCegbg+6BDoLdBx0EuVsTPAWTcLwH+HSRu/2ko7H7l\n\t6V20Cynk9/iGwNMfBTitKg59bJzDReMcjgGcAcnXzyj9cdEHUNTrIOFeVzHVRb/BFv9D\n\ttol1nBb1BzhmwCfmCnfUgPcNuERz1Dm9ZUCKAcvhkOF8pgDHsyhUGtFNbVe/Ms6H+5Qz\n\t58cCAb8zoIc61VyXGchVNwCB8hVH3q6OAciI3QZ8YMBuI81XAd5S0nTjqc2CCCyIwMLV\n\tGYvkk5AZ+BgErGagXKIHspCbjAvvXDPH4KCC3074CI4BnDFHcM6kqhlzFnhuVXOeM+Dy\n\t3Zii487n5gyOQtosehHOp3fly8+6WOh1I0QW69sg6beYuSzsD03zLBm78EoQxSuBFnjC\n\tyPkTI973Dbgo4sWGwgAsdHuHFcMzG17dfBWNFjJrfTvuVTdoPIu3WzG8jvMbXEWlNVTS\n\t1eSF74jFFnQON8aTcxJrgn2+++f55jaWd4eHCpujdfWdA8HOByutTfVz8rw15cGGgtKC\n\tBV2R3lBpc1c0EPGUN/hCjZ4Sp7iuLdiUmOONxPgkqRj+Z8Aepxrr2ydQdcH95fCb+E1z\n\tXNxJjmsMYB1I5HJKmjNkwVJxheZXbnRkOZYygAMogMspYI/wGl9euOUmu1YGJD4W0hgD\n\tWAfSU3Jzhsoxpe+KKiswCX+iWt30kFry+HWSbCJ+VJmURafudzOUIvZQRSpD4Qwey4Zf\n\t4TsiEjwgnrQck1ejrDivcvsU1s5P0bKa3UbZthjwfQPSDBAi3Mgm8xEm8uUO5+wAw0yx\n\tGV2g/i44o1KYAM+Jm5Lki3hgxY0c2aI31INnEX/cum9/fll1ibepxAl3lzfPqdiwIbnf\n\tenXqi5pgmTs/735vfl1H1Ir279sHwVIK5/Vb3NYbrcVZeMsiFS/2SHaeoVpssObu3fgI\n\t2u+5G0+afPu8AdMmxX5JgAnLxSzB4llOX1+W5bcHyRPvXt/5l2oPFauw/DOVwLjwfunA\n\tzUp2xs6X0xp1L8b7KI6gGKKv0aJfAiGuBsllYQkUZjVIPNDTxtZ7GbDb+MoL435j+OPq\n\t1sI/GVTJ6bjoKYx4HiTnyaOgPOxoyuDv9QPlYeEGY1ZPqNjhdxIv3qnUm9b9FiBM70ez\n\t7raF9Z1hfbududtazVN3ov3NfrndTv013275nPBbof0ezqnE/ocTSGZc2H4OcncHmy6G\n\tcpewzWyXAA4wxoC9zDXh8M3XQeTkWRwl1DdREd1/2oBXDLhowMcCkI/hG54rWXwTLxZq\n\t+IeoyPDfK8C5qwteTj/a7AZ4QSr4UZZXtsfkPmsZ8MpuCIfNx8HZ8esGX8U5umNjEs/5\n\t7atIZSbb2ULYUs+b05s24IABaw04acAgA/7W64ZTajgzj2SzFe9PWTsLDT9wql3zm5ac\n\teRpgC0g0YZfiumkfwMugN0ASqz6SFjg0CNA5zwKcmeoNVGRHuxRwURpgC0jmfN40XzDg\n\thwZ8JCBD7vPsf/i3jCwu+/gZVq3xEVRkjVcAvlDPAA7+zxPN7QYYEa5KgviJTmS0itfK\n\twhrn5FcB/fvcXHNmczlf5aYPcFiy+kviEMCJQrWkKSqqV2vFy+U/JyT/Pfy4/dzIc/bj\n\ty15e8qz97JKXrQtT+6xnhVqtvVN7odi4n8rf9E+RUv6pP/61nDPsJfR1/Kj2AH2TVmBf\n\tK/HKOA7z5j+LrU8QJ+S0NL3igeUrWoaf2vTElifbktu2/cX/AXd9NUMKZW5kc3RyZWFt\n\tCmVuZG9iagoxOCAwIG9iago0OTU0CmVuZG9iagoxMCAwIG9iago8PCAvVHlwZSAvRm9u\n\tdCAvU3VidHlwZSAvVHJ1ZVR5cGUgL0Jhc2VGb250IC9VVEZTRE0rQ291cmllciAvRm9u\n\tdERlc2NyaXB0b3IKMTkgMCBSIC9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZyAvRmly\n\tc3RDaGFyIDMyIC9MYXN0Q2hhciAxMTYgL1dpZHRocyBbIDYwMAowIDAgMCAwIDAgMCAw\n\tIDYwMCA2MDAgMCAwIDYwMCAwIDAgMCA2MDAgNjAwIDYwMCA2MDAgNjAwIDYwMCAwIDAg\n\tMCAwIDYwMCAwCjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAw\n\tIDAgMCAwIDAgMCAwIDAgMCAwIDAgNjAwIDAgNjAwIDAKMCAwIDAgNjAwIDYwMCAwIDYw\n\tMCAwIDAgMCAwIDAgNjAwIDYwMCAwIDYwMCA2MDAgMCAwIDAgMCA2MDAgXSA+PgplbmRv\n\tYmoKMTkgMCBvYmoKPDwgL1R5cGUgL0ZvbnREZXNjcmlwdG9yIC9Gb250TmFtZSAvVVRG\n\tU0RNK0NvdXJpZXIgL0ZsYWdzIDMyIC9Gb250QkJveCBbLTY1NSAtNDA5IDEwNjMgMTA5\n\tMF0KL0l0YWxpY0FuZ2xlIDAgL0FzY2VudCA3NTQgL0Rlc2NlbnQgLTI0NiAvQ2FwSGVp\n\tZ2h0IDU4NyAvU3RlbVYgNzYgL1hIZWlnaHQKNDU3IC9TdGVtSCA3MCAvTWF4V2lkdGgg\n\tODIzIC9Gb250RmlsZTIgMjAgMCBSID4+CmVuZG9iagoyMCAwIG9iago8PCAvTGVuZ3Ro\n\tIDIxIDAgUiAvTGVuZ3RoMSA4MjMyIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVh\n\tbQp4Aa2Ze3BUVZ7Hz7m30+nuhHS6051O0ulOd/qdNOQNkdeABkRQJ4pKGmXlGYKCoIDg\n\tYwoolxGjuLqWPJw447IzGC2diWJhSHC1VHzUSi1bW75qcdyqUUenVpZx0EGEZj/n3k4H\n\tsvPXzHbqm/Poe8895/v7/n7nd25vuGPjCjFObBW66Fy4ZF23MD7B1ULIw8vWLFlntvXj\n\tlK8vu3NDyGzLk5TB7nUr15htrZTr169cfVfufssxISrTPSuWLDe/F2cpJ/bQYbZlK2W0\n\tZ82GzWZb/3vKrtVrl+W+tzxFe8KaJZtzzxfq+aHblqxZQckneCX/QuvWrt9gNEVAjd+5\n\t7o4VuetlF+1dQvK/XD4q7OJuUWC0hHAIoQk9yXql0cM1m2v0vTc7p34rK23GcP+8zSzf\n\tv/W2E2feODtk22Z7mS+suRFYKg1blousu868ceZ127b8N8b96qmDQtSLIfp1odXLIWEx\n\tK69SmScmiwZRK8q5zlb/KjO7WcwV00Q632MVMy+6RrzKQJ1cdOFt2v+5TRdzLr5tSBTy\n\tvMJ6JhOa9ZNVFR08sU7sFJvEk2I3/39NO5y9XQi9T1RZ9omwEFyanjcorJ1dL0j5cGZQ\n\tnt8+KDoCh1i9fvPfjR8UMh0KzVrVMSAX09DSdNSFqenp0OwBPTb72q5IJtQb6r1ieW9o\n\tdqhnyfIBS8wo+WJFb6YhNCDmd63i/3Vd4YEZGX++uiKTmcw4FjUOt3B5b4YRbsmNQGl0\n\tNZzjooL0vNCAHu/suqZrYGuHf2BGR8YfDodmDbzW2TXwWoc/nMlwlTU/U2asVm/OuZA5\n\tW+v43maOMr9rYIZ/QGR6e9WY87si4YGtvb3+XtaRaw+K18Z0SDG2Y0auAyYYAyZmDcqt\n\tnQxGEQn7VUckHAkzz0wHz7an583vmsVMw5nxwnJUdANK2QeeAGtoH6W0UO4DB8GL4Dn6\n\taBvXca3oAIuBur8HDOXKhZTKB0yNC1GM/V6iHRLX03fxB3cwOiy57gKuLRQ2vAZfyX2K\n\tRip/dVnMnePyd5cIJ3WiRv7jEm7qZcKT7/HmapMR9T7pkFPlCW22LvSPLJsLJhQMFpy1\n\tXlrYYZts+8z+maO1KFh0qngXd2iiO7vL0l3wS1ZVKC7HzA0IBthK0fYxoNqlh/i64BQt\n\tahajpvO9/bgYpqkxjqV+mFKDC0t9Y1OZK+yKhV3hbos4u173n/08u6uw5PQ3d1hTapJS\n\t9mXX6k2WIyIg1gxzi1V4uW2mT0ykOhvcALrBneCnYBfYDw6Ct8AHoGjRzALxOZVvgbZI\n\tueKsrkHhb/AfEn4xbnom1+FUHU5hn55pbJIea6FV83rKfUHp9VgjtfFEXGtrdU+aLlua\n\ty/Wmy1wdlzQ2VS4oK625svnWWxZkJi+Nl5ZZ9ngfTP0ie/rh+769+9ID3vLKmXP2ys5D\n\tz8iWR25eXKnW88SF6/EyH0UD0/sDlTPG9FjcJVSuABmwCtwFHgB7wTPgEHgXfAyK8uvJ\n\tTX90PbkFmutpnThporutNZ6YINtaJ7IGX7nb69EKSyRrk090uC+b3NRcdYOnNDyP9WQy\n\t0xfFSz3Zn3seSD0l7Tu3/vneSw+UeypnXr4n++tDz2Tfe2TpTVVqPWuy/6KPl1eKCogb\n\tFCVIwAX0BhicLqfI5nLIK5TGQxokj54qJ8mTtqqa/3S6LZbs14UVJXqhbXZpqSZ9tWXF\n\t9oLSwnNvOt2aXlXoLi6yFxi6O3r+U5RUIoqETzoGRQUPsIMKdOVEd84GpTnrKUMVOqrQ\n\tUYWOKnRUoaMKHVXoqEJHFTqq0FGFPqIKHVWwlSiJ/AHPPANoKBvYsYEdG9ixgR0b2LGB\n\tHRvYsYEdG9ixgR0b2BmKGaF37InyK4+PKKxYCapYFE7PDOOEKjxY2DKKuZItT813EpXL\n\twQKwEmwC94Pd4GnwMngbfAgMFX9B5TugLYLgWvTpbmnGqppeq7lKVd1Vqmnd67duXb9h\n\t69YNhz/55PDh3/7WsiV78vT32f+Rru9Py9IfFstlsk22ymXZvuxR/n6m7EiM0s8U2Nip\n\t5gwJl6gWOjOthmErDFuVWZl1SFhOsTYHzXHA8KIKtcYKtcZD3CdZfw13hI4xP8PqiG1S\n\tzHAarwvVKV8K18bpnSJdctO4cQU1idqQTBV5i8rKn8o0JpPnnk0mGzP7LU2aFglURO2d\n\tuh4J/vBWIBnlkwzo/67igtjHfH+HJlrER8PMy0pIzfmRAxs6RmzowIYObOjAhg5s6MCG\n\tDmzowIYObOjAhg5s6DBsGGK9aWafZnGq3kC9IVdvy1tVqBUL06oBpjLOsKqKdzGh5yJf\n\tipph3xT2TWHfFPZNYd8U9k1h3xT2TWHfFPZNYd/UiH1T2Ddl2Neg6Udy4iSB20ZqiUeF\n\tKg4pQk0+PdLqlOFc3epVriwdbS2vBQKT5MK7l/xofcQ6LjYhGiwpm/HKsv2fZp9bMOEe\n\t+a4lEQ7HNZserKgfP/NAdXWrnP34rdtb07ayy9LTo+Gy6Vd80PdmdviaCXfWj0/Hdad+\n\tVU2E5bLQg+c/1U/DOcobImOqRCN4jYNKFdBun+nHayphvBLGK2G8EsYrYbwSxithvBLG\n\tK2G8EsYrxVfgezBu0RDDV4oGl/uSIfzErA0Kd4Phk27s6R6xp5vR3YzuZnQ3o7sZ3c3o\n\tbkZ3M7qb0d2M7oZOMypgQUO5yjPVTtSSt6NV2ZEdWXlnmuVFDDtaudo5Yj0n1nNiPSfW\n\tc2I9J9ZzYj0n1nNiPSfWc2I954j1nFjPaXrnyL5hRtuW5okq+PLX1jpJGdC0qWlP0y90\n\tbeO200f2fF1f43r/pk2Pr1zoT193bch79eI7b7zuhfLq2H/t6Pu3ZdpA6Jm7f/PpxtnB\n\tRPeO1Zl7XAV6wcwpDt1S3DP35s09Uf+0u17pXbUDQjXxIj5yoqCYWrvYNSyaWKzabQZF\n\tE2skFsFIEYxIVC4oHZRNlCGjfQhOFGdJWkl8IM03bcfwfhV+q0A1MCKArngkJ1A88kTC\n\ttHqGzjPsRjxQY4cZRT1LeZSdsomyWcUIl13mokEbep8mFTnsHC3NvvIaCYXEDLVZETac\n\txJN66c3FEG0ou106G2sjiQ3Z8ZXVgQJd7i9xO61Oi6W7xNVSXuH0VGu6rdAfuC4yg6gi\n\tj2r7zy3MttSkouH+UHBWMm0r0N6rLNGkLNX85edskWC53WlLRav6a+LRKAuR4jn2Hc1y\n\tgsz+5KCoZ7leUM/sg8w+yK6jODQ06kWj3hGNetGoF4160agXjXrRqBeNetGoF4160agX\n\tjXqNmOOFJ+wC00FGNvczIi71dF6pdsWw3WQ4AsMpGB6mlAReS73yngqh4z3mLsROY8Ye\n\tN+p1o1436nWjXjfqdaNeN+p1o1436nWjXuUsLOMLKt8BY2/JRRVLXqCmgAlDqsdFBhHO\n\tBXO5/dJ1Lb/5Kpt9t/93ddVF79/406d/vnnh8+5gZapFnmlsbJ6QnaKXVPj+9NKrp2+c\n\tWZW66p+23PurhenJ8ptwIJGIGXmeJved/0av17eoPV68MwQjKMmMLoLogprN6CLgVsCt\n\tgFsBtwJuBdwKuBVwK+BWwK0gugiiC6kxe7NSYDE2U6y6lYYN3XoVq17F6hBc2o0dz8sV\n\tzuMEskm48eVgAVgJNoH7wW7wNHgZvA0+BL8HfwbjFItWKuVAux11G4mWmT4qykzGSLf2\n\trVmQWb2mq2v1SKkdvXr50s7OpUuziVzFyH13kvvug5HpyrNIAQzPUn5kOT4oyvIrGc38\n\thtGEpg6neKATZZUL7VRjU0HuyWpHGTVdvdTm9AeitYHsn2rq6mrkuEBtNNB/OuQPROLV\n\tBY9Wx8MBf63KDfqyI/O4dEjNwWCqyIghSrcW5jM6l0LFaqHKqoeZuAYTai6FxtVqLird\n\tVCFRycd1QTKgbe8PRsJBWRyqqwtlTwVqI8F+tqrqQDhefWZtdTwSqK5huI7zJyz3FQSY\n\tRqO8c1g0worpDW5qOs8y/FHHH42kTuVxOprR0YyOZnQ0o6MZHc3oaEZHMzqa0dGMSgkH\n\tRSOrsR8DDUN4VUq4Db9K0aviYogI0MhaYkb0dNPbnPfSnBWK8ueJUYHlFFetuKke3XHi\n\tBjcqAkCz6bMC1QlUJ1CdQHUC1QlUJ1CdQHUC1QlUJ0Z8VuCzuAczV/Y28soCxG9F/CpN\n\tJAlppzIHdIEesBnsAHtAPxgE74CPQBF7cTE2sxp7cQXuIYz1Kw+KsP4oMTtmbGVEAk5H\n\tuooTwusRWDWB0OtHornLNLNxAtD6dg4c6H3whReeb++/5V1ZnP36rVV9zWXlLyfiEzq8\n\tZR3NycSeoP/BFx9+8KUDDz30krZt9tzsH985kj0xd16nv0IlfRYRIv3zGAdXKRaf/71l\n\tvP6SSMvuYY61VpFQdldnQg/Zv4fs30P27yH795D9e8j+PWT/HrJ/D9m/h+zfY7L3OZVv\n\tweiZ0KIsZBGjNqxTHXUXdERVR1TZcFDUwbhL5QqKcReMu0YYd8G4C8ZdMO6CcReMu2Dc\n\tBeMuGHfBuAvGXQbjkie4DJ6VLxUdZzwOFSRCRWbca6cyB3SBHrAZ7AB7QD8YBO+Aj8CX\n\t4DRQcS/K/HwjuYwPZflQlg9l+VCWD2X5UJYPZflQlg9l+VCWb0RZPpSFB6uThpnDBDgU\n\tKztPwIeV8dkS2K3NsMZGQZoqCDT6Y/FkqiYe9yeqGx/I9L0x/Nhld00sC82M1SSy7/d/\n\tnP1Uhj66cq++2BKuaZw3FIvVNF0zf/AfH38lFiuubEvU/PhXsvzYMelLoWr8vRtbL9QP\n\t4jUR8YkZBd2G1yhFBlBkoGFMPB+1Xc4hjcREJeps17mwyNZpupsOKTqk6JCiQ4oOKTqk\n\t6JCiQ4oOKTqk5I6LX1D5Dih3UxPwMwHlvmE1nhJBGBGER0TAWYpGF+gBm8EOsAf0A5Ii\n\tjBbGaGEYh+QgrhQ1I7VxKjf5xLnwqljYIF16bAd+tlF6AsFk3YTl76/6LHtC1n71H7K8\n\tocd5boX2oPOZe7YflPseefIn8epAo6+pVRZ+/Il0nxcH2+P3bXr0IcWpZDbCsocYOlV2\n\tDhPjrKhQZRFRXrKoU586VwsW5qK0Uar3PBUsstjMdhxcVgVyO3KA6BogugaIrgGia4Do\n\tGiC6BoiuAaJrgOgaILoGYCcAOwEj31cDRI0Y056rDYp2le87CFdVIDd6O6O3M3o7o7cz\n\tejujtzN6O6O3M3o7o7czejujtzN6u6H7puNDYkp+3OkqQntYhLHrh5T/hi5w6JzLGw5t\n\tXNGqrmg1PdzCuosw7hDOaBEeY8ZVudqgGA87E46pZ5nfYUS2tL8YA10x872LkTVxkiuR\n\tTqneJKnkQG3LHOqkHAhXHUokG65qTN3QnEq86g/KcLgmXSed8eSSsqLU0uZH5T031MdS\n\tiewf08lEIvuh3JL9ONloRkgy22h52bmWb0pqfcFgbe1Uh6YVtKW3ZJeHYpFYMOxPFEv1\n\tnlry9lxYpmF/v5iror3PsLp6K0E/+3kxdrfkd7UyxUaZuWfZ8k5UZuhBnfar4MCvMnkz\n\t4Jv7+khumNvqtcizS5pSCTmXFU3mKNtwLphI1dVJr2WnOesf9oajqZpolCCS0+cW4vsU\n\tOUWdzKxYVeW76m1ZyHDhdH6u7cy1gBmo95DqhDKOujqJkxdgsxJW1GjEVeWkUVanzp8q\n\tZ1F53rT8Gm1qjbYLNOFQHbwTyG/lLtVBsM53jG7lOV21qCtaTNUYMmpTHW2qw9zeOWAx\n\tiSQJmREpkqiVhrlBJ4kUSSJFEt9MEimSRIokkSJJpEii3iSRIkmkSBrbRQlTSxrLUjHI\n\ty5LLgbk9QwP18Rhk0sgWrDWXB4wjFQmXqbhRhRovFvLdmmmvb8o6WuoaGhb7g1f8w1W7\n\tn29oTjdM/WRGtG5y5JYV3X2RqXXR2QcnplINHTu1baFkLFxe1tEx8/D+7JRwNBEO1iWC\n\t8qmN9/R2ZxcHE3XBSCxJrBALiePr9RdxJp+83jxE6ub5/m/I1VSkcrNcN2cxO3Y1cgA7\n\tOYCdHMBODmAnB7CTA9jJAezkAHZyADs5gJ0cQL22wxKfU/kWqJCuzqy80Ecfo+/wcknc\n\tqOVHd5X/n7TNPADm9o+/Om27OC2TKiHL7R9a9xNH3tq798ib2tPZ4199mT0uo19+KWPr\n\t39i9+8iR3Xtelws/yJ6UpR98IJ3Zk0Z86CLHXmoZwoleUT90ceLMZfBBIz4kYFydVVOU\n\thZTqTK9+A2jMn0fSSvrpC96s+1SHz3QO5abW4yM+4YNyFWAx3SQql4MFYCXYBO4Hu8HT\n\t4GXwNvgQ5A6sRezG5EiYTh3tzBePKgAMirgKSbnw6jJSlQt2VpXCTJMj/kHVOJsFpL6p\n\taXxdXfbW61femA1WJ5qmLH1y1sZfJDyuZ+virdffHkuka/XltbFIJPviL3tuSQbCTb5E\n\tdN7cyOLlNfLqcCwVPNpWn2rO/Ct6Nz7Zx9DfX/qoXyjVixKVaqtfZrwc1HxsxQExXcwQ\n\ts1DwHHG1+LG4RlxrnAVUVDRfIKtjIGHt+utmz++4qv6ytRvvWLXiDiMsm89ZTMFvzOJe\n\toLb7PvAcOAzeA8fBf4OzDFkMqkEaTAVXgpvAanAveAj0gefO5z7cJ/J1STC+uJ0c0zZS\n\tuAuu5zkX3d84pt00pt08pt0ypq1+675wPm1j2pPHtG8c0140pr10THvZmLbxG/kF67l1\n\tzPfwdtF8bhvTXjumbfzG/r+kZ/qFCmVuZHN0cmVhbQplbmRvYmoKMjEgMCBvYmoKNTAx\n\tNwplbmRvYmoKMSAwIG9iago8PCAvUHJvZHVjZXIgKG1hY09TIFZlcnNpb24gMTAuMTUu\n\tNSBcKEJ1aWxkIDE5RjEwMVwpIFF1YXJ0eiBQREZDb250ZXh0KSAvQ3JlYXRpb25EYXRl\n\tCihEOjIwMjAwNzEzMDcwOTUxWjAwJzAwJykgL01vZERhdGUgKEQ6MjAyMDA3MTMwNzA5\n\tNTFaMDAnMDAnKSA+PgplbmRvYmoKeHJlZgowIDIyCjAwMDAwMDAwMDAgNjU1MzUgZiAK\n\tMDAwMDAzMTkzNSAwMDAwMCBuIAowMDAwMDEzODIzIDAwMDAwIG4gCjAwMDAwMjAzNTcg\n\tMDAwMDAgbiAKMDAwMDAwMDAyMiAwMDAwMCBuIAowMDAwMDEzODAyIDAwMDAwIG4gCjAw\n\tMDAwMTM5MzcgMDAwMDAgbiAKMDAwMDAxNzU0OSAwMDAwMCBuIAowMDAwMDIwMzIxIDAw\n\tMDAwIG4gCjAwMDAwMjA1MDAgMDAwMDAgbiAKMDAwMDAyNjE5MiAwMDAwMCBuIAowMDAw\n\tMDE0MDU3IDAwMDAwIG4gCjAwMDAwMTc1MjggMDAwMDAgbiAKMDAwMDAxNzU4NSAwMDAw\n\tMCBuIAowMDAwMDIwMzAwIDAwMDAwIG4gCjAwMDAwMjA0NTAgMDAwMDAgbiAKMDAwMDAy\n\tMDg3NSAwMDAwMCBuIAowMDAwMDIxMTI3IDAwMDAwIG4gCjAwMDAwMjYxNzEgMDAwMDAg\n\tbiAKMDAwMDAyNjU3NCAwMDAwMCBuIAowMDAwMDI2ODA3IDAwMDAwIG4gCjAwMDAwMzE5\n\tMTQgMDAwMDAgbiAKdHJhaWxlcgo8PCAvU2l6ZSAyMiAvUm9vdCAxNSAwIFIgL0luZm8g\n\tMSAwIFIgL0lEIFsgPDViNGNhYTg3MjMzYzg2NDAyM2U4M2ZiYmQ2NzQwMDJlPgo8NWI0\n\tY2FhODcyMzNjODY0MDIzZTgzZmJiZDY3NDAwMmU+IF0gPj4Kc3RhcnR4cmVmCjMyMTAw\n\tCiUlRU9GCg==\n\t</data>\n\t<key>ArchiveMatchStore</key>\n\t<dict>\n\t\t<key>Archive_Stores</key>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDGridRef</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>GridRefPosition</key>\n\t\t\t\t\t\t\t\t<string>Top Left</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>GridRefPosition</key>\n\t\t\t\t\t\t\t\t<string>Top Right</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>GridRefPosition</key>\n\t\t\t\t\t\t\t\t<string>Center</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDLock</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>CenterLock</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>CenterLock</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict/>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDGraphicStyle</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>6.26904296875</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837427</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837438</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837418</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>4.791015625</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>FillRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837427</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837438</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837418</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>5.41943359375</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>11</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FillRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.973187</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.98</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.333683</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.44</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.064313</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.06</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FillRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837427</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837438</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.8</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.837418</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FillRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.027434</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.007121</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.149131</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.986246</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>DrawsFill</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>DrawsLine</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>FillRGB</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t\t\t\t\t<string>0.031039</string>\n\t\t\t\t\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t\t\t\t\t<string>0.999963</string>\n\t\t\t\t\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.979346</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t\t\t\t\t<string>0.501957</string>\n\t\t\t\t\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t\t\t\t\t<string>0.556343</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>LineCapStyle</key>\n\t\t\t\t\t\t\t\t<string>Square</string>\n\t\t\t\t\t\t\t\t<key>LineJoinStyle</key>\n\t\t\t\t\t\t\t\t<string>Miter</string>\n\t\t\t\t\t\t\t\t<key>LineWidth</key>\n\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t<key>MiterLimit</key>\n\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t<key>StrokePosition</key>\n\t\t\t\t\t\t\t\t<string>Front</string>\n\t\t\t\t\t\t\t\t<key>WindingRule</key>\n\t\t\t\t\t\t\t\t<string>Non-Zero</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDParagraph</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>FirstLineHeadIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>HeadIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>LineFragmentPadding</key>\n\t\t\t\t\t\t\t\t<string>5</string>\n\t\t\t\t\t\t\t\t<key>LineSpacing</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ParagraphSpacing</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ParagraphSpacingBefore</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>TailIndent</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>TextAlignment</key>\n\t\t\t\t\t\t\t\t<string>Left</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDFont</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Family</key>\n\t\t\t\t\t\t\t\t<string>Avenir</string>\n\t\t\t\t\t\t\t\t<key>Name</key>\n\t\t\t\t\t\t\t\t<string>Avenir-Book</string>\n\t\t\t\t\t\t\t\t<key>Size</key>\n\t\t\t\t\t\t\t\t<string>18</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Family</key>\n\t\t\t\t\t\t\t\t<string>Courier</string>\n\t\t\t\t\t\t\t\t<key>Name</key>\n\t\t\t\t\t\t\t\t<string>Courier</string>\n\t\t\t\t\t\t\t\t<key>Size</key>\n\t\t\t\t\t\t\t\t<string>20</string>\n\t\t\t\t\t\t\t\t<key>Traits</key>\n\t\t\t\t\t\t\t\t<string>400</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDTextAttributes</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Font</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ForeColor</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedWhiteColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>White</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>Paragraph</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>Font</key>\n\t\t\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t\t\t\t<key>ForeColor</key>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t\t\t\t\t<string>NSCalibratedWhiteColorSpace</string>\n\t\t\t\t\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t\t\t<key>White</key>\n\t\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<key>Paragraph</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t\t<dict>\n\t\t\t\t<key>Class_Store</key>\n\t\t\t\t<string>DKDArrow</string>\n\t\t\t\t<key>Match_Hashes</key>\n\t\t\t\t<array>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>BinIndex</key>\n\t\t\t\t\t\t<string>4</string>\n\t\t\t\t\t\t<key>BinMatches</key>\n\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t<key>ArrowAngle</key>\n\t\t\t\t\t\t\t\t<string>160</string>\n\t\t\t\t\t\t\t\t<key>ArrowArchiveVersion</key>\n\t\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t\t\t<key>ArrowBackEnd</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ArrowForEachSegment</key>\n\t\t\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t\t\t\t<key>ArrowForm</key>\n\t\t\t\t\t\t\t\t<string>solid</string>\n\t\t\t\t\t\t\t\t<key>ArrowFrontEnd</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t\t<key>ArrowLineWidthFraction</key>\n\t\t\t\t\t\t\t\t<string>0.25</string>\n\t\t\t\t\t\t\t\t<key>ArrowOffset</key>\n\t\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t\t<key>ArrowSize</key>\n\t\t\t\t\t\t\t\t<string>8</string>\n\t\t\t\t\t\t\t\t<key>ReferenceArrow</key>\n\t\t\t\t\t\t\t\t<string>Relief</string>\n\t\t\t\t\t\t\t\t<key>UseCurveFillAndStroke</key>\n\t\t\t\t\t\t\t\t<string>YES</string>\n\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t</array>\n\t\t\t\t\t</dict>\n\t\t\t\t</array>\n\t\t\t\t<key>NHashBins</key>\n\t\t\t\t<string>16</string>\n\t\t\t</dict>\n\t\t</array>\n\t</dict>\n\t<key>DKDChangeTimeStamp</key>\n\t<string>2020-07-13 07:06:41 +0000</string>\n\t<key>DKDCreateTimeStamp</key>\n\t<string>2020-07-08 01:23:36 +0000</string>\n\t<key>DKDDisplayGraphicDetails</key>\n\t<dict>\n\t\t<key>AngleFormatDisplayDetails</key>\n\t\t<dict>\n\t\t\t<key>AngleDirection</key>\n\t\t\t<string>Right</string>\n\t\t\t<key>AngleForm</key>\n\t\t\t<string>degrees</string>\n\t\t\t<key>AngleRotation</key>\n\t\t\t<string>Counter Clockwise</string>\n\t\t\t<key>PrecisionAngles</key>\n\t\t\t<string>1</string>\n\t\t</dict>\n\t\t<key>AnglesDisplaySpec</key>\n\t\t<dict>\n\t\t\t<key>FormDisplaySpec</key>\n\t\t\t<string>Decimal</string>\n\t\t\t<key>PrecisionDisplaySpec</key>\n\t\t\t<string>2</string>\n\t\t\t<key>TextAlignDisplaySpec</key>\n\t\t\t<string>Left</string>\n\t\t\t<key>UnitsDisplaySpec</key>\n\t\t\t<string>Punctuation</string>\n\t\t</dict>\n\t\t<key>AreaForm</key>\n\t\t<string>Natural</string>\n\t\t<key>HelpTipDisplaySpec</key>\n\t\t<dict>\n\t\t\t<key>FormDisplaySpec</key>\n\t\t\t<string>Decimal</string>\n\t\t\t<key>PrecisionDisplaySpec</key>\n\t\t\t<string>3</string>\n\t\t\t<key>TextAlignDisplaySpec</key>\n\t\t\t<string>Left</string>\n\t\t\t<key>UnitsDisplaySpec</key>\n\t\t\t<string>Abbreviate</string>\n\t\t</dict>\n\t\t<key>InspectingSpecIndex</key>\n\t\t<string>0</string>\n\t\t<key>LengthsDisplaySpec</key>\n\t\t<dict>\n\t\t\t<key>FormDisplaySpec</key>\n\t\t\t<string>Decimal</string>\n\t\t\t<key>PrecisionDisplaySpec</key>\n\t\t\t<string>2</string>\n\t\t\t<key>TextAlignDisplaySpec</key>\n\t\t\t<string>Left</string>\n\t\t\t<key>UnitsDisplaySpec</key>\n\t\t\t<string>Nothing</string>\n\t\t</dict>\n\t\t<key>PercentDisplaySpec</key>\n\t\t<dict>\n\t\t\t<key>FormDisplaySpec</key>\n\t\t\t<string>Decimal</string>\n\t\t\t<key>PrecisionDisplaySpec</key>\n\t\t\t<string>1</string>\n\t\t\t<key>TextAlignDisplaySpec</key>\n\t\t\t<string>Left</string>\n\t\t\t<key>UnitsDisplaySpec</key>\n\t\t\t<string>Punctuation</string>\n\t\t</dict>\n\t\t<key>PercentFormatDisplayDetails</key>\n\t\t<dict>\n\t\t\t<key>PercentForm</key>\n\t\t\t<string>Percent</string>\n\t\t\t<key>PrecisionPercents</key>\n\t\t\t<string>1</string>\n\t\t</dict>\n\t</dict>\n\t<key>DKDGrids</key>\n\t<dict>\n\t\t<key>DynamicSnapGrid</key>\n\t\t<string>YES</string>\n\t\t<key>GuidesLayer</key>\n\t\t<string>NO</string>\n\t\t<key>MajorGrid</key>\n\t\t<dict>\n\t\t\t<key>GridAboveGraphics</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>GridRGB</key>\n\t\t\t<dict>\n\t\t\t\t<key>Blue</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>BluePlus</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t<string>DKDP3ColorSpace</string>\n\t\t\t\t<key>Green</key>\n\t\t\t\t<string>0.651064</string>\n\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t<string>0.713725</string>\n\t\t\t\t<key>Opacity</key>\n\t\t\t\t<string>0.6</string>\n\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t<string>0.6</string>\n\t\t\t\t<key>Red</key>\n\t\t\t\t<string>0.432559</string>\n\t\t\t\t<key>RedPlus</key>\n\t\t\t\t<string>0.54902</string>\n\t\t\t</dict>\n\t\t\t<key>GridSpacingX</key>\n\t\t\t<string>72</string>\n\t\t\t<key>GridSpacingY</key>\n\t\t\t<string>72</string>\n\t\t\t<key>LinkGridToRulers</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>PrintLineWidth</key>\n\t\t\t<string>1</string>\n\t\t\t<key>PrintsGrid</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>ShowsGrid</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>SnapsToGrid</key>\n\t\t\t<string>NO</string>\n\t\t</dict>\n\t\t<key>MinorGrid</key>\n\t\t<dict>\n\t\t\t<key>GridAboveGraphics</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>GridRGB</key>\n\t\t\t<dict>\n\t\t\t\t<key>Blue</key>\n\t\t\t\t<string>0.848787</string>\n\t\t\t\t<key>BluePlus</key>\n\t\t\t\t<string>0.87451</string>\n\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t<string>DKDP3ColorSpace</string>\n\t\t\t\t<key>Green</key>\n\t\t\t\t<string>0.828351</string>\n\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t<string>0.854902</string>\n\t\t\t\t<key>Opacity</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>Red</key>\n\t\t\t\t<string>0.664186</string>\n\t\t\t\t<key>RedPlus</key>\n\t\t\t\t<string>0.745098</string>\n\t\t\t</dict>\n\t\t\t<key>GridSpacingX</key>\n\t\t\t<string>18</string>\n\t\t\t<key>GridSpacingY</key>\n\t\t\t<string>18</string>\n\t\t\t<key>LinkGridToRulers</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>PrintLineWidth</key>\n\t\t\t<string>0.5</string>\n\t\t\t<key>PrintsGrid</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>ShowsGrid</key>\n\t\t\t<string>YES</string>\n\t\t\t<key>SnapsToGrid</key>\n\t\t\t<string>NO</string>\n\t\t</dict>\n\t\t<key>SnapDrawing</key>\n\t\t<string>NO</string>\n\t\t<key>SnapEnds</key>\n\t\t<string>NO</string>\n\t\t<key>SnapGuidelines</key>\n\t\t<string>NO</string>\n\t\t<key>SnapRadiusGrid</key>\n\t\t<string>3</string>\n\t\t<key>SnapSound</key>\n\t\t<string>None</string>\n\t\t<key>SoftSnap</key>\n\t\t<string>YES</string>\n\t</dict>\n\t<key>DKDHideExtension</key>\n\t<string>YES</string>\n\t<key>DKDLayersList</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CloakLayerGuidelines</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>CloakLayerVertices</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>FullLayerScale</key>\n\t\t\t<dict>\n\t\t\t\t<key>ArchivePrecision</key>\n\t\t\t\t<string>12</string>\n\t\t\t\t<key>ScaleOriginX</key>\n\t\t\t\t<string>0</string>\n\t\t\t\t<key>ScaleOriginY</key>\n\t\t\t\t<string>0</string>\n\t\t\t\t<key>ScalePlusDown</key>\n\t\t\t\t<string>YES</string>\n\t\t\t\t<key>ScalePlusToRight</key>\n\t\t\t\t<string>YES</string>\n\t\t\t\t<key>ScaleScale</key>\n\t\t\t\t<string>1</string>\n\t\t\t\t<key>ScaleUnits</key>\n\t\t\t\t<string>Centimeters</string>\n\t\t\t</dict>\n\t\t\t<key>GraphicsList</key>\n\t\t\t<array>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>D8CFAFC8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t<string>M551.700106929,230.549685252 C551.700106929,230.549685252 551.700106929,230.549685252 551.700106929,230.549685252 C605.867687199,231.215900312 642.113382578,216.421685253 690.041050333,249.167528716 C739.139052457,282.712985175 759.530985138,335.215772518 821.986213258,331.909424844</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDPath</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>A0907DC8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>24</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t<string>M1181.11756755,111.980561463 L1001.11756755,111.980561463 L1001.11756755,687.980561463 L1181.11756755,687.980561463</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDPath</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>E52D4BB8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>24</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t<string>M197.664151499,108 L377.664151499,108 L377.664151499,684 L197.664151499,684</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{244.702076316, 137.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>692211C8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{244.702076316, 137.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>6E309CA8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>11</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{268.466025766, 160.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>7E309CA8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{346.905237263, 155.606795084}, {205.517828471, 84.7864098321}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>B43413C8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{346.905237263, 170.209708957}, {127.627743841, 34.753203615}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>1A6A4DA8</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{357.995090248, 176.836090159}, {116.537890856, 21.8368569077}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>658BF725</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>9FD6E925</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M355.374102357,180.999596979 C355.450513716,180.989757649 355.531893321,180.99891282 355.603336433,180.970078988 C375.1487174,173.081729442 394.369526454,170.351376501 414.526913716,170.232475696 C433.583357689,170.120068939 453.715520994,170.117297653 472.575233617,178.020016246</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{346.905237263, 176.806503038}, {21.461192112, 21.461192112}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>26</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>6C3BAB25</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>3129FD25</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M355.52828239,194.17302455 C355.604693748,194.182863881 355.686073354,194.173708709 355.757516466,194.202542541 C375.302897433,202.090892087 394.523706487,204.821245028 414.681093748,204.940145833 C433.737537722,205.05255259 453.869701027,205.055323876 472.729413649,197.152605283</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDPolygon</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>24C4E6B8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>43</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M471.736299132,155.781297814 L471.758629467,222.90525506 L497.212698363,240.012899695 L552.370285944,240.393204916 L552.423065735,222.90390166 L539.171278371,222.569612018 L538.970985833,155.606795084 z</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1042.69016627, 137.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>B83C2EB8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1042.69016627, 137.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>DC6F7CB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>59</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1066.45411572, 160.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>EC6F7CB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1042.69016627, 245.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>A3955EB8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1042.69016627, 245.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>83955EB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>59</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1066.45411572, 268.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>93955EB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1042.69016627, 461.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>F6ED5EB8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1042.69016627, 461.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>D6ED5EB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>59</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1066.45411572, 484.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>E6ED5EB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1042.69016627, 353.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>0F826EB8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1042.69016627, 353.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>EE826EB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>59</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1066.45411572, 376.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>FE826EB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1042.69016627, 569.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>50B56EB8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1042.69016627, 569.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>30B56EB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>59</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{1066.45411572, 592.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>40B56EB8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{244.702076316, 245.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>D45691C8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{244.702076316, 245.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>B45691C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>11</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{268.466025766, 268.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>C45691C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{244.702076316, 569.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>E20A91C8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{244.702076316, 569.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>C20A91C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>11</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{268.466025766, 592.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>D20A91C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{244.702076316, 353.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>542D91C8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{244.702076316, 353.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>342D91C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>11</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{268.466025766, 376.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>442D91C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{244.702076316, 461.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>7FDF91C8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{244.702076316, 461.037924817}, {85.9241503666, 85.9241503666}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>5FDF91C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>11</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{268.466025766, 484.09905329}, {37.7357697744, 37.7357697744}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>6FDF91C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>9</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{349.850279578, 370.891218073}, {203.552643257, 176.843187025}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>DC6BFBC8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{349.850279578, 378.623398193}, {127.627743841, 34.753203615}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>98CBC8B8</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{360.940132563, 385.249779395}, {116.537890856, 21.8368569077}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>48CBC8B8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>58CBC8B8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M358.319144672,389.413286215 C358.39555603,389.403446884 358.476935636,389.412602056 358.548378748,389.383768224 C378.093759714,381.495418678 397.314568768,378.765065736 417.47195603,378.646164932 C436.528400004,378.533758175 456.660563309,378.530986889 475.520275931,386.433705482</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{349.850279578, 385.220192274}, {21.461192112, 21.461192112}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>68CBC8B8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>78CBC8B8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M358.473324705,402.586713786 C358.549736063,402.596553116 358.631115669,402.587397945 358.702558781,402.616231777 C378.247939748,410.504581323 397.468748802,413.234934264 417.626136063,413.353835069 C436.682580037,413.466241825 456.814743342,413.469013112 475.674455964,405.566294519</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{349.850279578, 486.623398193}, {127.627743841, 34.7532036147}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>961E05C8</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{360.940132563, 493.249779395}, {116.537890856, 21.8368569077}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>461E05C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>661E05C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M358.319144672,497.413286215 C358.39555603,497.403446884 358.476935635,497.412602056 358.548378747,497.383768224 C378.093759714,489.495418678 397.314568767,486.765065736 417.471956029,486.646164932 C436.528400004,486.533758175 456.660563308,486.530986889 475.52027593,494.433705482</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{349.850279578, 493.220192274}, {21.461192112, 21.461192112}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>761E05C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>861E05C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M358.473324705,510.586713786 C358.549736062,510.596553116 358.631115668,510.587397945 358.702558781,510.616231777 C378.247939748,518.504581323 397.468748802,521.234934264 417.626136063,521.353835069 C436.682580037,521.466241825 456.814743342,521.469013112 475.674455963,513.566294519</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDPolygon</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>A8CBC8B8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>43</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M473.567954086,370.891218073 L472.738486567,530.246455242 L498.192555464,547.354099877 L553.350143045,547.734405098 L553.402922835,530.245101842 L540.151135471,529.9108122 L539.77592016,371.845891736 z</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{828.817727292, 483.42549498}, {207.963834842, 176.843187025}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>1E833CC8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{909.153816679, 489.810309592}, {127.627745455, 34.7532036147}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>17ECF8C8</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{909.153816679, 496.436690794}, {116.537890856, 21.8368569077}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>C6ECF8C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>E6ECF8C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M1028.31269543,500.600197614 C1028.23628407,500.590358283 1028.15490446,500.599513455 1028.08346135,500.570679623 C1008.53808038,492.682330077 989.317271331,489.951977135 969.159884069,489.833076331 C950.103440094,489.720669574 929.97127679,489.717898288 911.111564168,497.620616881</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{1015.32036679, 496.407102059}, {21.4611953406, 21.4611953406}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>F6ECF8C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>07ECF8C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M1028.15851539,513.773625185 C1028.08210404,513.783464515 1028.00072443,513.774309344 1027.92928132,513.803143176 C1008.38390035,521.691492722 989.163091296,524.421845663 969.005704035,524.540746468 C949.949260061,524.653153224 929.817096756,524.655924511 910.957384135,516.753205918</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{908.412296226, 595.547380381}, {127.627745455, 34.7532036147}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>67ECF8C8</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{908.412296226, 602.173761583}, {116.537890856, 21.8368569077}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>27ECF8C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>37ECF8C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M1027.57117497,606.337268403 C1027.49476361,606.327429072 1027.41338401,606.336584244 1027.3419409,606.307750412 C1007.79655993,598.419400866 988.575750878,595.689047924 968.418363617,595.57014712 C949.361919641,595.457740363 929.229756338,595.454969077 910.370043715,603.35768767</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{1014.57884634, 602.144172848}, {21.4611953406, 21.4611953406}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>47ECF8C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>57ECF8C8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M1027.41699494,619.510695974 C1027.34058358,619.520535304 1027.25920398,619.511380133 1027.18776086,619.540213965 C1007.6423799,627.428563511 988.421570843,630.158916452 968.264183582,630.277817257 C949.207739608,630.390224013 929.075576303,630.3929953 910.215863683,622.490276707</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDPolygon</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>77ECF8C8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>43</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>17</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M908.65269604,483.42549498 L909.48216356,642.780732149 L884.028094663,659.888376784 L828.870507082,660.268682005 L828.817727292,642.779378749 L842.069514656,642.445089107 L842.444729967,484.380168643 z</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{824.870320644, 255.521726731}, {205.517830086, 84.786409832}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>12F55CC8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t<string>{{902.760405275, 270.124640604}, {127.627745455, 34.753203615}}</string>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDGroup</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>F1F55CC8</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t\t\t<key>GroupGraphics</key>\n\t\t\t\t\t\t\t<array>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{902.760405275, 276.751021806}, {116.537890856, 21.8368569077}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDRectangle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>A1F55CC8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>C1F55CC8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M1021.91928402,280.914528626 C1021.84287266,280.904689296 1021.76149306,280.913844467 1021.69004995,280.885010635 C1002.14466898,272.996661089 982.923859925,270.266308148 962.766472663,270.147407343 C943.71002869,270.035000586 923.577865385,270.0322293 904.718152762,277.934947893</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t\t\t\t\t<string>{{1008.92695539, 276.721433071}, {21.4611953406, 21.4611953406}}</string>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDCircle</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>10</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>D1F55CC8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>27</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t\t\t<string>E1F55CC8</string>\n\t\t\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t\t\t<string>40</string>\n\t\t\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t\t\t<string>M1021.76510399,294.087956197 C1021.68869263,294.097795528 1021.60731303,294.088640356 1021.53586991,294.117474188 C1001.99048895,302.005823734 982.769679892,304.736176675 962.612292631,304.85507748 C943.555848657,304.967484237 923.423685352,304.970255523 904.56397273,297.06753693</string>\n\t\t\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t\t</array>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t\t\t<string>DKDPolygon</string>\n\t\t\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t\t\t<string>14</string>\n\t\t\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t\t\t<string>02F55CC8</string>\n\t\t\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t\t\t<string>43</string>\n\t\t\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t\t\t<string>M905.557087246,255.696229461 L905.534756912,322.820186707 L880.080688016,339.927831342 L824.923100435,340.308136563 L824.870320644,322.818833307 L838.122108008,322.484543665 L838.322400546,255.521726731\nz</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDContinuousBezier</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>E033C1D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>8</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t<string>M555.938976435,540.286121347 C555.938976435,540.286121347 555.938976435,540.286121347 555.938976435,540.286121347 C610.106556705,540.952336407 659.083587856,525.975628193 707.011255612,558.721471656 C756.109257736,592.266928115 764.30983364,654.312586665 826.76506176,651.006238991</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>output ports</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{227.739327834, 656.918327281}, {110.936, 25}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>E7B8D3D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>input ports</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1040.04915996, 660.87987904}, {110.936, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>A7F0A4D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>plug</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{482.174803406, 505.277851198}, {52.3254628879, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>D28365D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>plug</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{851.188498255, 621.75023468}, {52.3254628879, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>D8ECC5D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>plug</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{483.962795439, 196.2599819}, {52.3254628879, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>9E7406D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>plug</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{849.988698879, 298.745095945}, {52.3254628879, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>55F226D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>wire</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{600.640008464, 231.690964419}, {63.8779712734, 36.331345519}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>43C756D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>wire</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{625.919125015, 511.220284543}, {52.3254628879, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>5D0AC6D8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>block1</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{244.180962123, 77.1565144974}, {85.7281072785, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>EE60ABD8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>block2</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1051.3838098, 80.6960508365}, {85.8497926861, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>24253ED8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>TextTransform</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>coefficientM11</key>\n\t\t\t\t\t\t<string>1.001419434203</string>\n\t\t\t\t\t\t<key>coefficientM12</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>coefficientM21</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>coefficientM22</key>\n\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t<key>coefficientTX</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>coefficientTY</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>block1[0]</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{120.4261771, 159.749325024}, {134.687470499, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>A8125FD8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>block2[1]</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1141.27624806, 276.765016736}, {134.687470499, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>16EFFFD8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>block1[2:4]</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{75.6596032848, 424.411701109}, {154.202767745, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>F91460E8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>block2[3:5]</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{1160.45526393, 525.291062871}, {154.202767745, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>82D751E8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>10</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDPath</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>953A88E8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>24</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t<string>M233.736076637,387.991671072 L216.086781939,387.967133955 L216,504 L234,504</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDPath</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>DD32CAE8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>24</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t<string>M1140.31143453,499.663648476 L1157.96072923,499.639111359 L1158.04751117,615.671977404 L1140.04751117,615.671977404</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>connect(block1[0], block2[1])</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{602.72529445, 165.56986382}, {361.835889279, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>39F17DE8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>24</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>AttributedText</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>String</key>\n\t\t\t\t\t\t<string>connect(block1[2:4], block2[3:5])</string>\n\t\t\t\t\t\t<key>TextAttribute</key>\n\t\t\t\t\t\t<string>16</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>Bounds</key>\n\t\t\t\t\t<string>{{415.455795687, 670.714431704}, {412.012175074, 25.3057174314}}</string>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDTextArea</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>796B7FE8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>24</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDLine</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t<string>4</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>98BB41F8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>24</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t<string>M636.784138302,220.735971802 L664.514298005,190.287697272</string>\n\t\t\t\t</dict>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Class</key>\n\t\t\t\t\t<string>DKDLine</string>\n\t\t\t\t\t<key>DKDLockInfo</key>\n\t\t\t\t\t<string>14</string>\n\t\t\t\t\t<key>DkBezArrow</key>\n\t\t\t\t\t<string>4</string>\n\t\t\t\t\t<key>GraphicID</key>\n\t\t\t\t\t<string>B9C6B1F8</string>\n\t\t\t\t\t<key>GraphicStyle</key>\n\t\t\t\t\t<string>24</string>\n\t\t\t\t\t<key>GridRef</key>\n\t\t\t\t\t<string>2</string>\n\t\t\t\t\t<key>SVGPath</key>\n\t\t\t\t\t<string>M723.103374232,579.105994864 L649.739835569,669.048964195</string>\n\t\t\t\t</dict>\n\t\t\t</array>\n\t\t\t<key>HideDimensions</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>LayerColorMod</key>\n\t\t\t<dict>\n\t\t\t\t<key>DKDOnColorMod</key>\n\t\t\t\t<string>NO</string>\n\t\t\t\t<key>DKDOpacityColorMod</key>\n\t\t\t\t<string>0.5</string>\n\t\t\t\t<key>DKDOutlineColorMod</key>\n\t\t\t\t<string>NO</string>\n\t\t\t\t<key>DKDTintColorColorMod</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t<string>NSCalibratedWhiteColorSpace</string>\n\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>White</key>\n\t\t\t\t\t<string>0.5</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>DKDTintFractionColorMod</key>\n\t\t\t\t<string>0.5</string>\n\t\t\t</dict>\n\t\t\t<key>LayerLock</key>\n\t\t\t<string>NO</string>\n\t\t\t<key>LayerName</key>\n\t\t\t<string>Paper</string>\n\t\t\t<key>LayerState</key>\n\t\t\t<string>Active</string>\n\t\t\t<key>OutlineLayer</key>\n\t\t\t<string>NO</string>\n\t\t</dict>\n\t</array>\n\t<key>DKDPagesSpec</key>\n\t<dict>\n\t\t<key>BackgroundDisplay</key>\n\t\t<string>Background</string>\n\t\t<key>CanvasBorder</key>\n\t\t<dict>\n\t\t\t<key>Blue</key>\n\t\t\t<string>0.45904</string>\n\t\t\t<key>BluePlus</key>\n\t\t\t<string>0.533333</string>\n\t\t\t<key>ColorSpace</key>\n\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t<key>ColorSpacePlus</key>\n\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t<key>Green</key>\n\t\t\t<string>0.458672</string>\n\t\t\t<key>GreenPlus</key>\n\t\t\t<string>0.533333</string>\n\t\t\t<key>Opacity</key>\n\t\t\t<string>1</string>\n\t\t\t<key>OpacityPlus</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Red</key>\n\t\t\t<string>0.475001</string>\n\t\t\t<key>RedPlus</key>\n\t\t\t<string>0.54902</string>\n\t\t</dict>\n\t\t<key>CanvasColor</key>\n\t\t<dict>\n\t\t\t<key>Catalog</key>\n\t\t\t<string>System</string>\n\t\t\t<key>Catalog-Color</key>\n\t\t\t<string>windowBackgroundColor</string>\n\t\t</dict>\n\t\t<key>CanvasMargin</key>\n\t\t<string>0</string>\n\t\t<key>DetailsDrawerWidth</key>\n\t\t<string>260</string>\n\t\t<key>DisplayAttributesBar</key>\n\t\t<string>YES</string>\n\t\t<key>DisplayRulers</key>\n\t\t<string>NO</string>\n\t\t<key>FullScreen</key>\n\t\t<string>NO</string>\n\t\t<key>FullScreenCanvasMargin</key>\n\t\t<string>141.73228</string>\n\t\t<key>LayersDrawerWidth</key>\n\t\t<string>266</string>\n\t\t<key>NonFullScreenCanvasMargin</key>\n\t\t<string>0</string>\n\t\t<key>NumberAcrossFirst</key>\n\t\t<string>YES</string>\n\t\t<key>PagesAcross</key>\n\t\t<string>1</string>\n\t\t<key>PagesDown</key>\n\t\t<string>1</string>\n\t\t<key>PagesSpecBackgroundRGB</key>\n\t\t<dict>\n\t\t\t<key>ColorSpace</key>\n\t\t\t<string>NSCalibratedWhiteColorSpace</string>\n\t\t\t<key>Opacity</key>\n\t\t\t<string>1</string>\n\t\t\t<key>White</key>\n\t\t\t<string>1</string>\n\t\t</dict>\n\t\t<key>PagesSpecPrintBackground</key>\n\t\t<string>NO</string>\n\t\t<key>ShowPageBreaks</key>\n\t\t<string>NO</string>\n\t\t<key>SizeChecker</key>\n\t\t<string>8</string>\n\t\t<key>aCheckerColor</key>\n\t\t<dict>\n\t\t\t<key>Blue</key>\n\t\t\t<string>0.926349</string>\n\t\t\t<key>BluePlus</key>\n\t\t\t<string>0.941176</string>\n\t\t\t<key>ColorSpace</key>\n\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t<key>ColorSpacePlus</key>\n\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t<key>Green</key>\n\t\t\t<string>0.926333</string>\n\t\t\t<key>GreenPlus</key>\n\t\t\t<string>0.941176</string>\n\t\t\t<key>Opacity</key>\n\t\t\t<string>1</string>\n\t\t\t<key>OpacityPlus</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Red</key>\n\t\t\t<string>0.926361</string>\n\t\t\t<key>RedPlus</key>\n\t\t\t<string>0.941176</string>\n\t\t</dict>\n\t\t<key>bCheckerColor</key>\n\t\t<dict>\n\t\t\t<key>Blue</key>\n\t\t\t<string>0.737155</string>\n\t\t\t<key>BluePlus</key>\n\t\t\t<string>0.784314</string>\n\t\t\t<key>ColorSpace</key>\n\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t<key>ColorSpacePlus</key>\n\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t<key>Green</key>\n\t\t\t<string>0.737142</string>\n\t\t\t<key>GreenPlus</key>\n\t\t\t<string>0.784314</string>\n\t\t\t<key>Opacity</key>\n\t\t\t<string>1</string>\n\t\t\t<key>OpacityPlus</key>\n\t\t\t<string>1</string>\n\t\t\t<key>Red</key>\n\t\t\t<string>0.737164</string>\n\t\t\t<key>RedPlus</key>\n\t\t\t<string>0.784314</string>\n\t\t</dict>\n\t</dict>\n\t<key>DKDPrintInfo</key>\n\t<dict>\n\t\t<key>BottomMargin</key>\n\t\t<string>18</string>\n\t\t<key>Copies</key>\n\t\t<string>1</string>\n\t\t<key>FallBackPaperSizeHeight</key>\n\t\t<string>1190.55114746</string>\n\t\t<key>FallBackPaperSizeWidth</key>\n\t\t<string>1453.32283465</string>\n\t\t<key>FirstPage</key>\n\t\t<string>1</string>\n\t\t<key>HorizontalPagination</key>\n\t\t<string>2</string>\n\t\t<key>HorizontallyCentered</key>\n\t\t<string>YES</string>\n\t\t<key>LastPage</key>\n\t\t<string>-1</string>\n\t\t<key>LeftMargin</key>\n\t\t<string>18</string>\n\t\t<key>MustCollate</key>\n\t\t<string>YES</string>\n\t\t<key>Orientation</key>\n\t\t<string>1</string>\n\t\t<key>PaperName</key>\n\t\t<string>Custom</string>\n\t\t<key>PaperSizeHeight</key>\n\t\t<string>1190.55114746</string>\n\t\t<key>PaperSizeWidth</key>\n\t\t<string>1453.32283465</string>\n\t\t<key>PreviewPageNumber</key>\n\t\t<string>1</string>\n\t\t<key>PrintAllPages</key>\n\t\t<string>YES</string>\n\t\t<key>PrintJobDisposition</key>\n\t\t<string>NSPrintSpoolJob</string>\n\t\t<key>PrintSavePath</key>\n\t\t<string></string>\n\t\t<key>PrintScalingFactor</key>\n\t\t<string>1</string>\n\t\t<key>PrinterName</key>\n\t\t<string>ApeosPort-V C4475 T2 (01:87:08) 2</string>\n\t\t<key>ReversePageOrder</key>\n\t\t<string>NO</string>\n\t\t<key>RightMargin</key>\n\t\t<string>18</string>\n\t\t<key>TopMargin</key>\n\t\t<string>18</string>\n\t\t<key>VerticalPagination</key>\n\t\t<string>0</string>\n\t\t<key>VerticallyCentered</key>\n\t\t<string>YES</string>\n\t\t<key>XPrintMirror</key>\n\t\t<string>NO</string>\n\t\t<key>YPrintMirror</key>\n\t\t<string>NO</string>\n\t</dict>\n\t<key>DKDSaveTimeStamp</key>\n\t<string>2020-07-13 07:09:51 +0000</string>\n\t<key>DKDTablet</key>\n\t<dict>\n\t\t<key>BrushDynamic</key>\n\t\t<string>NO</string>\n\t\t<key>BrushFit</key>\n\t\t<string>6</string>\n\t\t<key>PenMax</key>\n\t\t<string>25</string>\n\t\t<key>PenMin</key>\n\t\t<string>0.5</string>\n\t\t<key>PenPressureFactor</key>\n\t\t<string>0.5</string>\n\t\t<key>PencilDynamic</key>\n\t\t<string>NO</string>\n\t\t<key>PencilFit</key>\n\t\t<string>7</string>\n\t</dict>\n\t<key>DKDTimeFormat</key>\n\t<dict>\n\t\t<key>Field 0 Include</key>\n\t\t<string>Weekday</string>\n\t\t<key>Field 0 Type</key>\n\t\t<string>Long</string>\n\t\t<key>Field 1 Include</key>\n\t\t<string>Month</string>\n\t\t<key>Field 1 Type</key>\n\t\t<string>Short</string>\n\t\t<key>Field 2 Include</key>\n\t\t<string>Day</string>\n\t\t<key>Field 2 Type</key>\n\t\t<string>Number</string>\n\t\t<key>Field 3 Include</key>\n\t\t<string>Year</string>\n\t\t<key>Field 3 Type</key>\n\t\t<string>Long</string>\n\t\t<key>Include GMT</key>\n\t\t<string>NO</string>\n\t\t<key>Include Title</key>\n\t\t<string>YES</string>\n\t\t<key>IncludeDate</key>\n\t\t<string>YES</string>\n\t\t<key>IncludeTime</key>\n\t\t<string>YES</string>\n\t\t<key>Seperator 0</key>\n\t\t<string> - </string>\n\t\t<key>Seperator 1</key>\n\t\t<string>. </string>\n\t\t<key>Seperator 2</key>\n\t\t<string>, </string>\n\t\t<key>Seperator 3</key>\n\t\t<string>  </string>\n\t\t<key>Time Seperator</key>\n\t\t<string>:</string>\n\t\t<key>TimeAfterDate</key>\n\t\t<string>YES</string>\n\t\t<key>Twelve Hour Clock</key>\n\t\t<string>YES</string>\n\t\t<key>Used Once</key>\n\t\t<string>YES</string>\n\t</dict>\n\t<key>DKDToolbarSelectedButtonPairs</key>\n\t<array>\n\t\t<string>ColorTextToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>HSB_000020</string>\n\t\t</array>\n\t\t<string>ColorFillToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>HSB_0000D0</string>\n\t\t</array>\n\t\t<string>ColorStrokeToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>HSB_000020</string>\n\t\t</array>\n\t\t<string>GradientToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>EndGradientColor</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t<string>0.999991</string>\n\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t<string>0.999974</string>\n\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t<string>0.999999</string>\n\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t<string>0.999996</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>GradientFillClass</key>\n\t\t\t\t<string>DKDHorizontalGradientFill</string>\n\t\t\t\t<key>StartGradientColor</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Blue</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>BluePlus</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>ColorSpace</key>\n\t\t\t\t\t<string>NSCalibratedRGBColorSpace</string>\n\t\t\t\t\t<key>ColorSpacePlus</key>\n\t\t\t\t\t<string>DKDsRgbColorSpace</string>\n\t\t\t\t\t<key>Green</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>GreenPlus</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>Opacity</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>OpacityPlus</key>\n\t\t\t\t\t<string>1</string>\n\t\t\t\t\t<key>Red</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>RedPlus</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t</array>\n\t\t<string>PatternForToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>Toolbar_02</string>\n\t\t</array>\n\t\t<string>TextureForToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>Ancient</string>\n\t\t</array>\n\t\t<string>DKDArrowMenuToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>810007</string>\n\t\t</array>\n\t\t<string>DashMenuToolbarIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>810017</string>\n\t\t</array>\n\t\t<string>CombineMenuToolbarIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>621001</string>\n\t\t</array>\n\t\t<string>DKDConvertToMenuToolbarItemIdentifier_0</string>\n\t\t<array>\n\t\t\t<string>612032</string>\n\t\t</array>\n\t</array>\n\t<key>DKDWindowState</key>\n\t<dict>\n\t\t<key>CursorMode</key>\n\t\t<string>Nothing</string>\n\t\t<key>DocCenter</key>\n\t\t<string>{708.661417323, 477.816016622}</string>\n\t\t<key>DrawersOnMainView</key>\n\t\t<string>YES</string>\n\t\t<key>GDetailsLayersDrawerEdgePreference</key>\n\t\t<string>Auto</string>\n\t\t<key>GraphicDetailsOpen</key>\n\t\t<string>NO</string>\n\t\t<key>LayerActiveAbove</key>\n\t\t<string>NO</string>\n\t\t<key>LayerOpen</key>\n\t\t<string>NO</string>\n\t\t<key>LayerSelect</key>\n\t\t<string>Active Only</string>\n\t\t<key>LayersDrawerEdgePreference</key>\n\t\t<string>Auto</string>\n\t\t<key>OutlineDrawing</key>\n\t\t<string>NO</string>\n\t\t<key>WindowLocation</key>\n\t\t<string>433 454 1504 914 0 0 2560 1417 </string>\n\t\t<key>ZoomPercent</key>\n\t\t<string>97.529632</string>\n\t</dict>\n\t<key>GroupEdit</key>\n\t<string>Fixed</string>\n\t<key>NumberColorsToListInContextMenu</key>\n\t<string>12</string>\n\t<key>NumberPairColorsToListInContextMenu</key>\n\t<string>6</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[project]\nname = \"bdsim\"\nversion = \"1.1.2\"\nauthors = [{ name = \"Peter Corke\", email = \"rvc@petercorke.com\" }]\n\ndependencies = [\n    \"numpy>=1.17.4\",\n    \"scipy\",\n    \"matplotlib\",\n    \"spatialmath-python\",\n    \"ansitable\",\n    \"progress\",\n]\nlicense = { file = \"LICENSE\" }\n\ndescription = \"Simulate dynamic systems expressed in block diagram form using Python\"\nreadme = \"README.md\"\nrequires-python = \">=3.7\"\nclassifiers = [\n    \"Programming Language :: Python :: 3 :: Only\",\n    \"License :: OSI Approved :: MIT License\",\n    \"Operating System :: OS Independent\",\n]\nkeywords = [\"python\", \"block diagram\", \"dynamic simulation\"]\n\n[project.urls]\nhomepage = \"https://github.com/petercorke/bdsim\"\ndocumentation = \"https://petercorke.github.io/bdsim/\"\nrepository = \"https://github.com/petercorke/bdsim\"\n\n[project.optional-dependencies]\n\ndev = [\"sympy\", \"pytest\", \"pytest-timeout\", \"pytest-xvfb\", \"coverage\", \"flake8\"]\n\ndocs = [\n    \"sphinx\",\n    \"sphinx-rtd-theme\",\n    \"sphinx-autorun\",\n    \"sphinxcontrib-jsmath\",\n    \"sphinx-markdown-tables\",\n    \"sphinx-autodoc-typehints\",\n    \"sphinx-favicon\",\n]\n\nedit = [\"PyQt5\", \"PIL\"]\n\n[project.scripts]\n\nbdrun = \"bdsim:bdrun\"\nbdtex2icon = \"bdsim.tex2icon:main\"\n\n[project.gui-scripts]\n\n# ideally this would only happen if [edit] option given\nbdedit = \"bdsim.bdedit:main\"\n\n\n[build-system]\n\nrequires = [\"setuptools\", \"oldest-supported-numpy\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[tool.setuptools]\n\npackages = [\"bdsim\", \"bdsim.blocks\", \"bdsim.bdedit\"]\n\n[tool.black]\nline-length = 88\ntarget-version = ['py37']\n\n[tool.pytest.ini_options]\ntestpaths = \"tests\"\n\n[tool.coverage.run]\nomit = [\n    \"tex2icon.py\",\n    \"io.py\",\n    \"vision.py\",\n    \"bdsim/bdedit/*.py\",\n    \"tk_editor/*.py\",\n    \"examples/RVC3/*.py\",\n]\n"
  },
  {
    "path": "tests/__init__.py",
    "content": ""
  },
  {
    "path": "tests/test_bdsim.py",
    "content": "#!/usr/bin/env python3\n\nimport numpy as np\nimport math\n\nimport bdsim\nimport unittest\nimport numpy.testing as nt\nfrom pathlib import Path\n\n\nclass BDSimTest(unittest.TestCase):\n    def test_options(self):\n        sim = bdsim.BDSim()\n\n        self.assertFalse(sim.options.verbose)\n        self.assertTrue(sim.options.graphics)\n        self.assertFalse(sim.options.animation)\n\n        sim.options.verbose = True\n        self.assertTrue(sim.options.verbose)\n\n        sim.options.set(verbose=False)\n        self.assertFalse(sim.options.verbose)\n\n        sim.set_options(verbose=True)\n        self.assertTrue(sim.options.verbose)\n\n        sim.options.graphics = False\n        sim.options.animation = False\n\n        self.assertFalse(sim.options.graphics)\n        self.assertFalse(sim.options.animation)\n\n        sim.options.set(animation=True)\n        self.assertTrue(sim.options.graphics)\n        self.assertTrue(sim.options.animation)\n\n        sim.options.set(graphics=False)\n        self.assertFalse(sim.options.graphics)\n        self.assertFalse(sim.options.animation)\n\n        with self.assertRaises(ValueError):\n            sim.options.set(graphics=False, animation=True)\n\n    def test_bdrun(self):\n\n        file = Path(__file__).parent.parent / \"examples\" / \"eg1.bd\"\n\n        sim = bdsim.BDSim(graphics=None, progress=False)\n        bd = sim.blockdiagram()\n\n        bd = bdsim.bdload(bd, file)\n        self.assertEqual(len(bd.blocklist), 5)\n        self.assertEqual(len(bd.wirelist), 6)\n        bd.compile()\n        sim.run(bd, T=2)\n\n    def test_sim(self):\n        # all up test\n\n        sim = bdsim.BDSim(graphics=None, progress=False)\n        bd = sim.blockdiagram()\n\n        integ = bd.INTEGRATOR()\n        step = bd.STEP(t=1)\n        null = bd.NULL()\n        bd.connect(step, integ)\n        bd.connect(integ, null)\n\n        bd.compile()\n        out = sim.run(bd, 2)\n\n        self.assertIsInstance(out, bdsim.components.BDStruct)\n        self.assertTrue(hasattr(out, \"t\"))\n        self.assertIsInstance(out.t, np.ndarray)\n        self.assertEqual(out.t.ndim, 1)\n        n = out.t.shape[0]\n        self.assertGreater(n, 100)\n\n        self.assertTrue(hasattr(out, \"x\"))\n        self.assertIsInstance(out.x, np.ndarray)\n        self.assertEqual(out.x.shape, (n, 1))\n\n        self.assertTrue(hasattr(out, \"xnames\"))\n        self.assertIsInstance(out.xnames, list)\n        self.assertEqual(len(out.xnames), 1)\n        self.assertEqual(out.xnames[0], \"integrator.0x0\")\n\n        self.assertTrue(hasattr(out, \"ynames\"))\n        self.assertIsInstance(out.ynames, list)\n        self.assertEqual(len(out.ynames), 0)\n\n    def test_sim_implicit(self):\n        # all up test\n\n        sim = bdsim.BDSim(graphics=None, progress=False)\n        bd = sim.blockdiagram()\n\n        integ = bd.INTEGRATOR()\n        step = bd.STEP(t=1)\n        null = bd.NULL()\n        integ[0] = step\n        null[0] = integ\n\n        bd.compile()\n        out = sim.run(bd, 2)\n\n        self.assertIsInstance(out, bdsim.components.BDStruct)\n        self.assertTrue(hasattr(out, \"t\"))\n        self.assertIsInstance(out.t, np.ndarray)\n        self.assertEqual(out.t.ndim, 1)\n        n = out.t.shape[0]\n        self.assertGreater(n, 100)\n\n        self.assertTrue(hasattr(out, \"x\"))\n        self.assertIsInstance(out.x, np.ndarray)\n        self.assertEqual(out.x.shape, (n, 1))\n\n        self.assertTrue(hasattr(out, \"xnames\"))\n        self.assertIsInstance(out.xnames, list)\n        self.assertEqual(len(out.xnames), 1)\n        self.assertEqual(out.xnames[0], \"integrator.0x0\")\n\n        self.assertTrue(hasattr(out, \"ynames\"))\n        self.assertIsInstance(out.ynames, list)\n        self.assertEqual(len(out.ynames), 0)\n\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == \"__main__\":\n\n    unittest.main()\n"
  },
  {
    "path": "tests/test_blockdiagram.py",
    "content": "#!/usr/bin/env python3\n\nimport numpy as np\nimport scipy.interpolate\nimport math\n\nimport bdsim\nimport unittest\nimport numpy.testing as nt\n\n\nclass BlockTest(unittest.TestCase):\n    pass\n\n\nclass BlockDiagramTest(unittest.TestCase):\n    pass\n\n\nclass WiringTest(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.sim = bdsim.BDSim(animation=False)  # create simulator\n\n    def test_bd(self):\n\n        bd1 = self.sim.blockdiagram()\n        bd2 = self.sim.blockdiagram()\n        self.assertEqual(len(bd1), 0)\n        self.assertEqual(len(bd2), 0)\n        bd1.CONSTANT(2)\n        self.assertEqual(len(bd1), 1)\n        bd1.CONSTANT(2)\n        self.assertEqual(len(bd1), 2)\n        self.assertEqual(len(bd2), 0)\n        bd2.CONSTANT(2)\n        self.assertEqual(len(bd1), 2)\n        self.assertEqual(len(bd2), 1)\n\n    def test_connect_1(self):\n\n        bd = self.sim.blockdiagram()\n        src = bd.CONSTANT(2)\n        dst = bd.NULL(1)  # 1 port\n        bd.connect(src, dst)\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs[0], 2)\n\n    def test_connect_2(self):\n\n        bd = self.sim.blockdiagram()\n        src = bd.CONSTANT(2)\n        dst1 = bd.NULL(1)  # 1 port\n        dst2 = bd.NULL(1)  # 1 port\n        bd.connect(src, dst1)\n        bd.connect(src, dst2)\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst1.inputs[0], 2)\n        self.assertEqual(dst2.inputs[0], 2)\n\n    def test_multi_connect(self):\n\n        bd = self.sim.blockdiagram()\n        src = bd.CONSTANT(2)\n        dst1 = bd.NULL(1)  # 1 port\n        dst2 = bd.NULL(1)  # 1 port\n        bd.connect(src, dst1, dst2)\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst1.inputs[0], 2)\n        self.assertEqual(dst2.inputs[0], 2)\n\n    def test_ports1(self):\n\n        bd = self.sim.blockdiagram()\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst = bd.NULL(2)  # 2 ports\n        bd.connect(const1, dst[0])\n        bd.connect(const2, dst[1])\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [2, 3])\n\n    def test_ports2(self):\n\n        bd = self.sim.blockdiagram()\n        const = bd.CONSTANT([2, 3])\n        src = bd.DEMUX(2)\n        bd.connect(const, src)\n\n        dst1 = bd.NULL(1)  # 1 port\n        dst2 = bd.NULL(1)  # 1 port\n\n        bd.connect(src[0], dst1)\n        bd.connect(src[1], dst2)\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst1.inputs, [2])\n        self.assertEqual(dst2.inputs, [3])\n\n    def test_ports3(self):\n\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3, 4, 5])\n        src = bd.DEMUX(4)\n        bd.connect(const, src)\n\n        dst = bd.NULL(4)  # 4 ports\n        bd.connect(src[0], dst[0])\n        bd.connect(src[1], dst[1])\n        bd.connect(src[2], dst[2])\n        bd.connect(src[3], dst[3])\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [2, 3, 4, 5])\n\n    def test_slice1(self):\n\n        bd = self.sim.blockdiagram()\n\n        src = bd.CONSTANT(2)\n        dst = bd.NULL(2)  # 1 port\n        bd.connect(src, dst[0])\n        bd.connect(src, dst[1])\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [2, 2])\n\n    def test_slice2(self):\n\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3, 4, 5])\n        src = bd.DEMUX(4)\n        bd.connect(const, src)\n\n        dst = bd.NULL(4)  # 4 ports\n        bd.connect(src[0:4], dst[0:4])\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [2, 3, 4, 5])\n\n    def test_slice3(self):\n\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3, 4, 5])\n        src = bd.DEMUX(4)\n        bd.connect(const, src)\n\n        dst = bd.NULL(4)  # 4 ports\n        bd.connect(src[0:4], dst[3:-1:-1])\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5, 4, 3, 2])\n\n    def test_slice4(self):\n\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3, 4, 5])\n        src = bd.DEMUX(4)\n        bd.connect(const, src)\n\n        dst = bd.NULL(4)  # 4 ports\n        bd.connect(src[3:-1:-1], dst[0:4])\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5, 4, 3, 2])\n\n    def test_slice5(self):\n\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3, 4, 5])\n        src = bd.DEMUX(4)\n        bd.connect(const, src)\n\n        dst = bd.NULL(4)  # 4 ports\n        bd.connect(src[0:4:2], dst[0:4:2])  # 0, 2\n        bd.connect(src[1:4:2], dst[1:4:2])  # 1, 3\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [2, 3, 4, 5])\n\n    def test_slice5a(self):\n\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3, 4, 5])\n        src = bd.DEMUX(4)\n        bd.connect(const, src)\n\n        dst = bd.NULL(4)  # 4 ports\n        bd.connect(src[0:4:2], dst[0:2])  # 0, 2\n        bd.connect(src[1:4:2], dst[2:4])  # 1, 3\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [2, 4, 3, 5])\n\n    def test_slice6(self):\n\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3, 4, 5])\n        src = bd.DEMUX(4)\n        bd.connect(const, src)\n\n        dst = bd.NULL(4)  # 4 ports\n        bd.connect(src[3:-1:-1], dst[3:-1:-1])\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [2, 3, 4, 5])\n\n    def test_assignment11(self):\n\n        bd = self.sim.blockdiagram()\n\n        src = bd.CONSTANT(2)\n        dst = bd.NULL(1)  # 1 port\n\n        dst[0] = src\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs[0], 2)\n\n    def test_assignment2(self):\n\n        bd = self.sim.blockdiagram()\n\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst = bd.NULL(2)  # 2 ports\n\n        dst[0] = const1\n        dst[1] = const2\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [2, 3])\n\n    def test_assignment3(self):\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3, 4, 5])\n        src = bd.DEMUX(4)\n        bd.connect(const, src)\n\n        dst = bd.NULL(4)  # 4 ports\n\n        dst[3:-1:-1] = src[0:4]\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5, 4, 3, 2])\n\n    def test_chain1(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n\n        dst[0] = bd.CONSTANT(2) >> bd.GAIN(3)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [6])\n\n    def test_chain2(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n\n        dst[0] = bd.CONSTANT(2) >> bd.GAIN(3) >> bd.GAIN(4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [24])\n\n    def test_chain3(self):\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT([2, 3])\n        src = bd.DEMUX(2)\n        bd.connect(const, src)\n\n        dst = bd.NULL(2)  # 2 ports\n\n        dst[0] = src[0] >> bd.GAIN(2)\n        dst[1] = src[1] >> bd.GAIN(3)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [4, 9])\n\n    def test_inline1(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = bd.SUM(\"++\", inputs=(const1, const2))\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5])\n\n    def test_inline2(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = bd.SUM(\"++\", inputs=(const1, const2)) >> bd.GAIN(2)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [10])\n\n    def test_autosum1(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1 + const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5])\n\n    def test_autosum2a(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1 + const2[0]\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5])\n\n    def test_autosum2b(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1[0] + const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5])\n\n    def test_autosum2c(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1[0] + const2[0]\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5])\n\n    def test_autosum3a(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n\n        dst[0] = const1 + 3\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5])\n\n    def test_autosum3b(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = 2 + const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [5])\n\n    # ----------------------------------------------\n    def test_autosub1(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1 - const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [-1])\n\n    def test_autosub2a(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1 - const2[0]\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [-1])\n\n    def test_autosub2b(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1[0] - const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [-1])\n\n    def test_autosub2c(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1[0] - const2[0]\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [-1])\n\n    def test_autosub3a(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n\n        dst[0] = const1 - 3\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [-1])\n\n    def test_autosub3b(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = 2 - const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [-1])\n\n    # ----------------------------------------------\n\n    def test_autoneg1(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n\n        dst[0] = -const1\n\n        self.assertEqual(len(bd), 3)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [-2])\n\n    def test_autoneg2(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n\n        dst[0] = -const1[0]\n\n        self.assertEqual(len(bd), 3)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [-2])\n\n    # ----------------------------------------------\n\n    def test_autoprod1(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1 * const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [6])\n\n    def test_autoprod2a(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(3)\n        const2 = bd.CONSTANT(2)\n\n        dst[0] = const1[0] / const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n    def test_autoprod2b(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(3)\n        const2 = bd.CONSTANT(2)\n\n        dst[0] = const1[0] / const2[0]\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n    def test_autoprod2c(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(3)\n        const2 = bd.CONSTANT(2)\n\n        dst[0] = const1[0] / const2[0]\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n    def test_autoprod3a(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(2)\n        const2 = 3\n\n        dst[0] = const1 * const2\n\n        self.assertEqual(len(bd), 3)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [6])\n\n    def test_autoprod3b(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = 2\n        const2 = bd.CONSTANT(3)\n\n        dst[0] = const1 * const2\n\n        self.assertEqual(len(bd), 3)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [6])\n\n    # ----------------------------------------------\n\n    def test_autodiv1(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(3)\n        const2 = bd.CONSTANT(2)\n\n        dst[0] = const1 / const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n    def test_autodiv2a(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(3)\n        const2 = bd.CONSTANT(2)\n\n        dst[0] = const1[0] / const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n    def test_autodiv2b(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(3)\n        const2 = bd.CONSTANT(2)\n\n        dst[0] = const1[0] / const2[0]\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n    def test_autodiv2c(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(3)\n        const2 = bd.CONSTANT(2)\n\n        dst[0] = const1[0] / const2[0]\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n    def test_autodiv3a(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = bd.CONSTANT(3)\n        const2 = 2\n\n        dst[0] = const1 / const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n    def test_autodiv3b(self):\n        bd = self.sim.blockdiagram()\n\n        dst = bd.NULL(1)  # 1 ports\n        const1 = 3\n        const2 = bd.CONSTANT(2)\n\n        dst[0] = const1 / const2\n\n        self.assertEqual(len(bd), 4)\n\n        bd.compile(verbose=False)\n        bd.schedule_evaluate(x=[], t=0)\n        self.assertEqual(dst.inputs, [1.5])\n\n\nclass ImportTest(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.sim = bdsim.BDSim(animation=False)  # create simulator\n\n    def test_import1(self):\n        # create a subsystem\n        ss = self.sim.blockdiagram(name=\"subsystem1\")\n\n        f = ss.FUNCTION(lambda x: x)\n        inp = ss.INPORT(1)\n        outp = ss.OUTPORT(1)\n\n        ss.connect(inp, f)\n        ss.connect(f, outp)\n\n        # create main system\n        bd = self.sim.blockdiagram()\n\n        const = bd.CONSTANT(1)\n        scope = bd.SCOPE()\n\n        ff = bd.SUBSYSTEM(ss, name=\"subsys\")\n\n        bd.connect(const, ff)\n        bd.connect(ff, scope)\n\n        bd.compile(verbose=False)\n\n        self.assertEqual(len(bd.blocklist), 5)\n        self.assertEqual(len(bd.wirelist), 4)\n\n\n#     def test_import2(self):\n#         # create a subsystem\n#         ss = bdsim.BlockDiagram(name='subsystem1')\n\n#         f = ss.FUNCTION(lambda x: x)\n#         inp = ss.INPORT(1)\n#         outp = ss.NULL(1)\n\n#         ss.connect(inp, f)\n#         ss.connect(f, outp)\n\n#         # create main system\n#         bd = bdsim.BlockDiagram()\n\n#         const = bd.CONSTANT(1)\n#         scope1 = bd.SCOPE()\n#         scope2 = bd.SCOPE()\n\n#         f1 = bd.SUBSYSTEM(ss, name='subsys1')\n#         f2 = bd.SUBSYSTEM(ss, name='subsys2')\n\n#         bd.connect(const, f1, f2)\n#         bd.connect(f1, scope1)\n#         bd.connect(f2, scope2)\n\n#         bd.compile(verbose=False)\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == \"__main__\":\n\n    unittest.main()\n"
  },
  {
    "path": "tests/test_components.py",
    "content": "import unittest\nimport numpy.testing as nt\nfrom bdsim.components import *\nfrom bdsim.blocks import *\nfrom bdsim import BDSim, TimeQ, BlockDiagram\n\n\nclass WireTest(unittest.TestCase):\n    def test_init(self):\n\n        b1 = Constant(2, name=\"block1\")\n        b2 = Null()\n\n        w = Wire(b1, b2, name=\"wire1\")\n\n        w.info\n        self.assertIsInstance(str(w), str)\n\n    def test_bd(self):\n        sim = bdsim.BDSim()  # create simulator\n        bd = sim.blockdiagram()\n        b1 = bd.CONSTANT(2, name=\"block1\")\n        b2 = bd.NULL()\n\n        bd.connect(b1, b2)\n        bd.compile()\n\n        w = bd.wirelist[0]\n        self.assertIsInstance(str(w), str)\n        self.assertEqual(str(w), \"wire.0\")\n\n        self.assertIsInstance(w.fullname, str)\n        self.assertEqual(w.fullname, \"block1[0] --> null.0[0]\")\n\n        self.assertIsInstance(repr(w), str)\n        self.assertEqual(repr(w), \"wire.0: block1[0] --> null.0[0]\")\n\n\nclass PlugTest(unittest.TestCase):\n    def test_portlist(self):\n\n        block = Mux(5)\n        p = Plug(block, type=\"end\")\n        p = block[3]\n        pl = p.portlist\n        self.assertEqual(len(pl), 1)\n        self.assertEqual(pl[0], 3)\n\n        p = block[1:4]\n        pl = p.portlist\n        self.assertEqual(len(pl), 3)\n        self.assertEqual(list(pl), [1, 2, 3])\n\n        p = block[:4]\n        pl = p.portlist\n        self.assertEqual(len(pl), 4)\n        self.assertEqual(list(pl), [0, 1, 2, 3])\n\n        p = block[2:]\n        pl = p.portlist\n        self.assertEqual(len(pl), 3)\n        self.assertEqual(list(pl), [2, 3, 4])\n\n\nclass BlockTest(unittest.TestCase):\n    def test_init(self):\n        b1 = Constant(2)\n\n        b1.info\n\n    def test_predicates(self):\n\n        b1 = Scope()\n        b2 = Constant(2)\n        b3 = ZOH(Clock(1))\n\n        self.assertTrue(b1.isgraphics)\n        self.assertFalse(b2.isgraphics)\n\n        self.assertFalse(b2.isclocked)\n        self.assertTrue(b3.isclocked)\n\n\nclass PriorityQTest(unittest.TestCase):\n    def test_pushpop(self):\n        q = TimeQ()\n\n        q.push((0, \"a\"))\n        q.push((3, \"d\"))\n        q.push((2, \"c\"))\n        q.push((1, \"b\"))\n\n        self.assertEqual(len(q), 4)\n\n        self.assertIsInstance(str(q), str)\n        self.assertIsInstance(repr(q), str)\n        self.assertEqual(str(q), \"TimeQ: len=4, first out (0, 'a')\")\n\n        x = q.pop()\n        self.assertIsInstance(x, tuple)\n        self.assertEqual(x, (0, [\"a\"]))\n        x = q.pop()\n        self.assertEqual(x, (1, [\"b\"]))\n        x = q.pop()\n        self.assertEqual(x, (2, [\"c\"]))\n        x = q.pop()\n        self.assertEqual(x, (3, [\"d\"]))\n        x = q.pop()\n        self.assertEqual(x, (None, []))\n\n    def test_threshold(self):\n        q = TimeQ()\n        q.push((0, \"a\"))\n        q.push((3, \"d\"))\n        q.push((2, \"c\"))\n        q.push((0.001, \"b\"))\n\n        x = q.pop(dt=0.1)\n        self.assertEqual(x, (0, [\"a\", \"b\"]))\n        x = q.pop(dt=0.1)\n        self.assertEqual(x, (2, [\"c\"]))\n        x = q.pop(dt=0.1)\n        self.assertEqual(x, (3, [\"d\"]))\n\n    def test_until(self):\n        q = TimeQ()\n\n        q.push((0, \"a\"))\n        q.push((3, \"d\"))\n        q.push((2, \"c\"))\n        q.push((0.5, \"b\"))\n\n        x = q.pop_until(2)\n        self.assertEqual(len(x), 3)\n        for i in x:\n            self.assertTrue(i[0] <= 2)\n        self.assertEqual(len(q), 1)\n\n        x = q.pop_until(2.5)\n        self.assertEqual(len(x), 0)\n\n\nclass ClockTest(unittest.TestCase):\n    def test_init(self):\n\n        c = Clock(2)\n        self.assertEqual(c.T, 2)\n        self.assertEqual(c.offset, 0)\n\n        c = Clock(2, offset=1)\n        self.assertEqual(c.T, 2)\n        self.assertEqual(c.offset, 1)\n\n        c = Clock(2, \"ms\")\n        self.assertEqual(c.T, 0.002)\n\n        c = Clock(2, \"Hz\")\n        self.assertEqual(c.T, 0.5)\n\n    def test_block(self):\n        c = Clock(2)\n        block = ZOH(c)\n        self.assertEqual(len(c.blocklist), 1)\n        self.assertEqual(c.blocklist[0], block)\n\n    def test_str(self):\n\n        global clocklist\n        clocklist.clear()\n\n        c = Clock(2)\n        block = ZOH(c)\n\n        self.assertIsInstance(str(c), str)\n        self.assertEqual(str(c), \"clock.0: T=2 sec, clocking 1 blocks\")\n\n        self.assertIsInstance(repr(c), str)\n        self.assertEqual(repr(c), \"clock.0: T=2 sec, clocking 1 blocks\")\n\n        c = Clock(2, offset=1, name=\"myclock\")\n        block = ZOH(c)\n        self.assertIsInstance(repr(c), str)\n        self.assertEqual(repr(c), \"myclock: T=2 sec, offset=1, clocking 1 blocks\")\n\n    @unittest.skip\n    def test_state(self):\n        global clocklist\n        clocklist.clear()\n\n        c = Clock(2)\n        bd = BlockDiagram()\n        const = Constant(0, bd=bd)\n        block1 = ZOH(c, x0=3, bd=bd)\n        block2 = ZOH(c, x0=4, bd=bd)\n        null = Null(bd=bd)\n        bd.connect(const, block1)\n        bd.connect(block1, block2)\n        bd.connect(block2, null)\n        bd.compile()\n\n        self.assertEqual(len(c.blocklist), 2)\n        nt.assert_almost_equal(c.getstate0(), np.r_[3, 4])\n\n        c._x = np.r_[5, 6]\n        c.setstate()\n        nt.assert_almost_equal(block1._x, np.r_[5])\n        nt.assert_almost_equal(block2._x, np.r_[6])\n\n        nt.assert_almost_equal(c.getstate(0.0), np.r_[13, 14])\n\n    def test_time(self):\n        global clocklist\n        clocklist.clear()\n\n        c = Clock(2, offset=1)\n        block1 = ZOH(c, x0=3)\n\n        self.assertEqual(c.time(0), 1)\n        self.assertEqual(c.time(1), 3)\n        self.assertEqual(c.time(2), 5)\n\n        # c.start()\n        # t = c.next_event()\n\n\nclass StructTest(unittest.TestCase):\n    def test_struct(self):\n\n        x = BDStruct()\n        x.a = 1\n        x.b = \"hello\"\n        x.c = 4.56\n        x.d = [1, 2, 3]\n        self.assertEqual(x.a, 1)\n        self.assertEqual(x.b, \"hello\")\n        self.assertEqual(x.c, 4.56)\n        self.assertEqual(x.d, [1, 2, 3])\n        s = str(x)\n        print(s)\n        self.assertEqual(len(s.split(\"\\n\")), 4)\n\n    def test_struct_struct(self):\n        x = BDStruct(f=2)\n        x.a = BDStruct(name=\"baz\", a=1, b=4.56)\n        self.assertEqual(\n            str(x),\n            (\n                \"a    .baz::\\n        a     = 1 (int)\\n        b     = 4.56 (float)\\nf \"\n                \"    = 2 (int)\"\n            ),\n        )\n\n    def test_item(self):\n        x = BDStruct()\n        x[\"a\"] = 1\n        x[\"b\"] = \"hello\"\n        self.assertEqual(x.a, 1)\n        self.assertEqual(x.b, \"hello\")\n\n        self.assertEqual(x[\"a\"], 1)\n        self.assertEqual(x[\"b\"], \"hello\")\n\n    def test_init(self):\n\n        s = BDStruct(a=2, b=3)\n        self.assertEqual(s.a, 2)\n        self.assertEqual(s.b, 3)\n        with self.assertRaises(AttributeError):\n            z = s.c\n\n        s.c = 4\n        self.assertEqual(s.c, 4)\n        s.c = 5\n        self.assertEqual(s.c, 5)\n\n        s.d = 6\n        self.assertEqual(s.d, 6)\n\n        self.assertIsInstance(str(s), str)\n        self.assertIsInstance(repr(s), str)\n        self.assertEqual(\n            str(s), \"a     = 2 (int)\\nb     = 3 (int)\\nc     = 5 (int)\\nd     = 6 (int)\"\n        )\n\n    def test_len(self):\n        s = BDStruct(a=2, c=1, b=3)\n        self.assertEqual(len(s), 3)\n\n\nclass OptionTest(unittest.TestCase):\n    def test_init(self):\n        opt = OptionsBase()\n\n    def test_init1(self):\n        opt = OptionsBase(dict(foo=1, bar=\"hello\"))\n\n        self.assertEqual(opt.foo, 1)\n        self.assertEqual(opt.bar, \"hello\")\n\n    def test_init2(self):\n        opt = OptionsBase({}, dict(foo=1, bar=\"hello\"))\n\n        self.assertEqual(opt.foo, 1)\n        self.assertEqual(opt.bar, \"hello\")\n\n    def test_init1(self):\n        opt = OptionsBase(dict(foo=1, bar=\"hello\"), dict(foo=2, baz=3))\n\n        self.assertEqual(opt.foo, 1)\n        self.assertEqual(opt.bar, \"hello\")\n        self.assertEqual(opt.baz, 3)\n\n    def test_set(self):\n        opt = OptionsBase(dict(foo=1, bar=\"hello\"))\n\n        opt.foo = 2\n        self.assertEqual(opt.foo, 1)\n        self.assertEqual(opt.bar, \"hello\")\n\n    def test_set2(self):\n        opt = OptionsBase(dict(foo=1, bar=\"hello\"))\n\n        opt.set(foo=3)\n        self.assertEqual(opt.foo, 1)\n        self.assertEqual(opt.bar, \"hello\")\n\n    def test_set3(self):\n        opt = OptionsBase({}, dict(foo=1, bar=\"hello\"))\n\n        opt.set(foo=3)\n        self.assertEqual(opt.foo, 3)\n        self.assertEqual(opt.bar, \"hello\")\n\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == \"__main__\":\n\n    # opt = OptionsBase(dict(foo=1, bar='hello'), dict(foo=2))\n\n    # opt.set(foo=3)\n    # print(opt.foo)\n\n    unittest.main()\n"
  },
  {
    "path": "tests/test_connections.py",
    "content": "#!/usr/bin/env python3\n\nimport numpy as np\nimport scipy.interpolate\nimport math\n\nfrom bdsim.blocks.connections import *\n\nimport unittest\nimport numpy.testing as nt\n\nclass ConnectionsTest(unittest.TestCase):\n\n    def test_mux(self):\n        \n        block = Mux(2)\n        nt.assert_array_equal(block._output(1, 2)[0], np.r_[1,2])\n        \n        block = Mux(3)\n        nt.assert_array_equal(block._output(1, 2, 3)[0], np.r_[1,2, 3])\n        \n        block = Mux(2)\n        nt.assert_array_equal(block._output(1, np.r_[2, 3])[0], np.r_[1, 2, 3])\n        \n        \n    def test_demux(self):\n        block = DeMux(2)\n        self.assertEqual(block._output(np.r_[1,2])[0], 1)\n        self.assertEqual(block._output(np.r_[1,2])[1], 2)\n        \n    def test_item(self):\n        block = Item('sig2')\n        sig = {'sig1':1, 'sig2':2, 'sig3':3}\n        self.assertEqual(block._output(sig)[0], 2)\n    \n    # subsystems are tested by test_blockdiagram\n\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == '__main__':\n\n    unittest.main()\n"
  },
  {
    "path": "tests/test_discrete.py",
    "content": "#!/usr/bin/env python3\n\nimport numpy as np\nimport math\n\nimport matplotlib.pyplot as plt\n\nfrom bdsim.blocks.discrete import *\nfrom bdsim import Clock\n\nimport unittest\nimport numpy.testing as nt\n\nclass DiscreteTest(unittest.TestCase):\n    \n    def test_ZOH(self):\n        \n        clock = Clock(2, 'Hz')\n        x = 7\n        block = ZOH(clock, x0=5)  # state is scalar\n        self.assertEqual(block.ndstates, 1)\n        self.assertEqual(block.nstates, 0)\n        nt.assert_equal(block.getstate0(), np.r_[5])\n\n\n        x = np.r_[1]\n        nt.assert_equal(block.T_output(0, x=x)[0], x)\n\n        u = 3\n        nt.assert_equal(block.T_next(u, x=x), np.r_[u])\n    \n        u = np.r_[1]\n        nt.assert_equal(block.T_next(u), u)\n    \n    def test_dintegrator(self):\n\n        clock = Clock(2, 'Hz')\n        block = DIntegrator(clock, x0=5)  # state is scalar\n        self.assertEqual(block.ndstates, 1)\n        self.assertEqual(block.nstates, 0)\n\n        nt.assert_equal(block.getstate0(), np.r_[5])\n\n        x = np.r_[10]\n        u = -2\n        nt.assert_equal(block.T_output(u, x=x)[0], x)\n        nt.assert_equal(block.T_next(u, x=x), x + u *  clock.T)\n\n        block = DIntegrator(clock, x0=5, min=-10, max=10)  # state is scalar\n        x = np.r_[10]\n        u = 2\n        nt.assert_equal(block.T_next(u, x=x), x)\n\n        x = np.r_[-10]\n        u = -2\n        nt.assert_equal(block.T_next(u, x=x), x)\n\n    def test_dintegrator_vec(self):\n\n        clock = Clock(2, 'Hz')\n        block = DIntegrator(clock, x0=[5, 6])  # state is vector\n        self.assertEqual(block.ndstates, 2)\n        self.assertEqual(block.nstates, 0)\n\n        nt.assert_equal(block.getstate0(), np.r_[5, 6])\n\n        x = np.r_[10, 11]\n        u = np.r_[-2, 3]\n        nt.assert_equal(block.T_output(u, x=x)[0], x)\n        nt.assert_equal(block.T_next(u, x=x), x + u * clock.T)\n\n        # test with limits\n        block = DIntegrator(clock, x0=[5, 6], min=[-5, -10], max=[5, 10])  # state is vector\n        x = np.r_[-5, -10]\n        u = np.r_[-2, -3]\n        nt.assert_equal(block.T_next(u, x=x), x)\n\n        x = np.r_[5, 10]\n        u = np.r_[2, 3]\n        nt.assert_equal(block.T_next(u, x=x), x)\n\n    def test_pose_dintegrator(self):\n\n        clock = Clock(2, 'Hz')\n        T = SE3.Rand()\n        block = DPoseIntegrator(clock, x0=T)\n        nt.assert_equal(block.getstate0(), Twist3(T))\n\n        self.assertEqual(block.ndstates, 6)\n        self.assertEqual(block.nstates, 0)\n\n        x = block.getstate0()\n        u = np.r_[1,2,3,4,5,6]\n\n        nt.assert_equal(block.T_output(u, x=x)[0], T)\n\n        nt.assert_almost_equal(block.T_next(u, x=x), Twist3(T * SE3.Delta(u*clock.T)))\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == '__main__':\n\n    unittest.main()"
  },
  {
    "path": "tests/test_functions.py",
    "content": "#!/usr/bin/env python3\n\nimport numpy as np\nimport scipy.interpolate\nimport math\n\nfrom bdsim.blocks.functions import *\n\nimport unittest\nimport numpy.testing as nt\n\nclass FunctionBlockTest(unittest.TestCase):\n\n    def test_gain(self):\n\n        block = Gain(2)\n        self.assertEqual(block._output(1)[0], 2)\n\n        block = Gain(2)\n        nt.assert_array_almost_equal(block._output(np.r_[1,2,3])[0], np.r_[2,4,6])\n\n        block = Gain(np.r_[1,2,3])\n        nt.assert_array_almost_equal(block._output(2)[0], np.r_[2,4,6])\n\n        block = Gain(np.array([[1,2],[3,4]]))\n        nt.assert_array_almost_equal(block._output(2)[0], np.array([[2,4],[6,8]]))\n\n        block = Gain(np.array([[1,2],[3,4]]))\n        nt.assert_array_almost_equal(block._output(np.r_[1,2])[0], np.r_[7, 10])\n        \n        block = Gain(np.array([[1,2],[3,4]]), premul=True)\n        nt.assert_array_almost_equal(block._output(np.r_[1,2])[0], np.r_[5, 11])\n\n        block = Gain(np.array([[1,2],[3,4]]))\n        nt.assert_array_almost_equal(block._output(np.array([[5,6],[7,8]]))[0], np.array([[23,34],[31,46]]))\n        \n        block = Gain(np.array([[1,2],[3,4]]), premul=True)\n        nt.assert_array_almost_equal(block._output(np.array([[5,6],[7,8]]))[0], np.array([[19,22],[43,50]]))\n\n        block = Gain(np.array([[1,2],[3,4]]), order='postmul')\n        out = block._output(np.array([[5,6],[7,8]]))\n        nt.assert_array_almost_equal(out[0], np.array([[23,34],[31,46]]))\n\n    def test_sum(self):\n\n        block = Sum('++')\n        self.assertEqual(block.T_output(10, 5)[0], 15)\n\n        block = Sum('+-')\n        self.assertEqual(block.T_output(10, 5)[0], 5)\n\n        block = Sum('-+')\n        self.assertEqual(block.T_output(10, 5)[0], -5)\n\n        block = Sum('-+', mode='r')\n        self.assertEqual(block.T_output(10, 5)[0], -5)\n\n        block = Sum('+-', mode='c')\n        self.assertEqual(block.T_output(0, -5*math.pi)[0], -math.pi)\n        self.assertEqual(block.T_output(math.pi, -math.pi)[0], 0)\n\n        block = Sum('+-', mode='C')\n        self.assertEqual(block.T_output(0, -5*math.pi)[0], math.pi)\n        self.assertEqual(block.T_output(math.pi, -math.pi)[0], 0)\n\n        block = Sum('++', mode='l')\n        self.assertEqual(block.T_output(math.pi/2, math.pi)[0], math.pi/2)\n        self.assertEqual(block.T_output(math.pi, -math.pi)[0], 0)\n\n        block = Sum('++', mode='rc')\n        x = np.r_[math.pi, math.pi]\n        nt.assert_array_almost_equal(block.T_output(x, x)[0], [2*math.pi, 0])\n        x = np.ones((2, 4)) * math.pi\n        y = np.vstack((np.ones((4,))*2*math.pi, np.zeros((4,))))\n        nt.assert_array_almost_equal(block.T_output(x, x)[0], y)\n        \n    def test_prod(self):\n\n        block = Prod('**')\n        self.assertEqual(block._output(10, 5)[0], 50)\n\n        block = Prod('*/')\n        self.assertEqual(block._output(10, 5)[0], 2)\n\n        block = Prod('/*')\n        self.assertEqual(block._output(10, 5)[0], 0.5)\n        \n        # test matrix and np cases\n        \n    def test_clip(self):\n        \n        block = Clip(min=-1, max=1)\n        self.assertEqual(block._output(0)[0], 0)\n        \n        self.assertEqual(block._output(1)[0], 1)\n        \n        self.assertEqual(block._output(10)[0], 1)\n        \n        self.assertEqual(block._output(-1)[0], -1)\n        \n        self.assertEqual(block._output(-10)[0], -1)\n        \n        block = Clip(min=-2, max=3)\n        out = block._output(1)\n        self.assertEqual(out[0], 1)\n        self.assertEqual(block._output(1)[0], 1)\n        \n        self.assertEqual(block._output(10)[0], 3)\n        \n        self.assertEqual(block._output(-1)[0], -1)\n        \n        self.assertEqual(block._output(-10)[0], -2)\n        \n        nt.assert_array_equal(block._output(np.r_[-10, -2, -1, 0, 1, 3, 10])[0], np.r_[-2, -2, -1, 0, 1, 3, 3])\n\n\n    def test_function(self):\n\n        def test(x, y):\n            return x+y\n        \n        block = Function(test, nin=2)\n        self.assertEqual(block._output(1, 2)[0], 3)\n\n        block = Function(lambda x, y: x+y, nin=2)\n        self.assertEqual(block._output(1, 2)[0], 3)\n\n        block = Function(lambda x, y, a, b: x+y+a+b, nin=2, fargs=(3,4))\n        self.assertEqual(block._output(1, 2)[0], 10)\n\n        block = Function(lambda x, y, a=0, b=0: x+y+a+b, nin=2, fkwargs={'a':3, 'b':4})\n        self.assertEqual(block._output(1, 2)[0], 10)\n        \n    def test_interpolate(self):\n        block = Interpolate(x=(0,5,10), y=(0,1,0))\n\n        self.assertEqual(block._output(0)[0], 0)\n        \n        self.assertEqual(block._output(2.5)[0], 0.5)\n        self.assertEqual(block._output(5)[0], 1)\n        self.assertEqual(block._output(7.5)[0], 0.5)\n        self.assertEqual(block._output(10)[0], 0)\n        \n        block = Interpolate(x=np.r_[0,5,10], y=np.r_[0,1,0])\n        self.assertEqual(block._output(0)[0], 0)\n        self.assertEqual(block._output(2.5)[0], 0.5)\n        self.assertEqual(block._output(5)[0], 1)\n        self.assertEqual(block._output(7.5)[0], 0.5)\n        self.assertEqual(block._output(10)[0], 0)\n        \n        block = Interpolate(x=np.r_[0,5,10], y=np.r_[0,1,0].reshape((3,1)))\n        self.assertEqual(block._output(0)[0], 0)\n        self.assertEqual(block._output(2.5)[0], 0.5)\n        self.assertEqual(block._output(5)[0], 1)\n        self.assertEqual(block._output(7.5)[0], 0.5)\n        self.assertEqual(block._output(10)[0], 0)\n        \n        block = Interpolate(xy=[(0,0), (5,1), (10,0)])\n        self.assertEqual(block._output(0)[0], 0)\n        self.assertEqual(block._output(2.5)[0], 0.5)\n        self.assertEqual(block._output(5)[0], 1)\n        self.assertEqual(block._output(7.5)[0], 0.5)\n        self.assertEqual(block._output(10)[0], 0)\n        \n        # block = _Interpolate(xy=np.array([(0,0), (5,1), (10,0)]).T)\n        # self.assertEqual(block._output()[0], 0)\n        # self.assertEqual(block._output()[0], 0.5)\n        # self.assertEqual(block._output()[0], 1)\n        # self.assertEqual(block._output()[0], 0.5)\n        # self.assertEqual(block._output()[0], 0)\n        \n        \n        block = Interpolate(x=(0,5,10), y=(0,1,0), time=True)\n        self.assertEqual(block._output(t=0)[0], 0)\n        self.assertEqual(block._output(t=2.5)[0], 0.5)\n        self.assertEqual(block._output(t=5)[0], 1)\n        self.assertEqual(block._output(t=7.5)[0], 0.5)\n        self.assertEqual(block._output(t=10)[0], 0)\n        \n        block = Interpolate(x=np.r_[0,5,10], y=np.r_[0,1,0], time=True)\n        self.assertEqual(block._output(t=0)[0], 0)\n        self.assertEqual(block._output(t=2.5)[0], 0.5)\n        self.assertEqual(block._output(t=5)[0], 1)\n        self.assertEqual(block._output(t=7.5)[0], 0.5)\n        self.assertEqual(block._output(t=10)[0], 0)\n        \n        block = Interpolate(xy=[(0,0), (5,1), (10,0)], time=True)\n\n        self.assertEqual(block._output(t=0)[0], 0)\n        self.assertEqual(block._output(t=2.5)[0], 0.5)\n        self.assertEqual(block._output(t=5)[0], 1)\n        self.assertEqual(block._output(t=7.5)[0], 0.5)\n        self.assertEqual(block._output(t=10)[0], 0)\n        \n        # block = _Interpolate(xy=np.array([(0,0), (5,1), (10,0)]), time=True)\n        # out = block._output(0)\n        # self.assertIsInstance(out, list)\n        # self.assertAlmostEqual(len(out), 1)\n        # self.assertEqual(block._output(0)[0], 0)\n        # self.assertEqual(block._output(2.5)[0], 0.5)\n        # self.assertEqual(block._output(5)[0], 1)\n        # self.assertEqual(block._output(7.5)[0], 0.)\n        # self.assertEqual(block._output(10)[0], 0)\n\n\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == '__main__':\n\n    unittest.main()\n"
  },
  {
    "path": "tests/test_linalg.py",
    "content": "#!/usr/bin/env python3\n\nimport numpy as np\nimport scipy.interpolate\nimport math\n\nfrom bdsim.blocks.linalg import *\n\nimport unittest\nimport numpy.testing as nt\n\nclass LinalgBlockTest(unittest.TestCase):\n\n    def test_inverse(self):\n\n        block = Inverse()\n        x = np.array([[2, 1], [7, 4]])\n        xi = np.array([[4, -1], [-7, 2]])\n        nt.assert_array_almost_equal(block._output(x)[0], xi)\n        nt.assert_array_almost_equal(block._output(x)[1], np.linalg.cond(x))\n\n        # singular matrix\n        a = np.array([[1, 2], [2, 4]])\n        with self.assertRaises(RuntimeError):\n            x = block._output(a)[0]\n\n        # pseudo-inverse\n        block = Inverse(pinv=True)\n        x = block._output(a)[0]\n        # axa = a\n        nt.assert_array_almost_equal(a @ x @ a - a, np.zeros((2,2)))\n        \n    def test_transpose(self):\n        block = Transpose()\n        x = np.array([[1, 2], [3, 4]])\n        nt.assert_array_almost_equal(block._output(x)[0], x.T)\n\n    def test_det(self):\n        block = Det()\n        x = np.array([[1, 2], [3, 4]])\n        nt.assert_array_almost_equal(block._output(x)[0], -2)\n\n    def test_cond(self):\n        block = Cond()\n        x = np.array([[2, 1], [7, 4]])\n        nt.assert_array_almost_equal(block._output(x)[0], np.linalg.cond(x))\n\n    def test_norm(self):\n        block = Norm()\n        x = np.array([3, 4])\n        nt.assert_array_almost_equal(block._output(x)[0], 5)\n\n    def test_slice1(self):\n    \n        x = np.arange(10) + 100\n        block = Slice1([2])\n        nt.assert_array_almost_equal(block._output(x)[0], 102)\n\n        block = Slice1([4, 5, 6])\n        nt.assert_array_almost_equal(block._output(x)[0], [104, 105, 106])\n\n        block = Slice1((4, 7, 1))\n        nt.assert_array_almost_equal(block._output(x)[0], [104, 105, 106])\n\n        block = Slice1((4, 7, None))\n        nt.assert_array_almost_equal(block._output(x)[0], [104, 105, 106])\n\n        block = Slice1((6, 3, -1))\n        nt.assert_array_almost_equal(block._output(x)[0], [106, 105, 104])\n\n        with self.assertRaises(RuntimeError):\n            x = block._output(np.array([[1,2], [3,4]]))[0]\n\n        with self.assertRaises(ValueError):\n            block = Slice1(index=(1,2))\n\n    def test_slice2(self):\n\n        x = np.arange(20).reshape((4, 5)) + 100\n\n        block = Slice2(rows=[2], cols=None)\n        nt.assert_array_almost_equal(block._output(x)[0], np.c_[np.arange(110, 115)].T)\n\n        block = Slice2(rows=[2, 1], cols=None)\n        nt.assert_array_almost_equal(block._output(x)[0], \n            np.vstack((np.arange(110, 115), np.arange(105, 110)))\n            )\n\n        block = Slice2(rows=(2,3,None), cols=None)\n        nt.assert_array_almost_equal(block._output(x)[0], np.c_[np.arange(110, 115)].T)\n\n        block = Slice2(rows=(2, 0, -1), cols=None)\n        nt.assert_array_almost_equal(block._output(x)[0], \n            np.vstack((np.arange(110, 115), np.arange(105, 110)))\n            )\n\n        block = Slice2(cols=[2], rows=None)\n        nt.assert_array_almost_equal(block._output(x)[0], np.c_[np.arange(102, 120, 5)])\n\n        block = Slice2(cols=[2, 1], rows=None)\n        nt.assert_array_almost_equal(block._output(x)[0], \n            np.column_stack((np.arange(102, 120, 5), np.arange(101, 120, 5)))\n            )\n\n        block = Slice2(cols=(2, 3, None), rows=None)\n        nt.assert_array_almost_equal(block._output(x)[0], np.c_[np.arange(102, 120, 5)])\n\n        block = Slice2(cols=(2, 0, -1), rows=None)\n        nt.assert_array_almost_equal(block._output(x)[0], \n            np.column_stack((np.arange(102, 120, 5), np.arange(101, 120, 5)))\n            )\n\n        with self.assertRaises(RuntimeError):\n            x = block._output(np.r_[1,2,3])[0]\n\n        with self.assertRaises(ValueError):\n            block = Slice2(rows=(1,2))\n\n        with self.assertRaises(ValueError):\n            block = Slice2(cols=(1,2))\n\n    def test_flatten(self):\n\n        x = np.arange(20).reshape((4, 5)) + 100\n\n        block = Flatten('F')\n        nt.assert_array_almost_equal(block._output(x)[0], x.flatten('F'))\n\n        block = Flatten('C')\n        nt.assert_array_almost_equal(block._output(x)[0], x.flatten('C'))\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == '__main__':\n\n    unittest.main()"
  },
  {
    "path": "tests/test_sinks.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nDefine fundamental blocks available for use in block diagrams.\n\nEach class _MyClass in this module becomes a method MYCLASS() of the Simulation object.\nThis is done in Simulation.__init__()\n\nAll arguments to MYCLASS() must be named arguments and passed through to the constructor\n_MyClass.__init__().\n\nThese classses must subclass one of\n\n- Source, output is a constant or function of time\n- Sink, input only\n- Transfer, output is a function of state self.x (no pass through)\n- Function, output is a direct function of input\n\nThese classes all subclass Block.\n\nEvery class defined here provides several methods:\n    \n- __init__, mandatory to handle block specific parameter arguments\n- reset, \n- output, to compute the output value as a function of self.inputs which is \n  a dict indexed by input number\n- deriv, for Transfer subclass only, return the state derivative vector\n- check, to validate parameter settings\n\nCreated on Thu May 21 06:39:29 2020\n\n@author: Peter Corke\n\"\"\"\nimport numpy as np\nimport math\n\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import Polygon\nimport unittest\nimport numpy.testing as nt\n\nfrom bdsim.blocks.sinks import *\n\n\nclass SinkBlockTest(unittest.TestCase):\n    def test_print(self):\n        class State:\n            pass\n\n        # print to a string so we can check result\n        import io\n\n        f = io.StringIO()\n\n        b = Print(name=\"print block\", file=f)\n\n        b.T_step(1.23, t=1.0)\n        self.assertEqual(f.getvalue(), \"PRINT(print block (t=1.000) 1.23\\n\")\n\n        # test print of object\n        class testObject:\n            def strline(self):\n                return f\"testObject={self.value:d}\"\n\n        to = testObject()\n        to.value = 123\n\n        # rewind the string buffer\n        f.truncate(0)\n        f.seek(0, 0)\n        b.T_step(to, t=1.0)\n        self.assertEqual(f.getvalue(), \"PRINT(print block (t=1.000) testObject=123\\n\")\n\n        ## test with format string\n        f = io.StringIO()\n        b = Print(name=\"print block\", file=f, fmt=\"{:.1f}\")\n\n        b.T_step(1.23456, t=1.0)\n        self.assertEqual(f.getvalue(), \"PRINT(print block (t=1.000) 1.2\\n\")\n\n        # rewind the string buffer\n        f.truncate(0)\n        f.seek(0, 0)\n\n        b.T_step(np.r_[1.23456, 4.5679], t=1.0)\n        self.assertEqual(f.getvalue(), \"PRINT(print block (t=1.000) [1.2 4.6]\\n\")\n\n        # rewind the string buffer\n        f.truncate(0)\n        f.seek(0, 0)\n\n        b.T_step(\"a string\", t=1.0)\n        self.assertEqual(f.getvalue(), \"PRINT(print block (t=1.000) a string\\n\")\n\n    def test_stop(self):\n        class State:\n            def __init__(self):\n                self.stop = None\n\n        s = State()\n\n        b = Stop(lambda x: x > 5)\n        b.start(s)\n\n        b.T_step(0)\n        self.assertIsNone(s.stop)\n\n        b.T_step(10)\n        self.assertTrue(s.stop)\n        self.assertIs(s.stop, b)\n\n        b = Stop()\n        s.stop = None\n        b.start(s)\n\n        b.T_step(0)\n        self.assertIsNone(s.stop)\n\n        b.T_step(1)\n        self.assertTrue(s.stop)\n        self.assertIs(s.stop, b)\n\n        s.stop = None\n        b.T_step(False)\n        self.assertIsNone(s.stop)\n\n        b.T_step(True)\n        self.assertTrue(s.stop)\n        self.assertIs(s.stop, b)\n\n        with self.assertRaises(TypeError):\n            b = Stop(func=3)\n\n    def test_watch(self):\n        from bdsim import BDSim\n\n        sim = BDSim()  # create simulator\n        bd = sim.blockdiagram()\n        b1 = bd.CONSTANT(2)\n        b2 = bd.NULL()\n        b3 = bd.WATCH()\n        bd.connect(b1, b2, b3)\n        bd.compile()\n\n        # bd.start()\n        # state is not yet setup\n        # bd.state.watchlist\n\n\n# --------------------------------------------------------------------------------------#\nif __name__ == \"__main__\":\n\n    unittest.main()\n"
  },
  {
    "path": "tests/test_sources.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nDefine fundamental blocks available for use in block diagrams.\n\nEach class _MyClass in this module becomes a method MYCLASS() of the Simulation object.\nThis is done in Simulation.__init__()\n\nAll arguments to MYCLASS() must be named arguments and passed through to the constructor\n_MyClass.__init__().\n\nThese classses must subclass one of\n\n- Source, output is a constant or function of time\n- Sink, input only\n- Transfer, output is a function of state self.x (no pass through)\n- Function, output is a direct function of input\n\nThese classes all subclass Block.\n\nEvery class defined here provides several methods:\n    \n- __init__, mandatory to handle block specific parameter arguments\n- reset, \n- output, to compute the output value as a function of self.inputs which is \n  a dict indexed by input number\n- deriv, for Transfer subclass only, return the state derivative vector\n- check, to validate parameter settings\n\nCreated on Thu May 21 06:39:29 2020\n\n@author: Peter Corke\n\"\"\"\nimport numpy as np\nimport math\n\nfrom bdsim.blocks.sources import *\n\nimport unittest\nimport numpy.testing as nt\n\n\nclass SourceBlockTest(unittest.TestCase):\n    def test_constant(self):\n\n        block = Constant(value=7)\n        out = block.T_output()\n        self.assertIsInstance(out, list)\n        self.assertEqual(len(out), 1)\n        self.assertEqual(out[0], 7)\n\n        block = Constant(value=np.r_[1, 2, 3])\n        out = block.T_output()\n        self.assertIsInstance(out, list)\n        self.assertEqual(len(out), 1)\n        nt.assert_array_almost_equal(out[0], np.r_[1, 2, 3])\n\n    def test_waveform_sine(self):\n\n        block = WaveForm(wave=\"sine\")\n\n        self.assertAlmostEqual(block.T_output(t=0)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -1)\n\n        block = WaveForm(wave=\"sine\", amplitude=2)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 2)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -2)\n\n        block = WaveForm(wave=\"sine\", offset=1)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 2)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], 0)\n\n        block = WaveForm(wave=\"sine\", amplitude=2, offset=1)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 3)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -1)\n\n        block = WaveForm(wave=\"sine\", min=10, max=12)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 11)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 12)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], 10)\n\n        block = WaveForm(wave=\"sine\", phase=0.25)\n        self.assertAlmostEqual(block.T_output(t=0)[0], -1)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], 0)\n\n        block = WaveForm(wave=\"sine\", unit=\"rad/s\")\n        self.assertAlmostEqual(block.T_output(t=0)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=math.pi / 2)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=3 / 2 * math.pi)[0], -1)\n\n    def test_waveform_triangle(self):\n\n        block = WaveForm(wave=\"triangle\")\n\n        self.assertAlmostEqual(block.T_output(t=0)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -1)\n\n        block = WaveForm(wave=\"triangle\", amplitude=2)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 2)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -2)\n\n        block = WaveForm(wave=\"triangle\", offset=1)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 2)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], 0)\n\n        block = WaveForm(wave=\"triangle\", amplitude=2, offset=1)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 3)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -1)\n\n        block = WaveForm(wave=\"triangle\", min=10, max=12)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 11)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 12)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], 10)\n\n        block = WaveForm(wave=\"triangle\", phase=0.25)\n        self.assertAlmostEqual(block.T_output(t=0)[0], -1)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], 0)\n\n        block = WaveForm(wave=\"triangle\", unit=\"rad/s\")\n        self.assertAlmostEqual(block.T_output(t=0)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=math.pi / 2)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=3 / 2 * math.pi)[0], -1)\n\n    def test_waveform_square(self):\n\n        block = WaveForm(wave=\"square\")\n        self.assertAlmostEqual(block.T_output(t=0)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -1)\n\n        block = WaveForm(wave=\"square\", amplitude=2)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 2)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 2)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -2)\n\n        block = WaveForm(wave=\"square\", offset=1)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 2)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 2)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], 0)\n\n        block = WaveForm(wave=\"square\", amplitude=2, offset=1)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 3)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 3)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -1)\n\n        block = WaveForm(wave=\"square\", min=10, max=12)\n        self.assertAlmostEqual(block.T_output(t=0)[0], 12)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 12)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], 10)\n\n        block = WaveForm(wave=\"square\", phase=0.25)\n        self.assertAlmostEqual(block.T_output(t=0)[0], -1)\n        self.assertAlmostEqual(block.T_output(t=0.25)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=0.75)[0], -1)\n\n        block = WaveForm(wave=\"square\", unit=\"rad/s\")\n        self.assertAlmostEqual(block.T_output(t=0)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=math.pi / 2)[0], 1)\n        self.assertAlmostEqual(block.T_output(t=3 / 2 * math.pi)[0], -1)\n\n    def test_step(self):\n\n        block = Step()\n        self.assertEqual(block.T_output(t=0)[0], 0)\n\n        self.assertEqual(block.T_output(t=0.9)[0], 0)\n        self.assertEqual(block.T_output(t=1)[0], 1)\n\n        block = Step(off=1, on=2)\n        self.assertEqual(block.T_output(t=0.9)[0], 1)\n        self.assertEqual(block.T_output(t=1)[0], 2)\n\n        block = Step(T=2)\n        self.assertEqual(block.T_output(t=1.9)[0], 0)\n        self.assertEqual(block.T_output(t=2.1)[0], 1)\n\n    def test_piecewise(self):\n\n        block = Piecewise((0, 0), (1, 1), (2, 1), (2, 0), (10, 0))\n        out = block.T_output(t=0)\n        self.assertIsInstance(out, list)\n        self.assertEqual(len(out), 1)\n        self.assertEqual(out[0], 0)\n\n        self.assertEqual(block.T_output(t=0.5)[0], 0)\n        self.assertEqual(block.T_output(t=1)[0], 1)\n        self.assertEqual(block.T_output(t=1.1)[0], 1)\n        self.assertEqual(block.T_output(t=1.9)[0], 1)\n        self.assertEqual(block.T_output(t=2)[0], 0)\n        self.assertEqual(block.T_output(t=2.1)[0], 0)\n        self.assertEqual(block.T_output(t=9)[0], 0)\n\n    def test_ramp(self):\n        block = Ramp()\n        self.assertAlmostEqual(block.T_output(t=0)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=1)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=2)[0], 1)\n\n        block = Ramp(off=-1, T=2, slope=0.5)\n        self.assertAlmostEqual(block.T_output(t=0)[0], -1)\n        self.assertAlmostEqual(block.T_output(t=2)[0], -1)\n        self.assertAlmostEqual(block.T_output(t=4)[0], 0)\n        self.assertAlmostEqual(block.T_output(t=6)[0], 1)\n\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == \"__main__\":\n\n    unittest.main()\n"
  },
  {
    "path": "tests/test_spatial.py",
    "content": "#!/usr/bin/env python3\n\nimport numpy as np\nfrom spatialmath import *\n\nfrom bdsim.blocks.spatial import *\n\nimport unittest\nimport numpy.testing as nt\n\nclass SpatialMathBlockTest(unittest.TestCase):\n\n    def test_pose_postmul(self):\n\n        A = SE3.Trans(1,2,3) * SE3.Rx(np.pi/2)\n        block = Pose_postmul(A)\n        B = SE3.Rz(np.pi/2)\n        nt.assert_array_almost_equal(block._output(B)[0], B*A)\n\n    def test_pose_premul(self):\n\n        A = SE3.Trans(1,2,3) * SE3.Rx(np.pi/2)\n        block = Pose_premul(A)\n        B = SE3.Rz(np.pi/2)\n        nt.assert_array_almost_equal(block._output(B)[0], A*B)\n\n    def test_pose_inverse(self):\n\n        block = Pose_inverse()\n        A = SE3.Trans(1,2,3) * SE3.Rx(np.pi/2)\n\n        nt.assert_array_almost_equal(block._output(A)[0], A.inv())\n\n    def test_vector_transform(self):\n\n        A = SE3.Trans(1,2,3) * SE3.Rx(np.pi/2)\n        block = Transform_vector()\n        B = np.r_[1,2,3]\n        nt.assert_array_almost_equal(block._output(A,B)[0], A*B)\n        \n\n# ---------------------------------------------------------------------------------------#\nif __name__ == '__main__':\n\n    unittest.main()"
  },
  {
    "path": "tests/test_transfers.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nDefine fundamental blocks available for use in block diagrams.\n\nEach class _MyClass in this module becomes a method MYCLASS() of the Simulation object.\nThis is done in Simulation.__init__()\n\nAll arguments to MYCLASS() must be named arguments and passed through to the constructor\n_MyClass.__init__().\n\nThese classses must subclass one of\n\n- Source, output is a constant or function of time\n- Sink, input only\n- Transfer, output is a function of state self.x (no pass through)\n- Function, output is a direct function of input\n\nThese classes all subclass Block.\n\nEvery class defined here provides several methods:\n    \n- __init__, mandatory to handle block specific parameter arguments\n- reset, \n- output, to compute the output value as a function of self.inputs which is \n  a dict indexed by input number\n- deriv, for Transfer subclass only, return the state derivative vector\n- check, to validate parameter settings\n\nCreated on Thu May 21 06:39:29 2020\n\n@author: Peter Corke\n\"\"\"\nimport numpy as np\nimport math\n\nimport matplotlib.pyplot as plt\n\nfrom bdsim.blocks.transfers import *\n\nimport unittest\nimport numpy.testing as nt\n\n\nclass TransferTest(unittest.TestCase):\n    \n    def test_LTI_SS(self):\n        \n        A=np.array([[1, 2], [3, 4]])\n        B=np.array([5, 6])\n        C=np.array([7, 8])\n        block = LTI_SS(A=A, B=B, C=C, x0=[30,40])\n        x = np.r_[10, 11]\n        u = -2\n        nt.assert_equal(block.T_deriv(u, x=x), A@x  + B*u)\n        nt.assert_equal(block.T_output(u, x=x)[0], C@x)\n        nt.assert_equal(block.getstate0(), np.r_[30, 40])\n        \n        A=np.array([[1, 2], [3, 4]])\n        B=np.array([[5], [6]])\n        C=np.array([[7, 8]])\n        block = LTI_SS(A=A, B=B, C=C, x0=[30,40])\n        x = np.r_[10, 11]\n        u = -2\n        nt.assert_equal(block.T_deriv(u, x=x), A@x  + B@np.r_[u])\n        nt.assert_equal(block.T_output(u, x=x)[0], C@x)\n        nt.assert_equal(block.getstate0(), np.r_[30, 40])\n        \n    def test_LTI_SISO(self):\n        \n        block = LTI_SISO( [2, 1], [2, 4, 6])\n        nt.assert_equal(block.A, np.array([[-2, -3], [1, 0]]))\n        nt.assert_equal(block.B, np.array([[1], [0]]))\n        nt.assert_equal(block.C, np.array([[1, 0.5]]))\n    \n    def test_integrator(self):\n        block = Integrator(x0=30)\n        self.assertEqual(block.nstates, 1)\n        self.assertEqual(block.ndstates, 0)\n        x = np.r_[10]\n        u = -2\n        nt.assert_equal(block.T_deriv(u, x=x), u)\n        nt.assert_equal(block.getstate0(), np.r_[30])\n\n        block = Integrator(x0=5, min=-10, max=10)  # state is scalar\n        x = np.r_[11]\n        u = 2\n        nt.assert_equal(block.T_deriv(u, x=x), 0)\n\n        x = np.r_[-11]\n        u = -2\n        nt.assert_equal(block.T_deriv(u, x=x), 0)\n\n    def test_dintegrator_vec(self):\n\n        block = Integrator(x0=[5, 6])  # state is vector\n        self.assertEqual(block.nstates, 2)\n        self.assertEqual(block.ndstates, 0)\n\n        nt.assert_equal(block.getstate0(), np.r_[5, 6])\n\n        x = np.r_[10, 11]\n        u = np.r_[-2, 3]\n        nt.assert_equal(block.T_output(u, x=x)[0], x)\n        nt.assert_equal(block.T_deriv(u, x=x), u)\n\n        # test with limits\n        block = Integrator(x0=[5, 6], min=[-5, -10], max=[5, 10])  # state is vector\n        x = np.r_[-6, -11]\n        u = np.r_[-2, -3]\n        nt.assert_equal(block.T_deriv(u, x=x), [0, 0])\n\n        x = np.r_[6, 11]\n        u = np.r_[2, 3]\n        nt.assert_equal(block.T_deriv(u, x=x), [0, 0])\n\n\n# ---------------------------------------------------------------------------------------#\nif __name__ == '__main__':\n\n    unittest.main()"
  }
]