text:
package com.contactlab.api.ws;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for xmlDeliveryStatusType.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *

 *

 * <simpleType name="xmlDeliveryStatusType">
 *   <restriction base="{http://www.w3.org/2001/XMLSchema}string">
 *     <enumeration value="SUCCESS"/>
 *     <enumeration value="LOADING"/>
 *     <enumeration value="ERROR"/>
 *     <enumeration value="RECOVERED"/>
 *   </restriction>
 * </simpleType>
 *

 *
 */
@XmlType(name = "xmlDeliveryStatusType")
@XmlEnum
public enum XmlDeliveryStatusType {

    SUCCESS,
    LOADING,
    ERROR,
    RECOVERED;

    public String value() {
        return name();
    }

    public static XmlDeliveryStatusType fromValue(String v) {
        return valueOf(v);
    }

}


text:
import jquery  from 'jquery';
import _  from 'lodash';
import urlParse from 'url-parse';
import moment from 'moment';

export default {
  jquery,
  _,
  urlParse,
  moment
};

redpajama_set_name: RedPajamaGithub


text:
knockout.datatables
===================

* `columns` - columns definition
* `datasource` - provides grid model which manage data source. You can use the following data sources:

	* `ko.gridModel.inMemory` - grid model that use in memory data,
	* `ko.gridModel.odata` - grid model that use OData service to load server-side data,
	* you can just use `ko.gridModel(requestCallback)` to create your own grid model.

* `deferRender` - ???
* `dom` - ???
* `rowCallback` - ???
* `rowTemplate` - ???
* `selected` - observable, observableArray or item property name indicating if it is selected
* `scrollY` - enable scroll mode in grid
* `tabIndex` - ???
* `virtualScrolling` - enable virtual scroll mode


text:
pyposter
========

A simple usenet binary poster using python.

Remember to edit pyposter.ini before using!

Requires Python 3 to run. And I don't support no legacy 32 bit systems.

- Requires cyenc https://github.com/meganomic/cyenc
- Requires Par2cmdline* https://github.com/Parchive/par2cmdline or equivalent

Optional functionality
- Rar for preprocessing functionality, http://www.rarlab.com/

*Some older version aren't compatiable with this software. Use the latest version.


text:
package org.terasology.engine.rendering.nui.internal;

import org.joml.Quaternionfc;
import org.joml.Vector2ic;
import org.joml.Vector3fc;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.gestalt.assets.ResourceUrn;
import org.terasology.engine.config.Config;
import org.terasology.engine.config.RenderingConfig;
import org.terasology.engine.context.Context;
import org.terasology.engine.core.Time;
import org.terasology.engine.input.InputSystem;
import org.terasology.engine.rendering.assets.material.Material;
import org.terasology.engine.rendering.assets.texture.TextureRegion;
import org.terasology.engine.rendering.opengl.FrameBufferObject;
import org.terasology.joml.geom.Rectanglei;
import org.terasology.nui.SubRegion;
import org.terasology.nui.UITextureRegion;
import org.terasology.nui.canvas.CanvasImpl;
import org.terasology.engine.rendering.assets.mesh.Mesh;
import org.terasology.engine.rendering.nui.NUIManager;
import org.terasology.engine.utilities.Assets;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

public class TerasologyCanvasImpl extends CanvasImpl implements PropertyChangeListener {

    private static final Logger logger = LoggerFactory.getLogger(TerasologyCanvasImpl.class);

    private final NUIManager nuiManager;
    private final Time time;

    private Material meshMat;

    private RenderingConfig renderingConfig;

    public TerasologyCanvasImpl(NUIManager nuiManager, Context context, TerasologyCanvasRenderer renderer) {
        super(renderer, nuiManager, context.get(InputSystem.class).getKeyboard(), context.get(InputSystem.class).getMouseDevice(),
                Assets.getTexture("engine:white").get(), null, context.get(Config.class).getRendering().getUiScale() / 100);

        this.renderer = renderer;
        this.nuiManager = nuiManager;
        this.time = context.get(Time.class);
        this.meshMat = Assets.getMaterial("engine:UILitMesh").get();

        this.renderingConfig = context.get(Config.class).getRendering();
        this.uiScale = this.renderingConfig.getUiScale() / 100f;

        this.renderingConfig.subscribe(RenderingConfig.UI_SCALE, this);
    }

    @Override
    public void preRender() {
        super.preRender();

        if (getSkin() == null) {
            setSkin(Assets.getSkin("engine:default").get());
        }
    }

    @Override
    protected float getGameTimeInSeconds() {
        return time.getGameTime();
    }

    @Override
    protected long getGameTimeInMs() {
        return time.getGameTimeInMs();
    }

    //NOTE: now only accessible via CanvasUtility
    public SubRegion subRegionFBO(ResourceUrn uri, Vector2ic size) {
        return new SubRegionFBOImpl(uri, size);
    }

    // NOTE: drawMaterial and drawMesh can now only be accessed through CanvasUtility
    public void drawMaterial(Material material, Rectanglei region) {
        if (material.isRenderable()) {
            Rectanglei drawRegion = relativeToAbsolute(region);
            if (!state.cropRegion.intersectsRectangle(drawRegion)) {
                return;
            }
            material.setFloat("alpha", state.getAlpha());
            material.bindTextures();
            ((TerasologyCanvasRenderer) renderer).drawMaterialAt(material, drawRegion);
        }
    }

    public void drawMesh(Mesh mesh, Material material, Rectanglei region, Quaternionfc rotation, Vector3fc offset, float scale) {
        if (material == null) {
            logger.warn("Attempted to draw with nonexistent material");
            return;
        }
        if (mesh == null) {
            logger.warn("Attempted to draw nonexistent mesh");
            return;
        }

        Rectanglei drawRegion = relativeToAbsolute(region);
        if (!state.cropRegion.intersectsRectangle(drawRegion)) {
            return;
        }

        ((TerasologyCanvasRenderer) renderer).drawMesh(
                mesh, material, drawRegion, drawRegion.intersection(state.cropRegion),
                rotation, offset, scale, state.getAlpha());
    }

    public void drawMesh(Mesh mesh, UITextureRegion texture, Rectanglei region, Quaternionfc rotation, Vector3fc offset, float scale) {
        meshMat.setTexture("tex", ((TextureRegion) texture).getTexture());
        drawMesh(mesh, meshMat, region, rotation, offset, scale);
    }

    @Override
    public void propertyChange(PropertyChangeEvent evt) {
        if (evt.getPropertyName().equals(RenderingConfig.UI_SCALE)) {
            this.uiScale = this.renderingConfig.getUiScale() / 100f;
        }
    }

    private final class SubRegionFBOImpl implements SubRegion {
        private FrameBufferObject fbo;
        private CanvasState previousState;

        private SubRegionFBOImpl(ResourceUrn uri, Vector2ic size) {
            previousState = state;

            fbo = ((TerasologyCanvasRenderer) renderer).getFBO(uri, size);
            state = new CanvasState(state, new Rectanglei(0, 0, size.x(), size.y()));
            fbo.bindFrame();
        }

        @Override
        public void close() {
            fbo.unbindFrame();
            state = previousState;
        }
    }
}


text:
package com.linkedin.kafka.cruisecontrol.analyzer;

import com.linkedin.kafka.cruisecontrol.common.ClusterProperty;
import com.linkedin.kafka.cruisecontrol.common.TestConstants;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class RandomClusterExpDistNewBrokerTest extends RandomClusterTest {

  /**
   * Constructor of Random Cluster Test.
   *  @param modifiedProperties  Modified cluster properties over the {@link TestConstants#BASE_PROPERTIES}.
   * @param goalNameByPriority  Goal name by priority.
   * @param replicaDistribution Distribution of replicas in the test cluster.
   * @param balancingConstraint The balancing constraints.
   * @param verifications       The verifications to make.
   */
  public RandomClusterExpDistNewBrokerTest(Map<ClusterProperty, Number> modifiedProperties,
                                           Map<Integer, String> goalNameByPriority,
                                           TestConstants.Distribution replicaDistribution,
                                           BalancingConstraint balancingConstraint,
                                           List<OptimizationVerifier.Verification> verifications) {
    super(modifiedProperties, goalNameByPriority, replicaDistribution, balancingConstraint, verifications);
  }

  @Parameterized.Parameters
  public static Collection<Object[]> data() {
    return RandomClusterTest.data(TestConstants.Distribution.EXPONENTIAL);
  }

  @Test
  public void testNewBrokers() throws Exception {
    super.testNewBrokers();
  }
}


text:
package org.killbill.billing.plugin.adyen.client.payment.exception;

public class ModificationFailedException extends Exception {

    public ModificationFailedException(final Throwable t) {
        super(t);
    }
}


text:
	$(document).ready(function() {
		$('.scroll-to-top').click(function() {
			$('html, body').animate({ scrollTop: 0 }, 1600, 'easeInOutQuart');
			return false;
		});
	});


text:
using System;
using System.Collections.Generic;

namespace Graph.Collections
{
    public sealed class PairingNode<T> : IHeapNode<T>
    {
        public T Item { get; }
        public PairingNode<T> Parent { get; internal set; }
        public PairingNode<T> Sibling { get; internal set; }
        public PairingNode<T> Child { get; internal set; }

        public PairingNode(T item)
        {
            if (object.ReferenceEquals(item, null))
            {
                throw new ArgumentNullException(nameof(item));
            }

            Item = item;
            Parent = null;
            Sibling = null;
            Child = null;
        }

        public void Iterate(Func<PairingNode<T>, bool> action)
        {
            if (object.ReferenceEquals(action, null))
            {
                throw new ArgumentNullException(nameof(action));
            }

            var stack = new Stack<PairingNode<T>>();
            stack.Push(this);

            while (stack.Count != 0)
            {
                var node = stack.Pop();
                var cont = action(node);

                if (!cont)
                {
                    break;
                }

                if (!object.ReferenceEquals(node.Sibling, null))
                {
                    stack.Push(node.Sibling);
                }

                if (!object.ReferenceEquals(node.Child, null))
                {
                    stack.Push(node.Child);
                }
            }
        }

        internal void AddChild(PairingNode<T> node)
        {
            node.Parent = this;
            node.Sibling = this.Child;
            this.Child = node;
        }
    }

    public sealed class PairingHeap<T> : IHeap<T>
    {
        private PairingNode<T> _head;
        private readonly Func<T, T, int> _comparer;
        private int _count;

        public PairingHeap()
        : this(Comparer<T>.Default.Compare)
        {
        }

        public PairingHeap(Func<T, T, int> compare)
        {
            _comparer = compare ?? throw new ArgumentNullException(nameof(compare));
            _head = null;
            _count = 0;
        }

        private PairingNode<T> Link(PairingNode<T> node1, PairingNode<T> node2)
        {
            if (object.ReferenceEquals(node1, null))
            {
                return node2;
            }

            if (object.ReferenceEquals(node2, null))
            {
                return node1;
            }

            if (_comparer(node1.Item, node2.Item) > 0)
            {
                node2.AddChild(node1);
                return node2;
            }
            else
            {
                node1.AddChild(node2);
                return node1;
            }
        }

        private PairingNode<T> Extract(PairingNode<T> node)
        {
            var children = new List<PairingNode<T>>();

            var n = node.Child;
            while (!object.ReferenceEquals(n, null))
            {
                var pair = n.Sibling;
                n.Parent = null;
                n.Sibling = null;
                if (object.ReferenceEquals(pair, null))
                {
                    children.Add(n);
                    break;
                }

                var next = pair.Sibling;
                pair.Parent = null;
                pair.Sibling = null;
                children.Add(Link(n, pair));
                n = next;
            }

            if (children.Count == 0)
            {
                return null;
            }

            var root = children[0];
            for (var i = 1; i < children.Count; ++i)
            {
                root = Link(root, children[i]);
            }

            return root;
        }

        public int Count
        {
            get { return _count; }
        }

        public IHeapNode<T> Insert(T item)
        {
            if (object.ReferenceEquals(item, null))
            {
                throw new ArgumentNullException(nameof(item));
            }

            var node = new PairingNode<T>(item);
            if (object.ReferenceEquals(_head, null))
            {
                _head = node;
            }
            else
            {
                _head = Link(_head, node);
            }

            _count++;
            return node;
        }

