text:
/**
 * Base Model
 */

var _ = require('lodash');
var m = require('mithril');
var config = require('./global').config;
var modelConstructors = require('./global').modelConstructors;

function BaseModel(opts) {
    this.__options = {
        redraw: false,
        parse: true
    };
    this.__collections = [];
    this.__lid = _.uniqueId('model');
    this.__saved = false;
    this.__modified = false;
    this.__working = 0; // 0:idle, 1: fetch, 2: save, 3: destroy
    this.__json = {
        __model: this
    };
    _.bindAll(this, _.union(modelBindMethods, config.modelBindMethods));
    if (opts) this.opt(opts);
}

// Export class.
module.exports = BaseModel;

// Need to require after export. To fix the circular dependencies issue.
var store = require('./store');
var util = require('./util');
var Collection = require('./collection');

// Method to bind to Model object. Use by _.bindAll().
var modelBindMethods = [];

// Lodash methods to add.
var objectMethods = {
    has: 1,
    keys: 0,
    values: 0,
    pick: 1,
    omit: 1
};

// Prototype methods.
BaseModel.prototype = {
    opt: function(key, value) {
        if (_.isPlainObject(key)) _.assign(this.__options, key);
        else this.__options[key] = _.isUndefined(value) ? true : value;
    },
    // Get or set id of model.
    id: function(id) {
        return id ? this[config.keyId](id, true) : this[config.keyId]();
    },
    lid: function() {
        return this.__lid;
    },
    // Get the full url for store.
    url: function() {
        return config.baseUrl + (this.options.url || '/' + this.options.name.toLowerCase());
    },
    // Add this model to collection.
    attachCollection: function(collection) {
        if (!(collection instanceof Collection))
            throw new Error('Argument `collection` must be instance of Collection.');
        var model = collection.get(this);
        if (model && _.indexOf(this.__collections, collection) === -1) {
            // This model exist in collection.
            // Add collection to model's local reference.
            this.__collections.push(collection);
        } else {
            collection.add(this);
        }
    },
    // Remove this model from collection.
    detachCollection: function(collection) {
        if (!(collection instanceof Collection))
            throw new Error('Argument `collection` must be instance of Collection.');
        // Remove this model from collection first.
        if (collection.get(this)) collection.remove(this);
        // Remove that collection from model's collection.
        if (_.indexOf(this.__collections, collection) > -1)
            _.pull(this.__collections, collection);
    },
    // Sets all or a prop values from passed data.
    set: function(key, value, silent, saved) {
        if (_.isString(key)) this[key](value, silent);
        else this.setObject(key, silent, saved);
    },
    // Sets props by object.
    setObject: function(obj, silent, saved) {
        var isModel = obj instanceof BaseModel;
        if (!isModel && !_.isPlainObject(obj))
            throw new Error('Argument `obj` must be a model or plain object.');
        var _obj = (!isModel && this.__options.parse) ? this.options.parser(obj) : obj;
        var keys = _.keys(_obj);
        for (var i = keys.length - 1, key, val; i >= 0; i--) {
            key = keys[i];
            val = _obj[key];
            if (!this.__isProp(key) || !_.isFunction(this[key]))
                continue;
            if (isModel && _.isFunction(val)) {
                this[key](val(), true, saved);
            } else {
                this[key](val, true, saved);
            }
        }
        if (!silent) // silent
            this.__update();
    },
    // Get all or a prop values in object format. Creates a copy.
    get: function(key) {
        return key ? this[key]() : this.getCopy();
    },
    // Retrieve json representation. Including private properties.
    getJson: function() {
        return this.__json;
    },
    // Get a copy of json representation. Removing private properties.
    getCopy: function(deep, depopulate) {
        var copy = {};
        var keys = _.keys(this.__json);
        for (var i = 0, key, value; i < keys.length; i++) {
            key = keys[i];
            value = this.__json[key];
            if (this.__isProp(key)) {
                if (value && value.__model instanceof BaseModel)
                    copy[key] = depopulate ? value.__model.id() : value.__model.getCopy(deep, true);
                else
                    copy[key] = value;
            }
        }
        return deep ? _.cloneDeep(copy) : copy;
    },
    save: function(options, callback) {
        if (_.isFunction(options)) {
            callback = options;
            options = undefined;
        }
        var self = this;
        var req = this.id() ? store.put : store.post;
        this.__working = 2;
        return req.call(store, this.url(), this, options).then(function(data) {
            self.set(options && options.path ? _.get(data, options.path) : data, null, null, true);
            self.__saved = !!self.id();
            // Add to cache, if enabled
            self.__addToCache();
            self.__working = 0;
            if (_.isFunction(callback)) callback(null, data, self);
            return self;
        }, function(err) {
            self.__working = 0;
            if (_.isFunction(callback)) callback(err);
            throw err;
        });
    },
    fetch: function(options, callback) {
        if (_.isFunction(options)) {
            callback = options;
            options = undefined;
        }
        this.__working = 1;
        var self = this,
            data = this.__getDataId(),
            id = _.trim(data[config.keyId]);
        if (id && id != 'undefined' && id != 'null') {
            return store.get(this.url(), data, options).then(function(data) {
                if (data) {
                    self.set(options && options.path ? _.get(data, options.path) : data, null, null, true);
                    self.__saved = !!self.id();
                } else {
                    self.__saved = false;
                }
                self.__working = 0;
                self.__addToCache();
                if (_.isFunction(callback)) callback(null, data, self);
                return self;
            }, function(err) {
                self.__working = 0;
                if (_.isFunction(callback)) callback(err);
                throw err;
            });
        } else {
            this.__working = 0;
            var err = new Error('Model must have an id to fetch')
            if (_.isFunction(callback)) callback(err);
            return Promise.reject(err);
        }
    },
    populate: function(options, callback) {
        if (_.isFunction(options)) {
            callback = options;
            options = undefined;
        }
        var self = this;
        return new Promise(function(resolve, reject) {
            var refs = self.options.refs;
            var error;
            var countFetch = 0;
            _.forEach(refs, function(refName, refKey) {
                var value = self.__json[refKey];
                if (_.isString(value) || _.isNumber(value)) {
                    var data = {};
                    data[config.keyId] = value;
                    var model = modelConstructors[refName].create(data);
                    if (model.isSaved()) {
                        // Ok to link reference
                        self[refKey](model);
                    } else {
                        // Fetch and link
                        countFetch++;
                        model.fetch(
                            (options && options.fetchOptions && options.fetchOptions[refKey] ? options.fetchOptions[refKey] : null),
                            function(err, data, mdl) {
                                countFetch--;
                                if (err) {
                                    error = err;
                                } else {
                                    self[refKey](mdl);
                                }
                                if (!countFetch) {
                                    if (error) {
                                        reject(error);
                                        if (_.isFunction(callback)) callback(null, error);
                                    } else {
                                        // All fetched
                                        resolve(self);
                                        if (_.isFunction(callback)) callback(null, self);
                                    }
                                }
                            }
                        ).catch(reject);
                    }
                }
            });
            if (!countFetch) {
                resolve(self);
                if (_.isFunction(callback)) callback(null, self);
            }
        });
    },
    destroy: function(options, callback) {
        if (_.isFunction(options)) {
            callback = options;
            options = undefined;
        }
        // Destroy the model. Will sync to store.
        var self = this;
        var data = this.__getDataId(),
            id = _.trim(data[config.keyId]);
        this.__working = 3;
        if (id && id != 'undefined' && id != 'null') {
            return store.destroy(this.url(), data, options).then(function() {
                self.detach();
                self.__working = 0;
                if (_.isFunction(callback)) callback(null);
                self.dispose();
            }, function(err) {
                self.__working = 0;
                if (_.isFunction(callback)) callback(err);
                throw err;
            });
        } else {
            var err = new Error('Model must have an id to destroy');
            this.__working = 0;
            if (_.isFunction(callback)) callback(err);
            return Promise.reject(err);
        }
    },
    remove: function() {
        this.detach();
        this.dispose();
    },
    detach: function() {
        // Detach this model to all collection.
        var clonedCollections = _.clone(this.__collections);
        for (var i = 0; i < clonedCollections.length; i++) {
            clonedCollections[i].remove(this);
            clonedCollections[i] = null;
        }
    },
    dispose: function() {
        var keys = _.keys(this);
        var props = this.options.props;
        var i;
        this.__json.__model = null;
        for (i = 0; i < props.length; i++) {
            this[props[i]](null);
        }
        for (i = 0; i < keys.length; i++) {
            this[keys[i]] = null;
        }
    },
    isSaved: function() {
        // Fresh from store
        return this.__saved;
    },
    isNew: function() {
        return !this.__saved;
    },
    isModified: function() {
        // When a prop is modified
        return this.__modified;
    },
    isDirty: function() {
        return !this.isSaved() || this.isModified();
    },
    isWorking: function() {
        return this.__working > 0;
    },
    isFetching: function() {
        return this.__working === 1;
    },
    isSaving: function() {
        return this.__working === 2;
    },
    isDestroying: function() {
        return this.__working === 3;
    },
    __update: function() {
        var redraw;
        // Propagate change to model's collections.
        for (var i = 0; i < this.__collections.length; i++) {
            if (this.__collections[i].__update(true)) {
                redraw = true;
            }
        }
        // Levels: instance || schema || global
        if (redraw || this.__options.redraw || this.options.redraw || config.redraw) {
            // console.log('Redraw', 'Model');
            m.redraw();
        }
    },
    __isProp: function(key) {
        return _.indexOf(this.options.props, key) > -1;
    },
    __getDataId: function() {
        var dataId = {};
        dataId[config.keyId] = this.id();
        return dataId;
    },
    __addToCache: function() {
        if (this.constructor.__options.cache && !this.constructor.__cacheCollection.contains(this) && this.__saved) {
            this.constructor.__cacheCollection.add(this);
        }
    },
    __gettersetter: function(initial, key) {
        var _stream = config.stream();
        var self = this;
        // Wrapper
        function prop() {
            var value, defaultVal;
            // arguments[0] is value
            // arguments[1] is silent
            // arguments[2] is saved (from store)
            // arguments[3] is isinitial
            if (arguments.length) {
                // Write
                value = arguments[0];
                var ref = self.options.refs[key];
                if (ref) {
                    var refConstructor = modelConstructors[ref];
                    if (_.isPlainObject(value)) {
                        value = refConstructor.create(value);
                    } else if ((_.isString(value) || _.isNumber(value)) && refConstructor.__cacheCollection) {
                        // Try to find the model in the cache
                        value = refConstructor.__cacheCollection.get(value) || value;
                    }
                }
                if (value instanceof BaseModel) {
                    value.__saved = value.__saved || !!(arguments[2] && value.id());
                    value = value.getJson();
                }
                _stream(value);
                self.__modified = arguments[2] ? false : !arguments[3] && self.__json[key] !== _stream._state.value;
                self.__json[key] = _stream._state.value;
                if (!arguments[1])
                    self.__update(key);
                return value;
            }

            value = _stream();
            defaultVal = self.options && self.options.defaults[key];
            if (_.isNil(value)) {
                if (!_.isNil(defaultVal)) value = defaultVal;
            } else {
                if (value.__model instanceof BaseModel) {
                    value = value.__model;
                } else if (_.isPlainObject(value) && defaultVal instanceof BaseModel) {
                    // Fix invalid value of stream, might be due deleted reference instance model
                    _stream(null);
                    value = defaultVal;
                }
            }
            return (config.placeholder &&
                self.isFetching() &&
                key !== config.keyId &&
                _.indexOf(self.options.placehold, key) > -1 ?
                config.placeholder : value);
        }
        prop.stream = _stream;
        prop.call(this, initial, true, undefined, true);
        return prop;
    }
};

