text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>StationPlotLayout — MetPy 0.6</title>

    <link rel="shortcut icon" href="../../_static/metpy_32x32.ico"/>

    <link rel="canonical" href="https://unidata.github.io/MetPy/latest/api/generated/metpy.plots.StationPlotLayout.html"/>

    <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />

    <link rel="stylesheet" href="../../_static/gallery.css" type="text/css" />

    <link rel="stylesheet" href="../../_static/theme_override.css" type="text/css" />

        <link rel="index" title="Index"
              href="../../genindex.html"/>
        <link rel="search" title="Search" href="../../search.html"/>
    <link rel="top" title="MetPy 0.6" href="../../index.html"/>
        <link rel="up" title="plots" href="metpy.plots.html"/>
        <link rel="next" title="ctables" href="metpy.plots.ctables.html"/>
        <link rel="prev" title="StationPlot" href="metpy.plots.StationPlot.html"/>

             MetPy

                    <select class="version-list" id="version-list">
                      <option value=''>0.6</option>

                          <option value="../latest">latest</option>

                          <option value="../dev">dev</option>

                    </select>

  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Installation Guide

Unit Support

MetPy Examples

MetPy Tutorials

The MetPy API

constants

units

io

cdm

calc

plots

add_metpy_logo

add_timestamp

add_unidata_logo

Hodograph

SkewT

StationPlot

StationPlotLayout

Examples using metpy.plots.StationPlotLayout

ctables

gridding

Developer's Guide

Contributing

Citing MetPy

References

          MetPy

Docs »

The MetPy API »

plots »

StationPlotLayout

             View page source

StationPlotLayout¶

class metpy.plots.StationPlotLayout[source]¶

make a layout to encapsulate plotting using StationPlot.

This class keeps a collection of offsets, plot formats, etc. for a parameter based
on its name. This then allows a dictionary of data (or any object that allows looking
up of arrays based on a name) to be passed to plot() to plot the data all at once.

See also

StationPlot

Methods Summary

<colgroup>
<col width="10%" />
<col width="90%" />
</colgroup>

add_barb(u_name, v_name[, units])
Add a wind barb to the center of the station layout.

add_symbol(location, name, symbol_mapper, …)
Add a symbol to the station layout.

add_text(location, name, **kwargs)
Add a text field to the  station layout.

add_value(location, name[, fmt, units])
Add a numeric value to the station layout.

clear(() -> None.  Remove all items from D.)

copy(() -> a shallow copy of D)

fromkeys
Returns a new dict with keys from iterable and values equal to value.

get((k[,d]) -> D[k] if k in D, …)

items(…)

keys(…)

names()
Get the list of names used by the layout.

plot(plotter, data_dict)
Plot a collection of data using this layout for a station plot.

pop((k[,d]) -> v, …)
If key is not found, d is returned if given, otherwise KeyError is raised

popitem(() -> (k, v), …)
2-tuple; but raise KeyError if D is empty.

setdefault((k[,d]) -> D.get(k,d), …)

update(([E, …)
If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]

values(…)

Methods Documentation

add_barb(u_name, v_name, units=None, **kwargs)[source]¶

Add a wind barb to the center of the station layout.

This specifies that u- and v-component data should be pulled from the data
container using the keys u_name and v_name, respectively, and plotted as
a wind barb at the center of the station plot. If units are given, both
components will be converted to these units.

Additional keyword arguments given will be passed onto the actual plotting
code; this is useful for specifying things like color or line width.

<col class="field-name" />
<col class="field-body" />

Parameters:

u_name (str) – The name of the parameter for the u-component for barbs, which is used as
a key to pull data out of the data container passed to plot().

v_name (str) – The name of the parameter for the v-component for barbs, which is used as
a key to pull data out of the data container passed to plot().

units (pint-compatible unit, optional) – The units to use for plotting. Data will be converted to this unit before
conversion to a string. If not specified, no conversion is done.

kwargs – Additional keyword arguments to use for matplotlib's
barbs() function.

See also

add_symbol(), add_text(), add_value()

add_symbol(location, name, symbol_mapper, **kwargs)[source]¶

Add a symbol to the station layout.

This specifies that at the offset location, data should be pulled from the data
container using the key name and plotted. Data values will converted to glyphs
appropriate for MetPy's symbol font using the callable symbol_mapper.

Additional keyword arguments given will be passed onto the actual plotting
code; this is useful for specifying things like color or font properties.

<col class="field-name" />
<col class="field-body" />

Parameters:

location (str or tuple[float, float]) – The offset (relative to center) to plot this value. If str, should be one of
'C', 'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', or 'NW'. Otherwise, should be a tuple
specifying the number of increments in the x and y directions.

name (str) – The name of the parameter, which is used as a key to pull data out of the
data container passed to plot().

symbol_mapper (callable) – Controls converting data values to unicode code points for the
wx_symbol_font font. This should take a value and return a single unicode
character. See metpy.plots.wx_symbols for included mappers.

kwargs – Additional keyword arguments to use for matplotlib's plotting functions.

See also

add_barb(), add_text(), add_value()

add_text(location, name, **kwargs)[source]¶

Add a text field to the  station layout.

This specifies that at the offset location, data should be pulled from the data
container using the key name and plotted directly as text with no conversion
applied.

Additional keyword arguments given will be passed onto the actual plotting
code; this is useful for specifying things like color or font properties.

<col class="field-name" />
<col class="field-body" />

Parameters:

location (str or tuple(float, float)) – The offset (relative to center) to plot this value. If str, should be one of
'C', 'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', or 'NW'. Otherwise, should be a tuple
specifying the number of increments in the x and y directions.

name (str) – The name of the parameter, which is used as a key to pull data out of the
data container passed to plot().

kwargs – Additional keyword arguments to use for matplotlib's plotting functions.

See also

add_barb(), add_symbol(), add_value()

add_value(location, name, fmt='.0f', units=None, **kwargs)[source]¶

Add a numeric value to the station layout.

This specifies that at the offset location, data should be pulled from the data
container using the key name and plotted. The conversion of the data values to
a string is controlled by fmt. The units required for plotting can also
be passed in using units, which will cause the data to be converted before
plotting.

Additional keyword arguments given will be passed onto the actual plotting
code; this is useful for specifying things like color or font properties.

<col class="field-name" />
<col class="field-body" />

Parameters:

location (str or tuple[float, float]) – The offset (relative to center) to plot this value. If str, should be one of
'C', 'N', 'NE', 'E', 'SE', 'S', 'SW', 'W', or 'NW'. Otherwise, should be a tuple
specifying the number of increments in the x and y directions.

name (str) – The name of the parameter, which is used as a key to pull data out of the
data container passed to plot().

fmt (str or callable, optional) – How to format the data as a string for plotting. If a string, it should be
compatible with the format() builtin. If a callable, this should take a
value and return a string. Defaults to '0.f'.

units (pint-compatible unit, optional) – The units to use for plotting. Data will be converted to this unit before
conversion to a string. If not specified, no conversion is done.

kwargs – Additional keyword arguments to use for matplotlib's plotting functions.

See also

add_barb(), add_symbol(), add_text()

clear() → None.  Remove all items from D.¶

copy() → a shallow copy of D¶

fromkeys()¶

Returns a new dict with keys from iterable and values equal to value.

get(k[, d]) → D[k] if k in D, else d.  d defaults to None.¶

items() → a set-like object providing a view on D's items¶

keys() → a set-like object providing a view on D's keys¶

names()[source]¶

Get the list of names used by the layout.

<col class="field-name" />
<col class="field-body" />

Returns:	list[str] – the list of names of variables used by the layout

plot(plotter, data_dict)[source]¶

Plot a collection of data using this layout for a station plot.

This function iterates through the entire specified layout, pulling the fields named
in the layout from data_dict and plotting them using plotter as specified
in the layout. Fields present in the layout, but not in data_dict, are ignored.

<col class="field-name" />
<col class="field-body" />

Parameters:

plotter (StationPlot) – StationPlot to use to plot the data. This controls the axes,
spacing, station locations, etc.

data_dict (dict[str, array-like]) – Data container that maps a name to an array of data. Data from this object
will be used to fill out the station plot.

pop(k[, d]) → v, remove specified key and return the corresponding value.¶

If key is not found, d is returned if given, otherwise KeyError is raised

popitem() → (k, v), remove and return some (key, value) pair as a¶

2-tuple; but raise KeyError if D is empty.

setdefault(k[, d]) → D.get(k,d), also set D[k]=d if k not in D¶

update([E, ]**F) → None.  Update D from dict/iterable E and F.¶

If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
In either case, this is followed by: for k in F:  D[k] = F[k]

values() → an object providing a view on D's values¶

Examples using metpy.plots.StationPlotLayout¶

Station Plot with Layout

        Next

         Previous

        © Copyright 2016, MetPy Developers.
      Last updated on Nov 05, 2017 at 06:18:53.

  Built with Sphinx using a theme provided by Read the Docs.

Do you enjoy using MetPy?
  Say Thanks!


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace Telestrations.Models
{
    public class SketchBook
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        public string Author { get; set; }
        public string QuestionWord { get; set; }

        public List<Picture> Pictures { get; set; }
        public virtual Game Game { get; set; }

        [Timestamp]
        public byte[] Version { get; set; }
    }
}

redpajama_set_name: RedPajamaGithub


text:
var hyperlog = require('hyperlog')
var memdb = require('memdb')
var hdata = require('../')
var fs = require('fs')

var log = hyperlog(memdb())
log.createReadStream({ live: true })
  .pipe(hdata.save())
  .pipe(fs.createWriteStream('/tmp/log.data'))

var data = {
  A: { links: [], data: 'hello' },
  B: { links: ['A'], data: 'world' },
  C: { links: ['A'], data: 'zzz' },
  D: { links: ['B','C'], data: 'zing' },
}
var keys = Object.keys(data).sort()
var nodes = {}
;(function next (prev) {
  if (keys.length === 0) return
  var key = keys.shift()
  var links = data[key].links.map(function (link) { return nodes[link] })
  log.add(links, data[key].data, function (err, node) {
    if (err) return console.error(err)
    nodes[key] = node.key
    next()
  })
})(null)