        public T ExamineMin()
        {
            if (object.ReferenceEquals(_head, null))
            {
                throw new InvalidOperationException("The heap is empty.");
            }

            return _head.Item;
        }

        public T ExtractMin()
        {
            if (object.ReferenceEquals(_head, null))
            {
                throw new InvalidOperationException("The heap is empty.");
            }

            var node = _head;
            _head = Extract(_head);
            _count--;
            return node.Item;
        }

        public IHeapNode<T> Find(T item)
        {
            if (object.ReferenceEquals(_head, null))
            {
                throw new InvalidOperationException("The heap is empty.");
            }

            IHeapNode<T> foundItem = null;
            _head.Iterate((n) =>
            {
                if (EqualityComparer<T>.Default.Equals(n.Item, item))
                {
                    foundItem = n;
                    return false;
                }
                else
                {
                    return true;
                }
            });
            return foundItem;
        }

        public IHeapNode<T> UpdateItem(IHeapNode<T> heapNode, T item)
        {
            if (object.ReferenceEquals(heapNode, null))
            {
                throw new ArgumentNullException(nameof(heapNode));
            }
            if (object.ReferenceEquals(item, null))
            {
                throw new ArgumentNullException(nameof(item));
            }

            var node = heapNode as PairingNode<T>;
            if (object.ReferenceEquals(node, null))
            {
                throw new InvalidOperationException("Invalid node type for heap.");
            }

            if (_head == node)
            {
                ExtractMin();
                return Insert(item);
            }
            else
            {
                var child = Extract(node);
                if (!object.ReferenceEquals(child, null))
                {
                    child.Sibling = node.Parent.Child;
                    node.Parent.Child = child;
                }
                return Insert(item);
            }
        }

        public List<IHeapNode<T>> ToList()
        {
            var list = new List<IHeapNode<T>>();
            if (object.ReferenceEquals(_head, null))
            {
                return list;
            }

            _head.Iterate((node) =>
            {
                list.Add(node);
                return true;
            });

            return list;
        }
    }
}


text:
package camlegal

import (
	"testing"

	"go4.org/legal"
)

func TestLicenses(t *testing.T) {
	legal.RegisterLicense("dummy")
	licenses := legal.Licenses()
	if len(licenses) < 2 {
		t.Fatal("no second license text")
	}
	if licenses[1] != "dummy" {
		t.Error("license text mismatch")
	}
}


text:
$(function(){
	$(".search_keyword").keyup(function()
	{
	    var search_keyword_value = $(this).val();
	    if(search_keyword_value!='')
	    {
            var data = new FormData();
            data.append('search_keyword', search_keyword_value);
            var xhr = new XMLHttpRequest();
			xhr.onreadystatechange=function() {
			    if ( xhr.readyState==4 && xhr.status==200) {
			      $('#result').html(xhr.responseText);
			    }
			}
            xhr.open("POST", "public/php/searchpeople.php");
            xhr.send(data);
	    }
	    return false;
	});

	$('#search_keyword_id').click(function(){
	    $("#result").fadeIn();
	});
});


text:
export interface EncodeOptions {
  quality: number;
  target_size: number;
  target_PSNR: number;
  method: number;
  sns_strength: number;
  filter_strength: number;
  filter_sharpness: number;
  filter_type: number;
  partitions: number;
  segments: number;
  pass: number;
  show_compressed: number;
  preprocessing: number;
  autofilter: number;
  partition_limit: number;
  alpha_compression: number;
  alpha_filtering: number;
  alpha_quality: number;
  lossless: number;
  exact: number;
  image_hint: number;
  emulate_jpeg_size: number;
  thread_level: number;
  low_memory: number;
  near_lossless: number;
  use_delta_palette: number;
  use_sharp_yuv: number;
}

export interface WebPModule extends EmscriptenWasm.Module {
  encode(
    data: BufferSource,
    width: number,
    height: number,
    options: EncodeOptions,
  ): Uint8Array | null;
}

declare var moduleFactory: EmscriptenWasm.ModuleFactory<WebPModule>;

export default moduleFactory;


text:
<?php

namespace Modules\Backend;

class Module
{

	public function registerAutoloaders()
	{

		$loader = new \Phalcon\Loader();

		$loader->registerNamespaces(array(
			'Modules\Backend\Controllers' => __DIR__ . '/controllers/',
			'Modules\Backend\Models' => __DIR__ . '/models/',
		));

		$loader->register();
	}

	public function registerServices($di)
	{

		/**
		 * Read configuration
		 */
		$config = include __DIR__ . "/config/config.php";

		$di['dispatcher'] = function() {
			$dispatcher = new \Phalcon\Mvc\Dispatcher();
			$dispatcher->setDefaultNamespace("Modules\Backend\Controllers");
			return $dispatcher;
		};

		/**
		 * Setting up the view component
		 */
		$di['view'] = function() {

			$view = new \Phalcon\Mvc\View();

			$view->setViewsDir(__DIR__ . '/views/');
			$view->setLayoutsDir('../../common/layouts/');
			$view->setTemplateAfter('main');

			return $view;
		};

		/**
		 * Database connection is created based in the parameters defined in the configuration file
		 */
		$di['db'] = function() use ($config) {
			return new \Phalcon\Db\Adapter\Pdo\Mysql(array(
				"host" => $config->database->host,
				"username" => $config->database->username,
				"password" => $config->database->password,
				"dbname" => $config->database->name
			));
		};

	}

}


text:
package voldemort.store.krati;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import krati.cds.array.DataArray;
import krati.cds.impl.segment.MemorySegmentFactory;
import krati.cds.impl.segment.SegmentFactory;
import krati.cds.impl.store.DynamicDataStore;

import org.apache.log4j.Logger;

import voldemort.VoldemortException;
import voldemort.store.NoSuchCapabilityException;
import voldemort.store.StorageEngine;
import voldemort.store.StoreCapabilityType;
import voldemort.store.StoreUtils;
import voldemort.utils.ByteArray;
import voldemort.utils.ClosableIterator;
import voldemort.utils.Pair;
import voldemort.utils.Utils;
import voldemort.versioning.ObsoleteVersionException;
import voldemort.versioning.Occured;
import voldemort.versioning.VectorClock;
import voldemort.versioning.Version;
import voldemort.versioning.Versioned;

public class KratiStorageEngine implements StorageEngine<ByteArray, byte[]> {

    private static final Logger logger = Logger.getLogger(KratiStorageEngine.class);
    private final String name;

    private DynamicDataStore datastore = null;

    public KratiStorageEngine(String name,
                              int segmentFileSizeMB,
                              double hashLoadFactor,
                              int initLevel,
                              File dataDirectory) {
        this.name = Utils.notNull(name);
        SegmentFactory segmentFactory = new MemorySegmentFactory();

        try {
            datastore = new DynamicDataStore(dataDirectory,
                                             initLevel,
                                             segmentFileSizeMB,
                                             segmentFactory,
                                             hashLoadFactor);
        } catch(Exception e) {
            logger.error("Failed to initialize datastore");
            datastore = null;
        }

    }

    public Object getCapability(StoreCapabilityType capability) {
        throw new NoSuchCapabilityException(capability, getName());
    }

    public String getName() {
        return this.name;
    }

    public void close() throws VoldemortException {}

    public Map<ByteArray, List<Versioned<byte[]>>> getAll(Iterable<ByteArray> keys)
            throws VoldemortException {
        StoreUtils.assertValidKeys(keys);
        return StoreUtils.getAll(this, keys);
    }

    public List<Version> getVersions(ByteArray key) {
        return StoreUtils.getVersions(get(key));
    }

    public void truncate() {
        try {
            datastore.clear();
        } catch(Exception e) {
            logger.error(e);
            throw new VoldemortException("Failed to truncate Krati");
        }
    }

    public List<Versioned<byte[]>> get(ByteArray key) throws VoldemortException {
        StoreUtils.assertValidKey(key);
        try {
            return disassembleValues(datastore.get(key.get()));
        } catch(Exception e) {
            logger.error(e);
            throw new VoldemortException("Failed to deserialize data");
        }
    }

    public ClosableIterator<Pair<ByteArray, Versioned<byte[]>>> entries() {
        List<Pair<ByteArray, Versioned<byte[]>>> returnedList = new ArrayList<Pair<ByteArray, Versioned<byte[]>>>();
        DataArray array = datastore.getDataArray();
        for(int index = 0; index < array.length(); index++) {
            byte[] returnedBytes = array.getData(index);
            if(returnedBytes != null) {
                // Extract the key value pair from this
                // TODO: Move to DynamicDataStore code
                ByteBuffer bb = ByteBuffer.wrap(returnedBytes);
                int cnt = bb.getInt();
                if(cnt > 0) {
                    int keyLen = bb.getInt();
                    byte[] key = new byte[keyLen];
                    bb.get(key);

                    int valueLen = bb.getInt();
                    byte[] value = new byte[valueLen];
                    bb.get(value);

                    List<Versioned<byte[]>> versions;
                    try {
                        versions = disassembleValues(value);
                    } catch(IOException e) {
                        versions = null;
                    }

                    if(versions != null) {
                        Iterator<Versioned<byte[]>> iterVersions = versions.iterator();
                        while(iterVersions.hasNext()) {
                            Versioned<byte[]> currentVersion = iterVersions.next();
                            returnedList.add(Pair.create(new ByteArray(key), currentVersion));
                        }
                    }

                }
            }

        }
        return new KratiClosableIterator(returnedList);
    }

    public ClosableIterator<ByteArray> keys() {
        return StoreUtils.keys(entries());
    }

    public boolean delete(ByteArray key, Version maxVersion) throws VoldemortException {
        StoreUtils.assertValidKey(key);

        if(maxVersion == null) {
            try {
                return datastore.delete(key.get());
            } catch(Exception e) {
                logger.error(e);
                throw new VoldemortException("Failed to delete key" + key);
            }
        }

        List<Versioned<byte[]>> returnedValuesList = this.get(key);

        // Case if there is nothing to delete
        if(returnedValuesList.size() == 0) {
            return false;
        }

        Iterator<Versioned<byte[]>> iter = returnedValuesList.iterator();
        while(iter.hasNext()) {
            Versioned<byte[]> currentValue = iter.next();
            Version currentVersion = currentValue.getVersion();
            if(currentVersion.compare(maxVersion) == Occured.BEFORE) {
                iter.remove();
            }

        }

        try {
            if(returnedValuesList.size() == 0) {
                List<Versioned<byte[]>> genList = this.get(key);
                return datastore.delete(key.get());
            } else {
                return datastore.put(key.get(), assembleValues(returnedValuesList));
            }
        } catch(Exception e) {
            logger.error(e);
            throw new VoldemortException("Failed to delete key " + key);
        }
    }

    public void put(ByteArray key, Versioned<byte[]> value) throws VoldemortException {
        StoreUtils.assertValidKey(key);

        // First get the value
        List<Versioned<byte[]>> existingValuesList = this.get(key);

        // If no value, add one
        if(existingValuesList.size() == 0) {

            existingValuesList = new ArrayList<Versioned<byte[]>>();
            existingValuesList.add(new Versioned<byte[]>(value.getValue(), value.getVersion()));

        } else {

            // Update the value
            List<Versioned<byte[]>> removedValueList = new ArrayList<Versioned<byte[]>>();
            for(Versioned<byte[]> versioned: existingValuesList) {
                Occured occured = value.getVersion().compare(versioned.getVersion());

                if(occured == Occured.BEFORE) {
                    throw new ObsoleteVersionException("Obsolete version for key '" + key + "': "
                                                       + value.getVersion());
                } else if(occured == Occured.AFTER) {
                    removedValueList.add(versioned);
                }

            }
            existingValuesList.removeAll(removedValueList);
            existingValuesList.add(value);

        }

        try {
            datastore.put(key.get(), assembleValues(existingValuesList));
        } catch(Exception e) {
            logger.error(e);
            throw new VoldemortException("Failed to put key " + key);
        }
    }