// Inject lodash methods.
util.addMethods(BaseModel.prototype, _, objectMethods, '__json');


text:
jQuery slider Eklentisi

 Kullanımı

```html
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<title>Vehbi Akdoğan Slider Eklentisi </title>
	<meta name="description" content="Vehbi Akdoğan Tab Eklentisi, jQuery tab eklentisi  " />
	<meta name="keyword" content="Vehbi Akdoğan Tab Eklentisi, jQuery tab eklentisi   " />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta name="author" content="Vehbi Akdogan" />
	<link rel="stylesheet" href="style/style.css?v=1.0" />
	<script type="text/javascript" src="http://vehbiakdogan.com/demolar/_jq.js"></script>
	<script type="text/javascript" src="js/akdoganSlider.jquery.js"></script>
	<script type="text/javascript">
		$(function(){
			$("ul.akdoganSlider").akdoganSlider({
				width:"1000px", // slider Genişlik default 100%
				height:"500px", // slider Yükseklik default 100%
				ileriGeriOk :true, // ileri Geri Nesneleri Görünsünmü ? true/false
				geriOkHtml: "Geri Git", // geri ok html
				ileriOkHtml: "İleri Git", // ileri ok html
				noktaHtml : "♠", // alt nokta html
				autoPlay: true
			});

		});
	</script>
</head>
<body>
	<div class="ortala">
		<ul class="akdoganSlider">
			<li> <img src="images/1.jpg" alt="" /> <p> İçerik Yazısı </p></li>
			<li> <img src="images/2.jpg" alt="" /> <p> İçerik Yazısı </p></li>
			<li> <img src="images/3.jpg" alt="" /> <p> İçerik Yazısı </p></li>
		</ul>
	</div>
</body>
</html>
```

 Parametreler

 width: Sliderin genişliğini belirtir. Default Değeri 100%

 height: Sliderin yüksekliğini belirtir. Default Değeri 100%

 ileriGeriOk:ileri Geri Okların Gösterilip Gösterilmeyeceğini Belirtir. Alabileceği değerler True/False. Default değeri True.

 geriOkHtml: Geri Okunun Htmlini belirtir Default Değeri "Geri" Dir. html kodu kullanabilirsiniz.

 ileriOkHtml: İleri Okunun Htmlini belirtir Default Değeri "İleri" Dir. html kodu kullanabilirsiniz.

 noktaHtml: Slider sayısını gösteren noktalardır. boş bırakırsanız sayı olarak görünecektir..

 autoPlay:Sliderin Otomatik olarak Dönmesini Gösterir. alabileceği değerler true/false. Default Değeri false.

