text:
package me.st28.flexseries.flexcore.util;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * Various utility methods for Strings.
 */
public final class StringUtils {

    private StringUtils() { }

    public static <T> String collectionToString(Collection<T> collection, StringConverter<T> converter) {
        return collectionToString(collection, converter, " ");
    }

    public static <T> String collectionToString(Collection<T> collection, StringConverter<T> converter, String delimiter) {
        return collectionToString(collection, converter, delimiter, null);
    }

    public static <T> String collectionToString(Collection<T> collection, StringConverter<T> converter, String delimiter, String defaultValue) {
        if (collection == null) return "";

        StringBuilder sb = new StringBuilder();
        for (T item : collection) {
            if (sb.length() > 0) {
                sb.append(delimiter);
            }
            sb.append(converter.toString(item));
        }
        return sb.length() == 0 ? defaultValue : sb.toString();
    }

    public static <T> List<String> collectionToStringList(Collection<T> collection, StringConverter<T> converter) {
        List<String> returnList = new ArrayList<>();
        for (T item : collection) {
            returnList.add(converter.toString(item));
        }
        return returnList;
    }

    public static <T, F extends Collection<String>>  F collectionToStringCollection(Collection<T> collection, StringConverter<T> converter, F returnCollection) {
        for (T item : collection) {
            returnCollection.add(converter.toString(item));
        }
        return returnCollection;
    }

    public static String stringCollectionToString(Collection<String> collection) {
        return stringCollectionToString(collection, " ");
    }

    /**
     * Converts a string collection into a clean string.
     *
     * @param collection The collection to convert.
     * @param delimiter What to place between the strings from the collection.
     * @return A string containing the contents of the collection, separated by the given delimiter.
     */
    public static String stringCollectionToString(Collection<String> collection, String delimiter) {
        return stringCollectionToString(collection, delimiter, null);
    }

    public static String stringCollectionToString(Collection<String> collection, String delimiter, String defaultValue) {
        return collectionToString(collection, new StringConverter<String>() {
            @Override
            public String toString(String string) {
                return string;
            }
        }, delimiter, defaultValue);
    }

    /**
     * * @see #stringCollectionToString(java.util.Collection)
     */
    @Deprecated
    public static String stringListToString(List<String> list) {
        return StringUtils.stringCollectionToString(list, " ");
    }

    /**
     * @see #stringCollectionToString(java.util.Collection, String)
     */
    @Deprecated
    public static String stringListToString(List<String> list, String delimiter) {
        return StringUtils.stringCollectionToString(list, delimiter);
    }

    public static String[] splitStringByLength(String input, int length) {
        List<String> output = new ArrayList<>();

        while (input.length() > length) {
            output.add(input.substring(0, length));
            input = input.substring(length);
        }

        if (input.length() > 0) {
            output.add(input);
        }

        return output.toArray(new String[output.size()]);
    }