    /**
     * Store the versioned values
     *
     * @param values list of versioned bytes
     * @return the list of versioned values rolled into an array of bytes
     */
    private byte[] assembleValues(List<Versioned<byte[]>> values) throws IOException {

        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        DataOutputStream dataStream = new DataOutputStream(stream);

        for(Versioned<byte[]> value: values) {
            byte[] object = value.getValue();
            dataStream.writeInt(object.length);
            dataStream.write(object);

            VectorClock clock = (VectorClock) value.getVersion();
            dataStream.writeInt(clock.sizeInBytes());
            dataStream.write(clock.toBytes());
        }

        return stream.toByteArray();
    }

    /**
     * Splits up value into multiple versioned values
     *
     * @param value
     * @return
     * @throws IOException
     */
    private List<Versioned<byte[]>> disassembleValues(byte[] values) throws IOException {

        if(values == null)
            return new ArrayList<Versioned<byte[]>>(0);

        List<Versioned<byte[]>> returnList = new ArrayList<Versioned<byte[]>>();
        ByteArrayInputStream stream = new ByteArrayInputStream(values);
        DataInputStream dataStream = new DataInputStream(stream);

        while(dataStream.available() > 0) {
            byte[] object = new byte[dataStream.readInt()];
            dataStream.read(object);

            byte[] clockBytes = new byte[dataStream.readInt()];
            dataStream.read(clockBytes);
            VectorClock clock = new VectorClock(clockBytes);

            returnList.add(new Versioned<byte[]>(object, clock));
        }

        return returnList;
    }

    private class KratiClosableIterator implements
            ClosableIterator<Pair<ByteArray, Versioned<byte[]>>> {

        private Iterator<Pair<ByteArray, Versioned<byte[]>>> iter;

        public KratiClosableIterator(List<Pair<ByteArray, Versioned<byte[]>>> list) {
            iter = list.iterator();
        }

        public void close() {
        // Nothing to close here
        }

        public boolean hasNext() {
            return iter.hasNext();
        }

        public Pair<ByteArray, Versioned<byte[]>> next() {
            return iter.next();
        }

        public void remove() {
            Pair<ByteArray, Versioned<byte[]>> currentPair = next();
            delete(currentPair.getFirst(), currentPair.getSecond().getVersion());
        }

    }
}


text:
#pragma once
/*
** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
**
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of version 2 of the GNU Library General
** Public License as published by the Free Software Foundation.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
** Library General Public License for more details.  To obtain a
** copy of the GNU Library General Public License, write to the Free
** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**
** Any permitted reproduction of these routines, in whole or in part,
** must bear this legend.
**
**
** nes_rom.h
**
** NES ROM loading/saving related defines / prototypes
** $Id: nes_rom.h,v 1.2 2001/04/27 14:37:11 neil Exp $
*/
#include <unistd.h>
#include "nes_std.h"

typedef enum
{
   MIRROR_HORIZ   = 0,
   MIRROR_VERT    = 1
} mirror_t;

#define  ROM_FLAG_BATTERY     0x01
#define  ROM_FLAG_TRAINER     0x02
#define  ROM_FLAG_FOURSCREEN  0x04
#define  ROM_FLAG_VERSUS      0x08

typedef struct rominfo_s
{
   /* pointers to ROM and VROM */
   uint8 *rom, *vrom;

   /* pointers to SRAM and VRAM */
   uint8 *sram, *vram;

   /* number of banks */
   int rom_banks, vrom_banks;
   int sram_banks, vram_banks;

   int mapper_number;
   mirror_t mirror;

   uint8 flags;

   char filename[PATH_MAX + 1];
} rominfo_t;

extern int rom_checkmagic(const char *filename);
extern rominfo_t *rom_load(const char *filename);
extern void rom_free(rominfo_t **rominfo);
extern char *rom_getinfo(rominfo_t *rominfo);

/*
** $Log: nes_rom.h,v $
** Revision 1.2  2001/04/27 14:37:11  neil
** wheeee
**
** Revision 1.1.1.1  2001/04/27 07:03:54  neil
** initial
**
** Revision 1.2  2000/10/25 01:23:08  matt
** basic system autodetection
**
** Revision 1.1  2000/10/24 12:20:28  matt
** changed directory structure
**
** Revision 1.11  2000/10/22 15:01:29  matt
** irrelevant mirroring modes removed
**
** Revision 1.10  2000/10/17 03:22:38  matt
** cleaning up rom module
**
** Revision 1.9  2000/10/10 13:58:13  matt
** stroustrup squeezing his way in the door
**
** Revision 1.8  2000/10/10 13:03:54  matt
** Mr. Clean makes a guest appearance
**
** Revision 1.7  2000/07/25 02:20:58  matt
** cleanups
**
** Revision 1.6  2000/07/19 15:59:39  neil
** PATH_MAX, strncpy, snprintf, and strncat are our friends
**
** Revision 1.5  2000/07/17 01:52:27  matt
** made sure last line of all source files is a newline
**
** Revision 1.4  2000/06/09 15:12:25  matt
** initial revision
**
*/


text:
package com.shmtu.myprojectforsmu.utils;

import android.content.Context;
import android.widget.Toast;

import com.baidu.location.BDLocation;
import com.baidu.location.BDLocationListener;
import com.baidu.location.LocationClient;
import com.baidu.location.LocationClientOption;
import com.baidu.mapapi.map.BaiduMap;
import com.baidu.mapapi.map.BitmapDescriptorFactory;
import com.baidu.mapapi.map.MapStatus;
import com.baidu.mapapi.map.MapStatusUpdate;
import com.baidu.mapapi.map.MapStatusUpdateFactory;
import com.baidu.mapapi.map.MapView;
import com.baidu.mapapi.map.MarkerOptions;
import com.baidu.mapapi.map.MyLocationData;
import com.baidu.mapapi.model.LatLng;
import com.baidu.mapapi.search.core.SearchResult;
import com.baidu.mapapi.search.geocode.GeoCodeResult;
import com.baidu.mapapi.search.geocode.GeoCoder;
import com.baidu.mapapi.search.geocode.OnGetGeoCoderResultListener;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeOption;
import com.baidu.mapapi.search.geocode.ReverseGeoCodeResult;
import com.shmtu.myprojectforsmu.R;

public class LocatedPositionUtil implements OnGetGeoCoderResultListener{

	private Context context;
	public MyLocationListenner myListener = new MyLocationListenner();
	LocationClient mLocClient;// 定位相关
	private MapView mMapView;
	private BaiduMap mBaiduMap;
	private GeoCoder mSearch = null; // 搜索模块,也可去掉地图模块独立使用

	boolean isFirstLoc = false;// 是否首次定位

	public LocatedPositionUtil(Context context, MapView mMapView,
			BaiduMap mBaiduMap, LocationClient mLocClient){
		this.context = context;
		this.mMapView = mMapView;
		this.mBaiduMap = mBaiduMap;
		this.mLocClient = mLocClient;
	}

	public void init(){
		//开启定位图层
		mBaiduMap.setMyLocationEnabled(true);
		mBaiduMap.setMapStatus(MapStatusUpdateFactory.newMapStatus(new MapStatus.Builder().zoom(15).build()));//设置缩放级别
		// 初始化搜索模块,注册事件监听
		mSearch = GeoCoder.newInstance();
		mSearch.setOnGetGeoCodeResultListener(this);
		mLocClient.registerLocationListener(myListener);
		LocationClientOption option = new LocationClientOption();
		option.setOpenGps(true);// 打开gps
		option.setCoorType("bd09ll"); // 设置坐标类型
		option.setScanSpan(1000);
		mLocClient.setLocOption(option);
		mLocClient.start();
	}

	/**
	 * 定位SDK监听函数
	 */
	public class MyLocationListenner implements BDLocationListener {

		@Override
		public void onReceiveLocation(BDLocation location) {
			// map view 销毁后不在处理新接收的位置
			if (location == null || mMapView == null)
				return;
			MyLocationData locData = new MyLocationData.Builder()
			.accuracy(location.getRadius())
			// 此处设置开发者获取到的方向信息,顺时针0-360
			.direction(1000).latitude(location.getLatitude())
			.longitude(location.getLongitude()).build();
			mBaiduMap.setMyLocationData(locData);
			if (isFirstLoc) {
				isFirstLoc = false;
				LatLng ll = new LatLng(location.getLatitude(),
						location.getLongitude());
				MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
				mBaiduMap.animateMapStatus(u);

				// 反Geo搜索
				mSearch.reverseGeoCode(new ReverseGeoCodeOption()
				.location(ll));
				/*mSearch.geocode(new GeoCodeOption()
			    .city("上海")
			    .address("上海海事大学临港校区"));*/
			}
		}

		public void onReceivePoi(BDLocation poiLocation) {
		}
	}

	@Override
	public void onGetGeoCodeResult(GeoCodeResult result) {
		if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
			Toast.makeText(context, "抱歉,未能找到结果", Toast.LENGTH_LONG)
			.show();
			return;
		}
		mBaiduMap.addOverlay(new MarkerOptions().position(result.getLocation())
				.icon(BitmapDescriptorFactory
						.fromResource(R.drawable.icon_marka)));
		mBaiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(result
				.getLocation()));
		String strInfo = String.format("纬度:%f 经度:%f",
				result.getLocation().latitude, result.getLocation().longitude);
		Toast.makeText(context, strInfo, Toast.LENGTH_LONG).show();
	}

	@Override
	public void onGetReverseGeoCodeResult(ReverseGeoCodeResult result) {
		if (result == null || result.error != SearchResult.ERRORNO.NO_ERROR) {
			Toast.makeText(context, "抱歉,未能找到结果", Toast.LENGTH_LONG)
			.show();
			return;
		}
		mBaiduMap.addOverlay(new MarkerOptions().position(result.getLocation())
				.icon(BitmapDescriptorFactory
						.fromResource(R.drawable.icon_marka)));
		mBaiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(result
				.getLocation()));
		Toast.makeText(context, result.getAddress(),
				Toast.LENGTH_LONG).show();

	}

}


text:
package org.apache.flink.streaming.api.operators.python;

import org.apache.flink.annotation.Internal;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.functions.python.DataStreamPythonFunctionInfo;
import org.apache.flink.streaming.api.operators.InternalTimerService;
import org.apache.flink.streaming.api.utils.PythonOperatorUtils;
import org.apache.flink.streaming.api.watermark.Watermark;
import org.apache.flink.streaming.runtime.streamrecord.StreamRecord;
import org.apache.flink.types.Row;

/**
 * {@link PythonProcessOperator} is responsible for launching beam runner which will start a python
 * harness to execute user defined python ProcessFunction.
 */
@Internal
public class PythonProcessOperator<IN, OUT>
        extends OneInputPythonFunctionOperator<IN, OUT, Row, OUT> {

    private static final long serialVersionUID = 1L;

    private static final String PROCESS_FUNCTION_URN = "flink:transform:process_function:v1";

    private static final String FLAT_MAP_CODER_URN = "flink:coder:flat_map:v1";

    /** Reusable row for normal data runner inputs. */
    private transient Row reusableInput;

    /** We listen to this ourselves because we don't have an {@link InternalTimerService}. */
    private transient long currentWatermark;

    public PythonProcessOperator(
            Configuration config,
            TypeInformation<IN> inputTypeInfo,
            TypeInformation<OUT> outputTypeInfo,
            DataStreamPythonFunctionInfo pythonFunctionInfo) {
        super(
                config,
                Types.ROW(Types.LONG, Types.LONG, inputTypeInfo),
                outputTypeInfo,
                pythonFunctionInfo);
    }

    @Override
    public void open() throws Exception {
        super.open();
        reusableInput = new Row(3);
        currentWatermark = Long.MIN_VALUE;
    }

    @Override
    public void emitResult(Tuple2<byte[], Integer> resultTuple) throws Exception {
        byte[] rawResult = resultTuple.f0;
        int length = resultTuple.f1;
        if (PythonOperatorUtils.endOfLastFlatMap(length, rawResult)) {
            bufferedTimestamp.poll();
        } else {
            bais.setBuffer(rawResult, 0, length);
            OUT runnerOutput = runnerOutputTypeSerializer.deserialize(baisWrapper);
            collector.setAbsoluteTimestamp(bufferedTimestamp.peek());
            collector.collect(runnerOutput);
        }
    }

    @Override
    public void processElement(StreamRecord<IN> element) throws Exception {
        reusableInput.setField(0, element.getTimestamp());
        reusableInput.setField(1, currentWatermark);
        reusableInput.setField(2, element.getValue());
        element.replace(reusableInput);
        super.processElement(element);
    }

    @Override
    public void processWatermark(Watermark mark) throws Exception {
        super.processWatermark(mark);
        currentWatermark = mark.getTimestamp();
    }

    @Override
    public String getFunctionUrn() {
        return PROCESS_FUNCTION_URN;
    }

    @Override
    public String getCoderUrn() {
        return FLAT_MAP_CODER_URN;
    }
}