DEMO

redpajama_set_name: RedPajamaGithub


text:
package com.melon.modules.cached;

import com.melon.modules.entity.YfhOrderlist;
import com.melon.modules.entity.YfhRunnable;
import net.spy.memcached.MemcachedClient;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;

/**
 * .
 * User: xiongjinteng@raycloud.com
 * Date: 2017/6/26
 * Time: 16:55
 */
public class YfhOrderlistService {
    private static final String hostname = "localhost";
    private static final int port = 11211;

    private static final String YFH_UPDATE_CACHE = "YFH_UPDATE_CACHE_";
    private static final String SEPARATOR = "_";
    private static final String LOCKED = "LOCKED";
    private static final int EXP_TIME = 3600 * 24;

    private static List<YfhOrderlist> yfhOrderlists;
    private static long taobaoId = 557044849L;

    @Before
    public void setUp() throws Exception {
        buildYfhOrderlists();
    }

    static void buildYfhOrderlists() {
        yfhOrderlists = new ArrayList<>();
        for (int i = 1; i <= 10; i++) {
            YfhOrderlist yfhOrderlist = new YfhOrderlist();
            yfhOrderlist.setId((long) i);
            yfhOrderlist.setTaobaoId(taobaoId);
            yfhOrderlist.setTid(i + "" + i + i + i);
            yfhOrderlists.add(yfhOrderlist);
        }
    }

    @After
    public void shotDown() {
        //memcachedClient.shutdown();
    }

    @Test
    public void test002() throws IOException {

    }

    public static void main(String[] args) throws IOException {
        buildYfhOrderlists();
        MemcachedClient memcachedClient = new MemcachedClient(new InetSocketAddress(hostname, port));
        YfhRunnable runnable = new YfhRunnable();
        runnable.setMemcachedClient(memcachedClient);
        runnable.setYfhOrderlists(yfhOrderlists);
        new Thread(runnable, "thread-1").start();
        new Thread(runnable, "thread-2").start();
        new Thread(runnable, "thread-3").start();
        new Thread(runnable, "thread-4").start();

    }
}


text:
ConvertFrom-StringData @'
    GettingIPAddressMessage = Getting the IP Address.
    ApplyingIPAddressMessage = Applying the IP Address.
    IPAddressSetStateMessage = IP Interface was set to the desired state.
    CheckingIPAddressMessage = Checking the IP Address.
    IPAddressDoesNotMatchMessage = IP Address does NOT match desired state. Expected {0}, actual {1}.
    IPAddressMatchMessage = IP Address is in desired state.
    PrefixLengthDoesNotMatchMessage = Prefix Length does NOT match desired state. Expected {0}, actual {1}.
    PrefixLengthMatchMessage = Prefix Length is in desired state.
    DHCPIsNotDisabledMessage = DHCP is NOT disabled.
    DHCPIsAlreadyDisabledMessage = DHCP is already disabled.
    DHCPIsNotTestedMessage = DHCP status is ignored when Address Family is IPv6.
    InterfaceNotAvailableError = Interface "{0}" is not available. Please select a valid interface and try again.
    AddressFormatError = Address "{0}" is not in the correct format. Please correct the Address parameter in the configuration and try again.
    AddressIPv4MismatchError = Address "{0}" is in IPv4 format, which does not match server address family {1}. Please correct either of them in the configuration and try again.
    AddressIPv6MismatchError = Address "{0}" is in IPv6 format, which does not match server address family {1}. Please correct either of them in the configuration and try again.
    PrefixLengthError = A Prefix Length of {0} is not valid for {1} addresses. Please correct the Prefix Length and try again.
'@


text:
"""
# =============================================================================

Copyright Government of Canada 2015-2017

Written by: Eric Marinier, Public Health Agency of Canada,
    National Microbiology Laboratory

Funded by the National Micriobiology Laboratory and the Genome Canada / Alberta
    Innovates Bio Solutions project "Listeria Detection and Surveillance
    using Next Generation Genomics"

Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

# =============================================================================
"""

"""
# =============================================================================

This script consolidates multiple signatures files, produced by Neptune, into
a single file containing the best signatures from all files. This script
attempts to avoid overlapping signatures. However, this is not guaranteed.

# =============================================================================
"""

import argparse
import os

import Signature
import Database
import Utility