text:
using System;
using System.IO;
using System.Text.RegularExpressions;
using System.Web.Mvc;
using SimpleFiles.ViewModels;

namespace SimpleFiles.Controllers
{
    [Authorize]
    public class FilesController : Controller
    {
        private const long MaxFileSize = 5000000000; // 5 GB

        private readonly string[] _fileTypesAllowed =
        {
            "image/png", "image/x-png", "image/jpeg", "image/pjpeg", "image/gif",
            "text/plain", "application/zip", "application/x-rar-compressed", "audio/mpeg"
        };

        // GET: Files
        [Route("files/{page:int?}")]
        public ActionResult Index(int? page)
        {
            ViewBag.FileTypesAllowed = _fileTypesAllowed;

            ViewBag.SearchTerm = null;
            if (!String.IsNullOrWhiteSpace(Request.QueryString["search"]))
                ViewBag.SearchTerm = Request.QueryString["search"].Trim();

            ViewBag.Files = Models.File.GetFiles(Server.MapPath("~/uploads"), page ?? 1, ViewBag.SearchTerm);

            return View();
        }

        [ValidateAntiForgeryToken]
        [HttpPost]
        [Route("files")]
        public ActionResult Index(FileViewModels.UploadViewModel upload)
        {
            var uploadPath = "";
            var tempPath = "";

            // Check if a file has been sent from the form.
            if ((upload.File == null) || (upload.File.ContentLength == 0))
                ModelState.AddModelError("File", "No file uploaded.");
            else
            {
                tempPath = Path.GetTempFileName();
                upload.File.SaveAs(tempPath);

                var fileName = Path.GetFileName(upload.File.FileName);

                // Sanitize file name.
                var invalidChars = Regex.Escape(new string(Path.GetInvalidFileNameChars()));
                var invalidRegStr = string.Format(@"([{0}]*\.+$)|([{0}]+)", invalidChars);
                fileName = Regex.Replace(fileName, invalidRegStr, "_");
                fileName = fileName.Replace("+", "_"); // Remove double escape sequence.

                uploadPath = Path.Combine(Server.MapPath("~/uploads"), fileName);

                // Check if file with the name already exists.
                if (System.IO.File.Exists(uploadPath))
                    ModelState.AddModelError("File", "A file with the name \"" + fileName + "\" already exists.");

                // Check file size.
                if (upload.File.ContentLength > MaxFileSize)
                    ModelState.AddModelError("File",
                        "The file you uploaded is too large. The max file size allowed is: " +
                        Models.File.FormatSize(MaxFileSize));

                // Only allow certain file formats.
                var fileType = Models.File.GetMimeTypeFromFile(tempPath);
                if (Array.IndexOf(_fileTypesAllowed, fileType) == -1)
                    ModelState.AddModelError("File",
                        "The file you uploaded is not of an allowed file type (" + fileType + ").");
            }

            // Don't continue with the upload if there are any errors.
            if (!ModelState.IsValid)
            {
                if (tempPath != "")
                    System.IO.File.Delete(tempPath);

                ViewBag.FileTypesAllowed = _fileTypesAllowed;
                ViewBag.Files = Models.File.GetFiles(Server.MapPath("~/uploads"));

                return View(upload);
            }

            // Upload the file.
            System.IO.File.Move(tempPath, uploadPath);

            return RedirectToAction("Index");
        }
    }
}


text:
Zaman izleme
=============

Zaman izleme bilgileri, görev seviyesinde veya alt görev seviyesinde tanımlanabilir.

Görev zamanı izleme
------------------

![Task time tracking](screenshots/task-time-tracking.png)

Görevlerin iki alanı vardır:

- Tahmini zaman
- Harcanan zaman

Bu değerler çalışma saatlerini temsil eder ve manuel olarak ayarlanması gerekir.

Alt görev zaman izleme
---------------------

![Subtask time tracking](screenshots/subtask-time-tracking.png)

Alt görevlerin "geçen süre" ve "zaman tahmini" alanları da vardır.

Bu alanların değerini değiştirdiğinizde **görev zaman izleme değerleri otomatik olarak güncellenir ve tüm alt görev değerlerinin toplamı haline gelir**.

Kanboard, her bir alt görev durumu değişikliği arasındaki zamanı ayrı bir tabloda kaydeder.

- Alt görev durumunu **todo** dan **devam eden** ne olarak değiştirme başlangıç zamanını günlüğüne kaydeder
- Alt görev durumu **devam eden** dan **tamamlanmış** olarak değiştirildiğinde, bitiş saati günlüğe kaydedilir, ancak alt görevin ve görevin geöen süresi de güncellenir

Tüm kayıtların dökümü görev görünümü sayfasında görünür:

![Task timesheet](screenshots/task-timesheet.png)

Her bir alt görev için zamanlayıcı, istediği zaman durdurulabilir / başlatılabilir:

![Subtask timer](screenshots/subtask-timer.png)

- Zamanlayıcı, alt görev durumuna bağlı değildir
- Zamanlayıcıyı her başlatışınızda, zaman takibi tablosunda yeni bir kayıt oluşturulur
- Saati durdurduğunuz her sefer, bitiş tarihi saat izleme tablosuna kaydedilir
- Hesaplanan geçen süre en yakın çeyreğe yuvarlanır (sadece Kanboard < 1.0.32 için)


text:
<?xml version="1.0" encoding="UTF-8"?>

<channel name="xsettings" version="1.0">
  <property name="Net" type="empty">
    <property name="ThemeName" type="string" value="Matcha-dark-azul"/>
    <property name="IconThemeName" type="string" value="Papirus-Dark"/>
    <property name="DoubleClickTime" type="empty"/>
    <property name="DoubleClickDistance" type="empty"/>
    <property name="DndDragThreshold" type="empty"/>
    <property name="CursorBlink" type="empty"/>
    <property name="CursorBlinkTime" type="empty"/>
    <property name="SoundThemeName" type="empty"/>
    <property name="EnableEventSounds" type="empty"/>
    <property name="EnableInputFeedbackSounds" type="empty"/>
  </property>
  <property name="Xft" type="empty">
    <property name="DPI" type="int" value="180"/>
    <property name="Antialias" type="int" value="1"/>
    <property name="Hinting" type="int" value="0"/>
    <property name="HintStyle" type="string" value="hintnone"/>
    <property name="RGBA" type="empty"/>
  </property>
  <property name="Gtk" type="empty">
    <property name="CanChangeAccels" type="empty"/>
    <property name="ColorPalette" type="empty"/>
    <property name="FontName" type="string" value="Cantarell 11"/>
    <property name="MonospaceFontName" type="string" value="Fira Mono 10"/>
    <property name="IconSizes" type="empty"/>
    <property name="KeyThemeName" type="empty"/>
    <property name="ToolbarStyle" type="empty"/>
    <property name="ToolbarIconSize" type="empty"/>
    <property name="MenuImages" type="empty"/>
    <property name="ButtonImages" type="empty"/>
    <property name="MenuBarAccel" type="empty"/>
    <property name="CursorThemeName" type="string" value="Adwaita"/>
    <property name="CursorThemeSize" type="empty"/>
    <property name="DecorationLayout" type="string" value="menu:minimize,maximize,close"/>
  </property>
  <property name="Gdk" type="empty">
    <property name="WindowScalingFactor" type="empty"/>
  </property>
  <property name="Xfce" type="empty">
    <property name="LastCustomDPI" type="int" value="180"/>
  </property>
</channel>


text:
package org.ethereumclassic.etherjar.rpc.transport;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.impl.client.HttpClients;
import org.ethereumclassic.etherjar.rpc.JacksonRpcConverter;
import org.ethereumclassic.etherjar.rpc.RpcConverter;
import org.ethereumclassic.etherjar.rpc.json.RequestJson;

import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.logging.Logger;

/**
 * @author Igor Artamonov
 */
public class DefaultRpcTransport implements RpcTransport {

    private static final Logger log = Logger.getLogger(DefaultRpcTransport.class.getName());

    private int callSequence = 1;

    private URI host;
    private ExecutorService executorService;
    private RpcConverter rpcConverter;

    private HttpClient httpclient;

    public DefaultRpcTransport(URI host, RpcConverter rpcConverter, ExecutorService executorService, HttpClient httpClient) {
        this.host = host;
        this.rpcConverter = rpcConverter;
        this.executorService = executorService;
        httpclient = httpClient;
    }

    public DefaultRpcTransport(URI host, RpcConverter rpcConverter, ExecutorService executorService) {
        this.host = host;
        this.rpcConverter = rpcConverter;
        this.executorService = executorService;
        httpclient = HttpClients.createDefault();
    }

    public DefaultRpcTransport(URI host) {
        this.host = host;
        this.rpcConverter = createRpcConverter();
        this.executorService = createExecutor();
        httpclient = HttpClients.createDefault();
    }

    private RpcConverter createRpcConverter() {
        return new JacksonRpcConverter();
    }

    public ExecutorService createExecutor() {
        return Executors.newFixedThreadPool(2);
    }

    @Override
    public <T> Future<T> execute(final String method, final List params, final Class<T> resultType) throws IOException {
        return executorService.submit(new Callable<T>() {
            @Override
            public T call() throws Exception {
                return executeSync(method, params, resultType);
            }
        });
    }

    public <T> T executeSync(String method, List params, Class<T> resultType) throws IOException {
        String json = rpcConverter.toJson(buildCall(method, params));
        RequestBuilder requestBuilder = RequestBuilder.create("POST")
            .setUri(host)
            .addHeader("Content-Type", "application/json")
            .setEntity(new ByteArrayEntity(json.getBytes("UTF-8")));
        HttpResponse rcpResponse = httpclient.execute(requestBuilder.build());
        if (rcpResponse.getStatusLine().getStatusCode() != 200) {
            throw new IOException("Server returned error response: " + rcpResponse.getStatusLine().getStatusCode());
        }
        InputStream content = rcpResponse.getEntity().getContent();
        return rpcConverter.fromJson(content, resultType);
    }

    public RequestJson buildCall(String method, List<Object> params) {
        if (callSequence >= 0x1fffffff) {
            callSequence = 1;
        }
        return new RequestJson(method, params, callSequence++);
    }

}


text:
package org.xmlactions.db.query;

import static org.junit.Assert.*;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;