text:
from django.urls import reverse
from django_dynamic_fixture import G
from rest_framework import status
from rest_framework.test import APIClient, APITestCase

from accounts.models import User
from studies.models import Lab

class LabTestCase(APITestCase):
    def setUp(self):
        self.lab = G(Lab, name="ECCL", approved_to_test=True)
        self.lab2 = G(Lab, name="Practice lab")
        self.researcher = G(User, is_active=True, is_researcher=True)
        self.superuser = G(User, is_active=True, is_researcher=True, is_superuser=True)
        self.participant = G(User, is_active=True)
        self.url = (
            reverse("api:lab-list", kwargs={"version": "v1"}) + str(self.lab.uuid) + "/"
        )
        self.client = APIClient()

    def testGetLabDetailUnauthenticated(self):
        # Must be authenticated to view organization
        api_response = self.client.get(
            self.url, content_type="application/vnd.api+json"
        )
        self.assertEqual(api_response.status_code, status.HTTP_401_UNAUTHORIZED)

    def testGetLabDetailParticipant(self):
        self.client.force_authenticate(user=self.participant)
        api_response = self.client.get(
            self.url, content_type="application/vnd.api+json"
        )
        self.assertEqual(api_response.status_code, status.HTTP_200_OK)
        self.assertEqual(api_response.data["name"], self.lab.name)

    def testGetLabDetailResearcher(self):
        self.client.force_authenticate(user=self.researcher)
        api_response = self.client.get(
            self.url, content_type="application/vnd.api+json"
        )
        self.assertEqual(api_response.status_code, status.HTTP_200_OK)
        self.assertEqual(api_response.data["name"], self.lab.name)

    def testGetLabListResearcher(self):
        # Should only be able to get 1 (approved) lab
        self.client.force_authenticate(user=self.researcher)
        api_response = self.client.get(
            reverse("api:lab-list", kwargs={"version": "v1"}),
            content_type="application/vnd.api+json",
        )
        self.assertEqual(api_response.status_code, status.HTTP_200_OK)
        # Migration adds one approved lab so we see two, but not the unapproved one added in setup
        self.assertEqual(api_response.data["links"]["meta"]["count"], 2)
        self.assertNotIn(
            "Practice lab", [lab["name"] for lab in api_response.data["results"]]
        )

    def testPostLab(self):
        self.client.force_authenticate(user=self.superuser)
        api_response = self.client.post(
            reverse("api:lab-list", kwargs={"version": "v1"}),
            content_type="application/vnd.api+json",
        )
        self.assertEqual(api_response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)

    def testUpdateLab(self):
        self.client.force_authenticate(user=self.superuser)
        api_response = self.client.patch(
            self.url, content_type="application/vnd.api+json"
        )
        self.assertEqual(api_response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)

    def testDeleteLab(self):
        self.client.force_authenticate(user=self.superuser)
        api_response = self.client.delete(
            self.url, content_type="application/vnd.api+json"
        )
        self.assertEqual(api_response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)


text:
#ifndef MediaStreamSource_h
#define MediaStreamSource_h

#include "platform/PlatformExport.h"
#include "platform/audio/AudioDestinationConsumer.h"
#include "public/platform/WebMediaConstraints.h"
#include "wtf/Allocator.h"
#include "wtf/ThreadingPrimitives.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
#include <memory>

namespace blink {

class PLATFORM_EXPORT MediaStreamSource final : public GarbageCollectedFinalized<MediaStreamSource> {
public:
    class PLATFORM_EXPORT Observer : public GarbageCollectedMixin {
    public:
        virtual ~Observer() { }
        virtual void sourceChangedState() = 0;
    };

    class ExtraData {
        USING_FAST_MALLOC(ExtraData);
    public:
        virtual ~ExtraData() { }
    };

    enum StreamType {
        TypeAudio,
        TypeVideo
    };

    enum ReadyState {
        ReadyStateLive = 0,
        ReadyStateMuted = 1,
        ReadyStateEnded = 2
    };

    static MediaStreamSource* create(const String& id, StreamType, const String& name, bool remote, ReadyState = ReadyStateLive, bool requiresConsumer = false);

    const String& id() const { return m_id; }
    StreamType type() const { return m_type; }
    const String& name() const { return m_name; }
    bool remote() const { return m_remote; }

    void setReadyState(ReadyState);
    ReadyState getReadyState() const { return m_readyState; }

    void addObserver(Observer*);

    ExtraData* getExtraData() const { return m_extraData.get(); }
    void setExtraData(std::unique_ptr<ExtraData> extraData) { m_extraData = std::move(extraData); }

    void setConstraints(WebMediaConstraints constraints) { m_constraints = constraints; }
    WebMediaConstraints constraints() { return m_constraints; }

    void setAudioFormat(size_t numberOfChannels, float sampleRate);
    void consumeAudio(AudioBus*, size_t numberOfFrames);

    bool requiresAudioConsumer() const { return m_requiresConsumer; }
    void addAudioConsumer(AudioDestinationConsumer*);
    bool removeAudioConsumer(AudioDestinationConsumer*);
    const HeapHashSet<Member<AudioDestinationConsumer>>& audioConsumers() { return m_audioConsumers; }

    // |m_extraData| may hold pointers to GC objects, and it may touch them in destruction.
    // So this class is eagerly finalized to finalize |m_extraData| promptly.
    EAGERLY_FINALIZE();
    DECLARE_TRACE();

private:
    MediaStreamSource(const String& id, StreamType, const String& name, bool remote, ReadyState, bool requiresConsumer);

    String m_id;
    StreamType m_type;
    String m_name;
    bool m_remote;
    ReadyState m_readyState;
    bool m_requiresConsumer;
    HeapHashSet<WeakMember<Observer>> m_observers;
    Mutex m_audioConsumersLock;
    HeapHashSet<Member<AudioDestinationConsumer>> m_audioConsumers;
    std::unique_ptr<ExtraData> m_extraData;
    WebMediaConstraints m_constraints;
};

typedef HeapVector<Member<MediaStreamSource>> MediaStreamSourceVector;

} // namespace blink

#endif // MediaStreamSource_h


text:
package codacy.plugins.test

import codacy.plugins.DockerTest
import org.scalatest._

class ExampleToolTests extends FunSuite {
  test("tests with ExampleTool should pass") {
    DockerTest.main(Array("pattern", "codacy/codacy-example-tool:latest"))
  }
  test("tests with wrong test name should throw exception") {
    intercept[Exception](DockerTest.main(Array("patern", "codacy/codacy-example-tool:latest")))
  }
}


text:
package org.apache.zeppelin.resource;

/**
 * Well known resource names in ResourcePool
 */
public enum WellKnownResourceName {
  ZeppelinReplResult("zeppelin.repl.result"),                 // last object of repl
  ZeppelinTableResult("zeppelin.paragraph.result.table");     // paragraph run result

  String name;
  WellKnownResourceName(String name) {
    this.name = name;
  }

  public String toString() {
    return name;
  }
}


text:
.. _str: https://docs.python.org/2/library/stdtypes.html

.. _vim.fault.MigrationFault: ../../vim/fault/MigrationFault.rst

vim.fault.RDMNotPreserved
=========================
    :extends:

        `vim.fault.MigrationFault`_

  The virtual machine is configured with a Raw Disk Mapping. The host only supports Raw Disk Mappings in a limited fashion. After the migration, the RDM will function correctly, but it will be indistinguishable from a virtual disk when viewing the virtual machine's properties. This change will persist even if the virtual machine is migrated back to a host with full RDM support.This is a warning only for migrations to ESX 2.1.x hosts.

Attributes:

    device (`str`_)


text:
<?php

namespace Cinema\BoBundle\Controller;

use Cinema\BoBundle\Entity\Comments;
use Doctrine\Common\Util\Debug;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\RedirectResponse;

class CommentsController extends Controller
{

    public function getCommentsAction()
    {
        //getting the entity manager
        $em =$this->getDoctrine()->getManager();
        $repoComments=$em->getRepository("CinemaBoBundle:Comments");
        $commentsActives = $repoComments->getComments(6,2);
        $commentsInActives = $repoComments->getComments(6,0);
        $commentsEncoursVal = $repoComments->getComments(6,1);

        return $this->render('CinemaBoBundle:Comments:comments.html.twig',
            array("commentsActives"=>$commentsActives,
                  "commentsInActives"=>$commentsInActives,
                  "commentsEncoursVal"=>$commentsEncoursVal,
                ));
    }

}


text:
from __future__ import absolute_import, division, print_function
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}

DOCUMENTATION = '''
---
module: netscaler_save_config
short_description: Save Netscaler configuration.
description:
    - This module uncoditionally saves the configuration on the target netscaler node.
    - This module does not support check mode.
    - This module is intended to run either on the ansible  control node or a bastion (jumpserver) with access to the actual netscaler instance.

version_added: "2.4.0"

author: George Nikolopoulos (@giorgos-nikolopoulos)

options:
    nsip:
        description:
            - The ip address of the netscaler appliance where the nitro API calls will be made.
            - "The port can be specified with the colon (:). E.g. C(192.168.1.1:555)."
        required: True

    nitro_user:
        description:
            - The username with which to authenticate to the netscaler node.
        required: True

    nitro_pass:
        description:
            - The password with which to authenticate to the netscaler node.
        required: True

    nitro_protocol:
        choices: [ 'http', 'https' ]
        default: http
        description:
            - Which protocol to use when accessing the nitro API objects.

    validate_certs:
        description:
            - If C(no), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
        required: false
        default: 'yes'

    nitro_timeout:
        description:
            - Time in seconds until a timeout error is thrown when establishing a new session with Netscaler.
        default: 310

requirements:
    - nitro python sdk
'''

EXAMPLES = '''
---
- name: Save netscaler configuration
  delegate_to: localhost
  netscaler_save_config:
    nsip: 172.18.0.2
    nitro_user: nsroot
    nitro_pass: nsroot

- name: Setup server without saving  configuration
  delegate_to: localhost
  notify: Save configuration
  netscaler_server:
    nsip: 172.18.0.2
    nitro_user: nsroot
    nitro_pass: nsroot

    save_config: no

    name: server-1
    ipaddress: 192.168.1.1

# Under playbook's handlers

- name: Save configuration
  delegate_to: localhost
  netscaler_save_config:
    nsip: 172.18.0.2
    nitro_user: nsroot
    nitro_pass: nsroot
'''

RETURN = '''
loglines:
    description: list of logged messages by the module
    returned: always
    type: list
    sample: ['message 1', 'message 2']

msg:
    description: Message detailing the failure reason
    returned: failure
    type: str
    sample: "Action does not exist"

'''

import copy

try:
    from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_exception
    PYTHON_SDK_IMPORTED = True
except ImportError as e:
    PYTHON_SDK_IMPORTED = False

from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.netscaler import get_nitro_client, log, loglines, netscaler_common_arguments

def main():

    argument_spec = copy.deepcopy(netscaler_common_arguments)

    # Delete common arguments irrelevant to this module
    del argument_spec['state']
    del argument_spec['save_config']

    module = AnsibleModule(
        argument_spec=argument_spec,
        supports_check_mode=False,
    )

    module_result = dict(
        changed=False,
        failed=False,
        loglines=loglines,
    )

    # Fail the module if imports failed
    if not PYTHON_SDK_IMPORTED:
        module.fail_json(msg='Could not load nitro python sdk')

    # Fallthrough to rest of execution
    client = get_nitro_client(module)

    try:
        client.login()
    except nitro_exception as e:
        msg = "nitro exception during login. errorcode=%s, message=%s" % (str(e.errorcode), e.message)
        module.fail_json(msg=msg)
    except Exception as e:
        if str(type(e)) == "<class 'requests.exceptions.ConnectionError'>":
            module.fail_json(msg='Connection error %s' % str(e))
        elif str(type(e)) == "<class 'requests.exceptions.SSLError'>":
            module.fail_json(msg='SSL Error %s' % str(e))
        else:
            module.fail_json(msg='Unexpected error during login %s' % str(e))

    try:
        log('Saving configuration')
        client.save_config()
    except nitro_exception as e:
        msg = "nitro exception errorcode=" + str(e.errorcode) + ",message=" + e.message
        module.fail_json(msg=msg, **module_result)

    client.logout()
    module.exit_json(**module_result)