"""
# =============================================================================

GLOBALS

# =============================================================================
"""

PROGRAM_DESCRIPTION = 'Consolidates signatures from several Neptune signature \
    files (FASTA format) into a single representative signature file, \
    determined by signature score and sequence similarity.'

# DEFAULTS #

SEED_SIZE_DEFAULT = 11

# ARGUMENTS #

LONG = "--"
SHORT = "-"

# REQUIRED ARGUMENTS #

# Signatures
SIGNATURES = "signatures"
SIGNATURES_LONG = LONG + SIGNATURES
SIGNATURES_SHORT = SHORT + "s"
SIGNATURES_HELP = "The file locations of all signatures to consolidate."

# Output
OUTPUT = "output"
OUTPUT_LONG = LONG + OUTPUT
OUTPUT_SHORT = SHORT + "o"
OUTPUT_HELP = "The output directory to place the consolidate signatures and \
    any additional files."

# OPTIONAL ARGUMENTS #

# Seed Size
SEED_SIZE = "seed-size"
SEED_SIZE_LONG = LONG + SEED_SIZE
SEED_SIZE_SHORT = SHORT + "ss"
SEED_SIZE_HELP = "The seed size used during sequence alignment."

# OTHER #

COMPILED_SIGNATURES = "compiled.fasta"
COMPILED_DATABASE = "compiled.db"
COMPILED_DATABASE_QUERY = COMPILED_DATABASE + ".query"
CONSOLIDATED_SIGNATURES = "consolidated.fasta"

"""
# =============================================================================

COMPILE SIGNATURES
------------------

PURPOSE
-------

Compiles the signatures from several Neptune signature files (FASTA format)
into a single dictionary containing all signatures. This may result in repeated
signatures.

INPUT
-----

[(STRING ID) -> (SIGNATURE) DICTIONARY] [compiledSignatures]
    An initially empty dictionary that will be filled with signatures located
    in within the [signatureLocations] files.

[(FILE LOCATION) LIST] [signatureLocations]
    A list of signature file locations from which to compile signatures from.

RETURN
------

[(STRING ID) -> (SIGNATURE) DICTIONARY] [compiledSignatures]
    A dictionary containing all compiled signatures. This dictionary is the
    same object as the initially passed [compiledSignatures] dictionary.

POST
----

The [compiledSignatures] dictionary will be filled with the signatures.

# =============================================================================
"""
def compileSignatures(compiledSignatures, signatureLocations):

    fileID = 0

    # -- Read Files -- #
    for location in signatureLocations:

        signatures = Signature.readSignatures(location)

        for signatureID in signatures:

            compileID = str(fileID) + "." + signatureID
            compiledSignatures[compileID] = signatures[signatureID]
            compiledSignatures[compileID].ID = compileID

        fileID += 1

    return compiledSignatures

"""
# =============================================================================

PRODUCE SIGNATURES
------------------

PURPOSE
-------

Produces a list of consolidated signatures by outputting signatures to a file,
while attempting to avoid outputting duplicate signatures.

INPUT
-----

[SIGNATURE LIST] [sortedSignatures]
    A list of signatures, sorted by their corresponding Neptune signature
    scores. This list of signatures may contain apparently-duplicate
    signatures.

[FILE] [blastOutputFile]
    A readable BLASTN output file. This query is the output of aligning all
    [sortedSignatures] against themselves.

[FILE] [destination]
    A writable file-like object to write the consolidated signatures.

RETURN
------

[NONE]

POST
----

The list of consolidated signatures will be written to the [destination].

# =============================================================================
"""
def produceSignatures(sortedSignatures, blastOutputFile, destination):

    hits = {}  # [SIGNATURE ID] -> [(SIGNATURE ID) LIST] // (alignments)
    outputSignatures = {}  # Collection of already-output signatures.

    # Build a list of all query hits.
    # This creates a dictionary mapping signatures that align to each other.
    # [SIGNATURE ID] -> [(SIGNATURE ID) LIST]
    for line in blastOutputFile:

        hit = Database.Hit(line)

        # We only keep the hit if the ratio of the signature-to-alignment
        # length is sufficiently long.
        if (float(hit.alignmentLength) / float(hit.length) < float(0.50)):
            continue

        # Append the signature ID to the existing list of IDs.
        if hit.ID in hits:
            hits[hit.ID].append(hit.reference)

        # Create a new list of signature IDs associated with specific
        # signature ID.
        else:
            hits[hit.ID] = [hit.reference]

    # Write the signatures to output, while maintaining a dictionary of
    # signatures that were previously written to output. This attempts to
    # avoid writing signatures appear to be duplicates or appear to overlap
    # significantly.
    for signature in sortedSignatures:

        # Is the signature close to anything already written to output?
        if(all((ID not in outputSignatures) for ID in hits[signature.ID])):

            # The signature appears to be sufficiently unique.
            # Write the signature to output and update outputed signatures.
            outputSignatures[signature.ID] = signature
            Signature.writeSignature(signature, destination)