import org.junit.Before;
import org.junit.Test;
import org.xmlactions.action.Action;
import org.xmlactions.action.NestedActionException;
import org.xmlactions.action.actions.BaseAction;
import org.xmlactions.action.config.IExecContext;
import org.xmlactions.action.config.NoPersistenceExecContext;
import org.xmlactions.common.xml.BadXMLException;
import org.xmlactions.common.xml.XMLObject;
import org.xmlactions.db.StorageContainer;
import org.xmlactions.db.actions.Storage;
import org.xmlactions.db.actions.UtilsTestHelper;
import org.xmlactions.db.config.StorageConfig;
import org.xmlactions.db.env.EnvironmentAccess;
import org.xmlactions.db.query.Query;
import org.xmlactions.db.query.QueryBuilder;
import org.xmlactions.db.sql.mysql.MySqlSelectQuery;

import junit.framework.TestCase;

import org.xmlactions.mapping.xml_to_bean.XmlToBean;

public class TestQueryBuilder {

	private XmlToBean xmlToBean;

	@Before
	public void beforeMethod() {
		org.junit.Assume.assumeTrue(EnvironmentAccess.runDatabaseTests());
	}

	@Test
    public void testLoadAndPopulate() throws Exception {
        Action action = new Action();
        String page = Action.loadPage("src/test/resources", "db/storage.xml");
        BaseAction[] actions = action.processXML(UtilsTestHelper.getExecContext(), page);
        assertEquals("Invalid number of actions returned from processXML", 1, actions.length);

        assertTrue("Action [" + action.getClass().getName() + "] should be a Storage class",
                actions[0] instanceof Storage);

        IExecContext execContext = UtilsTestHelper.getExecContext();
        Storage storage = (Storage) actions[0];
        StorageConfig storageConfig = new StorageConfig();
        StorageContainer storageContainer = new StorageContainer("/db/storage.xml", execContext);
        storageConfig.setDatabaseName("test");
        storageConfig.setSqlBuilder(new MySqlSelectQuery());

        storageConfig.setStorageContainer(storageContainer);

        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put("address.id", "16");
        execContext.addNamedMap("row", map);
        //StorageConfig storageConfig = (StorageConfig) execContext.get("storageConfig");

        QueryBuilder qb = new QueryBuilder();
        Query query = qb.loadQuery("/config/query/query.xml");
        XMLObject xo = qb.buildQuery(UtilsTestHelper.getExecContext(), storageConfig, query);
        String xml = xo.mapXMLObject2XML(xo);
        assertNotNull(query);
    }
}


text:
package apps::vtom::restapi::plugin;

use strict;
use warnings;
use base qw(centreon::plugins::script_custom);

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options);
    bless $self, $class;

    $self->{modes} = {
        'cache'     => 'apps::vtom::restapi::mode::cache',
        'jobs'      => 'apps::vtom::restapi::mode::jobs',
        'list-jobs' => 'apps::vtom::restapi::mode::listjobs'
    };

    $self->{custom_modes}->{api} = 'apps::vtom::restapi::custom::api';
    $self->{custom_modes}->{legacy} = 'apps::vtom::restapi::custom::legacy';
    return $self;
}

1;

__END__

=head1 PLUGIN DESCRIPTION

Check VTOM software through HTTP/REST API.

=cut


text:
r"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page