if __name__ == "__main__":
    main()


text:
import Registry from '../../Registry';
import * as anObject from '.';

/**
 * Register `.anObject` assertion in default registry.
 *
 * @author Maciej Chałapuk (maciej@chalapuk.pl)
 */
anObject.registerIn(Registry.instance);


text:
/**
 *   @file
 * This example program is part of Unidata's netCDF library for
 * scientific data access.
 *
 * This program will create a large file in netCDF classic
 * format. From the netcdf docs:
 *
 * "If you don't use the unlimited dimension, only one variable can
 * exceed 2 Gbytes in size, but it can be as large as the underlying
 * file system permits. It must be the last variable in the dataset,
 * and the offset to the beginning of this variable must be less than
 * about 2 Gbytes."
 *
 * @author Ed Hartnett
*/

#include <netcdf.h>
#include <stdio.h>
#include <string.h>

/* This macro handles errors by outputting a message to stdout and
   then exiting. */
#define NC_EXAMPLE_ERROR 2 /* This is the exit code for failure. */
#define BAIL(e) do { \
printf("Bailing out in file %s, line %d, error:%s.\n", \
__FILE__, __LINE__, nc_strerror(e)); \
return NC_EXAMPLE_ERROR; \
} while (0)

#define NUMDIMS 1
#define NUMVARS 2
/* This dim len is the max size the first of two fixed size variables
   for an 8-byte type in classic format: int((2*31 - 4) / 8), that is,
   2 GB minus a bit, on an 8 byte boundary. That number is
   268435455. But this is the longest dim len which works. */
#define DIM_LEN 268435440

int
main()
{
   int ncid, spockid, kirkid, dimids[NUMDIMS];
   double val_out = 999.99;
   size_t index[NUMDIMS] = {1};
   int res;

   /* Create the netCDF classic format file. */
   if ((res = nc_create("example.nc", NC_CLOBBER, &ncid)))
      BAIL(res);

   /* Turn off fill mode to speed things up. */
   if ((res = nc_set_fill(ncid, NC_NOFILL, NULL)))
       BAIL(res);

   /* Define dimension. */
   if ((res = nc_def_dim(ncid, "longdim", DIM_LEN, dimids)))
      BAIL(res);

   /* Define two variables. */
   if ((res = nc_def_var(ncid, "spock", NC_DOUBLE, NUMDIMS,
			 dimids, &spockid)))
      BAIL(res);
   if ((res = nc_def_var(ncid, "kirk", NC_DOUBLE, NUMDIMS,
			 dimids, &kirkid)))
      BAIL(res);

   /* We're finished defining metadata. */
   if ((res = nc_enddef(ncid)))
      BAIL(res);

   if ((res = nc_put_var1_double(ncid, spockid, index, &val_out)))
      BAIL(res);

   /* We're done! */
   if ((res = nc_close(ncid)))
      BAIL(res);

   return 0;
}


text:
'use strict';

/**
 * @ngdoc object
 * @name core.config
 * @requires ng.$stateProvider
 * @requires ng.$urlRouterProvider
 * @description Defines the routes and other config within the core module
 */
angular
    .module('core')
    .config(['$urlRouterProvider',
        function($urlRouterProvider) {

            $urlRouterProvider.otherwise('/');
        }
    ]);


text:
@interface RRManagedObject : NSManagedObject<ReaperDataSource>

@property(nonatomic,strong)id objID;
@property(nonatomic,strong)NSDate *createdAt;
@property(nonatomic,strong)NSDate *updatedAt;

@end

@interface NSManagedObject (RRManagedObject)

@end


text:
namespace chromeos {

class UserContext;

// TODO(nkostylev): Extract interface, create a BaseLoginDisplay class.
// An abstract class that defines login UI implementation.
class LoginDisplay {
 public:
  // Sign in error IDs that require detailed error screen and not just
  // a simple error bubble.
  enum SigninError {
    // Shown in case of critical TPM error.
    TPM_ERROR,
  };

  class Delegate {
   public:
    // Cancels current password changed flow.
    virtual void CancelPasswordChangedFlow() = 0;

    // Ignore password change, remove existing cryptohome and
    // force full sync of user data.
    virtual void ResyncUserData() = 0;

    // Decrypt cryptohome using user provided |old_password|
    // and migrate to new password.
    virtual void MigrateUserData(const std::string& old_password) = 0;

    // Sign in using |username| and |password| specified.
    // Used for known users only.
    virtual void Login(const UserContext& user_context,
                       const SigninSpecifics& specifics) = 0;

    // Returns true if sign in is in progress.
    virtual bool IsSigninInProgress() const = 0;

    // Sign out the currently signed in user.
    // Used when the lock screen is being displayed.
    virtual void Signout() = 0;

    // Complete sign process with specified |user_context|.
    // Used for new users authenticated through an extension.
    virtual void CompleteLogin(const UserContext& user_context) = 0;

    // Notify the delegate when the sign-in UI is finished loading.
    virtual void OnSigninScreenReady() = 0;

    // Called when the user requests enterprise enrollment.
    virtual void OnStartEnterpriseEnrollment() = 0;

    // Called when the user requests enable developer features screen.
    virtual void OnStartEnableDebuggingScreen() = 0;

    // Called when the user requests kiosk enable screen.
    virtual void OnStartKioskEnableScreen() = 0;

    // Called when the owner permission for kiosk app auto launch is requested.
    virtual void OnStartKioskAutolaunchScreen() = 0;

    // Shows wrong HWID screen.
    virtual void ShowWrongHWIDScreen() = 0;

    // Sets the displayed email for the next login attempt with |CompleteLogin|.
    // If it succeeds, user's displayed email value will be updated to |email|.
    virtual void SetDisplayEmail(const std::string& email) = 0;

    // Returns name of the currently connected network, for error message,
    virtual base::string16 GetConnectedNetworkName() = 0;

    // Restarts the public-session auto-login timer if it is running.
    virtual void ResetPublicSessionAutoLoginTimer() = 0;

    // Returns true if user is allowed to log in by domain policy.
    virtual bool IsUserWhitelisted(const std::string& user_id) = 0;

   protected:
    virtual ~Delegate();
  };

  // |background_bounds| determines the bounds of login UI background.
  LoginDisplay(Delegate* delegate, const gfx::Rect& background_bounds);
  virtual ~LoginDisplay();

  // Clears and enables fields on user pod or GAIA frame.
  virtual void ClearAndEnablePassword() = 0;

  // Initializes login UI with the user pods based on list of known users and
  // guest, new user pods if those are enabled.
  virtual void Init(const user_manager::UserList& users,
                    bool show_guest,
                    bool show_users,
                    bool show_new_user) = 0;

  // Notifies the login UI that the preferences defining how to visualize it to
  // the user have changed and it needs to refresh.
  virtual void OnPreferencesChanged() = 0;

  // Changes enabled state of the UI.
  virtual void SetUIEnabled(bool is_enabled) = 0;

  // Displays simple error bubble with |error_msg_id| specified.
  // |login_attempts| shows number of login attempts made by current user.
  // |help_topic_id| is additional help topic that is presented as link.
  virtual void ShowError(int error_msg_id,
                         int login_attempts,
                         HelpAppLauncher::HelpTopic help_topic_id) = 0;

  // Displays detailed error screen for error with ID |error_id|.
  virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) = 0;

  // Show password changed dialog. If |show_password_error| is not null
  // user already tried to enter old password but it turned out to be incorrect.
  virtual void ShowPasswordChangedDialog(bool show_password_error,
                                         const std::string& email) = 0;

  // Shows signin UI with specified email.
  virtual void ShowSigninUI(const std::string& email) = 0;

  // Show whitelist check failed error. Happens after user completes online
  // signin but whitelist check fails.
  virtual void ShowWhitelistCheckFailedError() = 0;

  gfx::Rect background_bounds() const { return background_bounds_; }
  void set_background_bounds(const gfx::Rect& background_bounds) {
    background_bounds_ = background_bounds;
  }

  Delegate* delegate() { return delegate_; }
  void set_delegate(Delegate* delegate) { delegate_ = delegate; }

  gfx::NativeWindow parent_window() const { return parent_window_; }
  void set_parent_window(gfx::NativeWindow window) { parent_window_ = window; }

  bool is_signin_completed() const { return is_signin_completed_; }
  void set_signin_completed(bool value) { is_signin_completed_ = value; }

  int width() const { return background_bounds_.width(); }

 protected:
  // Login UI delegate (controller).
  Delegate* delegate_;

  // Parent window, might be used to create dialog windows.
  gfx::NativeWindow parent_window_;

  // Bounds of the login UI background.
  gfx::Rect background_bounds_;

  // True if signin for user has completed.
  // TODO(nkostylev): Find a better place to store this state
  // in redesigned login stack.
  // Login stack (and this object) will be recreated for next user sign in.
  bool is_signin_completed_;

  DISALLOW_COPY_AND_ASSIGN(LoginDisplay);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_LOGIN_UI_LOGIN_DISPLAY_H_


text:
delete from peserta_pelatihan;
delete from peserta;

insert into peserta (id, nama, email, tanggal_lahir)
values ('aa1', 'Peserta Test 001', 'peserta.test.001@gmail.com', '2011-10-01');

insert into peserta (id, nama, email, tanggal_lahir)
values ('aa2', 'Peserta Test 002', 'peserta.test.002@gmail.com', '2011-10-02');

insert into peserta (id, nama, email, tanggal_lahir)
values ('aa3', 'Peserta Test 003', 'peserta.test.003@gmail.com', '2011-10-03');


text:
using System.Reflection;

using Abp.Modules;

using DynamicTranslator.Application.SesliSozluk.Configuration;
using DynamicTranslator.LanguageManagement;

namespace DynamicTranslator.Application.SesliSozluk
{
    [DependsOn(typeof(DynamicTranslatorApplicationModule))]
    public class DynamicTranslatorSesliSozlukModule : DynamicTranslatorModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

            Configurations.ModuleConfigurations.UseSesliSozlukTranslate().WithConfigurations(configuration =>
                          {
                              configuration.Url = "http://www.seslisozluk.net/c%C3%BCmle-%C3%A7eviri/";
                              configuration.SupportedLanguages = LanguageMapping.SesliSozluk.ToLanguages();
                          });
        }
    }
}


text:
package br.com.caelum.vraptor.converter;

import javax.enterprise.inject.Vetoed;

import br.com.caelum.vraptor.validator.Message;

/**
 * A conversion error. The message should already be i18n.
 *
 * @author guilherme silveira
 */
@Vetoed
public class ConversionException extends IllegalArgumentException {

	private static final long serialVersionUID = 8817715363221616696L;
	private final ConversionMessage message;

	public ConversionException(Message message) {
		this.message = new ConversionMessage("", message);
	}

	@Override
	public String getMessage() {
		return message.getMessage();
	}

	public ConversionMessage getValidationMessage() {
		return message;
	}
}


text:
package shapeless

import org.junit.Test
import org.junit.Assert._

import test._

class SybClassTests {

  trait gsizeAll0 extends Poly1 {
    implicit def default[T](implicit data: Lazy[Data[this.type, T, Int]]) = at[T](1+data.value.gmapQ(_).sum)
  }
  object gsizeAll extends gsizeAll0 {
    implicit def caseString = at[String](_.length)
  }

  trait gsize0 extends Poly1 {
    implicit def default[T] = at[T](_ => 1)
  }
  object gsize extends gsize0 {
    implicit def caseInt = at[Int](_ => 1)
    implicit def caseString = at[String](_.length)
  }

  def gsizeAll2[T](t: T)(implicit everything: Everything[gsize.type, plus.type, T]) = everything(t)