"""
# =============================================================================

CONSOLIDATE SIGNATURES
----------------------

PURPOSE
-------

Consolidates signatures from several Neptune signature files into a single
representative Neptune signature file, determined by the signature score and
sequence similarity of all the contributing signatures.

The function compiles all the signatures into a single dictionary file, sorts
these signatures according to their Neptune signature score, and writes these
sorted signatures to a file. It then uses BLAST to query the signatures against
themselves and uses this information to report signatures in a greedy manner.
The signatures are reported in an order according to their signature score and
only if there has been no other similar signature (determined by BLAST) that
has already been reported.

INPUT
-----

[(FILE LOCATION) LIST] [signatureLocations]
    A list of Neptune signature file locations corresponding to files to
    consolidate.

[4 <= INT] [seedSize]
    The seed size used in alignments to determine similarity.

[(FILE DIRECTORY) LOCATION] [outputDirectoryLocation]
    The directory to write the output files.

RETURN
------

[NONE]

POST
----

The signatures and associated files will be written to several locations within
the [outputDirectoryLocation].

# =============================================================================
"""
def consolidateSignatures(
        signatureLocations, seedSize, outputDirectoryLocation):

    # --- Compile Signatures --- #
    compiledSignatures = {}
    compileSignatures(compiledSignatures, signatureLocations)

    # -- Sort Signatures -- #
    sortedSignatures = Signature.sortSignatures(compiledSignatures)

    # -- Write Signatures -- #
    compiledSignatureLocation = os.path.join(
        outputDirectoryLocation, COMPILED_SIGNATURES)

    compiledSignatureFile = open(compiledSignatureLocation, 'w')
    Signature.writeSignatures(sortedSignatures, compiledSignatureFile)
    compiledSignatureFile.close()

    # --- Build and Query Database --- #
    databaseLocation = os.path.join(
        outputDirectoryLocation, COMPILED_DATABASE)
    queryLocation = os.path.join(
        outputDirectoryLocation, COMPILED_DATABASE_QUERY)

    Database.createDatabaseJob(compiledSignatureLocation, databaseLocation)
    Database.queryDatabase(
        databaseLocation, compiledSignatureLocation,
        queryLocation, 0.50, seedSize)

    # --- Produce Signatures --- #
    outputLocation = os.path.join(
        outputDirectoryLocation, CONSOLIDATED_SIGNATURES)
    outputFile = open(outputLocation, 'w')
    queryFile = open(queryLocation, 'r')

    produceSignatures(sortedSignatures, queryFile, outputFile)

    outputFile.close()
    queryFile.close()

    # --- Clean Output --- #
    filelist = [f for f in os.listdir(outputDirectoryLocation)
                if f.startswith(COMPILED_DATABASE)]

    for f in filelist:
        os.remove(os.path.join(outputDirectoryLocation, f))

    os.remove(os.path.join(outputDirectoryLocation, COMPILED_SIGNATURES))

"""
# =============================================================================

PARSE

# =============================================================================
"""
def parse(parameters):

    signatureLocations = []
    Utility.expandInput(parameters[SIGNATURES], signatureLocations)

    outputDirectoryLocation = parameters[OUTPUT]

    seedSize = parameters[SEED_SIZE] \
        if parameters[SEED_SIZE] else SEED_SIZE_DEFAULT

    consolidateSignatures(
        signatureLocations, seedSize, outputDirectoryLocation)

"""
# =============================================================================

MAIN

# =============================================================================
"""
def main():

    # --- Parser ---
    parser = argparse.ArgumentParser(description=PROGRAM_DESCRIPTION)

    parser.add_argument(
        SIGNATURES_SHORT,
        SIGNATURES_LONG,
        dest=SIGNATURES,
        help=SIGNATURES_HELP,
        type=str, required=True, nargs='+')

    parser.add_argument(
        OUTPUT_SHORT,
        OUTPUT_LONG,
        dest=OUTPUT,
        help=OUTPUT_HELP,
        type=str, required=True)

    parser.add_argument(
        SEED_SIZE_SHORT,
        SEED_SIZE_LONG,
        dest=SEED_SIZE,
        help=SEED_SIZE_HELP,
        type=int, required=False)

    args = parser.parse_args()
    parameters = vars(args)
    parse(parameters)

"""
# =============================================================================
# =============================================================================
"""
if __name__ == '__main__':

    main()


text:
package com.sdl.selenium.web.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

// The method returns the current date

/**
 * @deprecated move this logic into your project
 */
public class GetData {
    public static String getToday(String format) {
        String ret = "";
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        ret = sdf.format(new Date());
        return ret;
    }

    public static String getYear() {
        String ret = "";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
        ret = sdf.format(new Date());
        return ret;
    }

    public static String getMonth() {
        String ret = "";
        SimpleDateFormat sdf = new SimpleDateFormat("MMM");
        ret = sdf.format(new Date());
        return ret;
    }

    public static String getDay() {
        String ret = "";
        SimpleDateFormat sdf = new SimpleDateFormat("dd");
        ret = sdf.format(new Date());
        return ret;
    }

    /**
     * Get Current day (+/- number of days/months/years)
     *
     * @param days days
     * @param months months
     * @param years years
     * @param format format
     * @return data
     */
    public static String getDate(int days, int months, int years, String format) {
        return getDate(days, months, years, format, Locale.ENGLISH);
    }

    public static String getDate(int days, int months, int years, String format, Locale locale) {
        Calendar now = Calendar.getInstance();
        SimpleDateFormat formatter = new SimpleDateFormat(format, locale);
        now.add(Calendar.DATE, +days);
        now.add(Calendar.MONTH, +months);
        now.add(Calendar.YEAR, +years);
        return formatter.format(now.getTime());
    }
}


text:
'use strict';

require('./_edit-biz.scss');

module.exports = {
  template: require('./edit-biz.html'),
  controller: ['$log', '$rootScope','$location', '$window','bizService', editBizController],
  controllerAs: 'editBizCtrl',
  bindings:{
    biz: '<',
    onDone: '&'
  }
};
function editBizController($log, $rootScope, $location, $window, bizService) {
  $log.debug('editBizController');

  this.biz = {};

  this.updateBiz = function() {
    bizService.updateBiz(this.biz)
    .then( biz => {
      this.biz = biz;
      this.onDone();
      $window.location.reload();
    })
    .catch( err => {
      $log.error('Failure', err);
    });
  };
}


text:
package discovery

import (
	"encoding/json"
	"fmt"
	"net/url"

	"github.com/emicklei/go-restful/swagger"

	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/errors"
	"k8s.io/kubernetes/pkg/api/unversioned"
	"k8s.io/kubernetes/pkg/api/v1"
	"k8s.io/kubernetes/pkg/client/restclient"
	"k8s.io/kubernetes/pkg/runtime"
	"k8s.io/kubernetes/pkg/version"
)

// DiscoveryInterface holds the methods that discover server-supported API groups,
// versions and resources.
type DiscoveryInterface interface {
	ServerGroupsInterface
	ServerResourcesInterface
	ServerVersionInterface
	SwaggerSchemaInterface
}

// ServerGroupsInterface has methods for obtaining supported groups on the API server
type ServerGroupsInterface interface {
	// ServerGroups returns the supported groups, with information like supported versions and the
	// preferred version.
	ServerGroups() (*unversioned.APIGroupList, error)
}