class FleetList(ListResource):
    """ PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. """

    def __init__(self, version):
        """
        Initialize the FleetList

        :param Version version: Version that contains the resource

        :returns: twilio.rest.supersim.v1.fleet.FleetList
        :rtype: twilio.rest.supersim.v1.fleet.FleetList
        """
        super(FleetList, self).__init__(version)

        # Path Solution
        self._solution = {}
        self._uri = '/Fleets'.format(**self._solution)

    def create(self, network_access_profile, unique_name=values.unset,
               data_enabled=values.unset, data_limit=values.unset,
               ip_commands_url=values.unset, ip_commands_method=values.unset,
               sms_commands_enabled=values.unset, sms_commands_url=values.unset,
               sms_commands_method=values.unset):
        """
        Create the FleetInstance

        :param unicode network_access_profile: The SID or unique name of the Network Access Profile of the Fleet
        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param bool data_enabled: Defines whether SIMs in the Fleet are capable of using data connectivity
        :param unicode data_limit: The total data usage (download and upload combined) in Megabytes that each Super SIM resource assigned to the Fleet can consume
        :param unicode ip_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device
        :param unicode ip_commands_method: A string representing the HTTP method to use when making a request to `ip_commands_url`
        :param bool sms_commands_enabled: Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands
        :param unicode sms_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number
        :param unicode sms_commands_method: A string representing the HTTP method to use when making a request to `sms_commands_url`

        :returns: The created FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetInstance
        """
        data = values.of({
            'NetworkAccessProfile': network_access_profile,
            'UniqueName': unique_name,
            'DataEnabled': data_enabled,
            'DataLimit': data_limit,
            'IpCommandsUrl': ip_commands_url,
            'IpCommandsMethod': ip_commands_method,
            'SmsCommandsEnabled': sms_commands_enabled,
            'SmsCommandsUrl': sms_commands_url,
            'SmsCommandsMethod': sms_commands_method,
        })

        payload = self._version.create(method='POST', uri=self._uri, data=data, )

        return FleetInstance(self._version, payload, )

    def stream(self, network_access_profile=values.unset, limit=None,
               page_size=None):
        """
        Streams FleetInstance records from the API as a generator stream.
        This operation lazily loads records as efficiently as possible until the limit
        is reached.
        The results are returned as a generator, so this operation is memory efficient.

        :param unicode network_access_profile: The SID or unique name of the Network Access Profile of the Fleet
        :param int limit: Upper limit for the number of records to return. stream()
                          guarantees to never return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, stream() will attempt to read the
                              limit with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.supersim.v1.fleet.FleetInstance]
        """
        limits = self._version.read_limits(limit, page_size)

        page = self.page(network_access_profile=network_access_profile, page_size=limits['page_size'], )

        return self._version.stream(page, limits['limit'])

    def list(self, network_access_profile=values.unset, limit=None, page_size=None):
        """
        Lists FleetInstance records from the API as a list.
        Unlike stream(), this operation is eager and will load `limit` records into
        memory before returning.

        :param unicode network_access_profile: The SID or unique name of the Network Access Profile of the Fleet
        :param int limit: Upper limit for the number of records to return. list() guarantees
                          never to return more than limit.  Default is no limit
        :param int page_size: Number of records to fetch per request, when not set will use
                              the default value of 50 records.  If no page_size is defined
                              but a limit is defined, list() will attempt to read the limit
                              with the most efficient page size, i.e. min(limit, 1000)

        :returns: Generator that will yield up to limit results
        :rtype: list[twilio.rest.supersim.v1.fleet.FleetInstance]
        """
        return list(self.stream(
            network_access_profile=network_access_profile,
            limit=limit,
            page_size=page_size,
        ))

    def page(self, network_access_profile=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of FleetInstance records from the API.
        Request is executed immediately

        :param unicode network_access_profile: The SID or unique name of the Network Access Profile of the Fleet
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetPage
        """
        data = values.of({
            'NetworkAccessProfile': network_access_profile,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(method='GET', uri=self._uri, params=data, )

        return FleetPage(self._version, response, self._solution)

    def get_page(self, target_url):
        """
        Retrieve a specific page of FleetInstance records from the API.
        Request is executed immediately

        :param str target_url: API-generated URL for the requested results page

        :returns: Page of FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetPage
        """
        response = self._version.domain.twilio.request(
            'GET',
            target_url,
        )

        return FleetPage(self._version, response, self._solution)

    def get(self, sid):
        """
        Constructs a FleetContext

        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.supersim.v1.fleet.FleetContext
        :rtype: twilio.rest.supersim.v1.fleet.FleetContext
        """
        return FleetContext(self._version, sid=sid, )

    def __call__(self, sid):
        """
        Constructs a FleetContext

        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.supersim.v1.fleet.FleetContext
        :rtype: twilio.rest.supersim.v1.fleet.FleetContext
        """
        return FleetContext(self._version, sid=sid, )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        return '<Twilio.Supersim.V1.FleetList>'

class FleetPage(Page):
    """ PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. """

    def __init__(self, version, response, solution):
        """
        Initialize the FleetPage

        :param Version version: Version that contains the resource
        :param Response response: Response from the API

        :returns: twilio.rest.supersim.v1.fleet.FleetPage
        :rtype: twilio.rest.supersim.v1.fleet.FleetPage
        """
        super(FleetPage, self).__init__(version, response)

        # Path Solution
        self._solution = solution

    def get_instance(self, payload):
        """
        Build an instance of FleetInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.supersim.v1.fleet.FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetInstance
        """
        return FleetInstance(self._version, payload, )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        return '<Twilio.Supersim.V1.FleetPage>'

class FleetContext(InstanceContext):
    """ PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. """

    def __init__(self, version, sid):
        """
        Initialize the FleetContext

        :param Version version: Version that contains the resource
        :param sid: The SID that identifies the resource to fetch

        :returns: twilio.rest.supersim.v1.fleet.FleetContext
        :rtype: twilio.rest.supersim.v1.fleet.FleetContext
        """
        super(FleetContext, self).__init__(version)

        # Path Solution
        self._solution = {'sid': sid, }
        self._uri = '/Fleets/{sid}'.format(**self._solution)

    def fetch(self):
        """
        Fetch the FleetInstance

        :returns: The fetched FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetInstance
        """
        payload = self._version.fetch(method='GET', uri=self._uri, )

        return FleetInstance(self._version, payload, sid=self._solution['sid'], )

    def update(self, unique_name=values.unset, network_access_profile=values.unset,
               ip_commands_url=values.unset, ip_commands_method=values.unset,
               sms_commands_url=values.unset, sms_commands_method=values.unset,
               data_limit=values.unset):
        """
        Update the FleetInstance

        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param unicode network_access_profile: The SID or unique name of the Network Access Profile of the Fleet
        :param unicode ip_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device
        :param unicode ip_commands_method: A string representing the HTTP method to use when making a request to `ip_commands_url`
        :param unicode sms_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number
        :param unicode sms_commands_method: A string representing the HTTP method to use when making a request to `sms_commands_url`
        :param unicode data_limit: The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume

        :returns: The updated FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetInstance
        """
        data = values.of({
            'UniqueName': unique_name,
            'NetworkAccessProfile': network_access_profile,
            'IpCommandsUrl': ip_commands_url,
            'IpCommandsMethod': ip_commands_method,
            'SmsCommandsUrl': sms_commands_url,
            'SmsCommandsMethod': sms_commands_method,
            'DataLimit': data_limit,
        })

        payload = self._version.update(method='POST', uri=self._uri, data=data, )

        return FleetInstance(self._version, payload, sid=self._solution['sid'], )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
        return '<Twilio.Supersim.V1.FleetContext {}>'.format(context)

class FleetInstance(InstanceResource):
    """ PLEASE NOTE that this class contains beta products that are subject to
    change. Use them with caution. """

    class DataMetering(object):
        PAYG = "payg"

    def __init__(self, version, payload, sid=None):
        """
        Initialize the FleetInstance

        :returns: twilio.rest.supersim.v1.fleet.FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetInstance
        """
        super(FleetInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_sid': payload.get('account_sid'),
            'sid': payload.get('sid'),
            'unique_name': payload.get('unique_name'),
            'date_created': deserialize.iso8601_datetime(payload.get('date_created')),
            'date_updated': deserialize.iso8601_datetime(payload.get('date_updated')),
            'url': payload.get('url'),
            'data_enabled': payload.get('data_enabled'),
            'data_limit': deserialize.integer(payload.get('data_limit')),
            'data_metering': payload.get('data_metering'),
            'sms_commands_enabled': payload.get('sms_commands_enabled'),
            'sms_commands_url': payload.get('sms_commands_url'),
            'sms_commands_method': payload.get('sms_commands_method'),
            'network_access_profile_sid': payload.get('network_access_profile_sid'),
            'ip_commands_url': payload.get('ip_commands_url'),
            'ip_commands_method': payload.get('ip_commands_method'),
        }

        # Context
        self._context = None
        self._solution = {'sid': sid or self._properties['sid'], }

    @property
    def _proxy(self):
        """
        Generate an instance context for the instance, the context is capable of
        performing various actions.  All instance actions are proxied to the context

        :returns: FleetContext for this FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetContext
        """
        if self._context is None:
            self._context = FleetContext(self._version, sid=self._solution['sid'], )
        return self._context

    @property
    def account_sid(self):
        """
        :returns: The SID of the Account that created the resource
        :rtype: unicode
        """
        return self._properties['account_sid']

    @property
    def sid(self):
        """
        :returns: The unique string that identifies the resource
        :rtype: unicode
        """
        return self._properties['sid']

    @property
    def unique_name(self):
        """
        :returns: An application-defined string that uniquely identifies the resource
        :rtype: unicode
        """
        return self._properties['unique_name']

    @property
    def date_created(self):
        """
        :returns: The ISO 8601 date and time in GMT when the resource was created
        :rtype: datetime
        """
        return self._properties['date_created']

    @property
    def date_updated(self):
        """
        :returns: The ISO 8601 date and time in GMT when the resource was last updated
        :rtype: datetime
        """
        return self._properties['date_updated']

    @property
    def url(self):
        """
        :returns: The absolute URL of the Fleet resource
        :rtype: unicode
        """
        return self._properties['url']

    @property
    def data_enabled(self):
        """
        :returns: Defines whether SIMs in the Fleet are capable of using data connectivity
        :rtype: bool
        """
        return self._properties['data_enabled']

    @property
    def data_limit(self):
        """
        :returns: The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume
        :rtype: unicode
        """
        return self._properties['data_limit']

    @property
    def data_metering(self):
        """
        :returns: The model by which a SIM is metered and billed
        :rtype: FleetInstance.DataMetering
        """
        return self._properties['data_metering']

    @property
    def sms_commands_enabled(self):
        """
        :returns: Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands
        :rtype: bool
        """
        return self._properties['sms_commands_enabled']

    @property
    def sms_commands_url(self):
        """
        :returns: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number
        :rtype: unicode
        """
        return self._properties['sms_commands_url']

    @property
    def sms_commands_method(self):
        """
        :returns: A string representing the HTTP method to use when making a request to `sms_commands_url`
        :rtype: unicode
        """
        return self._properties['sms_commands_method']

    @property
    def network_access_profile_sid(self):
        """
        :returns: The SID of the Network Access Profile of the Fleet
        :rtype: unicode
        """
        return self._properties['network_access_profile_sid']

    @property
    def ip_commands_url(self):
        """
        :returns: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device
        :rtype: unicode
        """
        return self._properties['ip_commands_url']

    @property
    def ip_commands_method(self):
        """
        :returns: A string representing the HTTP method to use when making a request to `ip_commands_url`
        :rtype: unicode
        """
        return self._properties['ip_commands_method']

    def fetch(self):
        """
        Fetch the FleetInstance

        :returns: The fetched FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetInstance
        """
        return self._proxy.fetch()

    def update(self, unique_name=values.unset, network_access_profile=values.unset,
               ip_commands_url=values.unset, ip_commands_method=values.unset,
               sms_commands_url=values.unset, sms_commands_method=values.unset,
               data_limit=values.unset):
        """
        Update the FleetInstance

        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param unicode network_access_profile: The SID or unique name of the Network Access Profile of the Fleet
        :param unicode ip_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device
        :param unicode ip_commands_method: A string representing the HTTP method to use when making a request to `ip_commands_url`
        :param unicode sms_commands_url: The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number
        :param unicode sms_commands_method: A string representing the HTTP method to use when making a request to `sms_commands_url`
        :param unicode data_limit: The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume

        :returns: The updated FleetInstance
        :rtype: twilio.rest.supersim.v1.fleet.FleetInstance
        """
        return self._proxy.update(
            unique_name=unique_name,
            network_access_profile=network_access_profile,
            ip_commands_url=ip_commands_url,
            ip_commands_method=ip_commands_method,
            sms_commands_url=sms_commands_url,
            sms_commands_method=sms_commands_method,
            data_limit=data_limit,
        )

    def __repr__(self):
        """
        Provide a friendly representation

        :returns: Machine friendly representation
        :rtype: str
        """
        context = ' '.join('{}={}'.format(k, v) for k, v in self._solution.items())
        return '<Twilio.Supersim.V1.FleetInstance {}>'.format(context)


text:
from __future__ import absolute_import, unicode_literals

import datetime
import re

from mopidy.models import TlTrack
from mopidy.mpd.protocol import tagtype_list

# TODO: special handling of local:// uri scheme
normalize_path_re = re.compile(r'[^/]+')

def normalize_path(path, relative=False):
    parts = normalize_path_re.findall(path or '')
    if not relative:
        parts.insert(0, '')
    return '/'.join(parts)

def track_to_mpd_format(track, position=None, stream_title=None):
    """
    Format track for output to MPD client.

    :param track: the track
    :type track: :class:`mopidy.models.Track` or :class:`mopidy.models.TlTrack`
    :param position: track's position in playlist
    :type position: integer
    :param stream_title: the current streams title
    :type position: string
    :rtype: list of two-tuples
    """
    if isinstance(track, TlTrack):
        (tlid, track) = track
    else:
        (tlid, track) = (None, track)

    result = [
        ('file', track.uri or ''),
        ('Time', track.length and (track.length // 1000) or 0),
        ('Artist', concat_multi_values(track.artists, 'name')),
        ('Album', track.album and track.album.name or ''),
    ]

    if stream_title is not None:
        result.append(('Title', stream_title))
        if track.name:
            result.append(('Name', track.name))
    else:
        result.append(('Title', track.name or ''))

    if track.date:
        result.append(('Date', track.date))

    if track.album is not None and track.album.num_tracks is not None:
        result.append(('Track', '%d/%d' % (
            track.track_no or 0, track.album.num_tracks)))
    else:
        result.append(('Track', track.track_no or 0))
    if position is not None and tlid is not None:
        result.append(('Pos', position))
        result.append(('Id', tlid))
    if track.album is not None and track.album.musicbrainz_id is not None:
        result.append(('MUSICBRAINZ_ALBUMID', track.album.musicbrainz_id))

    if track.album is not None and track.album.artists:
        result.append(
            ('AlbumArtist', concat_multi_values(track.album.artists, 'name')))
        musicbrainz_ids = concat_multi_values(
            track.album.artists, 'musicbrainz_id')
        if musicbrainz_ids:
            result.append(('MUSICBRAINZ_ALBUMARTISTID', musicbrainz_ids))

    if track.artists:
        musicbrainz_ids = concat_multi_values(track.artists, 'musicbrainz_id')
        if musicbrainz_ids:
            result.append(('MUSICBRAINZ_ARTISTID', musicbrainz_ids))

    if track.composers:
        result.append(
            ('Composer', concat_multi_values(track.composers, 'name')))

    if track.performers:
        result.append(
            ('Performer', concat_multi_values(track.performers, 'name')))

    if track.genre:
        result.append(('Genre', track.genre))

    if track.disc_no:
        result.append(('Disc', track.disc_no))

    if track.last_modified:
        datestring = datetime.datetime.utcfromtimestamp(
            track.last_modified // 1000).isoformat()
        result.append(('Last-Modified', datestring + 'Z'))

    if track.musicbrainz_id is not None:
        result.append(('MUSICBRAINZ_TRACKID', track.musicbrainz_id))

    if track.album and track.album.uri:
        result.append(('X-AlbumUri', track.album.uri))
    if track.album and track.album.images:
        images = ';'.join(i for i in track.album.images if i is not '')
        result.append(('X-AlbumImage', images))

    result = [element for element in result if _has_value(*element)]

    return result

def _has_value(tagtype, value):
    """
    Determine whether to add the tagtype to the output or not.

    :param tagtype: the MPD tagtype
    :type tagtype: string
    :param value: the tag value
    :rtype: bool
    """
    if tagtype in tagtype_list.TAGTYPE_LIST:
        return bool(value)
    return True

def concat_multi_values(models, attribute):
    """
    Format Mopidy model values for output to MPD client.

    :param models: the models
    :type models: array of :class:`mopidy.models.Artist`,
        :class:`mopidy.models.Album` or :class:`mopidy.models.Track`
    :param attribute: the attribute to use
    :type attribute: string
    :rtype: string
    """
    # Don't sort the values. MPD doesn't appear to (or if it does it's not
    # strict alphabetical). If we just use them in the order in which they come
    # in then the musicbrainz ids have a higher chance of staying in sync
    return ';'.join(
        getattr(m, attribute)
        for m in models if getattr(m, attribute, None) is not None
    )

def tracks_to_mpd_format(tracks, start=0, end=None):
    """
    Format list of tracks for output to MPD client.

    Optionally limit output to the slice ``[start:end]`` of the list.

    :param tracks: the tracks
    :type tracks: list of :class:`mopidy.models.Track` or
        :class:`mopidy.models.TlTrack`
    :param start: position of first track to include in output
    :type start: int (positive or negative)
    :param end: position after last track to include in output
    :type end: int (positive or negative) or :class:`None` for end of list
    :rtype: list of lists of two-tuples
    """
    if end is None:
        end = len(tracks)
    tracks = tracks[start:end]
    positions = range(start, end)
    assert len(tracks) == len(positions)
    result = []
    for track, position in zip(tracks, positions):
        result.append(track_to_mpd_format(track, position))
    return result

def playlist_to_mpd_format(playlist, *args, **kwargs):
    """
    Format playlist for output to MPD client.

    Arguments as for :func:`tracks_to_mpd_format`, except the first one.
    """
    return tracks_to_mpd_format(playlist.tracks, *args, **kwargs)


text:
module WealthHealth {
    'use strict';

    export interface IDashboardScope extends ng.IScope {
    }

    export class DashboardCtrl {
        static $inject = ['$scope'];

        constructor(
            public $scope: IDashboardScope
        ) {
        }
    }
}

WealthHealth.instance.controller('dashboardCtrl', WealthHealth.DashboardCtrl);


text:
using namespace commandline;

// save the image as screenshot
void saveScreenshot(QString filename, const Image<ColorRgb> & image)
{
	// store as PNG
	QImage pngImage((const uint8_t *) image.memptr(), image.width(), image.height(), 3*image.width(), QImage::Format_RGB888);
	pngImage.save(filename);
}

int main(int argc, char ** argv)
{
	std::cout
		<< "hyperion-aml:" << std::endl
		<< "\tVersion   : " << HYPERION_VERSION << " (" << HYPERION_BUILD_ID << ")" << std::endl
		<< "\tbuild time: " << __DATE__ << " " << __TIME__ << std::endl;

	QCoreApplication app(argc, argv);

	try
	{
		// create the option parser and initialize all parser
		Parser parser("AmLogic capture application for Hyperion");

		IntOption     & argFps        = parser.add<IntOption>    ('f', "framerate",  "Capture frame rate [default: %1]", "10");
		IntOption     & argWidth      = parser.add<IntOption>    (0x0, "width",      "Width of the captured image [default: %1]", "160", 160, 4096);
		IntOption     & argHeight     = parser.add<IntOption>    (0x0, "height",     "Height of the captured image [default: %1]", "160", 160, 4096);
		BooleanOption & argScreenshot = parser.add<BooleanOption>(0x0, "screenshot",   "Take a single screenshot, save it to file and quit");
		Option        & argAddress    = parser.add<Option>       ('a', "address",    "Set the address of the hyperion server [default: %1]", "127.0.0.1:19445");
		IntOption     & argPriority   = parser.add<IntOption>    ('p', "priority",   "Use the provided priority channel (the lower the number, the higher the priority) [default: %1]", "800");
		BooleanOption & argSkipReply  = parser.add<BooleanOption>(0x0, "skip-reply", "Do not receive and check reply messages from Hyperion");
		BooleanOption & argHelp       = parser.add<BooleanOption>('h', "help",       "Show this help message and exit");

		// parse all options
		parser.process(app);

		// check if we need to display the usage. exit if we do.
		if (parser.isSet(argHelp))
		{
			parser.showHelp(0);
		}

		AmlogicWrapper amlWrapper(argWidth.getInt(parser), argHeight.getInt(parser), 1000 / argFps.getInt(parser));

		if (parser.isSet(argScreenshot))
		{
			// Capture a single screenshot and finish
			const Image<ColorRgb> & screenshot = amlWrapper.getScreenshot();
			saveScreenshot("screenshot.png", screenshot);
		}
		else
		{
			// Create the Proto-connection with hyperiond
			ProtoConnectionWrapper protoWrapper(argAddress.value(parser), argPriority.getInt(parser), 1000, parser.isSet(argSkipReply));

			// Connect the screen capturing to the proto processing
			QObject::connect(&amlWrapper, SIGNAL(sig_screenshot(const Image<ColorRgb> &)), &protoWrapper, SLOT(receiveImage(Image<ColorRgb>)));

			// Start the capturing
			amlWrapper.start();

			// Start the application
			app.exec();
		}
	}
	catch (const std::runtime_error & e)
	{
		// An error occured. Display error and quit
		Error(Logger::getInstance("AMLOGIC"), "%s", e.what());
		return -1;
	}
	return 0;
}


text:
/**
 * global
 */
a:hover {cursor:pointer; }
ul {list-style:none; padding:0px; margin:0px; }

/**
 * 	logo
 */
body > .header .logo {font-family:sans-serif !important; }
body > .header .logo .info {font-size:8px; width:130px; height:50px; text-align:left; line-height:10px;   }
body > .header .logo .info  h4 {margin:15px 0px 0px 8px; }
body > .header .logo .info  h4 span {font-size:13px; }
body > .header .logo .image img{width:70px; }
body > .header .navbar {display:none; }

/**
 * navbar
 */
nav.navbar {border-bottom:0px !important; background-color:#444444 !important; color:#f6f6f6;}
nav.navbar .icon-bar {background-color:#f6f6f6 !important; }

/**
 * header
 */
header {z-index:0 !important;}

/**
 * section
 */
section.content{padding:0px; width:100%; height:100%;  }
section.content > * {width:100%; height:100%; padding:15px !important; margin:0px !important;   }
section.content {display:none;}
section.content-active {display:block;}
section.content-header {display:none;}

/**
 * aside
 */
aside.right-side {margin-top:-50px; }

/**
 * section-map
 */
section#contentMap > div {width:100%; height:100%; padding:0px !important; margin:0px !important;}
section#contentMap #map {width:100%; height:77.5%;  }
section#contentMap #tweet_carousel {width:100%; height:22.5%; background-color:#f1f1f1; border-radius:5px; }
#tweet_carousel #carousel_toolbar {width:100%; padding:10px; height:40px; background-color:#cccccc; color:#333333; display:none; }
#tweet_carousel #carousel_content {width:100%; padding:10px; }
.leaflet-popup-content a.photo-link img {max-height:250px !important; }

/**
 * carousel
 */
.carousel-item {position:relative; width:98%; margin:0 auto;}
.carousel-userProfile {position:absolute; top:5px; left:5px; }
.carousel-userProfile img {width:50px; height:50px; border-radius:50%;box-shadow: 1px 1px 10px #888888; }
.carousel-description {width:100%; background:rgba(0,0,0,0.7); color:#f6f6f6; padding:5px; position:absolute; bottom:0px; }
.carousel-datetime {background:rgba(255,0,0,0.7); color:#f6f6f6; padding:3px; position:absolute; top:5px; right:5px; border-radius:5px; }
.carousel-toolbar {position:absolute; top:20px; right:5px; }
.carousel-image img{height:250px; width:100%; border-radius:3px;}
.carousel-item .hover {display:none; }
.carousel-item:hover .hover {display:block;}

/**
 * sidebar-menu
 */
ul.sidebar-menu span.badge {background-color:#3C8DBC; color:#ffffff; float:right; margin-right:10px; }

/**
 * section-wall
 */

section#contentWall ul {display:block; }
.streamingList li .cards-multimedia {position:absolute; top:45px ; }
.streamingList li .tweet {height:100%; }
.streamingList li[data-hasMedia='true'] .e-entry-content {display:none; }
.streamingList li[data-hasMedia='true']:hover .e-entry-content {display:block; position:absolute; bottom:0px; width:98%; background:rgba(0,0,0,0.7); color:#ffffff; }
.streamingList li .media img {max-height:250px;}
.streamingList li  .twitter-tweet {height:300px}

/**section#contentWall ul li {width:23%; }*/

/**
 * twitter widget
 */
p.e-entry-title {font-size:160% !important; }

 /**
  * marker cluster
  */
.marker-cluster ul {position:absolute; top:-5px; left:40px; }
.marker-cluster ul li{width:auto;  padding:3px 5px 3px 5px; border-radius:3px;  margin:0px 0px 0px 0px; background-color:rgba(0,0,0,0.5); line-height:15px; text-align:left;}
.marker-cluster ul li a {font-size:12px;font-weight:bold;color:#ffffff;}
.marker-popup {padding:5px;width:300px;  }
.marker-popup .author {height:50px; display:block;}
.marker-popup .profile-image {border-radius:5px;  float:left; margin-right:10px;  }
.marker-popup .fullname {font-size:14px; font-weight:bold; display:block; margin-left:10px;  }
.marker-popup .account-name {color:#777777; display:block;  margin-left:10px; }
.marker-popup .content p {font-size:14px; margin:10px 0px 10px 0px;  }
.marker-popup .content .time {color:#777777; font-size:12px; }

/**
 * 	navigator
 */
.dashboard-menu li:hover {cursor:pointer;}

/**
 * 	setting floating box
 */
.no-print {display:none;}

/**
 * sidebar search
 */
.sidebar-search {color:#f6f6f6; padding:15px 15px 0px 15px ; width:100%; border-top:1px solid #555555; border-bottom:1px solid #555555; }

/**
* sidebar menu
*/
.filter-menu-content {display:none;}
.cities-menu {padding:0px; margin:0px; }
.cities-menu select {margin-left:33px; width:170px; margin-bottom:10px; padding:2px; }

/**
 * 	box
 */
.box-header p {float:right; margin:13px 10px 0px 0px ; font-style:italic; font-size:14px; color:#777777;}
.box .btn-group {margin:3px 15px; }
.box .btn-group li {font-size:13px; padding:5px; }
.box .btn-group li span {margin-left:5px; }

/**
 *  index
 */
.tweetChange {display:none; }

/**
 * 	table
 */
.table tr:nth-child(n+12) {display:none;}
.expand-arrow {padding:5px; }
.expand-arrow:hover {cursor:pointer; color:#3c8dbc}
.table a:hover{cursor:pointer;}
.tab-pane .table {margin-bottom:0px; }
.titleAnnotation {font-size:14px; color:#777777; margin-left:5px;}

/**
 * trend
 */
.tab-pane {width:98%; margin:auto; position:relative; }
.tab-pane > svg {width: 100% !important; margin:auto; }
#trendDaily {padding:0px; }
#trendDaily .dygraph-axis-label {font-size:12px; color:#555555; }
.box-trend li.loadingHistorical {}
.box-trend li.loadingHistorical img {width:20px; height:20px; }

/**
 * 	navbar
 */
ul#navbar-nav > li {display:none;}
ul#navbar-nav > li:nth-child(4) {display:block;}
.navbar-mainMenu {padding:1px 0px 0px 0px !important; margin-left:20px !important; }
.navbar-mainMenu img {width:25px; opacity:0.9;}
.navbar-mainMenu img:hover {opacity:1;}

/**
 *  trend
 */
.dygraph-legend {top:-45px !important; left:125px !important; width:150px !important; }
.dygraph-legend > span {display:block}
#trendLoading {position:absolute; bottom:20px; left:70px; z-index:100; display:none; }
#trendLoading img {width:20px; height:20px; }
.box-trend .dropdown-menu hr {margin:5px 0px 5px 0px; }

/**
 *  carousel
 */
#carouselContent {height:362px; position:relative; }
.owl-carousel .item  {position:relative; }
.owl-carousel .item img {width:99%; margin:0 auto;  height:322px; display:block; }
.owl-carousel .item .item-count {position:absolute; top:10px; right:10px; border-radius: 50%; width:30px; height:30px; text-align:center; padding-top:4px;  background-color:#ff0000; color:#ffffff; font-weight:bold;  }
.owl-carousel .item .item-description {position:absolute; bottom:0px; left:0px; width:99%; margin:0 0.5% 0 0.5%; background:rgba(0,0,0,0.7); color:#ffffff; padding:10px; }
.owl-carousel .item .item-description a {color:#ffffff;}
.owl-carousel .item .item-description a:hover {text-decoration:underline;}
/**
 * gallery
 */
.leaflet-control-mapGallery {}
.leaflet-control-mapGallery ul {list-style:none;padding:0px; margin:0px;}
.leaflet-control-mapGallery ul li {padding:4px; margin:10px 0px 10px 0px;  text-align:center; box-shadow: 0 1px 7px #999; background: #f8f8f9;-moz-border-radius: 8px; -webkit-border-radius: 8px;border-radius: 8px;}
.leaflet-control-mapGallery ul li:hover {background-color:#eeeeee; cursor:pointer;}
.leaflet-control-mapGallery ul li img {height:28px;}
/**
 * toc thumbnail
 */
.leaflet-control-tocThumbnail {position:relative}
.leaflet-control-tocThumbnail #basemapWidget {display:none; position:absolute; top:0px; right:0px; margin-right:40px; width:300px; }
.leaflet-control-tocThumbnail #basemapWidget ul {list-style:none;padding:0px; margin:0 auto;width:99.9%; height:100%; }
.leaflet-control-tocThumbnail #basemapWidget ul li {text-align:center; width:33%; padding-top:5px; margin:5px 0px 5px 0px; float:left; height:86px;}
.leaflet-control-tocThumbnail #basemapWidget ul li:hover {background-color:#f7f7f7; cursor:pointer;}
.leaflet-control-tocThumbnail #basemapWidget ul li img {width:80px; height:60px; border:1px solid #ffffff;  box-shadow: 0 1px 7px #999; -moz-border-radius: 8px;-webkit-border-radius: 8px;border-radius: 8px;}
.leaflet-control-tocThumbnail #basemapWidget ul li p {font-size:11px; color:#333333; margin:0px; }

/**
 * 	mapTable
 */
.box-map-table > table tr:not(:first-child):hover {cursor:pointer; background-color:#F3F4F5; }
.selectorKeyword {width:95%; padding:1px; margin:2px 0px 2px 0px; }
.userControl {display:none;}

/**
 * 	word cloud
 */
.box-wordcloud .box-body svg {border-width:0px !important; }
.box-wordcloud .box-header {margin-bottom:20px; border-bottom:1px solid #f4f4f4; padding-bottom:0px; }
#bar-wordcloud-title {padding-left:10px; }

/**
 * 	hot discussion
 */
#topStory .tab-pane {height:auto; position: relative;}

/**
 * user menu
 */
#usermenuToken {font-size:12px;}

/**
 *  copyright
 */
#copyright {text-align:left; padding:20px; position:absolute; width:99%; margin:0 auto; }
#copyright > * {display:block; float:left; }
#copyright > img {height:40px; margin:0 auto; }
#copyright > p {font-size:13px; padding:5px 0px 5px 15px; }

/**
 * map popup widget
 */
.mapPopupWidget {display:none; }

/**
 * popup loading
 */
#popupLoadCache {width:100%; height:auto; overflow:hidden; }
#popupLoadCache .modal-content {text-align:center; margin-top:25%;  }
#popupLoadCache .modal-header {}
#popupLoadCache .modal-header img.logo{width:100px; margin:0 auto; margin-top:25px; display:block;  }
#popupLoadCache .modal-body {font-weight:bold; }
#popupLoadCache .modal-body img.loading {margin:0 auto; display:block; margin-bottom:10px; }
#popupLoadCache .modal-footer {background-color:#e5e5e5; text-align:center; }

/**
 * 	popup_topic
 */
#popupTopic .modal-body {font-size:15px; }
#popupTopic .modal-body ul {display:inline-block; width:100%; padding:0px; margin:0px; }
#popupTopic .modal-body ul li {float:left; width:23%; margin:1%; padding:20px; height:100px; display:inline-block; text-align:center; border-radius:5px; border:1px solid #f4f4f4; vertical-align:middle; }
#popupTopic .modal-body ul li:hover {cursor:pointer; background-color:#f1f1f1; box-shadow:3px 3px 10px #cccccc; }
#popupTopic .modal-body ul li > img {width:50px; height:50px; border-radius:50%; box-shadow:1px 1px 10px #aaaaaa; }
#popupTopic .modal-body ol {padding-left:15px; }

/**
 * popup_ebola
 */
#popupEbola {width:70%; overflow:hidden; }
#popupEbola .modal-dialog {width:100%; }
#popupEbola .modal-body {font-size:15px; }
#popupEbola .modal-body h3 {margin-bottom:15px; }
#popupEbola .modal-body > ul {display:inline-block; width:100%; padding:0px; margin:0px;  }
#popupEbola .modal-body > ul > li {float:left; width:48%; margin:1%; height:270px;  padding:20px;  display:inline-block; text-align:center; border-radius:5px; border:1px solid #f4f4f4; vertical-align:middle; }
#popupEbola .modal-body > ul > li:hover {cursor:pointer; background-color:#f1f1f1; box-shadow:3px 3px 10px #cccccc; }
#popupEbola .modal-body > ul > li ul {margin:0 auto; width:95%; text-align:left; display:inline-block; font-size:13px;  }
#popupEbola .modal-body > ul > li ol {margin-left:-30px; }

/**
 * 	popup_dataTable and dataTable
 */
#popupDataTable {overflow:hidden}
#popupDataTable .modal-dialog {width:85%; }
#popupDataTable .modal-content {width:100%;}
#popupDataTable .dataTables_filter {float:right;position:relative; top:-20px; }
#popupDataTable .dataTables_filter input {width:200px; border-radius:5px; padding:5px; }
#popupDataTable .highlightKeyword {color:#ff0000;}
#popupDataTable .dataTables_scrollHead {height:27px; }
#popupDataTable .dataTables_scrollHead table {top:''; position:''; left:''}
#popupDataTable #dataTable th, #popupDataTable #dataTable td {white-space: nowrap; padding:6px 10px 6px 10px; }
#popupDataTable #dataTable tr:hover{background-color:#5e87b0; color:#ffffff; }
#popupDataTable #dataTable tr:hover a {text-decoration:underline; color:#ffffff; }
#popupDataTable .dataTable_info_msg {margin-left:10px; float:left; }
table.dataTable tr.odd {background-color:#F3F4F5}

/**
 * 	popup login
 */
#popupLogin {width:90%; height:auto; overflow:hidden; }
#popupLogin .modal-header {padding:0px; }
#popupLogin .modal-body form { }
#popupLogin .modal-body button.btn {position:relative; }
#popupLogin #loginLoading {width:20px; height:20px; position:absolute; right:5px; top:7px; display:none; }
#popupLogin #loginMsg {position:absolute; right:0px; top:0px; color:#ff0000; display:none;}

/**
 * popup privacy
 */
#popupPrivacy {width:90%; height:auto; overflow:hidden; }
#popupPrivacy .modal-header {position:absolute; border:0px; border-radius:5px; padding:5px; right:0px; }
#popupPrivacy .modal-body {font-size:15px; }

/**
 * popup privacy
 */
#popupFeedback {width:90%; height:90%; overflow:hidden; }
#popupFeedback iframe {width:100%; height:600px;}
#popupFeedback .modal-dialog {width:75% !important; }
#popupFeedback .modal-header {position:absolute; border:0px; border-radius:5px; padding:5px; right:0px; }
#popupFeedback .modal-body {font-size:15px; }

/**
 *   popup loading
 */
#popupLoading {overflow:hidden; width:auto; padding-top:15%; }

/**
 * 	table
 */
.opengraph {position:relative; height:100%; }
.opengraph > div {float:left; padding:1%; height:98%; }
.opengraph .opengraph-thumbnail {max-width:34%; padding:1% 3% 1% 3%;}
.opengraph .opengraph-thumbnail > img {width:80px; height:80px; border-radius:50%; box-shadow:1px 1px 10px #aaaaaa;  }
.opengraph .opengraph-content {max-width:65%; padding:1% 3% 1% 3%; }
.opengraph .opengraph-title {font-weight:bold; font-size:120%; }
.opengraph .opengraph-description {font-size:90%; color:#777777; }

/**
 * 	error topic
 */
#errorTopic {width:50%; height:100%;  margin:0 auto; text-align:center; }
#errorTopic  p {margin-top:50px; }
#errorTopic > ul {padding:0px; margin:0px; list-style:none;}
#errorTopic > ul > li { float:left; width:18%; margin:1%; height:100px; line-height:100px;  border-radius:5px;  }
#errorTopic > ul > li a {color:#ffffff; }

@media (min-width:1200px) {
	#popupEbola .modal-body > ul > li ul {font-size:14px; width:90%; }

}

@media (min-width:1200px) and (max-width:1500px){
	.dygraph-legend {top:0px !important; left:60px !important; }

}

@media (max-width: 767px) {
  #errorTopic > ul > li {width:98%; }

  #popupEbola .modal-body > ul  {width:99%;    }
  #popupEbola .modal-body > ul > li {height:300px; }
  #popupEbola .modal-body > ul > li ul {font-size:11px; padding-left:5px; }

}

@media (max-width: 568px){
	#carouselContent {height:290px; position:relative; }
	.owl-carousel .item img {width:99%; margin:0 auto;  height:250px; display:block; }

}


text:
<link rel="import" href="../../../polymer/polymer.html">
<link rel="import" href="../../../jviz-styles/jviz-styles.html">
<link rel="import" href="../../jviz.html">
<link rel="import" href="../jviz-icon/jviz-icon.html">

<dom-module id="jviz-btn">
  <template>

    <template is="dom-if" if="{{ icon }}">
      <jviz-icon class="btn-icon" icon$="{{ icon }}" color$="{{ color }}" size$="{{ height }}" reflect></jviz-icon>
    </template>
    <template is="dom-if" if="{{ text }}">

{{ text }}

    </template>
  </template>
</dom-module>


text:
import uuid

from django.core.urlresolvers import reverse
from django import http
from django.utils.datastructures import SortedDict

from mox import IgnoreArg  # noqa
from mox import IsA  # noqa

from openstack_dashboard import api
from openstack_dashboard.test import helpers as test

INDEX_URL = reverse('horizon:admin:instances:index')

class InstanceViewTest(test.BaseAdminViewTests):
    @test.create_stubs({api.nova: ('flavor_list', 'server_list',
                                   'extension_supported',),
                        api.keystone: ('tenant_list',),
                        api.network: ('servers_update_addresses',)})
    def test_index(self):
        servers = self.servers.list()
        flavors = self.flavors.list()
        tenants = self.tenants.list()
        api.nova.extension_supported('AdminActions', IsA(http.HttpRequest)) \
            .MultipleTimes().AndReturn(True)
        api.keystone.tenant_list(IsA(http.HttpRequest)).\
                                 AndReturn([tenants, False])
        search_opts = {'marker': None, 'paginate': True}
        api.nova.server_list(IsA(http.HttpRequest),
                             all_tenants=True, search_opts=search_opts) \
                                .AndReturn([servers, False])
        api.network.servers_update_addresses(IsA(http.HttpRequest), servers)
        api.nova.flavor_list(IsA(http.HttpRequest)).AndReturn(flavors)
        self.mox.ReplayAll()

        res = self.client.get(INDEX_URL)
        self.assertTemplateUsed(res, 'admin/instances/index.html')
        instances = res.context['table'].data
        self.assertItemsEqual(instances, servers)

    @test.create_stubs({api.nova: ('flavor_list', 'flavor_get',
                                    'server_list', 'extension_supported',),
                        api.keystone: ('tenant_list',),
                        api.network: ('servers_update_addresses',)})
    def test_index_flavor_list_exception(self):
        servers = self.servers.list()
        tenants = self.tenants.list()
        flavors = self.flavors.list()
        full_flavors = SortedDict([(f.id, f) for f in flavors])

        search_opts = {'marker': None, 'paginate': True}
        api.nova.server_list(IsA(http.HttpRequest),
                             all_tenants=True, search_opts=search_opts) \
                                .AndReturn([servers, False])
        api.network.servers_update_addresses(IsA(http.HttpRequest), servers)
        api.nova.extension_supported('AdminActions', IsA(http.HttpRequest)) \
            .MultipleTimes().AndReturn(True)
        api.nova.flavor_list(IsA(http.HttpRequest)). \
                            AndRaise(self.exceptions.nova)
        api.keystone.tenant_list(IsA(http.HttpRequest)).\
                                 AndReturn([tenants, False])
        for server in servers:
            api.nova.flavor_get(IsA(http.HttpRequest), server.flavor["id"]). \
                AndReturn(full_flavors[server.flavor["id"]])

        self.mox.ReplayAll()

        res = self.client.get(INDEX_URL)
        self.assertTemplateUsed(res, 'admin/instances/index.html')
        instances = res.context['table'].data
        self.assertItemsEqual(instances, servers)

    @test.create_stubs({api.nova: ('flavor_list', 'flavor_get',
                                    'server_list', 'extension_supported', ),
                        api.keystone: ('tenant_list',),
                        api.network: ('servers_update_addresses',)})
    def test_index_flavor_get_exception(self):
        servers = self.servers.list()
        flavors = self.flavors.list()
        tenants = self.tenants.list()
        # UUIDs generated using indexes are unlikely to match
        # any of existing flavor ids and are guaranteed to be deterministic.
        for i, server in enumerate(servers):
            server.flavor['id'] = str(uuid.UUID(int=i))

        search_opts = {'marker': None, 'paginate': True}
        api.nova.server_list(IsA(http.HttpRequest),
                             all_tenants=True, search_opts=search_opts) \
                                .AndReturn([servers, False])
        api.network.servers_update_addresses(IsA(http.HttpRequest), servers)
        api.nova.extension_supported('AdminActions', IsA(http.HttpRequest)) \
            .MultipleTimes().AndReturn(True)
        api.nova.flavor_list(IsA(http.HttpRequest)). \
                            AndReturn(flavors)
        api.keystone.tenant_list(IsA(http.HttpRequest)).\
                                 AndReturn([tenants, False])
        for server in servers:
            api.nova.flavor_get(IsA(http.HttpRequest), server.flavor["id"]). \
                AndRaise(self.exceptions.nova)
        self.mox.ReplayAll()

        res = self.client.get(INDEX_URL)
        instances = res.context['table'].data
        self.assertTemplateUsed(res, 'admin/instances/index.html')
        self.assertMessageCount(res, error=len(servers))
        self.assertItemsEqual(instances, servers)

    @test.create_stubs({api.nova: ('server_list',)})
    def test_index_server_list_exception(self):
        search_opts = {'marker': None, 'paginate': True}
        api.nova.server_list(IsA(http.HttpRequest),
                             all_tenants=True, search_opts=search_opts) \
                                .AndRaise(self.exceptions.nova)

        self.mox.ReplayAll()

        res = self.client.get(INDEX_URL)
        self.assertTemplateUsed(res, 'admin/instances/index.html')
        self.assertEqual(len(res.context['instances_table'].data), 0)

    @test.create_stubs({api.nova: ('server_get', 'flavor_get',
                                   'extension_supported', ),
                        api.keystone: ('tenant_get',)})
    def test_ajax_loading_instances(self):
        server = self.servers.first()
        flavor = self.flavors.list()[0]
        tenant = self.tenants.list()[0]
        api.nova.server_get(IsA(http.HttpRequest), server.id).AndReturn(server)
        api.nova.extension_supported('AdminActions', IsA(http.HttpRequest)) \
            .MultipleTimes().AndReturn(True)
        api.nova.flavor_get(IsA(http.HttpRequest),
                            server.flavor['id']).AndReturn(flavor)
        api.keystone.tenant_get(IsA(http.HttpRequest),
                                server.tenant_id,
                                admin=True).AndReturn(tenant)
        self.mox.ReplayAll()

        url = INDEX_URL + \
                "?action=row_update&table=instances&obj_id=" + server.id

        res = self.client.get(url, {},
                               HTTP_X_REQUESTED_WITH='XMLHttpRequest')

        self.assertTemplateUsed(res, "horizon/common/_data_table_row.html")
        self.assertContains(res, "test_tenant", 1, 200)
        self.assertContains(res, "instance-host", 1, 200)
        # two instances of name, other name comes from row data-display
        self.assertContains(res, "server_1", 2, 200)
        self.assertContains(res, "10.0.0.1", 1, 200)
        self.assertContains(res, "512MB RAM | 1 VCPU | 0Bytes Disk", 1, 200)
        self.assertContains(res, "Active", 1, 200)
        self.assertContains(res, "Running", 1, 200)

    @test.create_stubs({api.nova: ('flavor_list', 'server_list',
                                   'extension_supported', ),
                        api.keystone: ('tenant_list',),
                        api.network: ('servers_update_addresses',)})
    def test_index_options_before_migrate(self):
        servers = self.servers.list()
        api.keystone.tenant_list(IsA(http.HttpRequest)).\
            AndReturn([self.tenants.list(), False])
        search_opts = {'marker': None, 'paginate': True}
        api.nova.server_list(IsA(http.HttpRequest),
                             all_tenants=True, search_opts=search_opts) \
                                .AndReturn([servers, False])
        api.network.servers_update_addresses(IsA(http.HttpRequest), servers)
        api.nova.extension_supported('AdminActions', IsA(http.HttpRequest)) \
            .MultipleTimes().AndReturn(True)
        api.nova.flavor_list(IsA(http.HttpRequest)).\
            AndReturn(self.flavors.list())
        self.mox.ReplayAll()

        res = self.client.get(INDEX_URL)
        self.assertContains(res, "instances__migrate")
        self.assertNotContains(res, "instances__confirm")
        self.assertNotContains(res, "instances__revert")

    @test.create_stubs({api.nova: ('flavor_list', 'server_list',
                                   'extension_supported', ),
                        api.keystone: ('tenant_list',),
                        api.network: ('servers_update_addresses',)})
    def test_index_options_after_migrate(self):
        servers = self.servers.list()
        server1 = servers[0]
        server1.status = "VERIFY_RESIZE"
        server2 = servers[2]
        server2.status = "VERIFY_RESIZE"
        api.keystone.tenant_list(IsA(http.HttpRequest)) \
                    .AndReturn([self.tenants.list(), False])
        search_opts = {'marker': None, 'paginate': True}
        api.nova.extension_supported('AdminActions', IsA(http.HttpRequest)) \
            .MultipleTimes().AndReturn(True)
        api.nova.server_list(IsA(http.HttpRequest),
                             all_tenants=True, search_opts=search_opts) \
                                .AndReturn([servers, False])
        api.network.servers_update_addresses(IsA(http.HttpRequest), servers)
        api.nova.flavor_list(IsA(http.HttpRequest)).\
                             AndReturn(self.flavors.list())
        self.mox.ReplayAll()

        res = self.client.get(INDEX_URL)
        self.assertContains(res, "instances__confirm")
        self.assertContains(res, "instances__revert")
        self.assertNotContains(res, "instances__migrate")

    @test.create_stubs({api.nova: ('hypervisor_list',
                                   'server_get',)})
    def test_instance_live_migrate_get(self):
        server = self.servers.first()
        api.nova.server_get(IsA(http.HttpRequest), server.id) \
                .AndReturn(server)
        api.nova.hypervisor_list(IsA(http.HttpRequest)) \
                .AndReturn(self.hypervisors.list())

        self.mox.ReplayAll()

        url = reverse('horizon:admin:instances:live_migrate',
                      args=[server.id])
        res = self.client.get(url)

        self.assertTemplateUsed(res, 'admin/instances/live_migrate.html')

    @test.create_stubs({api.nova: ('server_get',)})
    def test_instance_live_migrate_get_server_get_exception(self):
        server = self.servers.first()
        api.nova.server_get(IsA(http.HttpRequest), server.id) \
                .AndRaise(self.exceptions.nova)

        self.mox.ReplayAll()

        url = reverse('horizon:admin:instances:live_migrate',
                      args=[server.id])
        res = self.client.get(url)

        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.nova: ('hypervisor_list',
                                   'server_get',)})
    def test_instance_live_migrate_list_hypervisor_get_exception(self):
        server = self.servers.first()
        api.nova.server_get(IsA(http.HttpRequest), server.id) \
                .AndReturn(server)
        api.nova.hypervisor_list(IsA(http.HttpRequest)) \
                .AndRaise(self.exceptions.nova)

        self.mox.ReplayAll()
        url = reverse('horizon:admin:instances:live_migrate',
                      args=[server.id])
        res = self.client.get(url)

        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.nova: ('hypervisor_list',
                                   'server_get',)})
    def test_instance_live_migrate_list_hypervisor_without_current(self):
        server = self.servers.first()
        api.nova.server_get(IsA(http.HttpRequest), server.id) \
                .AndReturn(server)
        api.nova.hypervisor_list(IsA(http.HttpRequest)) \
                .AndReturn(self.hypervisors.list())

        self.mox.ReplayAll()

        url = reverse('horizon:admin:instances:live_migrate',
                      args=[server.id])
        res = self.client.get(url)
        self.assertNotContains(
            res, "<option value=\"devstack003\">devstack003</option>")
        self.assertContains(
            res, "<option value=\"devstack001\">devstack001</option>")
        self.assertContains(
            res, "<option value=\"devstack002\">devstack002</option>")

    @test.create_stubs({api.nova: ('hypervisor_list',
                                   'server_get',
                                   'server_live_migrate',)})
    def test_instance_live_migrate_post(self):
        server = self.servers.first()
        hypervisor = self.hypervisors.first()
        host = hypervisor.hypervisor_hostname

        api.nova.server_get(IsA(http.HttpRequest), server.id) \
                .AndReturn(server)
        api.nova.hypervisor_list(IsA(http.HttpRequest)) \
                .AndReturn(self.hypervisors.list())
        api.nova.server_live_migrate(IsA(http.HttpRequest), server.id, host,
                                     block_migration=False,
                                     disk_over_commit=False) \
                .AndReturn([])

        self.mox.ReplayAll()

        url = reverse('horizon:admin:instances:live_migrate',
                      args=[server.id])
        res = self.client.post(url, {'host': host, 'instance_id': server.id})
        self.assertNoFormErrors(res)
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.nova: ('hypervisor_list',
                                   'server_get',
                                   'server_live_migrate',)})
    def test_instance_live_migrate_post_api_exception(self):
        server = self.servers.first()
        hypervisor = self.hypervisors.first()
        host = hypervisor.hypervisor_hostname

        api.nova.server_get(IsA(http.HttpRequest), server.id) \
                .AndReturn(server)
        api.nova.hypervisor_list(IsA(http.HttpRequest)) \
                .AndReturn(self.hypervisors.list())
        api.nova.server_live_migrate(IsA(http.HttpRequest), server.id, host,
                                     block_migration=False,
                                     disk_over_commit=False) \
                .AndRaise(self.exceptions.nova)

        self.mox.ReplayAll()

        url = reverse('horizon:admin:instances:live_migrate',
                      args=[server.id])
        res = self.client.post(url, {'host': host, 'instance_id': server.id})
        self.assertRedirectsNoFollow(res, INDEX_URL)

    @test.create_stubs({api.nova: ('server_get',)})
    def test_instance_details_exception(self):
        server = self.servers.first()

        api.nova.server_get(IsA(http.HttpRequest), server.id) \
                        .AndRaise(self.exceptions.nova)

        self.mox.ReplayAll()

        url = reverse('horizon:admin:instances:detail',
                      args=[server.id])
        res = self.client.get(url)

        self.assertRedirectsNoFollow(res, INDEX_URL)


text:
<?php
declare(strict_types=1);

class_alias(
    'Cake\Datasource\Paging\Exception\PageOutOfBoundsException',
    'Cake\Datasource\Exception\PageOutOfBoundsException'
);


text:
package org.yeastrc.ms.domain.protinfer;

public class ProteinferInput {

    private int id;
    private int pinferId;
    private int inputId;
//    private InputType inputType;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getProteinferId() {
        return pinferId;
    }
    public void setProteinferId(int pinferId) {
        this.pinferId = pinferId;
    }

    public int getInputId() {
        return inputId;
    }
    public void setInputId(int inputId) {
        this.inputId = inputId;
    }

//    public InputType getInputType() {
//        return this.inputType;
//    }
//
//    public void setInputType(InputType inputType) {
//        this.inputType = inputType;
//    }

    public static enum InputType {
        SEARCH('S'), ANALYSIS('A');

        private char shortName;

        private InputType(char shortName) {this.shortName = shortName;}

        public char getShortName() {return shortName;}

        public static InputType getInputTypeForChar(char shortName) {
            switch (shortName) {
                case 'S': return SEARCH;
                case 'A': return ANALYSIS;
                default:  return null;
            }
        }
    }
}


text:
import ast
import json
import sys

class Visitor(ast.NodeVisitor):
    def __init__(self):
        self.symbols = {"classes": [], "methods": [], "functions": []}

    def visit_Module(self, node):
        self.visitChildren(node)

    def visitChildren(self, node, namespace=""):
        for child in node.body:
            if isinstance(child, ast.FunctionDef):
                self.visitDef(child, namespace)
            if isinstance(child, ast.ClassDef):
                self.visitClassDef(child, namespace)
            try:
                if isinstance(child, ast.AsyncFunctionDef):
                    self.visitDef(child, namespace)
            except Exception:
                pass

    def visitDef(self, node, namespace=""):
        end_position = self.getEndPosition(node)
        symbol = "functions" if namespace == "" else "methods"
        self.symbols[symbol].append(self.getDataObject(node, namespace))

    def visitClassDef(self, node, namespace=""):
        end_position = self.getEndPosition(node)
        self.symbols['classes'].append(self.getDataObject(node, namespace))

        if len(namespace) > 0:
            namespace = "{0}::{1}".format(namespace, node.name)
        else:
            namespace = node.name
        self.visitChildren(node, namespace)

    def getDataObject(self, node, namespace=""):
        end_position = self.getEndPosition(node)
        return {
            "namespace": namespace,
            "name": node.name,
            "range": {
                "start": {
                    "line": node.lineno - 1,
                    "character": node.col_offset
                },
                "end": {
                    "line": end_position[0],
                    "character": end_position[1]
                }
            }
        }

    def getEndPosition(self, node):
        if not hasattr(node, 'body') or len(node.body) == 0:
            return (node.lineno - 1, node.col_offset)
        return self.getEndPosition(node.body[-1])

def provide_symbols(source):
    """Provides a list of all symbols in provided code.

    The list comprises of 3-item tuples that contain the starting line number,
    ending line number and whether the statement is a single line.

    """
    tree = ast.parse(source)
    visitor = Visitor()
    visitor.visit(tree)
    sys.stdout.write(json.dumps(visitor.symbols))
    sys.stdout.flush()

if __name__ == "__main__":
    if len(sys.argv) == 3:
        contents = sys.argv[2]
    else:
        with open(sys.argv[1], "r") as source:
            contents = source.read()

    try:
        default_encoding = sys.getdefaultencoding()
        encoded_contents = contents.encode(default_encoding, 'surrogateescape')
        contents = encoded_contents.decode(default_encoding, 'replace')
    except (UnicodeError, LookupError):
        pass
    if isinstance(contents, bytes):
        contents = contents.decode('utf8')
    provide_symbols(contents)


text:
import VSpeedDial from './VSpeedDial'

export { VSpeedDial }
export default VSpeedDial


text:
package com.thinkbiganalytics.nifi.savepoint.model;

import java.io.Serializable;

public class SavepointReplayEvent implements Serializable{

    private Long jobExecutionId;
    private String flowfileId;
    public enum Action {
        RETRY, RELEASE
    }
    private Action action;

    public SavepointReplayEvent(){

    }

    public Long getJobExecutionId() {
        return jobExecutionId;
    }

    public void setJobExecutionId(Long jobExecutionId) {
        this.jobExecutionId = jobExecutionId;
    }

    public String getFlowfileId() {
        return flowfileId;
    }

    public void setFlowfileId(String flowfileId) {
        this.flowfileId = flowfileId;
    }

    public Action getAction() {
        return action;
    }

    public void setAction(Action action) {
        this.action = action;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("SavepointReplayEvent{");
        sb.append("flowfileId='").append(flowfileId).append('\'');
        sb.append(", action=").append(action);
        sb.append('}');
        return sb.toString();
    }
}