  trait incAll0 extends Poly1 {
    implicit def default[T](implicit data: Lazy[DataT[this.type, T]]) = at[T](data.value.gmapT(_))
  }
  object incAll extends incAll0 {
    implicit def caseInt = at[Int](_+1)
    implicit def caseString = at[String](_+"*")
  }

  object inc extends Poly1 {
    implicit def caseInt = at[Int](_+1)
    implicit def caseString = at[String](_+"*")
  }

  def incAll2[T](t: T)(implicit everywhere: Everywhere[inc.type, T]) = everywhere(t)

  sealed trait Fruit
  case class Apple(i: Int) extends Fruit
  case class Pear(i: Int) extends Fruit
  case class Banana(i: Int) extends Fruit
  case class Orange(i: Int) extends Fruit

  object showFruit extends Poly1 {
    implicit def caseApple  = at[Apple] (_ => "Pomme")
    implicit def casePear   = at[Pear]  (_ => "Poire")
    implicit def caseBanana = at[Banana](_ => "Banane")
    implicit def caseOrange = at[Orange](_ => "Orange")
  }

  object cycleFruit extends Poly1 {
    implicit def caseApple  = at[Apple] { case Apple(i)  => Pear(i) }
    implicit def casePear   = at[Pear]  { case Pear(i)   => Banana(i) }
    implicit def caseBanana = at[Banana]{ case Banana(i) => Orange(i) }
    implicit def caseOrange = at[Orange]{ case Orange(i) => Apple(i) }
  }

  sealed trait Tree[T]
  case class Leaf[T](t: T) extends Tree[T]
  case class Node[T](left: Tree[T], right: Tree[T]) extends Tree[T]

  @Test
  def testGMapQ {
    val p = (23, "foo")
    val ps = gsizeAll(p)
    assertEquals(5, ps)

    val t = (23, "foo", true, 1.0)
    val ts = gsizeAll(t)
    assertEquals(7, ts)

    val l = List(1, 2, 3)
    val ls = gsizeAll(l)
    assertEquals(4, ls)

    val lp = List(("foo", 23), ("bar", 24))
    val lps = gsizeAll(lp)
    assertEquals(11, lps)

    val pl = (List(1, 2, 3), List("foo", "bar"))
    val pls = gsizeAll(pl)
    assertEquals(12, pls)
  }

  @Test
  def testGMapT {
    val p = (23, "foo")
    val pi = incAll(p)
    assertEquals((24, "foo*"), pi)

    val t = (23, "foo", true, 1.0)
    val ti = incAll(t)
    assertEquals((24, "foo*", true, 1.0), ti)

    val lp = List((23, "foo"), (13, "bar"))
    val lpi = incAll(lp)
    assertEquals(List((24, "foo*"), (14, "bar*")), lpi)

    val o = Option(23)
    val oi = incAll(o)
    assertEquals(Some(24), oi)

    val e: Either[String, Int] = Right(23)
    val ei = incAll(e)
    assertEquals(Right(24), ei)

    val lo = List(Some(1), None, Some(2))
    val loi = incAll(lo)
    assertEquals(List(Some(2), None, Some(3)), loi)
  }

  @Test
  def testEverything {
    val e1 = everything(gsize)(plus)(23)
    typed[Int](e1)
    assertEquals(1, e1)

    val e2 = everything(gsize)(plus)("foo")
    typed[Int](e2)
    assertEquals(3, e2)

    val e3 = everything(gsize)(plus)((23, "foo"))
    typed[Int](e3)
    assertEquals(5, e3)

    val e4 = everything(gsize)(plus)(List(1, 2, 3, 4))
    typed[Int](e4)
    assertEquals(5, e4)

    val e5 = everything(gsize)(plus)(Map("foo" -> 23, "bar" -> 24))
    typed[Int](e5)
    assertEquals(11, e5)

    val e6 = everything(gsize)(plus)(Map("foo" -> List(1, 2, 3), "bar" -> Nil))
    typed[Int](e6)
    assertEquals(14, e6)

    val is = gsizeAll2(23)
    typed[Int](is)
    assertEquals(1, is)

    val ss = gsizeAll2("foo")
    typed[Int](ss)
    assertEquals(3, ss)

    val ps = gsizeAll2(23, "foo")
    typed[Int](ps)
    assertEquals(5, ps)

    val ls = gsizeAll2(List(1, 2, 3, 4))
    typed[Int](ls)
    assertEquals(5, ls)

    val lps = gsizeAll2(List(("foo", 23), ("bar", 24)))
    typed[Int](lps)
    assertEquals(11, lps)

    val mps = gsizeAll2(Map("foo" -> List(1, 2, 3), "bar" -> Nil))
    typed[Int](mps)
    assertEquals(14, mps)
  }

  @Test
  def testEverywhere {
    val pi = incAll2((23, "foo"))
    typed[(Int, String)](pi)
    assertEquals((24, "foo*"), pi)

    val oi = incAll2(Option(23))
    typed[Option[Int]](oi)
    assertEquals(Some(24), oi)

    val ei = incAll2(Right(23): Either[String, Int])
    typed[Either[String, Int]](ei)
    assertEquals(Right(24), ei)

    val loi = incAll2(List(Some(1), None, Some(2)))
    typed[List[Option[Int]]](loi)
    assertEquals(List(Some(2), None, Some(3)), loi)

    val e1 = everywhere(inc)(23)
    typed[Int](e1)
    assertEquals(24, e1)

    val e2 = everywhere(inc)(Option(23))
    typed[Option[Int]](e2)
    assertEquals(Option(24), e2)

    val e3 = everywhere(inc)(List(23))
    typed[List[Int]](e3)
    assertEquals(List(24), e3)

    val e4 = everywhere(inc)(List(Option(23)))
    typed[List[Option[Int]]](e4)
    assertEquals(List(Option(24)), e4)

    val e5 = everywhere(inc)(Option(List(23)))
    typed[Option[List[Int]]](e5)
    assertEquals(Option(List(24)), e5)

    val e6 = everywhere(inc)(List(List(List(23))))
    typed[List[List[List[Int]]]](e6)
    assertEquals(List(List(List(24))), e6)

    val e7 = everywhere(inc)(Option(Option(Option(23))))
    typed[Option[Option[Option[Int]]]](e7)
    assertEquals(Option(Option(Option(24))), e7)

    val e8 = everywhere(inc)(List(Option(List(Option(List(Option(23)))))))
    typed[List[Option[List[Option[List[Option[Int]]]]]]](e8)
    assertEquals(List(Option(List(Option(List(Option(24)))))), e8)

    val e9 = everywhere(inc)(Vector(23))
    typed[Vector[Int]](e9)
    assertEquals(Vector(24), e9)

    val e10 = everywhere(inc)(Vector(Option(23)))
    typed[Vector[Option[Int]]](e10)
    assertEquals(Vector(Option(24)), e10)

    val e11 = everywhere(inc)(Map("foo" -> 23))
    typed[Map[String, Int]](e11)
    assertEquals(Map("foo" -> 24), e11)

    val e12 = everywhere(inc)(Map("foo" -> 1, "bar" -> 2))
    typed[Map[String, Int]](e12)
    assertEquals(Map("foo" -> 2, "bar" -> 3), e12)

    val e13 = everywhere(inc)(List(Map("foo" -> Vector(Option(1), None, Option(2)))))
    typed[List[Map[String, Vector[Option[Int]]]]](e13)
    assertEquals(List(Map("foo" -> Vector(Option(2), None, Option(3)))), e13)
  }

  @Test
  def testAtoms {
    val result1 = everywhere(inc)(23)
    typed[Int](result1)
    assertEquals(24, result1)

    val result2 = everywhere(inc)("foo")
    typed[String](result2)
    assertEquals("foo*", result2)

    val result3 = everywhere(inc)(Apple(1))
    typed[Apple](result3)
    assertEquals(Apple(2), result3)

    val result4 = everywhere(inc)(Apple(1): Fruit)
    typed[Fruit](result4)
    assertEquals(Apple(2), result4)

    val result5 = everywhere(showFruit)(Apple(1))
    typed[String](result5)
    assertEquals("Pomme", result5)

    val result6 = everywhere(cycleFruit)(Apple(1))
    typed[Pear](result6)
    assertEquals(Pear(1), result6)

    val result7 = everywhere(inc)(Apple(1): Fruit)
    typed[Fruit](result7)
    assertEquals(Apple(2), result7)
  }

  @Test
  def testHList {
    val l = 23 :: "foo" :: true :: 2.0 :: HNil

    val li = everywhere(inc)(l)
    typed[Int :: String :: Boolean :: Double :: HNil](li)
    assertEquals(24 :: "foo*" :: true :: 2.0 :: HNil, li)

    val ls = everything(gsize)(plus)(l)
    typed[Int](ls)
    assertEquals(7, ls)

    val l2 = 23 :: ("foo" :: true :: HNil) :: 2.0 :: HNil

    val li2 = everywhere(inc)(l2)
    typed[Int :: (String :: Boolean :: HNil) :: Double :: HNil](li2)
    assertEquals(24 :: ("foo*" :: true :: HNil) :: 2.0 :: HNil, li2)

    val ls2 = everything(gsize)(plus)(l2)
    typed[Int](ls2)
    assertEquals(8, ls2)

    val l3 = 23 :: 2.0 :: ("foo" :: true :: HNil) :: HNil

    val li3 = everywhere(inc)(l3)
    typed[Int :: Double :: (String :: Boolean :: HNil) :: HNil](li3)
    assertEquals(24 :: 2.0 :: ("foo*" :: true :: HNil) :: HNil, li3)

    val ls3 = everything(gsize)(plus)(l3)
    typed[Int](ls3)
    assertEquals(8, ls3)
  }

  @Test
  def testCoproduct {
    type ISBT = Int :+: String :+: Boolean :+: (String, String):+: CNil

    val ci = Coproduct[ISBT](23)
    val cs = Coproduct[ISBT]("foo")
    val cb = Coproduct[ISBT](true)
    val ct = Coproduct[ISBT]("bar", "baz")

    val cii = everywhere(inc)(ci)
    typed[ISBT](cii)
    assertEquals(Inl(24), cii)

    val csi = everywhere(inc)(cs)
    typed[ISBT](csi)
    assertEquals(Inr(Inl("foo*")), csi)

    val cbi = everywhere(inc)(cb)
    typed[ISBT](cbi)
    assertEquals(Inr(Inr(Inl(true))), cbi)

    val cti = everywhere(inc)(ct)
    typed[ISBT](cti)
    assertEquals(Inr(Inr(Inr(Inl(("bar*", "baz*"))))), cti)

    val cis = everything(gsize)(plus)(ci)
    typed[Int](cis)
    assertEquals(2, cis)

    val css = everything(gsize)(plus)(cs)
    typed[Int](css)
    assertEquals(4, css)

    val cbs = everything(gsize)(plus)(cb)
    typed[Int](cbs)
    assertEquals(2, cbs)

    val cts = everything(gsize)(plus)(ct)
    typed[Int](cts)
    assertEquals(8, cts)
  }

  case class A(x: Int, y: Boolean, z: Int)

  object flip extends Poly1 {
    implicit def apply[T] = at[T](identity)
    implicit def caseBoolean = at[Boolean](!_)
  }

  @Test
  def testGeneric1 {
    val input = A(1, true,  2)
    val expected = A(1, false, 2)

    val result = everywhere(flip)(input)

    assertEquals(expected, result)
  }

  @Test
  def testGeneric2 {
    val input = List(A(1, true,  2))
    val expected = List(A(1, false, 2))

    val result = everywhere(flip)(input)

    assertEquals(expected, result)
  }

  @Test
  def testGeneric3 {
    val input =    1 :: A(1, true,  2) :: HNil
    val expected = 1 :: A(1, false, 2) :: HNil

    val result = everywhere(flip)(input)

    assertEquals(expected, result)
  }

  @Test
  def testGeneric4 {
    val input =    (1, A(1, true,  2))
    val expected = (1, A(1, false, 2))

    val result = everywhere(flip)(input)

    assertEquals(expected, result)
  }

  case class Address(street: String, city: String, postcode: String)
  case class Person(name: String, age: Int, address: Address)

  @Test
  def testGeneric5 {
    val input = Address("Southover Street", "Brighton", "BN2 9UA")
    val expected = Address("Southover Street*", "Brighton*", "BN2 9UA*")

    val result = everywhere(inc)(input)
    assertEquals(expected, result)

    val result2 = everything(gsize)(plus)(input)
    assertEquals(32, result2)
  }