// ServerResourcesInterface has methods for obtaining supported resources on the API server
type ServerResourcesInterface interface {
	// ServerResourcesForGroupVersion returns the supported resources for a group and version.
	ServerResourcesForGroupVersion(groupVersion string) (*unversioned.APIResourceList, error)
	// ServerResources returns the supported resources for all groups and versions.
	ServerResources() (map[string]*unversioned.APIResourceList, error)
}

// ServerVersionInterface has a method for retrieving the server's version.
type ServerVersionInterface interface {
	// ServerVersion retrieves and parses the server's version (git version).
	ServerVersion() (*version.Info, error)
}

// SwaggerSchemaInterface has a method to retrieve the swagger schema.
type SwaggerSchemaInterface interface {
	// SwaggerSchema retrieves and parses the swagger API schema the server supports.
	SwaggerSchema(version unversioned.GroupVersion) (*swagger.ApiDeclaration, error)
}

// DiscoveryClient implements the functions that discover server-supported API groups,
// versions and resources.
type DiscoveryClient struct {
	*restclient.RESTClient
}

// Convert unversioned.APIVersions to unversioned.APIGroup. APIVersions is used by legacy v1, so
// group would be "".
func apiVersionsToAPIGroup(apiVersions *unversioned.APIVersions) (apiGroup unversioned.APIGroup) {
	groupVersions := []unversioned.GroupVersionForDiscovery{}
	for _, version := range apiVersions.Versions {
		groupVersion := unversioned.GroupVersionForDiscovery{
			GroupVersion: version,
			Version:      version,
		}
		groupVersions = append(groupVersions, groupVersion)
	}
	apiGroup.Versions = groupVersions
	// There should be only one groupVersion returned at /api
	apiGroup.PreferredVersion = groupVersions[0]
	return
}

// ServerGroups returns the supported groups, with information like supported versions and the
// preferred version.
func (d *DiscoveryClient) ServerGroups() (apiGroupList *unversioned.APIGroupList, err error) {
	// Get the groupVersions exposed at /api
	v := &unversioned.APIVersions{}
	err = d.Get().AbsPath("/api").Do().Into(v)
	apiGroup := unversioned.APIGroup{}
	if err == nil {
		apiGroup = apiVersionsToAPIGroup(v)
	}
	if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) {
		return nil, err
	}

	// Get the groupVersions exposed at /apis
	apiGroupList = &unversioned.APIGroupList{}
	err = d.Get().AbsPath("/apis").Do().Into(apiGroupList)
	if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) {
		return nil, err
	}
	// to be compatible with a v1.0 server, if it's a 403 or 404, ignore and return whatever we got from /api
	if err != nil && (errors.IsNotFound(err) || errors.IsForbidden(err)) {
		apiGroupList = &unversioned.APIGroupList{}
	}

	// append the group retrieved from /api to the list
	apiGroupList.Groups = append(apiGroupList.Groups, apiGroup)
	return apiGroupList, nil
}

// ServerResourcesForGroupVersion returns the supported resources for a group and version.
func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (resources *unversioned.APIResourceList, err error) {
	url := url.URL{}
	if groupVersion == "v1" {
		url.Path = "/api/" + groupVersion
	} else {
		url.Path = "/apis/" + groupVersion
	}
	resources = &unversioned.APIResourceList{}
	err = d.Get().AbsPath(url.String()).Do().Into(resources)
	if err != nil {
		// ignore 403 or 404 error to be compatible with an v1.0 server.
		if groupVersion == "v1" && (errors.IsNotFound(err) || errors.IsForbidden(err)) {
			return resources, nil
		} else {
			return nil, err
		}
	}
	return resources, nil
}

// ServerResources returns the supported resources for all groups and versions.
func (d *DiscoveryClient) ServerResources() (map[string]*unversioned.APIResourceList, error) {
	apiGroups, err := d.ServerGroups()
	if err != nil {
		return nil, err
	}
	groupVersions := unversioned.ExtractGroupVersions(apiGroups)
	result := map[string]*unversioned.APIResourceList{}
	for _, groupVersion := range groupVersions {
		resources, err := d.ServerResourcesForGroupVersion(groupVersion)
		if err != nil {
			return nil, err
		}
		result[groupVersion] = resources
	}
	return result, nil
}

// ServerVersion retrieves and parses the server's version (git version).
func (d *DiscoveryClient) ServerVersion() (*version.Info, error) {
	body, err := d.Get().AbsPath("/version").Do().Raw()
	if err != nil {
		return nil, err
	}
	var info version.Info
	err = json.Unmarshal(body, &info)
	if err != nil {
		return nil, fmt.Errorf("got '%s': %v", string(body), err)
	}
	return &info, nil
}

// SwaggerSchema retrieves and parses the swagger API schema the server supports.
func (d *DiscoveryClient) SwaggerSchema(version unversioned.GroupVersion) (*swagger.ApiDeclaration, error) {
	if version.IsEmpty() {
		return nil, fmt.Errorf("groupVersion cannot be empty")
	}

	groupList, err := d.ServerGroups()
	if err != nil {
		return nil, err
	}
	groupVersions := unversioned.ExtractGroupVersions(groupList)
	// This check also takes care the case that kubectl is newer than the running endpoint
	if stringDoesntExistIn(version.String(), groupVersions) {
		return nil, fmt.Errorf("API version: %v is not supported by the server. Use one of: %v", version, groupVersions)
	}
	var path string
	if version == v1.SchemeGroupVersion {
		path = "/swaggerapi/api/" + version.Version
	} else {
		path = "/swaggerapi/apis/" + version.Group + "/" + version.Version
	}

	body, err := d.Get().AbsPath(path).Do().Raw()
	if err != nil {
		return nil, err
	}
	var schema swagger.ApiDeclaration
	err = json.Unmarshal(body, &schema)
	if err != nil {
		return nil, fmt.Errorf("got '%s': %v", string(body), err)
	}
	return &schema, nil
}

func setDiscoveryDefaults(config *restclient.Config) error {
	config.APIPath = ""
	config.GroupVersion = nil
	config.Codec = runtime.NoopEncoder{api.Codecs.UniversalDecoder()}
	return nil
}

// NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. This client
// can be used to discover supported resources in the API server.
func NewDiscoveryClientForConfig(c *restclient.Config) (*DiscoveryClient, error) {
	config := *c
	if err := setDiscoveryDefaults(&config); err != nil {
		return nil, err
	}
	client, err := restclient.UnversionedRESTClientFor(&config)
	return &DiscoveryClient{client}, err
}

// NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. If
// there is an error, it panics.
func NewDiscoveryClientForConfigOrDie(c *restclient.Config) *DiscoveryClient {
	client, err := NewDiscoveryClientForConfig(c)
	if err != nil {
		panic(err)
	}
	return client

}

// New creates a new DiscoveryClient for the given RESTClient.
func NewDiscoveryClient(c *restclient.RESTClient) *DiscoveryClient {
	return &DiscoveryClient{c}
}

func stringDoesntExistIn(str string, slice []string) bool {
	for _, s := range slice {
		if s == str {
			return false
		}
	}
	return true
}


text:
***************
Getting started
***************

.. highlight:: javascript

Installation
============
- Get the latest and greatest version of Galleria and jQuery

- Place the galleria src folder in your project.

Usage
=====
Include jQuery and Galleria on your web page.

Use the static method ``Galleria.loadTheme()`` to load a Galleria theme::

You can also load the theme manually in your ```` tag::

Add images
----------
There are several ways of adding image data to your gallery, but the simplets
way is probably to add some HTML.Just put the images inside any container on
the site::

If you want separate thumbnails, just add them as a link::

You can also define the images as a JSON array::

Galleria also provides plugins to fetch image data from other sources like
Flickr & SlideShowPro.

Activate Galleria
-----------------
When DOM is ready, you can run Galleria. The best way to do this is to put the
following code before closing the body tag::

The galleria function takes one arguments, *options*. The options argument is
an object with Galleria options that you can use, please view the options
documentation for a complete list.

If you run into problems, try passing ``debug: true`` as an option or set
``Galleria.debug = true`` to trace errors.

More examples
-------------
With extra options::

Customize
---------
If you wish to add alternative sources of image data, try the
:doc:`/plugin/flickr` and :doc:`/plugin/slideshowpro` documentation. If you
would like to add more advanced cunstomizations, read
:doc:`/tutorial/extending`. *Good luck!*


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Lichenologist 38(6): 499 (2006)

#### Original name
Caloplaca sorediella Arup

### Remarks
null


text:
<?php

namespace Maut\BabblingBundle\Features\Context;

use Symfony\Component\HttpKernel\KernelInterface;
use Behat\Symfony2Extension\Context\KernelAwareInterface;
use Behat\MinkExtension\Context\RawMinkContext;

use Behat\Mink\Exception\ExpectationException;

use Maut\BabblingBundle\Entity\Tag;

/**
 * Feature context containing tag related tests.
 */
class TagContext extends RawMinkContext
                  implements KernelAwareInterface
{
    private $kernel;
    private $parameters;

    /**
     * Initializes context with parameters from behat.yml.
     *
     * @param array $parameters
     */
    public function __construct(array $parameters)
    {
        $this->parameters = $parameters;
    }

    /**
     * Sets HttpKernel instance.
     * This method will be automatically called by Symfony2Extension ContextInitializer.
     *
     * @param KernelInterface $kernel
     */
    public function setKernel(KernelInterface $kernel)
    {
        $this->kernel = $kernel;
    }

    /**
     * @return DoctrineEntityManager
     */
    protected function getEntityManager()
    {
        return $this->kernel->getContainer()->get('doctrine')->getManager();
    }

    /**
     * @Then /^I should see tag "([^"]*)"$/
     *
     * @param string $tag The name of the tag
     */
    public function iShouldSeeTag($tag)
    {
        $this->assertSession()->elementTextContains('css', 'ul.post-tags', $tag);
    }

    /**
     * @Given /^I should not see tag "([^"]*)"$/
     *
     * @param string $tag The name of the tag
     */
    public function iShouldNotSeeTag($tag)
    {
        $this->assertSession()->elementTextNotContains('css', 'ul.post-tags', $tag);
    }

    /**
     * @Given /^I have tag "([^"]*)" attached to blogpost with slug "([^"]*)"$/
     *
     * @param string $name The name of the tag
     * @param string $slug The slug of the blogpost
     */
    public function iHaveTagAttachedToBlogpostWithSlug($name, $slug)
    {
        $em = $this->getEntityManager();

        $post = $em->getRepository('MautBabblingBundle:Post')
            ->findOneBy(array('slug' => $slug));

        if ($post === false) {
            $message = 'The post was found.';
            throw new ExpectationException($message, $this->getSession());
        }

        $tag = $em->getRepository('MautBabblingBundle:Tag')
            ->findOneByName($name);

        if (!$tag) {
            $tag = new Tag();
            $tag->setName($name);
        }

        $tag->addPost($post);
        $post->addTag($tag);

        $em->persist($tag);
        $em->flush();
    }
}


text:
package com.metadave.breeze.ast;

public class BreezeASTVerifyContext {
}


text:
package org.ovirt.engine.core.bll.gluster;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.ovirt.engine.core.utils.MockConfigRule.mockConfig;

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

import org.junit.ClassRule;
import org.junit.Test;
import org.mockito.Mock;
import org.ovirt.engine.core.bll.BaseCommandTest;
import org.ovirt.engine.core.common.action.gluster.GlusterVolumeRebalanceParameters;
import org.ovirt.engine.core.common.businessentities.Cluster;
import org.ovirt.engine.core.common.businessentities.VDS;
import org.ovirt.engine.core.common.businessentities.VDSStatus;
import org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol;
import org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity;
import org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus;
import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity;
import org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType;
import org.ovirt.engine.core.common.businessentities.gluster.TransportType;
import org.ovirt.engine.core.common.config.ConfigValues;
import org.ovirt.engine.core.common.errors.EngineMessage;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.compat.Version;
import org.ovirt.engine.core.dao.gluster.GlusterVolumeDao;
import org.ovirt.engine.core.utils.MockConfigRule;

public class StartRebalanceGlusterVolumeCommandTest extends BaseCommandTest {
    private static final Version SUPPORTED_VERSION = new Version(3, 4);
    private static final Version UNSUPPORTED_VERSION = new Version(3, 3);

    @Mock
    GlusterVolumeDao volumeDao;