    public static boolean equalsIgnoreCaseMultiple(String input, String... other) {
        for (String str: other) {
            if (input.equalsIgnoreCase(str)) {
                return true;
            }
        }
        return false;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package repetition.exercises.solutions.array;

import java.util.*;

public class Exercise24 {
	public static void main(String[] args) {

		int totalNum;
		int[] numbers = new int[] { 1, 2, 3, 4, 6, 7 };
		totalNum = 7;
		int expectedNumSum = totalNum * ((totalNum + 1) / 2);
		int numSum = 0;
		for (int i : numbers) {
			numSum += i;
		}
		System.out.print(expectedNumSum - numSum);
		System.out.print("\n");
	}
}


text:
#ifndef VRMAININTERFACE_H
#define VRMAININTERFACE_H

#include <display/VRGraphicsToolkit.h>
#include <display/VRWindowToolkit.h>
#include <input/VRInputDevice.h>
#include <main/VREventHandler.h>
#include <main/VRRenderHandler.h>
#include <main/VRError.h>

namespace MinVR {

class VRFactory;

/** The hooks needed for plugins to communicate with VRMain are defined
    here in an abstract base class that should have only minimal changes
    as MinVR evolves.  This is to avoid versioning issues where even a
    small change in the implementation of VRMain or VRFactory might
    force all the plugins to need to be recompiled.
*/
class VRMainInterface {
public:
  virtual void addEventHandler(VREventHandler *eHandler) = 0;
  virtual void addRenderHandler(VRRenderHandler *rHandler) = 0;
  virtual void addInputDevice(VRInputDevice *dev) = 0;
  virtual VRDataIndex* getConfig() = 0;
  virtual VRGraphicsToolkit* getGraphicsToolkit(const std::string &name) = 0;
  virtual VRWindowToolkit* getWindowToolkit(const std::string &name) = 0;
  virtual VRFactory* getFactory() = 0;
  virtual void addPluginSearchPath(const std::string& path) = 0;
  virtual int getArgc() = 0;
  virtual char** getArgv() = 0;
};

} // end namespace

#endif


text:
from __future__ import absolute_import, division, print_function

# Import astronomical modules
from astropy.units import Unit

# Import the relevant PTS classes and modules
from .component import AnalysisComponent
from ...core.tools.logging import log
from ...core.tools import filesystem as fs
from ..core.sed import SED
from ..core.attenuation import AttenuationCurve, SMCAttenuationCurve, MilkyWayAttenuationCurve, CalzettiAttenuationCurve, BattistiAttenuationCurve
from ...core.plot.attenuation import AttenuationPlotter

# -----------------------------------------------------------------

# IR-through-UV extinction curve (Fitzpatrick+, 2007):
# http://vizier.cfa.harvard.edu/viz-bin/VizieR?-source=J/ApJ/663/320
#  - J/ApJ/663/320/stars: Survey stars (tables 1, 3 and 4 of paper) (328 rows)

# UVOT imaging of M81 and Holmberg IX (Hoversten+, 2011):
#  - J/AJ/141/205/table3: Source photometry and fitted parameters
#    http://vizier.cfa.harvard.edu/viz-bin/VizieR-3?-source=J/AJ/141/205/table3
#  -> has "AV": Best fitting internal extinction A_V

# -----------------------------------------------------------------

class AttenuationAnalyser(AnalysisComponent):

    """
    This class...
    """

    def __init__(self, config=None):

        """
        The constructor ...
        :param config:
        :return:
        """

        # Call the constructor of the base class
        super(AttenuationAnalyser, self).__init__(config)

        # -- Attributes --

        # The SEDs
        self.total_sed = None
        self.transparent_sed = None

        # The attenuation curves
        self.attenuation_sfr = None
        self.attenuation_diffuse = None
        self.attenuation_total = None

        # The reference attenuation curves
        self.references = dict()

    # -----------------------------------------------------------------

    @classmethod
    def from_arguments(cls, arguments):

        """
        This function ...
        :param arguments:
        :return:
        """

        # Create a new AttenuationAnalyser instance
        analyser = cls()

        # Set the modeling path
        analyser.config.path = arguments.path

        # Return the new instance
        return analyser

    # -----------------------------------------------------------------

    def run(self):

        """
        This function ...
        :return:
        """

        # 1. Call the setup function
        self.setup()

        # 2. Load the simulated SEDs
        self.load_seds()

        # 3. Calculate the attenuation curve
        self.calculate_attenuation()

        # 4. Get the reference attenuation curves
        self.get_references()

        # 5. Writing
        self.write()

        # 6. Plotting
        self.plot()

    # -----------------------------------------------------------------

    def setup(self):

        """
        This function ...
        :return:
        """

        # Call the setup function of the base class
        super(AttenuationAnalyser, self).setup()

    # -----------------------------------------------------------------

    def load_seds(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Loading the simulated total and transparent SED ...")

        # Determine the path to the SED file corresponding to the 'earth' instrument
        sed_path = fs.join(self.analysis_out_path, self.galaxy_name + "_earth_sed.dat")

        # Load the total SED
        self.total_sed = SED.from_skirt(sed_path, contribution="total")

        # Load the transparent SED
        self.transparent_sed = SED.from_skirt(sed_path, contribution="transparent")

    # -----------------------------------------------------------------

    def calculate_attenuation(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Calculating the attenuations ...")

        # The wavelength of the V band
        v_band_wavelength = 0.55 * Unit("micron")

        # Calculate the attenuations of the dust in star-forming regions
        #self.attenuation_sfr = AttenuationCurve()
        # Find the V-band attenuation for the SFR dust
        #v_band_attenuation_sfr = self.attenuation_sfr.attenuation_at(v_band_wavelength)

        # Calculate the attenuations of the diffuse dust component
        self.attenuation_diffuse = AttenuationCurve.from_seds(self.total_sed, self.transparent_sed)

        # Find the V-band attenuation for the diffuse dust component
        v_band_attenuation_diffuse = self.attenuation_diffuse.attenuation_at(v_band_wavelength)

        # Normalize the attenuation curve to the V-band attenuation
        self.attenuation_diffuse.normalize_at(v_band_wavelength)

        # SED of transparent + delta flux mappings
        #transparent_sfr_sed = self.transparent_sed + delta_flux_mappings

        # Calculate the attenuations for all the dust
        #self.attenuation_total = AttenuationCurve.from_seds(self.total_sed, transparent_sfr_sed)
        # Find the total V-band attenuation
        #v_band_attenuation_total = self.attenuation_total.attenuation_at(v_band_wavelength)

        #print(' V band attenuation from star-forming regions:   ' + str(att_mappings_V))
        print(' V band attenuation from diffuse dust: ' + str(v_band_attenuation_diffuse))
        #print(' total V band attenuation:          ' + str(att_tot_V))

        #proportion = delta_flux_mappings / (modTrans - modFlux)

        #print(' V band energy fraction of mappings attenuation to total: ' + str(proportion[np.argmin(np.abs(modWls - 0.55))]))
        #print(' NUV band energy fraction of mappings attenuation to total: ' + str(proportion[np.argmin(np.abs(modWls - 0.227))]))
        #print(' FUV band energy fraction of mappings attenuation to total: ' + str(proportion[np.argmin(np.abs(modWls - 0.153))]))
        #print(' Mean energy fraction of mappings attenuation to total:   ' + str(np.mean(proportion[modWls < 5])))
        #print(' Median energy fraction of mappings attenuation to total: ' + str(np.median(proportion[modWls < 5])))

    # -----------------------------------------------------------------

    def calculate_attenuation_mapping(self):

        """
        This function ...
        :return:
        """

        # refAtt_MAPPINGS = "Files/AttenuationLawMAPPINGS.dat"
        # refSED_MAPPINGS = "SKIRTrun/models/testHeating/MappingsHeating/mappings_i0_sed.dat"

        # input = np.loadtxt(refAtt_MAPPINGS)
        # wl_mappings = input[:, 0]  # wl in micron from long to short wl.
        # abs_mappings = input[:, 1]  # factor
        # V band attenuation = total dust mass / total surface of M31 / 1e5 * 0.67 see data file.
        # Av_mappings = 2143279.799 / (0.137 ** 2 * 15230) / 1e5 * 0.67
        # Attenuation law (not normalized). abs for V band is 2.23403e-01
        # A_mappings = abs_mappings / 2.23403e-01 * Av_mappings
        # Create interpolation function
        # A_interpfunc = interpolate.interp1d(wl_mappings, A_mappings, kind='linear')

        # load the MAPPINGS SED
        # input = np.loadtxt(refSED_MAPPINGS)
        # flux_mappings = input[:, 1]  # in Jy

        # atts_mappings = A_interpfunc(modWls)  # Attenuation from dust in star forming regions
        # delta_flux_mappings = flux_mappings * (10 ** (atts_mappings / 2.5) - 1)  # additional flux from mappings attenuation

        pass

    # -----------------------------------------------------------------

    def get_references(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Loading the reference attenuation curves ...")

        # Load the Milky Way, SMC and Calzetti attenuation curves
        self.references["Milky Way"] = MilkyWayAttenuationCurve()
        self.references["SMC"] = SMCAttenuationCurve()
        self.references["Calzetti"] = CalzettiAttenuationCurve()
        self.references["Battisti"] = BattistiAttenuationCurve()

    # -----------------------------------------------------------------

    def write(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Writing ...")

        # Write the attenuation curves
        self.write_attenuations()

    # -----------------------------------------------------------------

    def write_attenuations(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Writing the attenuations ...")

        # Determine the path to the SFR attenuation file
        sfr_path = fs.join(self.analysis_attenuation_path, "sfr.dat")

        # Determine the path to the diffuse dust attenuation file
        diffuse_path = fs.join(self.analysis_attenuation_path, "diffuse.dat")

        # Determine the path to the total dust attenuation file
        total_path = fs.join(self.analysis_attenuation_path, "total.dat")

        # Write the diffuse dust attenuations
        self.attenuation_diffuse.save(diffuse_path)

    # -----------------------------------------------------------------

    def plot(self):

        """
        This function ...
        :return:
        """

        # Inform the user
        log.info("Plotting ...")

        # Create a new AttenuationPlotter instance
        plotter = AttenuationPlotter()

        # Add the diffuse attenuation curve
        plotter.add_attenuation_curve(self.attenuation_diffuse, "diffuse")

        # Add the reference attenuation curves
        for name in self.references: plotter.add_attenuation_curve(self.references[name], name)

        # Determine the path to the diffuse attenuation plot file
        diffuse_path = fs.join(self.analysis_attenuation_path, "diffuse.pdf")

        # Run the plotter
        plotter.run(diffuse_path)

# -----------------------------------------------------------------


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

'use strict';

/**
 * Scrollable thumbnail ribbon at the bottom of the Gallery in the Slide mode.
 *
 * @param {Document} document Document.
 * @param {MetadataCache} metadataCache MetadataCache instance.
 * @param {cr.ui.ArrayDataModel} dataModel Data model.
 * @param {cr.ui.ListSelectionModel} selectionModel Selection model.
 * @param {function(string)} onThumbnailError Thumbnail load error handler.
 * @return {Element} Ribbon element.
 * @constructor
 */
function Ribbon(document, metadataCache, dataModel, selectionModel,
                onThumbnailError) {
  var self = document.createElement('div');
  Ribbon.decorate(self,
      metadataCache, dataModel, selectionModel, onThumbnailError);
  return self;
}

/**
 * Inherit from HTMLDivElement.
 */
Ribbon.prototype.__proto__ = HTMLDivElement.prototype;

/**
 * Decorate a Ribbon instance.
 *
 * @param {Ribbon} self Self pointer.
 * @param {MetadataCache} metadataCache MetadataCache instance.
 * @param {cr.ui.ArrayDataModel} dataModel Data model.
 * @param {cr.ui.ListSelectionModel} selectionModel Selection model.
 * @param {function(string)} onThumbnailError Thumbnail load error handler.
 */
Ribbon.decorate = function(self, metadataCache, dataModel, selectionModel,
                           onThumbnailError) {
  self.__proto__ = Ribbon.prototype;
  self.metadataCache_ = metadataCache;
  self.dataModel_ = dataModel;
  self.selectionModel_ = selectionModel;
  self.onThumbnailError_ = onThumbnailError;

  self.className = 'ribbon';
};

/**
 * Max number of thumbnails in the ribbon.
 * @type {number}
 */
Ribbon.ITEMS_COUNT = 5;

/**
 * Force redraw the ribbon.
 */
Ribbon.prototype.redraw = function() {
  this.onSelection_();
};

/**
 * Clear all cached data to force full redraw on the next selection change.
 */
Ribbon.prototype.reset = function() {
  this.renderCache_ = {};
  this.firstVisibleIndex_ = 0;
  this.lastVisibleIndex_ = -1;  // Zero thumbnails
};

/**
 * Enable the ribbon.
 */
Ribbon.prototype.enable = function() {
  this.onContentBound_ = this.onContentChange_.bind(this);
  this.dataModel_.addEventListener('content', this.onContentBound_);

  this.onSpliceBound_ = this.onSplice_.bind(this);
  this.dataModel_.addEventListener('splice', this.onSpliceBound_);

  this.onSelectionBound_ = this.onSelection_.bind(this);
  this.selectionModel_.addEventListener('change', this.onSelectionBound_);

  this.reset();
  this.redraw();
};

/**
 * Disable ribbon.
 */
Ribbon.prototype.disable = function() {
  this.dataModel_.removeEventListener('content', this.onContentBound_);
  this.dataModel_.removeEventListener('splice', this.onSpliceBound_);
  this.selectionModel_.removeEventListener('change', this.onSelectionBound_);

  this.removeVanishing_();
  this.textContent = '';
};

/**
 * Data model splice handler.
 * @param {Event} event Event.
 * @private
 */
Ribbon.prototype.onSplice_ = function(event) {
  if (event.removed.length == 0)
    return;

  if (event.removed.length > 1) {
    console.error('Cannot remove multiple items');
    return;
  }

  var removed = this.renderCache_[event.removed[0].getUrl()];
  if (!removed || !removed.parentNode || !removed.hasAttribute('selected')) {
    console.error('Can only remove the selected item');
    return;
  }

  var persistentNodes = this.querySelectorAll('.ribbon-image:not([vanishing])');
  if (this.lastVisibleIndex_ < this.dataModel_.length) { // Not at the end.
    var lastNode = persistentNodes[persistentNodes.length - 1];
    if (lastNode.nextSibling) {
      // Pull back a vanishing node from the right.
      lastNode.nextSibling.removeAttribute('vanishing');
    } else {
      // Push a new item at the right end.
      this.appendChild(this.renderThumbnail_(this.lastVisibleIndex_));
    }
  } else {
    // No items to the right, move the window to the left.
    this.lastVisibleIndex_--;
    if (this.firstVisibleIndex_) {
      this.firstVisibleIndex_--;
      var firstNode = persistentNodes[0];
      if (firstNode.previousSibling) {
        // Pull back a vanishing node from the left.
        firstNode.previousSibling.removeAttribute('vanishing');
      } else {
        // Push a new item at the left end.
        var newThumbnail = this.renderThumbnail_(this.firstVisibleIndex_);
        newThumbnail.style.marginLeft = -(this.clientHeight - 2) + 'px';
        this.insertBefore(newThumbnail, this.firstChild);
        setTimeout(function() {
          newThumbnail.style.marginLeft = '0';
        }, 0);
      }
    }
  }

  removed.removeAttribute('selected');
  removed.setAttribute('vanishing', 'smooth');
  this.scheduleRemove_();
};

/**
 * Selection change handler.
 * @private
 */
Ribbon.prototype.onSelection_ = function() {
  var indexes = this.selectionModel_.selectedIndexes;
  if (indexes.length == 0)
    return;  // Ignore temporary empty selection.
  var selectedIndex = indexes[0];

  var length = this.dataModel_.length;

  // TODO(dgozman): use margin instead of 2 here.
  var itemWidth = this.clientHeight - 2;
  var fullItems = Ribbon.ITEMS_COUNT;
  fullItems = Math.min(fullItems, length);
  var right = Math.floor((fullItems - 1) / 2);

  var fullWidth = fullItems * itemWidth;
  this.style.width = fullWidth + 'px';

  var lastIndex = selectedIndex + right;
  lastIndex = Math.max(lastIndex, fullItems - 1);
  lastIndex = Math.min(lastIndex, length - 1);
  var firstIndex = lastIndex - fullItems + 1;

  if (this.firstVisibleIndex_ != firstIndex ||
      this.lastVisibleIndex_ != lastIndex) {

    if (this.lastVisibleIndex_ == -1) {
      this.firstVisibleIndex_ = firstIndex;
      this.lastVisibleIndex_ = lastIndex;
    }

    this.removeVanishing_();

    this.textContent = '';
    var startIndex = Math.min(firstIndex, this.firstVisibleIndex_);
    // All the items except the first one treated equally.
    for (var index = startIndex + 1;
         index <= Math.max(lastIndex, this.lastVisibleIndex_);
         ++index) {
      // Only add items that are in either old or the new viewport.
      if (this.lastVisibleIndex_ < index && index < firstIndex ||
          lastIndex < index && index < this.firstVisibleIndex_)
        continue;
      var box = this.renderThumbnail_(index);
      box.style.marginLeft = '0';
      this.appendChild(box);
      if (index < firstIndex || index > lastIndex) {
        // If the node is not in the new viewport we only need it while
        // the animation is playing out.
        box.setAttribute('vanishing', 'slide');
      }
    }

    var slideCount = this.childNodes.length + 1 - Ribbon.ITEMS_COUNT;
    var margin = itemWidth * slideCount;
    var startBox = this.renderThumbnail_(startIndex);
    if (startIndex == firstIndex) {
      // Sliding to the right.
      startBox.style.marginLeft = -margin + 'px';
      if (this.firstChild)
        this.insertBefore(startBox, this.firstChild);
      else
        this.appendChild(startBox);
      setTimeout(function() {
        startBox.style.marginLeft = '0';
      }, 0);
    } else {
      // Sliding to the left. Start item will become invisible and should be
      // removed afterwards.
      startBox.setAttribute('vanishing', 'slide');
      startBox.style.marginLeft = '0';
      if (this.firstChild)
        this.insertBefore(startBox, this.firstChild);
      else
        this.appendChild(startBox);
      setTimeout(function() {
        startBox.style.marginLeft = -margin + 'px';
      }, 0);
    }

    ImageUtil.setClass(this, 'fade-left',
        firstIndex > 0 && selectedIndex != firstIndex);

    ImageUtil.setClass(this, 'fade-right',
        lastIndex < length - 1 && selectedIndex != lastIndex);

    this.firstVisibleIndex_ = firstIndex;
    this.lastVisibleIndex_ = lastIndex;

    this.scheduleRemove_();
  }

  var oldSelected = this.querySelector('[selected]');
  if (oldSelected) oldSelected.removeAttribute('selected');

  var newSelected =
      this.renderCache_[this.dataModel_.item(selectedIndex).getUrl()];
  if (newSelected) newSelected.setAttribute('selected', true);
};

/**
 * Schedule the removal of thumbnails marked as vanishing.
 * @private
 */
Ribbon.prototype.scheduleRemove_ = function() {
  if (this.removeTimeout_)
    clearTimeout(this.removeTimeout_);

  this.removeTimeout_ = setTimeout(function() {
    this.removeTimeout_ = null;
    this.removeVanishing_();
  }.bind(this), 200);
};

/**
 * Remove all thumbnails marked as vanishing.
 * @private
 */
Ribbon.prototype.removeVanishing_ = function() {
  if (this.removeTimeout_) {
    clearTimeout(this.removeTimeout_);
    this.removeTimeout_ = 0;
  }
  var vanishingNodes = this.querySelectorAll('[vanishing]');
  for (var i = 0; i != vanishingNodes.length; i++) {
    vanishingNodes[i].removeAttribute('vanishing');
    this.removeChild(vanishingNodes[i]);
  }
};

/**
 * Create a DOM element for a thumbnail.
 *
 * @param {number} index Item index.
 * @return {Element} Newly created element.
 * @private
 */
Ribbon.prototype.renderThumbnail_ = function(index) {
  var item = this.dataModel_.item(index);
  var url = item.getUrl();

  var cached = this.renderCache_[url];
  if (cached)
    return cached;

  var thumbnail = this.ownerDocument.createElement('div');
  thumbnail.className = 'ribbon-image';
  thumbnail.addEventListener('click', function() {
    var index = this.dataModel_.indexOf(item);
    this.selectionModel_.unselectAll();
    this.selectionModel_.setIndexSelected(index, true);
  }.bind(this));

  util.createChild(thumbnail, 'image-wrapper');

  this.metadataCache_.get(url, Gallery.METADATA_TYPE,
      this.setThumbnailImage_.bind(this, thumbnail, url));

  // TODO: Implement LRU eviction.
  // Never evict the thumbnails that are currently in the DOM because we rely
  // on this cache to find them by URL.
  this.renderCache_[url] = thumbnail;
  return thumbnail;
};

/**
 * Set the thumbnail image.
 *
 * @param {Element} thumbnail Thumbnail element.
 * @param {string} url Image url.
 * @param {Object} metadata Metadata.
 * @private
 */
Ribbon.prototype.setThumbnailImage_ = function(thumbnail, url, metadata) {
  new ThumbnailLoader(url, ThumbnailLoader.LoaderType.IMAGE, metadata).load(
      thumbnail.querySelector('.image-wrapper'),
      ThumbnailLoader.FillMode.FILL /* fill */,
      ThumbnailLoader.OptimizationMode.NEVER_DISCARD,
      null /* success callback */,
      this.onThumbnailError_.bind(null, url));
};

/**
 * Content change handler.
 *
 * @param {Event} event Event.
 * @private
 */
Ribbon.prototype.onContentChange_ = function(event) {
  var url = event.item.getUrl();
  this.remapCache_(event.oldUrl, url);

  var thumbnail = this.renderCache_[url];
  if (thumbnail && event.metadata)
    this.setThumbnailImage_(thumbnail, url, event.metadata);
};

/**
 * Update the thumbnail element cache.
 *
 * @param {string} oldUrl Old url.
 * @param {string} newUrl New url.
 * @private
 */
Ribbon.prototype.remapCache_ = function(oldUrl, newUrl) {
  if (oldUrl != newUrl && (oldUrl in this.renderCache_)) {
    this.renderCache_[newUrl] = this.renderCache_[oldUrl];
    delete this.renderCache_[oldUrl];
  }
};


text:
class AddOpenstackFieldsToCloudNetworks < ActiveRecord::Migration
  def change
    add_column :cloud_networks, :status, :string
    add_column :cloud_networks, :enabled, :boolean
    add_column :cloud_networks, :external_facing, :boolean
  end
end


text:
package org.apache.geode.management.internal.cli.commands;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.io.IOException;

import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import org.apache.geode.test.compiler.JarBuilder;
import org.apache.geode.test.junit.categories.AcceptanceTest;
import org.apache.geode.test.junit.rules.gfsh.GfshExecution;
import org.apache.geode.test.junit.rules.gfsh.GfshRule;
import org.apache.geode.test.junit.rules.gfsh.GfshScript;

@Category(AcceptanceTest.class)
public class DestroyIndexIfExistsTest {

  @Rule
  public GfshRule gfsh = new GfshRule();

  @Test
  public void destroyIndexIfExists() throws Exception {
    GfshExecution execution =
        GfshScript.of("start locator --name=locator", "start server --name=server",
            "sleep --time=1", "destroy index --name=i1 --if-exists=true").execute(gfsh);

    assertThat(execution.getOutputText()).contains("Index i1 not found - skipped");
  }
}


text:
* Install go tooling
    * https://golang.org
    * Or use *brew install go*
* Execute *go build*

## Configuration

Requires a configuration file named "pget.json" with customer_id and pin in one of the following locations:

* /etc/pget/
* $HOME/.pget/
* ./

**Example:**

```json
{
  "customer_id": "",
  "pin": ""
}
```

## Usage

Using *--help* on commands gives you further options

```
usage: pget [<flags>] <command> [<args> ...]

Premiumize Get

Flags:
  --help   Show context-sensitive help (also try --help-long and --help-man).
  --debug  Dump parsed premiumize.me responses

Commands:
  help [<command>...]
    Show help.

  list
    List torrents

  tree [<name>]
    Print tree of the torrent files

  download [<flags>] [<name>]
    Downloads the content of a given torrent

  upload [<link>]
    Upload a torrent file or magnet link

  watch [<flags>]
    Watch for local or remote files to upload/download
```

## Example

The following will

* Upload torrent or magnet files from the ./upload directory (--upload)
* Download finished downloads to the ./download directory (--download)
* Ignore directory hierarchies (--flatten)
* Only download video files (--video-only)
* Only load stuff that has previously been uploaded (--strict)

```bash
./pget watch --upload upload --download download --video-only --flatten --strict
```


text:
Puppet::Type.type(:quantum_plugin_cisco).provide(
  :ini_setting,
  :parent => Puppet::Type.type(:ini_setting).provider(:ruby)
) do

  def section
    resource[:name].split('/', 2).first
  end

  def setting
    resource[:name].split('/', 2).last
  end

  def separator
    '='
  end

  def file_path
    '/etc/quantum/plugins/cisco/cisco_plugins.ini'
  end

end


text:
"""
Dataset
"""

from os.path import dirname, join

import numpy as np
from numpy import ma
from scipy import io

from ..utils import Bunch, check_random_state

def load_robot():
    """Load and return synthetic robot state data (state estimation)

    =================================
    Number of time steps          501
    Dimensionality of Observations  2
    Dimensionality of States        5
    =================================

    Returns
    -------
    data : Bunch
        Dictionary-like object containing all data.  Access attributes as you
        would the contents of a dictionary or of an object.

    Examples
    --------
    >>> from pykalman.datasets import load_robot
    >>> data = load_robot()
    >>> data.data.shape
    (501, 2)
    """
    def pad_and_mask(X):
        """Pad X's first index with zeros and mask it"""
        zeros = np.zeros(X.shape[1:])[np.newaxis]
        X = np.vstack([zeros, X])
        mask = np.zeros(X.shape)
        mask[0] = True
        return ma.array(X, mask=mask)

    module_path = dirname(__file__)
    data = io.loadmat(join(module_path, 'data', 'robot.mat'))
    descr = open(join(module_path, 'descr', 'robot.rst')).read()
    Z = pad_and_mask(data['y'].T)
    X = data['x'].T
    A = data['A']
    b = data['b'].T
    C = data['C']
    d = data['d'][:, 0]
    Q_0 = 10.0 * np.eye(5)
    R_0 = 10.0 * np.eye(2)
    Q = data['Q']
    R = data['R']
    x_0 = data['x0'][:, 0]
    V_0 = data['P_0']
    X_filt = data['xfilt'].T
    V_filt = data['Vfilt'][0]
    ll = data['ll'][0]
    X_smooth = data['xsmooth'].T
    V_smooth = data['Vsmooth'][0]
    T = Z.shape[0]

    # V_filt is actually an object array where each object is a 2D array.
    # Convert it to a proper, 3D array.  Likewise for V_smooth.
    V_filt = np.asarray([V_filt[t] for t in range(V_filt.shape[0])])
    V_smooth = np.asarray([V_smooth[t] for t in range(V_smooth.shape[0])])

    return Bunch(n_timesteps=T, observations=Z, states=X, transition_matrix=A,
        transition_offsets=b, observation_matrix=C, observation_offset=d,
        initial_transition_covariance=Q_0, initial_observation_covariance=R_0,
        transition_covariance=Q, observation_covariance=R,
        initial_state_mean=x_0, initial_state_covariance=V_0,
        filtered_state_means=X_filt, filtered_state_covariances=V_filt,
        loglikelihoods=ll, smoothed_state_means=X_smooth,
        smoothed_state_covariances=V_smooth, DESCR=descr)


text:
> Documentation and test modifications are not included in this changelog. For more details, see [full commit history](https://github.com/liferay/alloy-ui/commits/master/src/aui-pagination).

## @VERSION@

No registries yet.

## [3.0.0](https://github.com/liferay/alloy-ui/releases/tag/3.0.0)

* [AUI-1174](https://issues.liferay.com/browse/AUI-1174) Validate source code with JSHint
* [AUI-1274](https://issues.liferay.com/browse/AUI-1274) AUI Pagination setState() and _uiSetPage() are not in sync
* [AUI-1267](https://issues.liferay.com/browse/AUI-1267) Move CSS classes from Alloy Bootstrap to AlloyUI
* [AUI-1234](https://issues.liferay.com/browse/AUI-1234) Change Pagination CSS class from container `<div>` to content `<ul>` on Bootstrap 3

## [2.5.0](https://github.com/liferay/alloy-ui/releases/tag/2.5.0)

* [AUI-1264](https://issues.liferay.com/browse/AUI-1264) Pagination doesn't have skip to first or last page
* [AUI-1163](https://issues.liferay.com/browse/AUI-1163) Remove unnecessary constants
* [AUI-1106](https://issues.liferay.com/browse/AUI-1106) Add showControls attribute in a simple way


text:
using System;
using System.Collections.Generic;
using MatterHackers.Agg;
using MatterHackers.Agg.Font;
using MatterHackers.Agg.UI;
using MatterHackers.VectorMath;

namespace MatterHackers.MatterControl
{
	public class TextScrollWidget : GuiWidget
	{
		object locker = new object();

		private string[] StartLineStringFilters = null;

		private EventHandler unregisterEvents;

		private List<string> allSourceLines;
		private List<string> visibleLines;

		private TypeFacePrinter printer = null;

		public Color TextColor = new Color(102, 102, 102);
		private int forceStartLine = -1;

		public double Position0To1
		{
			get
			{
				if (forceStartLine == -1)
				{
					return 0;
				}
				else
				{
					return ((visibleLines.Count - (double)forceStartLine) / visibleLines.Count);
				}
			}

			set
			{
				forceStartLine = (int)(visibleLines.Count * (1 - value)) - 1;
				forceStartLine = Math.Max(0, forceStartLine);
				forceStartLine = Math.Min(visibleLines.Count - 1, forceStartLine);

				// If the start would be less than one screen worth of content, allow
				// the whole screen to have content and scroll with new material.
				if (forceStartLine > visibleLines.Count - NumVisibleLines)
				{
					forceStartLine = -1;
				}
				Invalidate();
			}
		}

		public int NumVisibleLines => (int)Math.Ceiling(Height / printer.TypeFaceStyle.EmSizeInPixels);

		public TextScrollWidget(PrinterConfig printer, List<string> sourceLines)
		{
			this.printer = new TypeFacePrinter("", new StyledTypeFace(ApplicationController.GetTypeFace(NamedTypeFace.Liberation_Mono), 12));
			this.printer.DrawFromHintedCache = true;
			this.allSourceLines = sourceLines;
			this.visibleLines = sourceLines;
			printer.Connection.TerminalLog.HasChanged.RegisterEvent(RecievedNewLine, ref unregisterEvents);
		}

		private void ConditionalyAddToVisible(string line)
		{
			if (StartLineStringFilters != null
				&& StartLineStringFilters.Length > 0)
			{
				bool lineIsVisible = true;
				foreach (string startFilter in StartLineStringFilters)
				{
					if (line == null
						|| line.Contains("M105")
						|| line.Length < 3
						|| line.StartsWith(startFilter))
					{
						lineIsVisible = false;
						break;
					}
				}

				if (lineIsVisible)
				{
					visibleLines.Add(line);
				}
			}
		}

		private void RecievedNewLine(object sender, EventArgs e)
		{
			var stringEvent = e as StringEventArgs;
			if (stringEvent != null)
			{
				ConditionalyAddToVisible(stringEvent.Data);
			}
			else // the list changed in some big way (probably cleared)
			{
				if (StartLineStringFilters != null
					&& StartLineStringFilters.Length > 0)
				{
					CreateFilteredList();
				}
			}

			Invalidate();
		}

		private void CreateFilteredList()
		{
			lock (locker)
			{
				visibleLines = new List<string>();
				string[] allSourceLinesTemp = allSourceLines.ToArray();
				foreach (string line in allSourceLinesTemp)
				{
					ConditionalyAddToVisible(line);
				}
			}
		}

		public void SetLineStartFilter(string[] startLineStringsToFilter)
		{
			if (startLineStringsToFilter != null
				&& startLineStringsToFilter.Length > 0)
			{
				StartLineStringFilters = startLineStringsToFilter;
				CreateFilteredList();
			}
			else
			{
				visibleLines = allSourceLines;
			}
		}

		public void WriteToFile(string filePath)
		{
			// Make a copy so we don't have it change while writing.
			string[] allSourceLinesTemp = allSourceLines.ToArray();
			System.IO.File.WriteAllLines(filePath, allSourceLinesTemp);
		}

		public override void OnClosed(EventArgs e)
		{
			unregisterEvents?.Invoke(this, null);
			base.OnClosed(e);
		}

		public override void OnDraw(Graphics2D graphics2D)
		{
			RectangleDouble Bounds = LocalBounds;

			int numLinesToDraw = NumVisibleLines;

			double y = LocalBounds.Bottom + printer.TypeFaceStyle.EmSizeInPixels * numLinesToDraw;
			lock (visibleLines)
			{
				lock (locker)
				{
					int startLineIndex = visibleLines.Count - numLinesToDraw;
					if (forceStartLine != -1)
					{
						y = LocalBounds.Top;

						if (forceStartLine > visibleLines.Count - numLinesToDraw)
						{
							forceStartLine = -1;
						}
						else
						{
							// make sure we show all the lines we can
							startLineIndex = Math.Min(forceStartLine, startLineIndex);
						}
					}
					int endLineIndex = visibleLines.Count;
					for (int lineIndex = startLineIndex; lineIndex < endLineIndex; lineIndex++)
					{
						if (lineIndex >= 0)
						{
							if (visibleLines[lineIndex] != null)
							{
								printer.Text = visibleLines[lineIndex];
								printer.Origin = new Vector2(Bounds.Left + 2, y);
								printer.Render(graphics2D, TextColor);
							}
						}
						y -= printer.TypeFaceStyle.EmSizeInPixels;
						if (y < -printer.TypeFaceStyle.EmSizeInPixels)
						{
							break;
						}
					}
				}
			}

			base.OnDraw(graphics2D);
		}

		public override void OnMouseWheel(MouseEventArgs mouseEvent)
		{
			base.OnMouseWheel(mouseEvent);
			double scrollDelta = (mouseEvent.WheelDelta / ((visibleLines.Count) * 60.0));

			if (scrollDelta < 0)//Rounding seems to favor scrolling up, compensating scroll down to feel as smooth
			{
				scrollDelta *= 2;
			}
			else if (Position0To1 == 0)//IF we scroll up at the bottom get pop out from the "on screen" chunk
			{
				scrollDelta = (NumVisibleLines / (double)visibleLines.Count);
			}

			double newPos = Position0To1 + scrollDelta;

			if (newPos > 1)
			{
				newPos = 1;
			}
			else if (newPos < 0)
			{
				newPos = 0;
			}

			Position0To1 = newPos;
		}

		public override void OnKeyDown(KeyEventArgs keyEvent)
		{
			// make sure children controls get to try to handle this event first
			base.OnKeyDown(keyEvent);

			// check for arrow keys (but only if no modifiers are pressed)
			if (!keyEvent.Handled
				&& !keyEvent.Control
				&& !keyEvent.Alt
				&& !keyEvent.Shift)
			{
				double startingScrollPosition = Position0To1;
				double scrollDelta = (NumVisibleLines / (double)visibleLines.Count);
				double newPos = Position0To1;

				switch (keyEvent.KeyCode)
				{
					case Keys.PageDown:
						newPos -= scrollDelta;
						break;
					case Keys.PageUp:
						newPos += scrollDelta;
						break;
					case Keys.Home:
						newPos = 1;
						break;
					case Keys.End:
						newPos = 0;
						break;
				}

				if (newPos > 1)
				{
					newPos = 1;
				}
				else if (newPos < 0)
				{
					newPos = 0;
				}

				Position0To1 = newPos;

				// we only handled the key if it resulted in the area scrolling
				if (startingScrollPosition != Position0To1)
				{
					keyEvent.Handled = true;
				}
			}
		}
	}
}


text:
var Promise = require('bluebird');

var chai = require('chai'),
    chaiAsPromised = require('chai-as-promised');

chai.use(chaiAsPromised);
chai.should();

var Validator = require('jsonschema').Validator;

var config = require('./../../config');

var thing = require('model/entity/thing');

var thingIdSchema = {
  "id": "/thingSchema",
  "properties": {
    "thingId": {
      "$ref": "/entity/thing#/definitions/thingId"
    }
  }
};

var attributeSchema = {
  "id": "/attributeSchema",
  "properties": {
    "attribute": {
      "$ref": "/entity/thing#/definitions/attribute"
    }
  }
};

describe('the thing entity model', function() {
  var context = config.getContext();
  var validator;

  beforeEach(function() {
    validator = new Validator();
    validator.addSchema(thing);
  });

  it('must validate a valid name', function(done) {
    var testName = this.test.fullTitle();

    context.logger.info(testName);

    var entity = {
      thingId: 'valid_name0-11'
    };

    Promise.try(function() {
          var result = validator.validate(entity, thingIdSchema);

          return result.valid;
        })
      .should.eventually.be.fulfilled
      .and.equal(true)
      .and.notify(done);
  });

  it('must not validate an invalid name', function(done) {
    var testName = this.test.fullTitle();

    context.logger.info(testName);

    var entity = {
      thingId: 'invalidId#'
    };

    Promise.try(function() {
          var result = validator.validate(entity, thingIdSchema);

          return result.valid;
        })
      .should.eventually.be.equal(false)
      .and.notify(done);
  });

  it('must validate a valid attribute', function(done) {
    var testName = this.test.fullTitle();

    context.logger.info(testName);

    var entity = {
      attribute: {
        attr1: 'val1'
      }
    };

    Promise.try(function() {
          var result = validator.validate(entity, attributeSchema)

          return result.valid;
        })
      .should.eventually.be.equal(true)
      .and.notify(done);
  });
});


text: var pkg = require('canvas-designer');


text:
package de.some.package;

/**
 * Hello world!
 *
 */
public class App
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
    }
}


text:
class AddPositionToPages < ActiveRecord::Migration
  def change
    add_column :pages, :position, :integer
    remove_column :pages, :sorted_at
  end
end


text:
Tag Manager API . accounts . permissions

Instance Methods

  close()

Close httplib2 connections.

  create(accountId, body=None, x__xgafv=None)

Creates a user's Account & Container Permissions.

  delete(accountId, permissionId, x__xgafv=None)

Removes a user from the account, revoking access to it and all of its containers.

  get(accountId, permissionId, x__xgafv=None)

Gets a user's Account & Container Permissions.

  list(accountId, x__xgafv=None)

List all users that have access to the account along with Account and Container Permissions granted to each of them.

  update(accountId, permissionId, body=None, x__xgafv=None)

Updates a user's Account & Container Permissions.

Method Details

    close()

Close httplib2 connections.

    create(accountId, body=None, x__xgafv=None)

Creates a user's Account & Container Permissions.

Args:
  accountId: string, The GTM Account ID. (required)
  body: object, The request body.
    The object takes the form of:

{ # Represents a user's permissions to an account and its container.
  "accountAccess": { # Defines the Google Tag Manager Account access permissions. # GTM Account access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    "permission": [ # List of Account permissions. Valid account permissions are read and manage. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "A String",
    ],
  },
  "accountId": "A String", # GTM Account ID.
  "containerAccess": [ # GTM Container access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    { # Defines the Google Tag Manager Container access permissions.
      "containerId": "A String", # GTM Container ID. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "permission": [ # List of Container permissions. Valid container permissions are: read, edit, delete, publish. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
        "A String",
      ],
    },
  ],
  "emailAddress": "A String", # User's email address. @mutable tagmanager.accounts.permissions.create
  "permissionId": "A String", # Account Permission ID.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a user's permissions to an account and its container.
  "accountAccess": { # Defines the Google Tag Manager Account access permissions. # GTM Account access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    "permission": [ # List of Account permissions. Valid account permissions are read and manage. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "A String",
    ],
  },
  "accountId": "A String", # GTM Account ID.
  "containerAccess": [ # GTM Container access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    { # Defines the Google Tag Manager Container access permissions.
      "containerId": "A String", # GTM Container ID. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "permission": [ # List of Container permissions. Valid container permissions are: read, edit, delete, publish. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
        "A String",
      ],
    },
  ],
  "emailAddress": "A String", # User's email address. @mutable tagmanager.accounts.permissions.create
  "permissionId": "A String", # Account Permission ID.
}

    delete(accountId, permissionId, x__xgafv=None)

Removes a user from the account, revoking access to it and all of its containers.

Args:
  accountId: string, The GTM Account ID. (required)
  permissionId: string, The GTM User ID. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

    get(accountId, permissionId, x__xgafv=None)

Gets a user's Account & Container Permissions.

Args:
  accountId: string, The GTM Account ID. (required)
  permissionId: string, The GTM User ID. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a user's permissions to an account and its container.
  "accountAccess": { # Defines the Google Tag Manager Account access permissions. # GTM Account access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    "permission": [ # List of Account permissions. Valid account permissions are read and manage. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "A String",
    ],
  },
  "accountId": "A String", # GTM Account ID.
  "containerAccess": [ # GTM Container access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    { # Defines the Google Tag Manager Container access permissions.
      "containerId": "A String", # GTM Container ID. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "permission": [ # List of Container permissions. Valid container permissions are: read, edit, delete, publish. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
        "A String",
      ],
    },
  ],
  "emailAddress": "A String", # User's email address. @mutable tagmanager.accounts.permissions.create
  "permissionId": "A String", # Account Permission ID.
}

    list(accountId, x__xgafv=None)

List all users that have access to the account along with Account and Container Permissions granted to each of them.

Args:
  accountId: string, The GTM Account ID. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # List AccountUsers Response.
  "userAccess": [ # All GTM AccountUsers of a GTM Account.
    { # Represents a user's permissions to an account and its container.
      "accountAccess": { # Defines the Google Tag Manager Account access permissions. # GTM Account access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
        "permission": [ # List of Account permissions. Valid account permissions are read and manage. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
          "A String",
        ],
      },
      "accountId": "A String", # GTM Account ID.
      "containerAccess": [ # GTM Container access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
        { # Defines the Google Tag Manager Container access permissions.
          "containerId": "A String", # GTM Container ID. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
          "permission": [ # List of Container permissions. Valid container permissions are: read, edit, delete, publish. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
            "A String",
          ],
        },
      ],
      "emailAddress": "A String", # User's email address. @mutable tagmanager.accounts.permissions.create
      "permissionId": "A String", # Account Permission ID.
    },
  ],
}

    update(accountId, permissionId, body=None, x__xgafv=None)

Updates a user's Account & Container Permissions.

Args:
  accountId: string, The GTM Account ID. (required)
  permissionId: string, The GTM User ID. (required)
  body: object, The request body.
    The object takes the form of:

{ # Represents a user's permissions to an account and its container.
  "accountAccess": { # Defines the Google Tag Manager Account access permissions. # GTM Account access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    "permission": [ # List of Account permissions. Valid account permissions are read and manage. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "A String",
    ],
  },
  "accountId": "A String", # GTM Account ID.
  "containerAccess": [ # GTM Container access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    { # Defines the Google Tag Manager Container access permissions.
      "containerId": "A String", # GTM Container ID. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "permission": [ # List of Container permissions. Valid container permissions are: read, edit, delete, publish. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
        "A String",
      ],
    },
  ],
  "emailAddress": "A String", # User's email address. @mutable tagmanager.accounts.permissions.create
  "permissionId": "A String", # Account Permission ID.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Represents a user's permissions to an account and its container.
  "accountAccess": { # Defines the Google Tag Manager Account access permissions. # GTM Account access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    "permission": [ # List of Account permissions. Valid account permissions are read and manage. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "A String",
    ],
  },
  "accountId": "A String", # GTM Account ID.
  "containerAccess": [ # GTM Container access permissions. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
    { # Defines the Google Tag Manager Container access permissions.
      "containerId": "A String", # GTM Container ID. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
      "permission": [ # List of Container permissions. Valid container permissions are: read, edit, delete, publish. @mutable tagmanager.accounts.permissions.create @mutable tagmanager.accounts.permissions.update
        "A String",
      ],
    },
  ],
  "emailAddress": "A String", # User's email address. @mutable tagmanager.accounts.permissions.create
  "permissionId": "A String", # Account Permission ID.
}


text:
package com.googlecode.htmleasy;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Annotation which defines a set of view definitions (ViewWith) items for an Htmleasy model.  Place this annotation
 * on a method and populate it an array of ViewWith annotations.  This allows the one method/controller to return
 * multiple types/models and the most appropriate view is selected to render the item.
 *
 * e.g.
 *
 *   <code>
 *   @ViewSet({@ViewWith(ifClass=Boat.class, value="/boat.jsp"), @ViewWith(ifClass=Car.class, value="/car.jsp")})
 *   </code>
 *
 * Note: Order is important. The first matching view in the list is used.
 *
 * @author Chris Dance <chris.dance@papercut.com>
 */
@Target({TYPE, METHOD})
@Retention(RUNTIME)
public @interface ViewSet
{
	/** The list of ViewWith items */
	ViewWith[] value();
}