  @Test
  def testGeneric6 {
    val input = Person("Joe Grey", 37, Address("Southover Street", "Brighton", "BN2 9UA"))
    val expected = Person("Joe Grey*", 38, Address("Southover Street*", "Brighton*", "BN2 9UA*"))

    val result = everywhere(inc)(input)
    assertEquals(expected, result)

    val result2 = everything(gsize)(plus)(input)
    assertEquals(42, result2)
  }

  @Test
  def testHList2 {
    val input = Apple(1) :: Pear(2) :: Banana(3) :: Orange(4) :: HNil
    val expected = Pear(1) :: Banana(2) :: Orange(3) :: Apple(4) :: HNil

    val result = everywhere(cycleFruit)(input)
    typed[Pear :: Banana :: Orange :: Apple :: HNil](result)
    assertEquals(expected, result)
  }

  @Test
  def testHList3 {
    val input = Apple(1) :: Pear(2) :: Banana(3) :: Orange(4) :: HNil
    val expected = "Pomme" :: "Poire" :: "Banane" :: "Orange" :: HNil

    val result = everywhere(showFruit)(input)
    typed[String :: String :: String :: String :: HNil](result)
    assertEquals(expected, result)
  }

  @Test
  def testCoproduct2 {
    type APBO = Apple :+: Pear :+: Banana :+: Orange :+: CNil
    type PBOA = Pear :+: Banana :+: Orange :+: Apple :+: CNil

    val input1 = Coproduct[APBO](Apple(1))
    val expected1 = Coproduct[PBOA](Pear(1))

    val result1 = everywhere(cycleFruit)(input1)
    typed[PBOA](result1)
    assertEquals(expected1, result1)

    val input2 = Coproduct[APBO](Pear(2))
    val expected2 = Coproduct[PBOA](Banana(2))

    val result2 = everywhere(cycleFruit)(input2)
    typed[PBOA](result2)
    assertEquals(expected2, result2)

    val input3 = Coproduct[APBO](Banana(3))
    val expected3 = Coproduct[PBOA](Orange(3))

    val result3 = everywhere(cycleFruit)(input3)
    typed[PBOA](result3)
    assertEquals(expected3, result3)

    val input4 = Coproduct[APBO](Orange(4))
    val expected4 = Coproduct[PBOA](Apple(4))

    val result4 = everywhere(cycleFruit)(input4)
    typed[PBOA](result4)
    assertEquals(expected4, result4)
  }

  @Test
  def testRecursion {
    val tree1: Tree[Int] = Leaf(1)
    val expected1: Tree[Int] = Leaf(2)

    val result1 = everywhere(inc)(tree1)
    typed[Tree[Int]](result1)
    assertEquals(expected1, result1)

    val tree2: Tree[Int] = Node(Leaf(1), Leaf(2))
    val expected2: Tree[Int] = Node(Leaf(2), Leaf(3))

    val result2 = everywhere(inc)(tree2)
    typed[Tree[Int]](result2)
    assertEquals(expected2, result2)

    val tree3: Tree[Int] = Node(Node(Node(Leaf(1), Node(Leaf(2), Leaf(3))), Leaf(4)), Node(Leaf(5), Leaf(6)))
    val expected3: Tree[Int] = Node(Node(Node(Leaf(2), Node(Leaf(3), Leaf(4))), Leaf(5)), Node(Leaf(6), Leaf(7)))

    val result3 = everywhere(inc)(tree3)
    typed[Tree[Int]](result3)
    assertEquals(expected3, result3)
  }
}


text:
@interface TMViewController ()

@end

@implementation TMViewController
@synthesize selectedIndex = _selectedIndex;
@synthesize ellipseProgress = _ellipseProgress;
@synthesize progress = _progress;
@synthesize timer = _timer;

- (void)viewDidLoad
{
    [super viewDidLoad];

    _ellipseProgress = [[TMEllipseProgressView alloc]init];
    _progress = 0.0;
    [_ellipseProgress setProgress:_progress];

    switch (_selectedIndex) {
        case 0:
            [_ellipseProgress setFrame:CGRectMake(10, 10, 200, 200)];
            break;
        case 1:
            [_ellipseProgress setFrame:CGRectMake(10, 10, 300, 200)];
            break;
        case 2:
            [_ellipseProgress setFrame:CGRectMake(10, 10, 200, 300)];
            [_ellipseProgress setProgressTintColor:[UIColor redColor]];
            [_ellipseProgress setTrackTintColor:[UIColor greenColor]];
            [_ellipseProgress setBarSize:20.0];
            [_ellipseProgress setStartAngle:-M_PI_4];
            break;
        default:
            break;
    }

    [[self view]addSubview:_ellipseProgress];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Action methods

- (IBAction)refreshAction:(id)sender {
    _progress = 0.0;
    [_ellipseProgress setProgress:_progress];
}

- (IBAction)pauseAction:(id)sender {
    [_timer invalidate];
}

- (IBAction)playAction:(id)sender {
    _timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(showActivity) userInfo:nil repeats:YES];
}

#pragma mark - Private methods

- (void)showActivity {
    if (_progress < 1.0) {
        _progress += 0.05;
        [_ellipseProgress setProgress:_progress animated:YES];
    } else {
        [_timer invalidate];
    }
}

@end


text:
class LIBCOMM_API CIPListener :
	public CIPConnection
{
public:
	CIPListener(void);
	virtual ~CIPListener(void);
	void Listen(int Port, string address="");
	virtual void OnSelect(CSupervisor *superviser);

};


text:
<?xml version="1.0" encoding="UTF-8"?>
<imageIndex>
  <image>
    <originalFileName>29.jpg</originalFileName>
    <size>241598</size>
    <dateLastModified>Fri, 13 May 2011 02:07:15 GMT</dateLastModified>
    <width>911</width>
    <height>683</height>
    <cachedImage>
      <fileName>fkluoiu1.jpeg</fileName>
      <dateCreated>Fri, 13 May 2011 02:07:25 GMT</dateCreated>
      <dateLastAccessed>Mon, 09 Mar 2015 21:04:34 GMT</dateLastAccessed>
      <imageFormat>jpeg</imageFormat>
      <compression>90</compression>
      <width>100</width>
      <height>75</height>
      <bgColor>#FFFFFF</bgColor>
      <transparent>True</transparent>
      <border>0</border>
      <borderColor>#000000</borderColor>
      <constrain>True</constrain>
      <pad>False</pad>
    </cachedImage>
    <cachedImage>
      <fileName>gjsqtfqp.jpeg</fileName>
      <dateCreated>Fri, 13 May 2011 02:07:29 GMT</dateCreated>
      <dateLastAccessed>Mon, 16 Mar 2015 16:28:21 GMT</dateLastAccessed>
      <imageFormat>jpeg</imageFormat>
      <compression>90</compression>
      <width>600</width>
      <height>450</height>
      <bgColor>#FFFFFF</bgColor>
      <transparent>True</transparent>
      <border>0</border>
      <borderColor>#000000</borderColor>
      <constrain>True</constrain>
      <pad>False</pad>
    </cachedImage>
    <cachedImage>
      <fileName>ikikcg5e.jpeg</fileName>
      <dateCreated>Wed, 21 Mar 2012 13:13:10 GMT</dateCreated>
      <dateLastAccessed>Tue, 13 Jan 2015 21:03:39 GMT</dateLastAccessed>
      <imageFormat>jpeg</imageFormat>
      <compression>90</compression>
      <width>911</width>
      <height>683</height>
      <bgColor>#FFFFFF</bgColor>
      <transparent>True</transparent>
      <border>0</border>
      <borderColor>#000000</borderColor>
      <constrain>False</constrain>
      <pad>False</pad>
    </cachedImage>
  </image>
</imageIndex>


text:
<?php

// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;

/**
 * Triggers Purchase Receipt to be sent after the payment status is updated
 *
 * @since 1.0.8.4
 * @param int $payment_id Payment ID
 * @return void
 */
function edd_trigger_purchase_receipt( $payment_id ) {
	// Make sure we don't send a purchase receipt while editing a payment
	if ( isset( $_POST['edd-action'] ) && 'edit_payment' == $_POST['edd-action'] )
		return;

	// Send email with secure download link
	edd_email_purchase_receipt( $payment_id );
}
add_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999, 1 );

/**
 * Resend the Email Purchase Receipt. (This can be done from the Payment History page)
 *
 * @since 1.0
 * @param array $data Payment Data
 * @return void
 */
function edd_resend_purchase_receipt( $data ) {

	$purchase_id = absint( $data['purchase_id'] );

	if( empty( $purchase_id ) ) {
		return;
	}

	if( ! current_user_can( 'edit_shop_payments' ) ) {
		wp_die( __( 'You do not have permission to edit this payment record', 'edd' ), __( 'Error', 'edd' ), array( 'response' => 403 ) );
	}

	edd_email_purchase_receipt( $purchase_id, false );

	// Grab all downloads of the purchase and update their file download limits, if needed
	// This allows admins to resend purchase receipts to grant additional file downloads
	$downloads = edd_get_payment_meta_cart_details( $purchase_id, true );

	if ( is_array( $downloads ) ) {
		foreach ( $downloads as $download ) {
			$limit = edd_get_file_download_limit( $download['id'] );
			if ( ! empty( $limit ) ) {
				edd_set_file_download_limit_override( $download['id'], $purchase_id );
			}
		}
	}

	wp_redirect( add_query_arg( array( 'edd-message' => 'email_sent', 'edd-action' => false, 'purchase_id' => false ) ) );
	exit;
}
add_action( 'edd_email_links', 'edd_resend_purchase_receipt' );

/**
 * Trigger the sending of a Test Email
 *
 * @since 1.5
 * @param array $data Parameters sent from Settings page
 * @return void
 */
function edd_send_test_email( $data ) {
	if ( ! wp_verify_nonce( $data['_wpnonce'], 'edd-test-email' ) )
		return;

	// Send a test email
    edd_email_test_purchase_receipt();

    // Remove the test email query arg
    wp_redirect( remove_query_arg( 'edd_action' ) ); exit;
}
add_action( 'edd_send_test_email', 'edd_send_test_email' );


text:
module VagrantPlugins
  module ChefInstaller
    VERSION = '1.0.0'
  end
end


text:
#import "PFBlockRetryer.h"

#import <Bolts/BFTask.h>

#import "BFTask+Private.h"

@implementation PFBlockRetryer

+ (BFTask *)retryBlock:(PFBlockRetryerBlock)block forAttempts:(NSUInteger)attempts {
    NSTimeInterval delay = initialRetryDelay_;
    delay += initialRetryDelay_ * ((double)arc4random_uniform(0x0FFFF) / 0x0FFFF);
    return [self retryBlock:block forAttempts:attempts delay:delay];
}

+ (BFTask *)retryBlock:(PFBlockRetryerBlock)block forAttempts:(NSUInteger)attempts delay:(NSTimeInterval)delay {
    return [block() continueWithBlock:^id(BFTask *task) {
        if (!task.error && !task.exception) {
            return task;
        }

        if (attempts <= 1) {
            return task;
        }

        return [[BFTask taskWithDelay:(int)(delay * 1000)] continueWithBlock:^id(BFTask *task) {
            return [self retryBlock:block forAttempts:(attempts - 1)];
        }];
    }];
}

///--------------------------------------
#pragma mark - Delay
///--------------------------------------

static NSTimeInterval initialRetryDelay_ = 1.0;

+ (void)setInitialRetryDelay:(NSTimeInterval)newDelay {
    initialRetryDelay_ = newDelay;
}

+ (NSTimeInterval)initialRetryDelay {
    return initialRetryDelay_;
}

@end


text:
'''
Created on 21/02/2013

@author: u76345
'''
import os
import sys
import logging
import re
import numpy
from datetime import datetime, time
from osgeo import gdal

from agdc import Stacker
from EOtools.utils import log_multiline
from agdc import BandLookup

SCALE_FACTOR = 10000

# Set top level standard output
console_handler = logging.StreamHandler(sys.stdout)
console_handler.setLevel(logging.INFO)
console_formatter = logging.Formatter('%(message)s')
console_handler.setFormatter(console_formatter)