    private final Guid volumeId1 = new Guid("8bc6f108-c0ef-43ab-ba20-ec41107220f5");
    private final Guid volumeId2 = new Guid("b2cb2f73-fab3-4a42-93f0-d5e4c069a43e");
    private final Guid volumeId3 = new Guid("000000000000-0000-0000-0000-00000003");
    private final Guid volumeId4 = new Guid("000000000000-0000-0000-0000-00000004");
    private final Guid CLUSTER_ID = new Guid("b399944a-81ab-4ec5-8266-e19ba7c3c9d1");

    @ClassRule
    public static MockConfigRule mcr = new MockConfigRule(
            mockConfig(ConfigValues.GlusterAsyncTasksSupport, UNSUPPORTED_VERSION.getValue(), false),
            mockConfig(ConfigValues.GlusterAsyncTasksSupport, SUPPORTED_VERSION.getValue(), true));

    @Mock
    protected Cluster cluster;

    /**
     * The command under test.
     */
    private StartRebalanceGlusterVolumeCommand cmd;

    private void prepareMocks(StartRebalanceGlusterVolumeCommand command) {
        doReturn(volumeDao).when(command).getGlusterVolumeDao();
        doReturn(getVds(VDSStatus.Up)).when(command).getUpServer();
        doReturn(getDistributedVolume(volumeId1)).when(volumeDao).getById(volumeId1);
        doReturn(getDistributedVolume(volumeId2)).when(volumeDao).getById(volumeId2);
        doReturn(getReplicatedVolume(volumeId3, 2)).when(volumeDao).getById(volumeId3);
        doReturn(getReplicatedVolume(volumeId4, 4)).when(volumeDao).getById(volumeId4);
        doReturn(null).when(volumeDao).getById(null);
        doReturn(SUPPORTED_VERSION).when(cluster).getCompatibilityVersion();
        doReturn(cluster).when(command).getCluster();
    }

    private VDS getVds(VDSStatus status) {
        VDS vds = new VDS();
        vds.setId(Guid.newGuid());
        vds.setVdsName("gfs1");
        vds.setClusterId(CLUSTER_ID);
        vds.setStatus(status);
        return vds;
    }

    private GlusterVolumeEntity getDistributedVolume(Guid volumeId) {
        GlusterVolumeEntity volume = getVolume(volumeId);
        volume.setStatus((volumeId == volumeId1) ? GlusterStatus.UP : GlusterStatus.DOWN);
        volume.setBricks(getBricks(volumeId, 2));
        volume.setVolumeType(GlusterVolumeType.DISTRIBUTE);
        volume.setClusterId(CLUSTER_ID);
        return volume;
    }

    private GlusterVolumeEntity getReplicatedVolume(Guid volumeId, int brickCount) {
        GlusterVolumeEntity volume = getVolume(volumeId);
        volume.setStatus(GlusterStatus.UP);
        volume.setBricks(getBricks(volumeId, brickCount));
        volume.setVolumeType(GlusterVolumeType.REPLICATE);
        volume.setReplicaCount(brickCount);
        volume.setClusterId(CLUSTER_ID);
        return volume;
    }

    private GlusterVolumeEntity getVolume(Guid id) {
        GlusterVolumeEntity volumeEntity = new GlusterVolumeEntity();
        volumeEntity.setId(id);
        volumeEntity.setName("test-vol");
        volumeEntity.addAccessProtocol(AccessProtocol.GLUSTER);
        volumeEntity.addTransportType(TransportType.TCP);
        return volumeEntity;
    }

    private List<GlusterBrickEntity> getBricks(Guid volumeId, int n) {
        List<GlusterBrickEntity> bricks = new ArrayList<>();
        GlusterBrickEntity brick;
        for (Integer i = 0; i < n; i++) {
            brick = new GlusterBrickEntity();
            brick.setVolumeId(volumeId);
            brick.setBrickDirectory("/tmp/test-vol" + i.toString());
            brick.setStatus(GlusterStatus.UP);
            bricks.add(brick);
        }
        return bricks;
    }

    private StartRebalanceGlusterVolumeCommand createTestCommand(Guid volumeId) {
        return new StartRebalanceGlusterVolumeCommand(new GlusterVolumeRebalanceParameters(volumeId,
                false,
                false));
    }

    @Test
    public void validateSucceedsOnUpVolume() {
        cmd = spy(createTestCommand(volumeId1));
        prepareMocks(cmd);
        assertTrue(cmd.validate());
    }

    @Test
    public void validateSucceedsOnDistributedVolume() {
        cmd = spy(createTestCommand(volumeId4));
        prepareMocks(cmd);
        assertFalse(cmd.validate());
    }

    @Test
    public void validateFailesOnDownVolume() {
        cmd = spy(createTestCommand(volumeId2));
        prepareMocks(cmd);
        assertFalse(cmd.validate());
    }

    @Test
    public void validateFailsOnNoDistribution() {
        cmd = spy(createTestCommand(volumeId3));
        prepareMocks(cmd);
        assertFalse(cmd.validate());
    }

    @Test
    public void validateFailsOnNull() {
        cmd = spy(createTestCommand(null));
        prepareMocks(cmd);
        assertFalse(cmd.validate());
    }

    @Test
    public void validateFailsOnCompat() {
        cmd = spy(createTestCommand(volumeId1));
        prepareMocks(cmd);
        doReturn(UNSUPPORTED_VERSION).when(cluster).getCompatibilityVersion();
        assertFalse(cmd.validate());
        assertTrue(cmd.getReturnValue()
                .getValidationMessages()
                .contains(EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString()));
    }

}


text:
<!---
Copyright 2017 The AMP HTML Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# AMP CSS classes

This document describes AMP CSS classes prefixed with `amp-`. These classes allow for customizations of some features of AMP runtime and extensions.

## Input mode classes

AMP provides the following CSS classes that are set on the document's `body` to assist with some typical desktop and mobile cases:

-   `amp-mode-touch`: This class is set when AMP detects touch input.
-   `amp-mode-mouse`: This class is set when AMP detects mouse input.
-   `amp-mode-keyboard-active`: This class is set when AMP detects that the keyboard is active.

## Component-specific classes

See the _Styling_ section in the AMP component's reference documentation to learn about specific `amp-` classes used for that component (for example, `amp-carousel-button-prev` in [`amp-carousel`](https://amp.dev/documentation/components/amp-carousel#styling)).