logger = logging.getLogger(__name__)
if not logger.level:
    logger.setLevel(logging.DEBUG) # Default logging level for all modules
    logger.addHandler(console_handler)

class NDVIStacker(Stacker):
    """ Subclass of Stacker
    Used to implement specific functionality to create stacks of derived datasets.
    """
    def derive_datasets(self, input_dataset_dict, stack_output_info, tile_type_info):
        """ Overrides abstract function in stacker class. Called in Stacker.stack_derived() function.
        Creates PQA-masked NDVI stack

        Arguments:
            input_dataset_dict: Dict keyed by processing level (e.g. ORTHO, NBAR, PQA, DEM)
                containing all tile info which can be used within the function
                A sample is shown below (including superfluous band-specific information):

{
'NBAR': {'band_name': 'Visible Blue',
    'band_tag': 'B10',
    'end_datetime': datetime.datetime(2000, 2, 9, 23, 46, 36, 722217),
    'end_row': 77,
    'level_name': 'NBAR',
    'nodata_value': -999L,
    'path': 91,
    'satellite_tag': 'LS7',
    'sensor_name': 'ETM+',
    'start_datetime': datetime.datetime(2000, 2, 9, 23, 46, 12, 722217),
    'start_row': 77,
    'tile_layer': 1,
    'tile_pathname': '/g/data/v10/datacube/EPSG4326_1deg_0.00025pixel/LS7_ETM/150_-025/2000/LS7_ETM_NBAR_150_-025_2000-02-09T23-46-12.722217.tif',
    'x_index': 150,
    'y_index': -25},
'ORTHO': {'band_name': 'Thermal Infrared (Low Gain)',
     'band_tag': 'B61',
     'end_datetime': datetime.datetime(2000, 2, 9, 23, 46, 36, 722217),
     'end_row': 77,
     'level_name': 'ORTHO',
     'nodata_value': 0L,
     'path': 91,
     'satellite_tag': 'LS7',
     'sensor_name': 'ETM+',
     'start_datetime': datetime.datetime(2000, 2, 9, 23, 46, 12, 722217),
     'start_row': 77,
     'tile_layer': 1,
     'tile_pathname': '/g/data/v10/datacube/EPSG4326_1deg_0.00025pixel/LS7_ETM/150_-025/2000/LS7_ETM_ORTHO_150_-025_2000-02-09T23-46-12.722217.tif',
     'x_index': 150,
     'y_index': -25},
'PQA': {'band_name': 'Pixel Quality Assurance',
    'band_tag': 'PQA',
    'end_datetime': datetime.datetime(2000, 2, 9, 23, 46, 36, 722217),
    'end_row': 77,
    'level_name': 'PQA',
    'nodata_value': None,
    'path': 91,
    'satellite_tag': 'LS7',
    'sensor_name': 'ETM+',
    'start_datetime': datetime.datetime(2000, 2, 9, 23, 46, 12, 722217),
    'start_row': 77,
    'tile_layer': 1,
    'tile_pathname': '/g/data/v10/datacube/EPSG4326_1deg_0.00025pixel/LS7_ETM/150_-025/2000/LS7_ETM_PQA_150_-025_2000-02-09T23-46-12.722217.tif,
    'x_index': 150,
    'y_index': -25}
}

        Arguments (Cont'd):
            tile_type_info: dict containing tile type information.
                Obtained from stacker object (e.g: stacker.tile_type_dict[tile_type_id]).
                A sample is shown below

{'crs': 'EPSG:4326',
    'file_extension': '.tif',
    'file_format': 'GTiff',
    'format_options': 'COMPRESS=LZW,BIGTIFF=YES',
    'tile_directory': 'EPSG4326_1deg_0.00025pixel',
    'tile_type_id': 1L,
    'tile_type_name': 'Unprojected WGS84 1-degree at 4000 pixels/degree',
    'unit': 'degree',
    'x_origin': 0.0,
    'x_pixel_size': Decimal('0.00025000000000000000'),
    'x_pixels': 4000L,
    'x_size': 1.0,
    'y_origin': 0.0,
    'y_pixel_size': Decimal('0.00025000000000000000'),
    'y_pixels': 4000L,
    'y_size': 1.0}

        Function must create one or more GDAL-supported output datasets. Useful functions in the
        Stacker class include Stacker.get_pqa_mask(), but it is left to the coder to produce exactly
        what is required for a single slice of the temporal stack of derived quantities.

        Returns:
            output_dataset_info: Dict keyed by stack filename
                containing metadata info for GDAL-supported output datasets created by this function.
                Note that the key(s) will be used as the output filename for the VRT temporal stack
                and each dataset created must contain only a single band. An example is as follows:
{'/g/data/v10/tmp/ndvi/NDVI_stack_150_-025.vrt':
    {'band_name': 'Normalised Differential Vegetation Index with PQA applied',
    'band_tag': 'NDVI',
    'end_datetime': datetime.datetime(2000, 2, 9, 23, 46, 36, 722217),
    'end_row': 77,
    'level_name': 'NDVI',
    'nodata_value': None,
    'path': 91,
    'satellite_tag': 'LS7',
    'sensor_name': 'ETM+',
    'start_datetime': datetime.datetime(2000, 2, 9, 23, 46, 12, 722217),
    'start_row': 77,
    'tile_layer': 1,
    'tile_pathname': '/g/data/v10/tmp/ndvi/LS7_ETM_NDVI_150_-025_2000-02-09T23-46-12.722217.tif',
    'x_index': 150,
    'y_index': -25}
}

        """
        assert type(input_dataset_dict) == dict, 'input_dataset_dict must be a dict'

        log_multiline(logger.debug, input_dataset_dict, 'input_dataset_dict', '\t')

        # Test function to copy ORTHO & NBAR band datasets with pixel quality mask applied
        # to an output directory for stacking

        output_dataset_dict = {}
        nbar_dataset_info = input_dataset_dict.get('NBAR') # Only need NBAR data for NDVI
        if nbar_dataset_info is None:
            return

        #thermal_dataset_info = input_dataset_dict['ORTHO'] # Could have one or two thermal bands

        # Instantiate band lookup object with all required lookup parameters
        lookup = BandLookup(data_cube=self,
                            lookup_scheme_name='LANDSAT-LS5/7',
                            tile_type_id=tile_type_info['tile_type_id'],
                            satellite_tag=nbar_dataset_info['satellite_tag'],
                            sensor_name=nbar_dataset_info['sensor_name'],
                            level_name=nbar_dataset_info['level_name']
                            )

        nbar_dataset_path = nbar_dataset_info['tile_pathname']

        #=======================================================================
        # # Generate sorted list of band info for this tile type, satellite and sensor
        # band_dict = self.bands[tile_type_info['tile_type_id']][(nbar_dataset_info['satellite_tag'], nbar_dataset_info['sensor_name'])]
        # band_info_list = [band_dict[tile_layer] for tile_layer in sorted(band_dict.keys()) if band_dict[tile_layer]['level_name'] == 'NBAR']
        #=======================================================================

        # Get a boolean mask from the PQA dataset (use default parameters for mask and dilation)
        pqa_mask = self.get_pqa_mask(input_dataset_dict['PQA']['tile_pathname'])

        nbar_dataset = gdal.Open(nbar_dataset_path)
        assert nbar_dataset, 'Unable to open dataset %s' % nbar_dataset
        logger.debug('Opened NBAR dataset %s', nbar_dataset_path)

        #no_data_value = nbar_dataset_info['nodata_value']
        no_data_value = -32767 # Need a value outside the scaled range -10000 - +10000

        for output_tag in ['NDVI']: # List of outputs to generate from each file - just NDVI at this stage.

            output_stack_path = os.path.join(self.output_dir, '%s_pqa_masked.vrt' % output_tag)

            output_tile_path = os.path.join(self.output_dir, re.sub('\.\w+$',
                                                                   '_%s%s' % (output_tag,
                                                                                tile_type_info['file_extension']),
                                                                   os.path.basename(nbar_dataset_path)
                                                                   )
                                           )

            # Copy metadata for eventual inclusion in stack file output
            # This could also be written to the output tile if required
            output_dataset_info = dict(nbar_dataset_info)
            output_dataset_info['tile_pathname'] = output_tile_path # This is the most important modification - used to find
            output_dataset_info['band_name'] = '%s with PQA mask applied' % output_tag
            output_dataset_info['band_tag'] = '%s-PQA' % output_tag
            output_dataset_info['tile_layer'] = 1

            # Check for existing, valid file
            if self.refresh or not os.path.exists(output_tile_path) or not gdal.Open(output_tile_path):
                gdal_driver = gdal.GetDriverByName(tile_type_info['file_format'])
                output_dataset = gdal_driver.Create(output_tile_path,
                                                    nbar_dataset.RasterXSize, nbar_dataset.RasterYSize,
                                                    1, nbar_dataset.GetRasterBand(1).DataType,
                                                    tile_type_info['format_options'].split(','))
                assert output_dataset, 'Unable to open output dataset %s'% output_dataset
                output_dataset.SetGeoTransform(nbar_dataset.GetGeoTransform())
                output_dataset.SetProjection(nbar_dataset.GetProjection())

                output_band = output_dataset.GetRasterBand(1)

                # Calculate NDVI here
                # Remember band indices are one-based
                try:
                    # Read and adjust arrays for NIR and R
                    NIR_array = nbar_dataset.GetRasterBand(lookup.band_no['NIR']).ReadAsArray() * lookup.adjustment_multiplier['NIR'] + lookup.adjustment_offset['NIR'] * SCALE_FACTOR
                    R_array = nbar_dataset.GetRasterBand(lookup.band_no['R']).ReadAsArray() * lookup.adjustment_multiplier['R'] + lookup.adjustment_offset['R'] * SCALE_FACTOR
                except TypeError:
                    return

                data_array = numpy.true_divide(NIR_array - R_array, NIR_array + R_array) * SCALE_FACTOR

                self.apply_pqa_mask(data_array, pqa_mask, no_data_value)

                output_band.WriteArray(data_array)
                output_band.SetNoDataValue(no_data_value)
                output_band.FlushCache()

                # This is not strictly necessary - copy metadata to output dataset
                output_dataset_metadata = nbar_dataset.GetMetadata()
                if output_dataset_metadata:
                    output_dataset.SetMetadata(output_dataset_metadata)
                    log_multiline(logger.debug, output_dataset_metadata, 'output_dataset_metadata', '\t')

                output_dataset.FlushCache()
                logger.info('Finished writing %s', output_tile_path)
            else:
                logger.info('Skipped existing, valid dataset %s', output_tile_path)

            output_dataset_dict[output_stack_path] = output_dataset_info
#                    log_multiline(logger.debug, output_dataset_info, 'output_dataset_info', '\t')

        log_multiline(logger.debug, output_dataset_dict, 'output_dataset_dict', '\t')
        # NDVI dataset processed - return info
        return output_dataset_dict

if __name__ == '__main__':
    def date2datetime(input_date, time_offset=time.min):
        if not input_date:
            return None
        return datetime.combine(input_date, time_offset)
    # Stacker class takes care of command line parameters
    ndvi_stacker = NDVIStacker()

    if ndvi_stacker.debug:
        console_handler.setLevel(logging.DEBUG)

    # Check for required command line parameters
    assert ndvi_stacker.x_index, 'Tile X-index not specified (-x or --x_index)'
    assert ndvi_stacker.y_index, 'Tile Y-index not specified (-y or --y_index)'
    assert ndvi_stacker.output_dir, 'Output directory not specified (-o or --output)'

    stack_info_dict = ndvi_stacker.stack_derived(x_index=ndvi_stacker.x_index,
                         y_index=ndvi_stacker.y_index,
                         stack_output_dir=ndvi_stacker.output_dir,
                         start_datetime=date2datetime(ndvi_stacker.start_date, time.min),
                         end_datetime=date2datetime(ndvi_stacker.end_date, time.max),
                         satellite=ndvi_stacker.satellite,
                         sensor=ndvi_stacker.sensor)

    log_multiline(logger.debug, stack_info_dict, 'stack_info_dict', '\t')
    logger.info('Finished creating %d temporal stack files in %s.', len(stack_info_dict), ndvi_stacker.output_dir)