text:
namespace Wareh.Controllers
{
    using System.Linq;
    using System.Web.Mvc;
    using Models;

    public class SupplierController : Controller
    {
        [HttpGet]
        [Authorize]
        public ActionResult Index()
        {
            using (var db = new ApplicationDbContext())
            {
                var suppliers = db.Suppliers.ToList();

                return View(suppliers);
            }
        }

        [HttpGet]
        [Authorize]
        public ActionResult Create()
        {
            return View();
        }

        [HttpPost]
        [Authorize]
        public ActionResult Create(Supplier supplier)
        {
            if (ModelState.IsValid)
            {
                using (var db = new ApplicationDbContext())
                {
                    db.Suppliers.Add(supplier);
                    db.SaveChanges();

                    return RedirectToAction("Index");
                }
            }

            return View(supplier);
        }

        [HttpGet]
        [Authorize]
        public ActionResult Edit(int? id)
        {
            using (var db = new ApplicationDbContext())
            {
                var supplier = db.Suppliers.Find(id);

                if (supplier == null)
                {
                    RedirectToAction("Index");
                }

                return View(supplier);
            }
        }

        [HttpPost]
        [Authorize]
        public ActionResult Edit(Supplier model)
        {
            if (ModelState.IsValid)
            {
                using (var db = new ApplicationDbContext())
                {
                    var supplier = db.Suppliers.Find(model.Id);

                    if (supplier == null)
                    {
                        RedirectToAction("Index");
                    }

                    supplier.Name = model.Name;
                    supplier.Address = model.Address;
                    supplier.City = model.City;
                    supplier.Country = model.Country;
                    supplier.HomePage = model.HomePage;

                    db.SaveChanges();

                    return RedirectToAction("Details", new { id = model.Id });
                }
            }

            return View(model);
        }

        [HttpGet]
        [Authorize]
        public ActionResult Details(int? id)
        {
            using (var db = new ApplicationDbContext())
            {
                var supplier = db.Suppliers.Find(id);

                if (supplier == null)
                {
                    RedirectToAction("Index");
                }

                return View(supplier);
            }
        }
    }
}


text:
<?php

// To be able to access files in this CDash installation regardless
// of getcwd() value:
//
$cdashpath = str_replace('\\', '/', dirname(dirname(__FILE__)));
set_include_path($cdashpath . PATH_SEPARATOR . get_include_path());

require_once("cdash/config.php");
require_once("cdash/pdo.php");
require_once("cdash/common.php");

$buildid = pdo_real_escape_numeric($_GET["buildid"]);
if(!isset($buildid) || !is_numeric($buildid))
  {
  echo "Not a valid buildid!";
  return;
  }

$db = pdo_connect("$CDASH_DB_HOST", "$CDASH_DB_LOGIN","$CDASH_DB_PASS");
pdo_select_db("$CDASH_DB_NAME",$db);

// Find the project variables
$build = pdo_query("SELECT name,type,siteid,projectid,starttime
                    FROM build WHERE id='$buildid'");
$build_array = pdo_fetch_array($build);

$buildtype = $build_array["type"];
$buildname = $build_array["name"];
$siteid = $build_array["siteid"];
$starttime = $build_array["starttime"];
$projectid = $build_array["projectid"];

// Find the other builds
$previousbuilds = pdo_query("SELECT build.id,build.starttime,build.endtime,build.builderrors,
                             build.buildwarnings,build.testfailed,
                             buildupdate.status as updatestatus,
                             buildupdate.warnings AS updatewarnings,
                             buildupdate.nfiles,
                             configure.status AS configurestatus,
                             configure.warnings AS configurewarnings
                             FROM build
                             JOIN build2update ON (build2update.buildid=build.id)
                             JOIN buildupdate ON (build2update.updateid=buildupdate.id)
                             JOIN configure ON (configure.buildid=build.id)
                             WHERE build.siteid='$siteid' AND build.type='$buildtype' AND build.name='$buildname'
                             AND build.projectid='$projectid' AND build.starttime<='$starttime'
                             ORDER BY build.starttime DESC LIMIT 50");
?>

Date
Update Files
Update Errors
Update Warnings
Configure Errors
Configure Warnings
Build Errors
Build Warnings
Tests Failed

<?php
$i=0;
while($build_array = pdo_fetch_array($previousbuilds))
  {
  $updateerrors = $build_array["updatestatus"];
  if($updateerrors == 0) {$updateerrors = 0;}
  $updatewarnings = $build_array["updatewarnings"];
  if($updatewarnings == 0) {$updatewarnings = 0;}
  $configureerrors = $build_array["configurestatus"];
  if($configureerrors == 0) {$configureerrors = 0;}
  $configurewarnings = $build_array["configurewarnings"];
  if($configurewarnings == 0) {$configurewarnings = 0;}

  $builderrors = $build_array["builderrors"];
  if($builderrors == 0) {$builderrors = 0;}
  $buildwarnings = $build_array["buildwarnings"];
  if($buildwarnings == 0) {$buildwarnings = 0;}
  $testfailed = $build_array["testfailed"];
  if($testfailed == 0) {$testfailed = 0;}
?>

  <?php
  if($i > 0) // Don't link the current build
    {
  ?>
    <a href="buildSummary.php?buildid=<?php echo $build_array["id"]?>">
  <?php
    }
  echo date("Y-m-d H:i:d",strtotime($build_array["starttime"]));
  if($i > 0)
    {
    echo "";
    }
   ?>

  <?php echo $build_array["nfiles"]; ?>
  <td class=<?php if($updateerrors>0) echo "error"; else echo "normal" ?>><?php echo $updateerrors; ?>
  <td class=<?php if($updatewarnings>0) echo "warning"; else echo "normal" ?>><?php echo $updatewarnings; ?>
  <td class=<?php if($configureerrors>0) echo "error"; else echo "normal" ?>><?php echo $configureerrors; ?>
  <td class=<?php if($configurewarnings>0) echo "warning"; else echo "normal" ?>><?php echo $configurewarnings; ?>
  <td class=<?php if($builderrors>0) echo "error"; else echo "normal" ?>><?php echo $builderrors; ?>
  <td class=<?php if($buildwarnings>0) echo "warning"; else echo "normal" ?>><?php echo $buildwarnings; ?>
  <td class=<?php if($testfailed>0) echo "error"; else echo "normal" ?>><?php echo $testfailed; ?>

<?php
  $i++;
  }
?>

redpajama_set_name: RedPajamaGithub


text:
define([
	"dojo/_base/declare",
	"dojo/_base/array",
	"dojo/_base/query",
	"dojo/_base/lang",
	"dojo/_base/sniff",
	"dojo/dom-class",
	"dojo/mouse",
	"dojo/keys",
	"../../core/_Module",
	"./_Base"
], function(declare, array, query, lang, sniff, domClass, mouse, keys, _Module, _Base){

	return declare(/*===== "gridx.modules.extendedSelect.Column", =====*/_Base, {
		// summary:
		//		Provides advanced column selections.
		// description:
		//		This module provides an advanced way for selecting columns by clicking, swiping, SPACE key, or CTRL/SHIFT CLICK to select multiple columns.
		//
		// example:
		//		1. Use select api on column object obtained from grid.column(i)
		//		|	grid.column(1).select();
		//		|	grid.column(1).deselect();
		//		|	grid.column(1).isSelected();
		//
		//		2. Use select api on select.row module
		//		|	grid.select.column.selectById(columnId);
		//		|	grid.select.column.deSelectById(columnId);
		//		|	grid.select.column.isSelected(columnId);
		//		|	grid.select.column.getSelected();//[]
		//		|	grid.select.column.clear();

		// name: [readonly] String
		//		module name
		name: 'selectColumn',

//        optional: ['columnResizer'],

		// columnMixin: Object
		//		A map of functions to be mixed into grid column object, so that we can use select api on column object directly
		//		- grid.column(1).select() | deselect() | isSelected();
		columnMixin: {
			select: function(){
				this.grid.select.column.selectById(this.id);
				return this;
			},
			deselect: function(){
				this.grid.select.column.deselectById(this.id);
				return this;
			},
			isSelected: function(){
				return !!this.grid._columnsById[this.id]._selected;
			}
		},

		//Public-----------------------------------------------------------------
/*=====
		selectById: function(columnId){
			// summary:
			//		Select a column by id.
		},

		deselectById: function(columnId){
			// summary:
			//		Deselect a column by id.
		},

		selectByIndex: function(columnIndex){
			// summary:
			//		Select a column by index
		},

		deSelectByIndex: function(columnIndex){
			// summary:
			//		Deselect a column by index.
		},
=====*/

		getSelected: function(){
			// summary:
			//		Get id array of all selected columns
			return array.map(array.filter(this.grid._columns, function(col){
				return col._selected;
			}), function(col){
				return col.id;
			});
		},

		clear: function(silent){
			// summary:
			//		Deselected all selected columns;
			query(".gridxColumnSelected", this.grid.domNode).forEach(function(node){
				domClass.remove(node, 'gridxColumnSelected');
				node.removeAttribute('aria-selected');
			});
			array.forEach(this.grid._columns, function(col){
				col._selected = 0;	//0 as false
			});
			this._clear();
			if(!silent){
				this._onSelectionChange();
			}
		},

		isSelected: function(){
			// summary:
			//		Check if the given column(s) are all selected.
			var cols = this.grid._columnsById;
			return array.every(arguments, function(id){
				var col = cols[id];
				return col && col._selected;
			});
		},

		//Private---------------------------------------------------------------
		_type: 'column',

		_markById: function(args, toSelect){
			array.forEach(args, function(colId){
				var col = this.grid._columnsById[colId];
				if(col){
					col._selected = toSelect;
					this._doHighlight({column: col.index}, toSelect);
				}
			}, this);
		},

		_markByIndex: function(args, toSelect){
			var i, col, columns = this.grid._columns;
			for(i = 0; i < args.length; ++i){
				var arg = args[i];
				if(lang.isArrayLike(arg)){
					var start = arg[0],
						end = arg[1],
						count;
					if(start >= 0 && start < Infinity){
						if(!(end >= start && end < Infinity)){
							end = columns.length - 1;
						}
						for(; start < end + 1; ++start){
							col = columns[start];
							if(col){
								col._selected = toSelect;
								this._doHighlight({column: col.index}, toSelect);
							}
						}
					}
				}else if(arg >= 0 && arg < Infinity){
					col = columns[arg];
					if(col){
						col._selected = toSelect;
						this._doHighlight({column: arg}, toSelect);
					}
				}
			}
		},

		_init: function(){
			var t = this, g = t.grid;
			t.batchConnect(
				[g, 'onHeaderCellMouseDown', function(e){
					if(mouse.isLeft(e) && !domClass.contains(e.target, 'gridxArrowButtonNode')){
						t._start({column: e.columnIndex}, g._isCopyEvent(e), e.shiftKey);
					}
				}],
				[g, 'onHeaderCellMouseOver', function(e){
					t._highlight({column: e.columnIndex});
				}],
				[g, 'onCellMouseOver', function(e){
					t._highlight({column: e.columnIndex});
				}],
				[g, sniff('ff') < 4 ? 'onHeaderCellKeyUp' : 'onHeaderCellKeyDown', function(e){
					if((e.keyCode == keys.SPACE || e.keyCode == keys.ENTER) && !domClass.contains(e.target, 'gridxArrowButtonNode')){
						t._start({column: e.columnIndex}, g._isCopyEvent(e), e.shiftKey);
						t._end();
					}
				}],
				[g.header, 'onMoveToHeaderCell', '_onMoveToHeaderCell']
			);
		},

		_onRender: function(start, count){
			var i, j, end = start + count, g = this.grid, bn = g.bodyNode, node,
				cols = array.filter(g._columns, function(col){
					return col._selected;
				});
			for(i = cols.length - 1; i >= 0; --i){
				for(j = start; j < end; ++j){
					node = query(['[visualindex="', j, '"] [colid="', cols[i].id, '"]'].join(''), bn)[0];
					domClass.add(node, 'gridxColumnSelected');
					node.setAttribute('aria-selected', true);
				}
			}
		},

		_onMoveToHeaderCell: function(columnId, e){
			if(e.shiftKey && (e.keyCode == keys.LEFT_ARROW || e.keyCode == keys.RIGHT_ARROW)){
				var t = this, col = t.grid._columnsById[columnId];
				t._start({column: col.index}, t.grid._isCopyEvent(e), 1);	//1 as true
				t._end();
			}
		},

		_isSelected: function(target){
			var t = this, col = t.grid._columns[target.column], id = col.id;
			return t._isRange ? array.indexOf(t._refSelectedIds, id) >= 0 : col._selected;
		},

		_beginAutoScroll: function(){
			var autoScroll = this.grid.autoScroll;
			this._autoScrollV = autoScroll.vertical;
			autoScroll.vertical = false;
		},

		_endAutoScroll: function(){
			this.grid.autoScroll.vertical = this._autoScrollV;
		},

		_doHighlight: function(target, toHighlight){
			query('[colid="' + this.grid._columns[target.column].id + '"].gridxCell', this.grid.domNode).forEach(function(node){
				domClass.toggle(node, 'gridxColumnSelected', toHighlight);
			});
		},

		_focus: function(target){
			var g = this.grid;
			if(g.focus){
				//Seems breaking encapsulation...
				g.header._focusNode(query('[colid="' + g._columns[target.column].id + '"].gridxCell', g.header.domNode)[0]);
			}
		},

		_addToSelected: function(start, end, toSelect){
			var t = this, g = t.grid, a, i;
			if(!t._isRange){
				t._refSelectedIds = t.getSelected();
			}
			if(t._isRange && t._inRange(end.column, start.column, t._lastEndItem.column)){
				start = Math.min(end.column, t._lastEndItem.column);
				end = Math.max(end.column, t._lastEndItem.column);
				for(i = start; i <= end; ++i){
					g._columns[i]._selected = array.indexOf(t._refSelectedIds, g._columns[i].id) >= 0;
				}
			}else{
				a = Math.min(start.column, end.column);
				end = Math.max(start.column, end.column);
				start = a;
				for(i = start; i <= end; ++i){
					g._columns[i]._selected = toSelect;
				}
			}
		}
	});
});


text:
import ctcp from './ctcp';
import error from './error';
import join from './join';
import kick from './kick';
import mode from './mode';
import motd from './motd';
import message from './message';
import names from './names';
import nick from './nick';
import notice from './notice';
import part from './part';
import quit from './quit';
import topic from './topic';
import welcome from './welcome';
import whois from './whois';

export const eventPluginList = [
    ctcp,
    error,
    join,
    kick,
    mode,
    motd,
    message,
    names,
    nick,
    notice,
    part,
    quit,
    topic,
    welcome,
    whois,
];


text:
Shows how create controller in Magento 2
Links:
yourDomain/index.php/controller/hello
yourDomain/index.php/controller/hello/world
yourDomain/index.php/controller/test
yourDomain/index.php/controller/test/check

License
----
MIT


text:
package com.temp.designPatterns.composite;

import java.util.List;

import com.google.common.collect.Lists;

public class Composite extends Component {

	private List<Component> childComponents = Lists.newArrayList();

	@Override
	public void someOperation() {
		if(this.childComponents != null) {
			for(Component c : childComponents) {
				c.someOperation();
			}
		}
	}

	@Override
	public void addChild(Component child) {
		childComponents.add(child);
	}

	@Override
	public void removeChild(Component child) {
		childComponents.remove(child);
	}

	@Override
	public Component getChildren(int index) {
		if(index >= 0 && index < childComponents.size()) {
			return childComponents.get(index);
		}
		return null;
	}
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="NSV game.">
	<meta name="author" content="Nikolay Tsenkov.">
	<link rel="shortcut icon" href="/css/img/favicon.ico">

	<title>NSV</title>

	<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">

	<link href="css/main.css" rel="stylesheet">


text:
import os
import re

from genomepy.exceptions import GenomeDownloadError
from genomepy.files import get_file_info
from genomepy.providers.base import BaseProvider
from genomepy.utils import cleanpath, get_genomename

class LocalProvider(BaseProvider):
    """
    Local genome provider.

    Give a local genome the genomepy treatment.
    """

    name = "Local"
    _cli_install_options = {
        "path_to_annotation": {
            "long": "path-to-annotation",
            "help": "link to the annotation file, required if this is not in the same directory as the fasta file",
            "default": None,
        },
    }

    def __init__(self):
        self.genomes = {}

    @staticmethod
    def ping():
        return True

    def genome_taxid(self, name):
        return

    def assembly_accession(self, name):
        return

    def search(self, term):
        """return an empty generator,
        same as if no genomes were found at the other providers"""
        yield from ()

    def _genome_info_tuple(self, name):
        return tuple()

    def _check_name(self, name):
        """check if genome name can be found for provider"""
        return name

    def get_genome_download_link(self, path, mask=None, **kwargs):
        path = cleanpath(path)
        if not os.path.exists(path):
            raise FileNotFoundError(f"Local path to genome does not exist: {path}")
        return path

    def get_annotation_download_link(self, name: str, **kwargs) -> str:
        """
        Return a filepath to a matching annotation.

        Parameters
        ----------
        name : str
            genome name
        **kwargs: dict, optional:
            path_to_annotation : direct path to the gene annotation

        Returns
        -------
        str
            path

        Raises
        ------
        GenomeDownloadError
            if no functional path was found
        """
        path = kwargs.get("path_to_annotation")
        if path:
            path = cleanpath(path)
            if not os.path.exists(path):
                raise FileNotFoundError(
                    f"Local path to annotation does not exist: {path}"
                )
            ext = get_file_info(path)[0]
            if ext not in [".gtf", ".gff", ".gff3", ".bed"]:
                raise TypeError(
                    "Only (gzipped) gtf, gff and bed files are supported.\n"
                )
            return path

        paths = self.get_annotation_download_links(name)
        if paths:
            return paths[0]

        raise GenomeDownloadError(
            f"No gene annotations found for {get_genomename(name)}.\n"
        )

    def get_annotation_download_links(self, name, **kwargs):
        """Returns all files containing both name and an annotation extension"""
        name = cleanpath(name)
        genome_dir = os.path.dirname(name)
        search_list = os.listdir(genome_dir)
        search_name = get_genomename(name)

        hits = []
        for ext in ["gtf", "gff", "gff3"]:
            # .*? = non greedy filler. (\.gz)? = optional .gz
            expr = f"{search_name}.*?\.{ext}(\.gz)?"  # noqa: W605
            for line in search_list:
                hit = re.search(expr, line, flags=re.IGNORECASE)
                if hit:
                    hit = os.path.join(genome_dir, hit[0])
                    hits.append(hit)

        return hits


text:
package org.keycloak.common;

import static org.keycloak.common.Profile.Type.DEPRECATED;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Properties;
import java.util.Set;
import org.jboss.logging.Logger;

/**
 * @author Bill Burke
 * @version $Revision: 1 $
 */
public class Profile {

    public static final String PRODUCT_NAME = ProductValue.RHSSO.getName();
    public static final String PROJECT_NAME = ProductValue.KEYCLOAK.getName();
    private static final Logger logger = Logger.getLogger(Profile.class);

    private static Profile CURRENT;
    private final ProductValue product;
    private final ProfileValue profile;
    private final Set<Feature> disabledFeatures = new HashSet<>();
    private final Set<Feature> previewFeatures = new HashSet<>();
    private final Set<Feature> experimentalFeatures = new HashSet<>();
    private final Set<Feature> deprecatedFeatures = new HashSet<>();
    private final PropertyResolver propertyResolver;
    public Profile(PropertyResolver resolver) {
        this.propertyResolver = resolver;
        Config config = new Config();

        product = PRODUCT_NAME.toLowerCase().equals(Version.NAME) ? ProductValue.RHSSO : ProductValue.KEYCLOAK;
        profile = ProfileValue.valueOf(config.getProfile().toUpperCase());

        for (Feature f : Feature.values()) {
            Boolean enabled = config.getConfig(f);
            Type type = product.equals(ProductValue.RHSSO) ? f.getTypeProduct() : f.getTypeProject();

            switch (type) {
                case DEFAULT:
                    if (enabled != null && !enabled) {
                        disabledFeatures.add(f);
                    }
                    break;
                case DEPRECATED:
                    deprecatedFeatures.add(f);
                case DISABLED_BY_DEFAULT:
                    if (enabled == null || !enabled) {
                        disabledFeatures.add(f);
                    } else if (DEPRECATED.equals(type)) {
                        logger.warnf("Deprecated feature enabled: " + f.name().toLowerCase());
                    }
                    break;
                case PREVIEW:
                    previewFeatures.add(f);
                    if ((enabled == null || !enabled) && !profile.equals(ProfileValue.PREVIEW)) {
                        disabledFeatures.add(f);
                    } else {
                        logger.info("Preview feature enabled: " + f.name().toLowerCase());
                    }
                    break;
                case EXPERIMENTAL:
                    experimentalFeatures.add(f);
                    if (enabled == null || !enabled) {
                        disabledFeatures.add(f);
                    } else {
                        logger.warn("Experimental feature enabled: " + f.name().toLowerCase());
                    }
                    break;
            }
        }

        if ((!disabledFeatures.contains(Feature.ADMIN2) || !disabledFeatures.contains(Feature.ADMIN)) && disabledFeatures.contains(Feature.ADMIN_API)) {
                throw new RuntimeException(String.format("Invalid value for feature: %s needs to be enabled because it is required by feature %s.",
                        Feature.ADMIN_API, Arrays.asList(Feature.ADMIN, Feature.ADMIN2)));
        }
    }

    private static Profile getInstance() {
        if (CURRENT == null) {
            CURRENT = new Profile(null);
        }
        return CURRENT;
    }

    public static void setInstance(Profile instance) {
        CURRENT = instance;
    }

    public static void init() {
        PropertyResolver resolver = null;

        if (CURRENT != null) {
            resolver = CURRENT.propertyResolver;
        }

        CURRENT = new Profile(resolver);
    }

    public static String getName() {
        return getInstance().profile.name().toLowerCase();
    }

    public static Set<Feature> getDisabledFeatures() {
        return getInstance().disabledFeatures;
    }

    public static Set<Feature> getPreviewFeatures() {
        return getInstance().previewFeatures;
    }

    public static Set<Feature> getExperimentalFeatures() {
        return getInstance().experimentalFeatures;
    }

    public static Set<Feature> getDeprecatedFeatures() {
        return getInstance().deprecatedFeatures;
    }

    public static boolean isFeatureEnabled(Feature feature) {
        return !getInstance().disabledFeatures.contains(feature);
    }

    public static boolean isProduct() {
        return getInstance().profile.equals(ProfileValue.PRODUCT);
    }

    public enum Type {
        DEFAULT,
        DISABLED_BY_DEFAULT,
        PREVIEW,
        EXPERIMENTAL,
        DEPRECATED;
    }

    public enum Feature {
        AUTHORIZATION("Authorization Service", Type.DEFAULT),
        ACCOUNT2("New Account Management Console", Type.DEFAULT),
        ACCOUNT_API("Account Management REST API", Type.DEFAULT),
        ADMIN_FINE_GRAINED_AUTHZ("Fine-Grained Admin Permissions", Type.PREVIEW),
        /**
         * Controls the availability of the Admin REST-API.
         */
        ADMIN_API("Admin API", Type.DEFAULT),

        /**
         * Controls the availability of the legacy admin-console.
         * Note that the admin-console requires the {@link #ADMIN_API} feature.
         */
        @Deprecated
        ADMIN("Legacy Admin Console", Type.DEPRECATED),

        /**
         * Controls the availability of the admin-console.
         * Note that the admin-console requires the {@link #ADMIN_API} feature.
         */
        ADMIN2("New Admin Console", Type.DEFAULT),
        DOCKER("Docker Registry protocol", Type.DISABLED_BY_DEFAULT),
        IMPERSONATION("Ability for admins to impersonate users", Type.DEFAULT),
        OPENSHIFT_INTEGRATION("Extension to enable securing OpenShift", Type.PREVIEW),
        SCRIPTS("Write custom authenticators using JavaScript", Type.PREVIEW),
        TOKEN_EXCHANGE("Token Exchange Service", Type.PREVIEW),
        WEB_AUTHN("W3C Web Authentication (WebAuthn)", Type.DEFAULT),
        CLIENT_POLICIES("Client configuration policies", Type.DEFAULT),
        CIBA("OpenID Connect Client Initiated Backchannel Authentication (CIBA)", Type.DEFAULT),
        MAP_STORAGE("New store", Type.EXPERIMENTAL),
        PAR("OAuth 2.0 Pushed Authorization Requests (PAR)", Type.DEFAULT),
        DECLARATIVE_USER_PROFILE("Configure user profiles using a declarative style", Type.PREVIEW),
        DYNAMIC_SCOPES("Dynamic OAuth 2.0 scopes", Type.EXPERIMENTAL),
        CLIENT_SECRET_ROTATION("Client Secret Rotation", Type.PREVIEW),
        STEP_UP_AUTHENTICATION("Step-up Authentication", Type.DEFAULT),
        RECOVERY_CODES("Recovery codes", Type.PREVIEW),
        UPDATE_EMAIL("Update Email Action", Type.PREVIEW);

        private final Type typeProject;
        private final Type typeProduct;
        private String label;

        Feature(String label, Type type) {
            this(label, type, type);
        }

        Feature(String label, Type typeProject, Type typeProduct) {
            this.label = label;
            this.typeProject = typeProject;
            this.typeProduct = typeProduct;
        }

        public String getLabel() {
            return label;
        }

        public Type getTypeProject() {
            return typeProject;
        }

        public Type getTypeProduct() {
            return typeProduct;
        }

        public boolean hasDifferentProductType() {
            return typeProject != typeProduct;
        }
    }

    private enum ProductValue {
        KEYCLOAK("Keycloak"),
        RHSSO("RH-SSO");

        private final String name;

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

        public String getName() {
            return name;
        }
    }

    private enum ProfileValue {
        COMMUNITY,
        PRODUCT,
        PREVIEW
    }

    public interface PropertyResolver {
        String resolve(String feature);
    }

    private class Config {

        private Properties properties;

        public Config() {
            properties = new Properties();

            try {
                String jbossServerConfigDir = System.getProperty("jboss.server.config.dir");
                if (jbossServerConfigDir != null) {
                    File file = new File(jbossServerConfigDir, "profile.properties");
                    if (file.isFile()) {
                        try (FileInputStream is = new FileInputStream(file)) {
                            properties.load(is);
                        }
                    }
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public String getProfile() {
            String profile = getProperty("keycloak.profile");
            if (profile != null) {
                return profile;
            }

            profile = properties.getProperty("profile");
            if (profile != null) {
                return profile;
            }

            return Version.DEFAULT_PROFILE;
        }

        public Boolean getConfig(Feature feature) {
            String config = getProperty("keycloak.profile.feature." + feature.name().toLowerCase());

            if (config == null) {
                config = properties.getProperty("feature." + feature.name().toLowerCase());
            }

            if (config == null) {
                return null;
            } else if (config.equals("enabled")) {
                return Boolean.TRUE;
            } else if (config.equals("disabled")) {
                return Boolean.FALSE;
            } else {
                throw new RuntimeException("Invalid value for feature " + config);
            }
        }

        private String getProperty(String name) {
            String value = System.getProperty(name);

            if (value != null) {
                return value;
            }

            if (propertyResolver != null) {
                return propertyResolver.resolve(name);
            }

            return null;
        }
    }

}


text:
import weakref
from Foundation import NSObject, NSRect, NSMakeRect, NSZeroRect
from AppKit import NSView, NSViewController, NSPopover, NSMinXEdge, NSMaxXEdge, \
    NSMinYEdge, NSMaxYEdge, NSPopoverBehaviorApplicationDefined, NSPopoverBehaviorTransient, \
    NSPopoverBehaviorSemitransient

from vanilla.vanillaBase import VanillaBaseObject, _breakCycles, _addAutoLayoutRules
from vanilla.nsSubclasses import getNSSubclass

_edgeMap = {
    "left": NSMinXEdge,
    "right": NSMaxXEdge,
    "top": NSMinYEdge,
    "bottom": NSMaxYEdge
}

_behaviorMap = {
    "applicationDefined": NSPopoverBehaviorApplicationDefined,
    "transient": NSPopoverBehaviorTransient,
    "semitransient": NSPopoverBehaviorSemitransient
}

class VanillaPopoverContentView(NSView):

    def _getContentView(self):
        return self

class VanillaPopoverDelegate(NSObject):

    def popoverWillShow_(self, notification):
        self.vanillaWrapper()._alertBindings("will show")

    def popoverDidShow_(self, notification):
        self.vanillaWrapper()._alertBindings("did show")

    def popoverWillClose_(self, notification):
        self.vanillaWrapper()._alertBindings("will close")

    def popoverDidClose_(self, notification):
        self.vanillaWrapper()._alertBindings("did close")

class Popover(VanillaBaseObject):

    """
    A popover capable of containing controls.

    .. image:: /_images/Popover.png

    ::

        from vanilla import Window, List, Popover, TextBox

        class PopoverExample:

            def __init__(self):
                self.w = Window((120, 120))
                self.w.list = List((0, 0, -0, -0),
                        ['A', 'B', 'C'],
                        selectionCallback=self.showPopoverCallback)
                self.w.open()

            def showPopoverCallback(self, sender):
                selection = sender.getSelection()
                if not selection:
                    return
                index = sender.getSelection()[0]
                relativeRect = sender.getNSTableView().rectOfRow_(index)
                self.pop = Popover((140, 80))
                self.pop.text = TextBox((10, 10, -10, -10), 'This is a popover.')
                self.pop.open(parentView=sender.getNSTableView(), preferredEdge='right', relativeRect=relativeRect)

        PopoverExample()

    **size** Tuple of form *(width, height)* representing the size of the content
    in the popover.

    **parentView** The parent view that the popover should pop out from. This
    can be either a vanilla object or an instance of `NSView`_ or `NSView_` subclass.

    **preferredEdge** The edge of the parent view that you want the popover
    to pop out from. These are the options:

    +------------+
    | *"left"*   |
    +------------+
    | *"right"*  |
    +------------+
    | *"top"*    |
    +------------+
    | *"bottom"* |
    +------------+

    **behavior** The desired behavior of the popover. These are the options:

    +------------------------+-----------------------------------------------------+
    | *"applicationDefined"* | Corresponds to NSPopoverBehaviorApplicationDefined. |
    +------------------------+-----------------------------------------------------+
    | *"transient"*          | Corresponds to NSPopoverBehaviorTransient.          |
    +------------------------+-----------------------------------------------------+
    | *"semitransient"*      | Corresponds to NSPopoverBehaviorSemitransient.      |
    +------------------------+-----------------------------------------------------+

    .. _NSView: https://developer.apple.com/documentation/appkit/nsview?language=objc
    """

    nsPopoverClass = NSPopover
    contentViewClass = VanillaPopoverContentView
    contentViewControllerClass = NSViewController

    def __init__(self, size, parentView=None, preferredEdge="top", behavior="semitransient"):
        if isinstance(parentView, VanillaBaseObject):
            parentView = parentView._getContentView()
        self._parentView = parentView
        self._preferredEdge = preferredEdge
        # content view and controller
        self._nsObject = getNSSubclass(self.contentViewClass).alloc().initWithFrame_(((0, 0), size))
        self._contentViewController = self.contentViewControllerClass.alloc().init()
        self._contentViewController.setView_(self._nsObject)
        # popover
        cls = getNSSubclass(self.nsPopoverClass)
        self._popover = cls.alloc().init()
        self._popover.setContentViewController_(self._contentViewController)
        self._popover.setBehavior_(_behaviorMap[behavior])
        # delegate
        self._delegate = VanillaPopoverDelegate.alloc().init()
        self._delegate.vanillaWrapper = weakref.ref(self)
        self._popover.setDelegate_(self._delegate)
        self._bindings = {}
        self._autoLayoutViews = {}

    def __del__(self):
        self._breakCycles()

    def _breakCycles(self):
        super(Popover, self)._breakCycles()
        view = self._getContentView()
        if view is not None:
            _breakCycles(view)
        self._contentViewController = None
        self._popover = None
        self._parentView = None
        self._delegate = None

    def getNSPopover(self):
        return self._popover

    def open(self, parentView=None, preferredEdge=None, relativeRect=None):
        """
        Open the popover. If desired, the *parentView* may be specified.
        If not, the values assigned during init will be used.

        Additionally, a rect of form `(x, y, width, height)` may be
        specified to indicate where the popover should pop out from.
        If not provided, the parent view's bounds will be used.
        """
        if isinstance(parentView, VanillaBaseObject):
            parentView = parentView._getContentView()
        if parentView is None:
            parentView = self._parentView
        if relativeRect is not None:
            if not isinstance(relativeRect, NSRect):
                x, y, w, h = relativeRect
                relativeRect = NSMakeRect(x, y, w, h)
        else:
            relativeRect = NSZeroRect
        if preferredEdge is None:
            preferredEdge = self._preferredEdge
        preferredEdge = _edgeMap[preferredEdge]
        self._popover.showRelativeToRect_ofView_preferredEdge_(relativeRect, parentView, preferredEdge)

    def close(self):
        """
        Close the popover.

        Once a popover has been closed it can not be re-opened.
        """
        self._popover.close()

    def resize(self, width, height):
        """
        Change the size of the popover to *width* and *height*.
        """
        self._popover.setContentSize_((width, height))

    def bind(self, event, callback):
        """
        Bind a callback to an event.

        **event** A string representing the desired event. The options are:

        +----------------+-----------------------------------------------+
        | *"will show"*  | Called immediately before the popover shows.  |
        +----------------+-----------------------------------------------+
        | *"did show"*   | Called immediately after the popover shows.   |
        +----------------+-----------------------------------------------+
        | *"will close"* | Called immediately before the popover closes. |
        +----------------+-----------------------------------------------+
        | *"did close"*  | Called immediately after the popover closes.  |
        +----------------+-----------------------------------------------+
        """
        if event not in self._bindings:
            self._bindings[event] = []
        self._bindings[event].append(callback)

    def unbind(self, event, callback):
        """
        Unbind a callback from an event.

        **event** A string representing the desired event.
        Refer to :meth:`Popover.bind` for the options.

        **callback** The callback that has been bound to the event.
        """
        self._bindings[event].remove(callback)

    def _alertBindings(self, key):
        if hasattr(self, "_bindings"):
            if key in self._bindings:
                for callback in self._bindings[key]:
                    # XXX why return? there could be more than one binding.
                    return callback(self)

    def addAutoPosSizeRules(self, rules, metrics=None):
        """
        Add auto layout rules for controls/view in this view.

        **rules** must by a list of rule definitions. Rule definitions may take two forms:

        * strings that follow the `Visual Format Language`_
        * dictionaries with the following key/value pairs:

        +---------------------------+-------------------------------------------------------------------------+
        | key                       | value                                                                   |
        +===========================+=========================================================================+
        | *"view1"*                 | The vanilla wrapped view for the left side of the rule.                 |
        +---------------------------+-------------------------------------------------------------------------+
        | *"attribute1"*            | The attribute of the view for the left side of the rule.                |
        |                           | See below for options.                                                  |
        +---------------------------+-------------------------------------------------------------------------+
        | *"relation"* (optional)   | The relationship between the left side of the rule                      |
        |                           | and the right side of the rule. See below for options.                  |
        |                           | The default value is `"=="`.                                            |
        +---------------------------+-------------------------------------------------------------------------+
        | *"view2"*                 | The vanilla wrapped view for the right side of the rule.                |
        +---------------------------+-------------------------------------------------------------------------+
        | *"attribute2"*            | The attribute of the view for the right side of the rule.               |
        |                           | See below for options.                                                  |
        +---------------------------+-------------------------------------------------------------------------+
        | *"multiplier"* (optional) | The constant multiplied with the attribute on the right side of         |
        |                           | the rule as part of getting the modified attribute.                     |
        |                           | The default value is `1`.                                               |
        +---------------------------+-------------------------------------------------------------------------+
        | *"constant"* (optional)   | The constant added to the multiplied attribute value on the right       |
        |                           | side of the rule to yield the final modified attribute.                 |
        |                           | The default value is `0`.                                               |
        +---------------------------+-------------------------------------------------------------------------+

        The `attribute1` and `attribute2` options are:

        +-------------------+--------------------------------+
        | value             | AppKit equivalent              |
        +===================+================================+
        | *"left"*          | NSLayoutAttributeLeft          |
        +-------------------+--------------------------------+
        | *"right"*         | NSLayoutAttributeRight         |
        +-------------------+--------------------------------+
        | *"top"*           | NSLayoutAttributeTop           |
        +-------------------+--------------------------------+
        | *"bottom"*        | NSLayoutAttributeBottom        |
        +-------------------+--------------------------------+
        | *"leading"*       | NSLayoutAttributeLeading       |
        +-------------------+--------------------------------+
        | *"trailing"*      | NSLayoutAttributeTrailing      |
        +-------------------+--------------------------------+
        | *"width"*         | NSLayoutAttributeWidth         |
        +-------------------+--------------------------------+
        | *"height"*        | NSLayoutAttributeHeight        |
        +-------------------+--------------------------------+
        | *"centerX"*       | NSLayoutAttributeCenterX       |
        +-------------------+--------------------------------+
        | *"centerY"*       | NSLayoutAttributeCenterY       |
        +-------------------+--------------------------------+
        | *"baseline"*      | NSLayoutAttributeBaseline      |
        +-------------------+--------------------------------+
        | *"lastBaseline"*  | NSLayoutAttributeLastBaseline  |
        +-------------------+--------------------------------+
        | *"firstBaseline"* | NSLayoutAttributeFirstBaseline |
        +-------------------+--------------------------------+

        Refer to the `NSLayoutAttribute documentation`_ for the information about what each of these do.

        The `relation` options are:

        +--------+------------------------------------+
        | value  | AppKit equivalent                  |
        +========+====================================+
        | *"<="* | NSLayoutRelationLessThanOrEqual    |
        +--------+------------------------------------+
        | *"=="* | NSLayoutRelationEqual              |
        +--------+------------------------------------+
        | *">="* | NSLayoutRelationGreaterThanOrEqual |
        +--------+------------------------------------+

        Refer to the `NSLayoutRelation documentation`_ for the information about what each of these do.

        **metrics** may be either *None* or a dict containing key value pairs
        representing metrics keywords used in the rules defined with strings.

        .. _Visual Format Language: https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage.html#//apple_ref/doc/uid/TP40010853-CH27-SW1
        .. _NSLayoutAttribute documentation: https://developer.apple.com/documentation/uikit/nslayoutattribute?language=objc
        .. _NSLayoutRelation documentation: https://developer.apple.com/documentation/uikit/nslayoutrelation?language=objc

        """
        _addAutoLayoutRules(self, rules, metrics)


text:
const Enhancement = require('./tars-enhancement.js');

module.exports = class IO extends Enhancement {

  constructor() {
    super('io');
    // Dependencies
    this.Chalk = require('chalk');
    this.Emoji = require('node-emoji');
    this.Inquire = require('inquirer');
    this.CLI = require('commander');
    this.parseTemplate = require('string-template');
    // Configuration
    this.emotions = {
      unemotional: {emojis: ['neutral_face'], color: 'white'},
      happy: {emojis: ['smile'], color: 'green'},
      sad: {emojis: ['cry'], color: 'blue'},
      somber: {emojis: ['pensive','cloud_rain'], color: 'blue'},
      celebrating: {emojis: ['smile','tada'], color: '_colorRainbow'},
      grimacing: {emojis: ['grimacing'], color: 'red'},
      thinking: {emojis: ['thinking_face'], color: 'cyan'}
    };
  }

  /**
   * Rainbowify your text!
   * @param  {String} msg The message you would like rainbowified!
   * @return {String}     The rainbowified text!
   */
  _colorRainbow(msg) {
    var rainbow = ['yellow','red','green','cyan','blue','magenta'];
    var styled_msg = "";
    for (var i = 0; i < msg.length; i++) {
      var color = rainbow[(i % 6)];
      styled_msg += chalk[color](msg.charAt(i));
    }
    return styled_msg;
  }

  ///////////////////////////////////////////
  // Utility functions
  ///////////////////////////////////////////

  // TODO: Finishing cleaning up of TARS Emote
  emote(message, feeling = 'unemotional') {
    var words = message;
    if (this.emotions[feeling].color.charAt(0) === '_') {
      words = ` ${this[this.emotions[feeling].color](message)}`;
    } else if (this.emotions[feeling].color !== 'default') {
      words = ` ${this.Chalk[this.emotions[feeling].color](message)}`;
    }

    for (var i = this.emotions[feeling].emojis.length-1; i >= 0; i--) {
      words = ':' + this.emotions[feeling].emojis[i] + ': ' + words;
    }

    console.log(this.Emoji.emojify(words));
  }

}


text:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { Routes, RouterModule } from '@angular/router';
import { NgbdDatepickerBasic  } from './datepicker.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';

const routes: Routes = [{
	path: '',
	data: {
      title: 'Datepicker',
      urls: [{title: 'Dashboard', url: '/'},{title: 'ngComponent'},{title: 'Datepicker'}]
    },
	component: NgbdDatepickerBasic
}];

@NgModule({
	imports: [
    	FormsModule,
    	CommonModule,

      NgbModule.forRoot(),
    	RouterModule.forChild(routes)
    ],
	declarations: [NgbdDatepickerBasic ]
})
export class DatepickerModule { }


text:
using Newtonsoft.Json;

namespace PanoramicDataWin8.model.data
{
    public abstract class InputFieldModel : InputModel
    {
        public abstract string InputVisualizationType
        {
            get;
        }

        public abstract string InputDataType
        {
            get;
        }

        public override bool Equals(object obj)
        {
            if (obj is InputFieldModel)
            {
                var am = obj as InputFieldModel;
                return
                    am.OriginModel.Equals(this.OriginModel) &&
                    am.Name.Equals(this.Name) &&
                    am.InputVisualizationType.Equals(this.InputVisualizationType) &&
                    am.InputDataType.Equals(this.InputDataType);
            }
            return false;
        }

        public override int GetHashCode()
        {
            int code = 0;
            code ^= this.OriginModel.GetHashCode();
            code ^= this.Name.GetHashCode();
            code ^= this.InputVisualizationType.GetHashCode();
            code ^= this.InputDataType.GetHashCode();
            return code;
        }
    }
}


text:
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
using AppUIBasics.Common;
using AppUIBasics.ControlPages;
using AppUIBasics.Data;
using System;
using Windows.Foundation.Metadata;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Navigation;

// The Item Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234232

namespace AppUIBasics
{
    /// <summary>
    /// A page that displays details for a single item within a group.
    /// </summary>
    public partial class ItemPage : Page
    {
        private NavigationHelper navigationHelper;
        private ControlInfoDataItem item;

        /// <summary>
        /// NavigationHelper is used on each page to aid in navigation and
        /// process lifetime management
        /// </summary>
        public NavigationHelper NavigationHelper
        {
            get { return this.navigationHelper; }
        }

        public ControlInfoDataItem Item
        {
            get { return item; }
            set { item = value; }
        }

        public CommandBar BottomCommandBar
        {
            get { return bottomCommandBar; }
        }

        public ItemPage()
        {
            this.InitializeComponent();
            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += navigationHelper_LoadState;
        }

        /// <summary>
        /// Populates the page with content passed during navigation.  Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            var item = await ControlInfoDataSource.GetItemAsync((String)e.NavigationParameter);

            if (item != null)
            {
                Item = item;

                // Load control page into frame.
                var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();

                string pageRoot = loader.GetString("PageStringRoot");

                string pageString = pageRoot + item.UniqueId + "Page";
                Type pageType = Type.GetType(pageString);

                if (pageType != null)
                {
                    this.contentFrame.Navigate(pageType);
                }

                if(item.Title == "AppBar")
                {
                    //Child pages don't follow the visible bounds, so we need to add margin to account for this
                    header.Margin = new Thickness(0, 24, 0, 0);
                }
            }
        }

        private void ThemeToggleButton_Checked(object sender, RoutedEventArgs e)
        {
            this.RequestedTheme = ElementTheme.Light;
        }

        private void ThemeToggleButton_Unchecked(object sender, RoutedEventArgs e)
        {
            this.RequestedTheme = ElementTheme.Dark;
        }

        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);
            this.RequestedTheme = ElementTheme.Dark;
        }

        private void SearchButton_Click(object sender, RoutedEventArgs e)
        {
            this.Frame.Navigate(typeof(SearchResultsPage));
        }

        private void HelpButton_Click(object sender, RoutedEventArgs e)
        {
            ShowHelp();
            bottomCommandBar.IsOpen = false;
        }

        protected void RelatedControl_Click(object sender, RoutedEventArgs e)
        {
            ButtonBase b = (ButtonBase)sender;

            NavigationRootPage.RootFrame.Navigate(typeof(ItemPage), b.Content.ToString());
        }

        private void ShowHelp()
        {
            var loader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();

            string HTMLOpenTags = loader.GetString("HTMLOpenTags");
            string HTMLCloseTags = loader.GetString("HTMLCloseTags");

            contentWebView.NavigateToString(HTMLOpenTags + Item.Content + HTMLCloseTags);

            if (!helpPopup.IsOpen)
            {
                rootPopupBorder.Width = 346;
                rootPopupBorder.Height = this.ActualHeight;
                helpPopup.HorizontalOffset = Window.Current.Bounds.Width - 346;
                helpPopup.IsOpen = true;
            }
        }

        private void SearchBox_QuerySubmitted(SearchBox sender, SearchBoxQuerySubmittedEventArgs args)
        {

            this.Frame.Navigate(typeof(SearchResultsPage), args.QueryText);

        }

        #region NavigationHelper registration

        /// The methods provided in this section are simply used to allow
        /// NavigationHelper to respond to the page's navigation methods.
        ///
        /// Page specific logic should be placed in event handlers for the
        /// <see cref="GridCS.Common.NavigationHelper.LoadState"/>
        /// and <see cref="GridCS.Common.NavigationHelper.SaveState"/>.
        /// The navigation parameter is available in the LoadState method
        /// in addition to page state preserved during an earlier session.

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            navigationHelper.OnNavigatedTo(e);
        }

        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            navigationHelper.OnNavigatedFrom(e);
        }

        #endregion
    }
}


text:
import * as types from '../constants/ActionTypes'

const makeAction = type => ({commit}, ...args) => commit(type, ...args)

export const startGame = makeAction(types.START_GAME)
export const endTurn = makeAction(types.END_TURN)

export const play = ({commit, getters}, position) => {
  // if tile is playable
  if (getters.isTilePlayable(position)) {
    // switch all the coins related to position
    commit(types.SWITCH_COINS, [position, ...getters.availableMoves[position.x][position.y]])
    // and end the turn
    commit(types.END_TURN)
  }
}


text:
package com.floragunn.searchguard.configuration;

import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.inject.multibindings.Multibinder;
import org.elasticsearch.common.logging.ESLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.index.engine.IndexSearcherWrapper;

public class SearchGuardIndexSearcherWrapperModule extends AbstractModule {

    protected final ESLogger log = Loggers.getLogger(this.getClass());
    private static volatile Class searchGuardFlsDlsIndexSearcherWrapper = null;

    @Override
    protected void configure() {
        //TODO how often called?
        final Multibinder wrapperMultibinder = Multibinder.newSetBinder(binder(), IndexSearcherWrapper.class);

        if(searchGuardFlsDlsIndexSearcherWrapper != null) {
            wrapperMultibinder.addBinding().to(searchGuardFlsDlsIndexSearcherWrapper);
            return;
        }

        try {
            Class _searchGuardFlsDlsIndexSearcherWrapper;
            if ((_searchGuardFlsDlsIndexSearcherWrapper = Class
                    .forName("com.floragunn.searchguard.configuration.SearchGuardFlsDlsIndexSearcherWrapper")) != null) {
                wrapperMultibinder.addBinding().to(_searchGuardFlsDlsIndexSearcherWrapper);
                searchGuardFlsDlsIndexSearcherWrapper = _searchGuardFlsDlsIndexSearcherWrapper;
                log.info("FLS/DLS enabled");
            } else {
                throw new ClassNotFoundException();
            }

        } catch (final ClassNotFoundException e) {
            log.debug("FLS/DLS not enabled");
            wrapperMultibinder.addBinding().to(SearchGuardIndexSearcherWrapper.class);
        }

    }

}


text:
/**
 * Strategies for mapping a list of attributes (such as roles or LDAP groups) to a list of
 * {@code GrantedAuthority}s.
 * <p>
 * Provides a layer of indirection between a security data repository and the logical authorities
 * required within an application.
 */
package org.springframework.security.core.authority.mapping;


text: Samples apps implementing different combinations of Prism and DI containers.


text:
#include <aws/devops-guru/model/DescribeFeedbackResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::DevOpsGuru::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DescribeFeedbackResult::DescribeFeedbackResult()
{
}

DescribeFeedbackResult::DescribeFeedbackResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

DescribeFeedbackResult& DescribeFeedbackResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("InsightFeedback"))
  {
    m_insightFeedback = jsonValue.GetObject("InsightFeedback");

  }

  return *this;
}


text:
module ConsoleUtils::ActiveRecordUtils  #:nodoc:
  module RandomRecord #:nodoc:
    module FinderMethods
      def random
        reorder('RANDOM()')
      end

      def anyone
        random.first
      end

      def anyid(n = nil)
        if n
          @_anyid_history[-n.abs].presence || anyid()
        else
          idval = connection.select_value(select(:id).random.limit(1))
          model.type_for_attribute('id').send(:cast_value, idval).tap do |result|
            (@_anyid_history ||= []) << result
            @_anyid_history.shift if @_anyid_history.size > 10
          end
        end
      end
    end

    module Querying
      delegate :random, :anyone, :anyid, to: :all
    end
  end
end


text:
// +build !ignore_autogenerated

// This file was autogenerated by conversion-gen. Do not edit it manually!

package v1alpha1

import (
	v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
	conversion "k8s.io/apimachinery/pkg/conversion"
	runtime "k8s.io/apimachinery/pkg/runtime"
	admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration"
	unsafe "unsafe"
)

func init() {
	localSchemeBuilder.Register(RegisterConversions)
}

// RegisterConversions adds conversion functions to the given scheme.
// Public to allow building arbitrary schemes.
func RegisterConversions(scheme *runtime.Scheme) error {
	return scheme.AddGeneratedConversionFuncs(
		Convert_v1alpha1_AdmissionHookClientConfig_To_admissionregistration_AdmissionHookClientConfig,
		Convert_admissionregistration_AdmissionHookClientConfig_To_v1alpha1_AdmissionHookClientConfig,
		Convert_v1alpha1_ExternalAdmissionHook_To_admissionregistration_ExternalAdmissionHook,
		Convert_admissionregistration_ExternalAdmissionHook_To_v1alpha1_ExternalAdmissionHook,
		Convert_v1alpha1_ExternalAdmissionHookConfiguration_To_admissionregistration_ExternalAdmissionHookConfiguration,
		Convert_admissionregistration_ExternalAdmissionHookConfiguration_To_v1alpha1_ExternalAdmissionHookConfiguration,
		Convert_v1alpha1_ExternalAdmissionHookConfigurationList_To_admissionregistration_ExternalAdmissionHookConfigurationList,
		Convert_admissionregistration_ExternalAdmissionHookConfigurationList_To_v1alpha1_ExternalAdmissionHookConfigurationList,
		Convert_v1alpha1_Initializer_To_admissionregistration_Initializer,
		Convert_admissionregistration_Initializer_To_v1alpha1_Initializer,
		Convert_v1alpha1_InitializerConfiguration_To_admissionregistration_InitializerConfiguration,
		Convert_admissionregistration_InitializerConfiguration_To_v1alpha1_InitializerConfiguration,
		Convert_v1alpha1_InitializerConfigurationList_To_admissionregistration_InitializerConfigurationList,
		Convert_admissionregistration_InitializerConfigurationList_To_v1alpha1_InitializerConfigurationList,
		Convert_v1alpha1_Rule_To_admissionregistration_Rule,
		Convert_admissionregistration_Rule_To_v1alpha1_Rule,
		Convert_v1alpha1_RuleWithOperations_To_admissionregistration_RuleWithOperations,
		Convert_admissionregistration_RuleWithOperations_To_v1alpha1_RuleWithOperations,
		Convert_v1alpha1_ServiceReference_To_admissionregistration_ServiceReference,
		Convert_admissionregistration_ServiceReference_To_v1alpha1_ServiceReference,
	)
}

func autoConvert_v1alpha1_AdmissionHookClientConfig_To_admissionregistration_AdmissionHookClientConfig(in *v1alpha1.AdmissionHookClientConfig, out *admissionregistration.AdmissionHookClientConfig, s conversion.Scope) error {
	if err := Convert_v1alpha1_ServiceReference_To_admissionregistration_ServiceReference(&in.Service, &out.Service, s); err != nil {
		return err
	}
	out.URLPath = in.URLPath
	out.CABundle = *(*[]byte)(unsafe.Pointer(&in.CABundle))
	return nil
}

// Convert_v1alpha1_AdmissionHookClientConfig_To_admissionregistration_AdmissionHookClientConfig is an autogenerated conversion function.
func Convert_v1alpha1_AdmissionHookClientConfig_To_admissionregistration_AdmissionHookClientConfig(in *v1alpha1.AdmissionHookClientConfig, out *admissionregistration.AdmissionHookClientConfig, s conversion.Scope) error {
	return autoConvert_v1alpha1_AdmissionHookClientConfig_To_admissionregistration_AdmissionHookClientConfig(in, out, s)
}

func autoConvert_admissionregistration_AdmissionHookClientConfig_To_v1alpha1_AdmissionHookClientConfig(in *admissionregistration.AdmissionHookClientConfig, out *v1alpha1.AdmissionHookClientConfig, s conversion.Scope) error {
	if err := Convert_admissionregistration_ServiceReference_To_v1alpha1_ServiceReference(&in.Service, &out.Service, s); err != nil {
		return err
	}
	out.URLPath = in.URLPath
	out.CABundle = *(*[]byte)(unsafe.Pointer(&in.CABundle))
	return nil
}

// Convert_admissionregistration_AdmissionHookClientConfig_To_v1alpha1_AdmissionHookClientConfig is an autogenerated conversion function.
func Convert_admissionregistration_AdmissionHookClientConfig_To_v1alpha1_AdmissionHookClientConfig(in *admissionregistration.AdmissionHookClientConfig, out *v1alpha1.AdmissionHookClientConfig, s conversion.Scope) error {
	return autoConvert_admissionregistration_AdmissionHookClientConfig_To_v1alpha1_AdmissionHookClientConfig(in, out, s)
}

func autoConvert_v1alpha1_ExternalAdmissionHook_To_admissionregistration_ExternalAdmissionHook(in *v1alpha1.ExternalAdmissionHook, out *admissionregistration.ExternalAdmissionHook, s conversion.Scope) error {
	out.Name = in.Name
	if err := Convert_v1alpha1_AdmissionHookClientConfig_To_admissionregistration_AdmissionHookClientConfig(&in.ClientConfig, &out.ClientConfig, s); err != nil {
		return err
	}
	out.Rules = *(*[]admissionregistration.RuleWithOperations)(unsafe.Pointer(&in.Rules))
	out.FailurePolicy = (*admissionregistration.FailurePolicyType)(unsafe.Pointer(in.FailurePolicy))
	return nil
}

// Convert_v1alpha1_ExternalAdmissionHook_To_admissionregistration_ExternalAdmissionHook is an autogenerated conversion function.
func Convert_v1alpha1_ExternalAdmissionHook_To_admissionregistration_ExternalAdmissionHook(in *v1alpha1.ExternalAdmissionHook, out *admissionregistration.ExternalAdmissionHook, s conversion.Scope) error {
	return autoConvert_v1alpha1_ExternalAdmissionHook_To_admissionregistration_ExternalAdmissionHook(in, out, s)
}

func autoConvert_admissionregistration_ExternalAdmissionHook_To_v1alpha1_ExternalAdmissionHook(in *admissionregistration.ExternalAdmissionHook, out *v1alpha1.ExternalAdmissionHook, s conversion.Scope) error {
	out.Name = in.Name
	if err := Convert_admissionregistration_AdmissionHookClientConfig_To_v1alpha1_AdmissionHookClientConfig(&in.ClientConfig, &out.ClientConfig, s); err != nil {
		return err
	}
	out.Rules = *(*[]v1alpha1.RuleWithOperations)(unsafe.Pointer(&in.Rules))
	out.FailurePolicy = (*v1alpha1.FailurePolicyType)(unsafe.Pointer(in.FailurePolicy))
	return nil
}

// Convert_admissionregistration_ExternalAdmissionHook_To_v1alpha1_ExternalAdmissionHook is an autogenerated conversion function.
func Convert_admissionregistration_ExternalAdmissionHook_To_v1alpha1_ExternalAdmissionHook(in *admissionregistration.ExternalAdmissionHook, out *v1alpha1.ExternalAdmissionHook, s conversion.Scope) error {
	return autoConvert_admissionregistration_ExternalAdmissionHook_To_v1alpha1_ExternalAdmissionHook(in, out, s)
}

func autoConvert_v1alpha1_ExternalAdmissionHookConfiguration_To_admissionregistration_ExternalAdmissionHookConfiguration(in *v1alpha1.ExternalAdmissionHookConfiguration, out *admissionregistration.ExternalAdmissionHookConfiguration, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.ExternalAdmissionHooks = *(*[]admissionregistration.ExternalAdmissionHook)(unsafe.Pointer(&in.ExternalAdmissionHooks))
	return nil
}

// Convert_v1alpha1_ExternalAdmissionHookConfiguration_To_admissionregistration_ExternalAdmissionHookConfiguration is an autogenerated conversion function.
func Convert_v1alpha1_ExternalAdmissionHookConfiguration_To_admissionregistration_ExternalAdmissionHookConfiguration(in *v1alpha1.ExternalAdmissionHookConfiguration, out *admissionregistration.ExternalAdmissionHookConfiguration, s conversion.Scope) error {
	return autoConvert_v1alpha1_ExternalAdmissionHookConfiguration_To_admissionregistration_ExternalAdmissionHookConfiguration(in, out, s)
}

func autoConvert_admissionregistration_ExternalAdmissionHookConfiguration_To_v1alpha1_ExternalAdmissionHookConfiguration(in *admissionregistration.ExternalAdmissionHookConfiguration, out *v1alpha1.ExternalAdmissionHookConfiguration, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.ExternalAdmissionHooks = *(*[]v1alpha1.ExternalAdmissionHook)(unsafe.Pointer(&in.ExternalAdmissionHooks))
	return nil
}

// Convert_admissionregistration_ExternalAdmissionHookConfiguration_To_v1alpha1_ExternalAdmissionHookConfiguration is an autogenerated conversion function.
func Convert_admissionregistration_ExternalAdmissionHookConfiguration_To_v1alpha1_ExternalAdmissionHookConfiguration(in *admissionregistration.ExternalAdmissionHookConfiguration, out *v1alpha1.ExternalAdmissionHookConfiguration, s conversion.Scope) error {
	return autoConvert_admissionregistration_ExternalAdmissionHookConfiguration_To_v1alpha1_ExternalAdmissionHookConfiguration(in, out, s)
}

func autoConvert_v1alpha1_ExternalAdmissionHookConfigurationList_To_admissionregistration_ExternalAdmissionHookConfigurationList(in *v1alpha1.ExternalAdmissionHookConfigurationList, out *admissionregistration.ExternalAdmissionHookConfigurationList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]admissionregistration.ExternalAdmissionHookConfiguration)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_v1alpha1_ExternalAdmissionHookConfigurationList_To_admissionregistration_ExternalAdmissionHookConfigurationList is an autogenerated conversion function.
func Convert_v1alpha1_ExternalAdmissionHookConfigurationList_To_admissionregistration_ExternalAdmissionHookConfigurationList(in *v1alpha1.ExternalAdmissionHookConfigurationList, out *admissionregistration.ExternalAdmissionHookConfigurationList, s conversion.Scope) error {
	return autoConvert_v1alpha1_ExternalAdmissionHookConfigurationList_To_admissionregistration_ExternalAdmissionHookConfigurationList(in, out, s)
}

func autoConvert_admissionregistration_ExternalAdmissionHookConfigurationList_To_v1alpha1_ExternalAdmissionHookConfigurationList(in *admissionregistration.ExternalAdmissionHookConfigurationList, out *v1alpha1.ExternalAdmissionHookConfigurationList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]v1alpha1.ExternalAdmissionHookConfiguration)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_admissionregistration_ExternalAdmissionHookConfigurationList_To_v1alpha1_ExternalAdmissionHookConfigurationList is an autogenerated conversion function.
func Convert_admissionregistration_ExternalAdmissionHookConfigurationList_To_v1alpha1_ExternalAdmissionHookConfigurationList(in *admissionregistration.ExternalAdmissionHookConfigurationList, out *v1alpha1.ExternalAdmissionHookConfigurationList, s conversion.Scope) error {
	return autoConvert_admissionregistration_ExternalAdmissionHookConfigurationList_To_v1alpha1_ExternalAdmissionHookConfigurationList(in, out, s)
}

func autoConvert_v1alpha1_Initializer_To_admissionregistration_Initializer(in *v1alpha1.Initializer, out *admissionregistration.Initializer, s conversion.Scope) error {
	out.Name = in.Name
	out.Rules = *(*[]admissionregistration.Rule)(unsafe.Pointer(&in.Rules))
	return nil
}

// Convert_v1alpha1_Initializer_To_admissionregistration_Initializer is an autogenerated conversion function.
func Convert_v1alpha1_Initializer_To_admissionregistration_Initializer(in *v1alpha1.Initializer, out *admissionregistration.Initializer, s conversion.Scope) error {
	return autoConvert_v1alpha1_Initializer_To_admissionregistration_Initializer(in, out, s)
}

func autoConvert_admissionregistration_Initializer_To_v1alpha1_Initializer(in *admissionregistration.Initializer, out *v1alpha1.Initializer, s conversion.Scope) error {
	out.Name = in.Name
	out.Rules = *(*[]v1alpha1.Rule)(unsafe.Pointer(&in.Rules))
	return nil
}

// Convert_admissionregistration_Initializer_To_v1alpha1_Initializer is an autogenerated conversion function.
func Convert_admissionregistration_Initializer_To_v1alpha1_Initializer(in *admissionregistration.Initializer, out *v1alpha1.Initializer, s conversion.Scope) error {
	return autoConvert_admissionregistration_Initializer_To_v1alpha1_Initializer(in, out, s)
}

func autoConvert_v1alpha1_InitializerConfiguration_To_admissionregistration_InitializerConfiguration(in *v1alpha1.InitializerConfiguration, out *admissionregistration.InitializerConfiguration, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.Initializers = *(*[]admissionregistration.Initializer)(unsafe.Pointer(&in.Initializers))
	return nil
}

// Convert_v1alpha1_InitializerConfiguration_To_admissionregistration_InitializerConfiguration is an autogenerated conversion function.
func Convert_v1alpha1_InitializerConfiguration_To_admissionregistration_InitializerConfiguration(in *v1alpha1.InitializerConfiguration, out *admissionregistration.InitializerConfiguration, s conversion.Scope) error {
	return autoConvert_v1alpha1_InitializerConfiguration_To_admissionregistration_InitializerConfiguration(in, out, s)
}

func autoConvert_admissionregistration_InitializerConfiguration_To_v1alpha1_InitializerConfiguration(in *admissionregistration.InitializerConfiguration, out *v1alpha1.InitializerConfiguration, s conversion.Scope) error {
	out.ObjectMeta = in.ObjectMeta
	out.Initializers = *(*[]v1alpha1.Initializer)(unsafe.Pointer(&in.Initializers))
	return nil
}

// Convert_admissionregistration_InitializerConfiguration_To_v1alpha1_InitializerConfiguration is an autogenerated conversion function.
func Convert_admissionregistration_InitializerConfiguration_To_v1alpha1_InitializerConfiguration(in *admissionregistration.InitializerConfiguration, out *v1alpha1.InitializerConfiguration, s conversion.Scope) error {
	return autoConvert_admissionregistration_InitializerConfiguration_To_v1alpha1_InitializerConfiguration(in, out, s)
}

func autoConvert_v1alpha1_InitializerConfigurationList_To_admissionregistration_InitializerConfigurationList(in *v1alpha1.InitializerConfigurationList, out *admissionregistration.InitializerConfigurationList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]admissionregistration.InitializerConfiguration)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_v1alpha1_InitializerConfigurationList_To_admissionregistration_InitializerConfigurationList is an autogenerated conversion function.
func Convert_v1alpha1_InitializerConfigurationList_To_admissionregistration_InitializerConfigurationList(in *v1alpha1.InitializerConfigurationList, out *admissionregistration.InitializerConfigurationList, s conversion.Scope) error {
	return autoConvert_v1alpha1_InitializerConfigurationList_To_admissionregistration_InitializerConfigurationList(in, out, s)
}

func autoConvert_admissionregistration_InitializerConfigurationList_To_v1alpha1_InitializerConfigurationList(in *admissionregistration.InitializerConfigurationList, out *v1alpha1.InitializerConfigurationList, s conversion.Scope) error {
	out.ListMeta = in.ListMeta
	out.Items = *(*[]v1alpha1.InitializerConfiguration)(unsafe.Pointer(&in.Items))
	return nil
}

// Convert_admissionregistration_InitializerConfigurationList_To_v1alpha1_InitializerConfigurationList is an autogenerated conversion function.
func Convert_admissionregistration_InitializerConfigurationList_To_v1alpha1_InitializerConfigurationList(in *admissionregistration.InitializerConfigurationList, out *v1alpha1.InitializerConfigurationList, s conversion.Scope) error {
	return autoConvert_admissionregistration_InitializerConfigurationList_To_v1alpha1_InitializerConfigurationList(in, out, s)
}

func autoConvert_v1alpha1_Rule_To_admissionregistration_Rule(in *v1alpha1.Rule, out *admissionregistration.Rule, s conversion.Scope) error {
	out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups))
	out.APIVersions = *(*[]string)(unsafe.Pointer(&in.APIVersions))
	out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
	return nil
}

// Convert_v1alpha1_Rule_To_admissionregistration_Rule is an autogenerated conversion function.
func Convert_v1alpha1_Rule_To_admissionregistration_Rule(in *v1alpha1.Rule, out *admissionregistration.Rule, s conversion.Scope) error {
	return autoConvert_v1alpha1_Rule_To_admissionregistration_Rule(in, out, s)
}

func autoConvert_admissionregistration_Rule_To_v1alpha1_Rule(in *admissionregistration.Rule, out *v1alpha1.Rule, s conversion.Scope) error {
	out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups))
	out.APIVersions = *(*[]string)(unsafe.Pointer(&in.APIVersions))
	out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
	return nil
}

// Convert_admissionregistration_Rule_To_v1alpha1_Rule is an autogenerated conversion function.
func Convert_admissionregistration_Rule_To_v1alpha1_Rule(in *admissionregistration.Rule, out *v1alpha1.Rule, s conversion.Scope) error {
	return autoConvert_admissionregistration_Rule_To_v1alpha1_Rule(in, out, s)
}

func autoConvert_v1alpha1_RuleWithOperations_To_admissionregistration_RuleWithOperations(in *v1alpha1.RuleWithOperations, out *admissionregistration.RuleWithOperations, s conversion.Scope) error {
	out.Operations = *(*[]admissionregistration.OperationType)(unsafe.Pointer(&in.Operations))
	if err := Convert_v1alpha1_Rule_To_admissionregistration_Rule(&in.Rule, &out.Rule, s); err != nil {
		return err
	}
	return nil
}

// Convert_v1alpha1_RuleWithOperations_To_admissionregistration_RuleWithOperations is an autogenerated conversion function.
func Convert_v1alpha1_RuleWithOperations_To_admissionregistration_RuleWithOperations(in *v1alpha1.RuleWithOperations, out *admissionregistration.RuleWithOperations, s conversion.Scope) error {
	return autoConvert_v1alpha1_RuleWithOperations_To_admissionregistration_RuleWithOperations(in, out, s)
}

func autoConvert_admissionregistration_RuleWithOperations_To_v1alpha1_RuleWithOperations(in *admissionregistration.RuleWithOperations, out *v1alpha1.RuleWithOperations, s conversion.Scope) error {
	out.Operations = *(*[]v1alpha1.OperationType)(unsafe.Pointer(&in.Operations))
	if err := Convert_admissionregistration_Rule_To_v1alpha1_Rule(&in.Rule, &out.Rule, s); err != nil {
		return err
	}
	return nil
}

// Convert_admissionregistration_RuleWithOperations_To_v1alpha1_RuleWithOperations is an autogenerated conversion function.
func Convert_admissionregistration_RuleWithOperations_To_v1alpha1_RuleWithOperations(in *admissionregistration.RuleWithOperations, out *v1alpha1.RuleWithOperations, s conversion.Scope) error {
	return autoConvert_admissionregistration_RuleWithOperations_To_v1alpha1_RuleWithOperations(in, out, s)
}

func autoConvert_v1alpha1_ServiceReference_To_admissionregistration_ServiceReference(in *v1alpha1.ServiceReference, out *admissionregistration.ServiceReference, s conversion.Scope) error {
	out.Namespace = in.Namespace
	out.Name = in.Name
	return nil
}

// Convert_v1alpha1_ServiceReference_To_admissionregistration_ServiceReference is an autogenerated conversion function.
func Convert_v1alpha1_ServiceReference_To_admissionregistration_ServiceReference(in *v1alpha1.ServiceReference, out *admissionregistration.ServiceReference, s conversion.Scope) error {
	return autoConvert_v1alpha1_ServiceReference_To_admissionregistration_ServiceReference(in, out, s)
}

func autoConvert_admissionregistration_ServiceReference_To_v1alpha1_ServiceReference(in *admissionregistration.ServiceReference, out *v1alpha1.ServiceReference, s conversion.Scope) error {
	out.Namespace = in.Namespace
	out.Name = in.Name
	return nil
}

// Convert_admissionregistration_ServiceReference_To_v1alpha1_ServiceReference is an autogenerated conversion function.
func Convert_admissionregistration_ServiceReference_To_v1alpha1_ServiceReference(in *admissionregistration.ServiceReference, out *v1alpha1.ServiceReference, s conversion.Scope) error {
	return autoConvert_admissionregistration_ServiceReference_To_v1alpha1_ServiceReference(in, out, s)
}


text:
package jp.wasabeef.recyclerview.animators;

import android.support.v4.view.ViewCompat;
import android.support.v7.widget.RecyclerView;

public class FlipInLeftYAnimator extends BaseItemAnimatorSimple {

    @Override
    protected void animateRemoveImpl(final RecyclerView.ViewHolder holder) {
        ViewCompat.animate(holder.itemView)
                .rotationY(90)
                .setDuration(getRemoveDuration())
                .setListener(new DefaultRemoveVpaListener(holder))
                .start();
        mRemoveAnimations.add(holder);
    }

    @Override
    protected void preAnimateAdd(RecyclerView.ViewHolder holder) {
        ViewCompat.setRotationY(holder.itemView, 90);
    }

    @Override
    protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
        ViewCompat.animate(holder.itemView)
                .rotationY(0)
                .setDuration(getAddDuration())
                .setListener(new DefaultAddVpaListener(holder)).start();
        mAddAnimations.add(holder);
    }
}


text:
//********************************************************************
//*
//* Warning: This file was generated by MDE4CPP Generator
//*
//********************************************************************

#ifndef UML4CPPPROFILE_GETTERNAME_GETTERNAMEIMPL_HPP
#define UML4CPPPROFILE_GETTERNAME_GETTERNAMEIMPL_HPP

#include <functional>

//Model includes
#include "../GetterName.hpp"
#include "uml/impl/StereotypeImpl.hpp"

class AnyObject;
typedef std::shared_ptr<AnyObject> Any;

namespace uml
{
	class Property;
	class Operation;
}

//*********************************
namespace UML4CPPProfile
{
	class GetterNameImpl : virtual public uml::StereotypeImpl, virtual public GetterName
	{
		public:
			GetterNameImpl(const GetterNameImpl & obj);
			virtual std::shared_ptr<ecore::EObject> copy() const;
			GetterNameImpl& operator=(GetterNameImpl const&);

		protected:
			friend class UML4CPPProfileFactoryImpl;
			//constructor
			GetterNameImpl();
			virtual std::shared_ptr<GetterName> getThisGetterNamePtr();
			virtual void setThisGetterNamePtr(std::weak_ptr<GetterName> thisGetterNamePtr);

		public:

			//destructor
			virtual ~GetterNameImpl();

			//*********************************
			// Operations
			//*********************************

			//*********************************
			// Attributes Getter Setter
			//*********************************
			virtual std::weak_ptr<uml::Property> getBase_Property() const ;
			virtual void setBase_Property(std::weak_ptr<uml::Property> _base_Property);
			virtual std::string getGetterName() const ;
			virtual void setGetterName(std::string _getterName);

			//*********************************
			// Union Getter
			//*********************************

		protected:
			virtual std::shared_ptr<uml::Class> getMetaClass() const;
			virtual void instantiate();
			virtual void destroy();

		public:
			//*********************************
			// Structural Feature Getter/Setter
			//*********************************
			//Get
			virtual Any get(std::shared_ptr<uml::Property> _property) const ;
			virtual Any get(std::string _qualifiedName) const ;
			virtual Any get(unsigned long _uID) const ;
			//Set
			virtual void set(std::shared_ptr<uml::Property> _property, Any value) ;
			virtual void set(std::string _qualifiedName, Any value) ;
			virtual void set(unsigned long _uID, Any value) ;
			//Unset
			virtual void unset(std::shared_ptr<uml::Property> _property) ;
			virtual void unset(std::string _qualifiedName) ;
			virtual void unset(unsigned long _uID) ;

			//*********************************
			// Operation Invocation
			//*********************************
			//Invoke
			virtual Any invoke(std::shared_ptr<uml::Operation> _operation, std::shared_ptr<Bag<Any>> _arguments) ;
			virtual Any invoke(std::string _qualifiedName, std::shared_ptr<Bag<Any>> _arguments) ;
			virtual Any invoke(unsigned long _uID, std::shared_ptr<Bag<Any>> _arguments) ;

		private:
			std::weak_ptr<GetterName> m_thisGetterNamePtr;
			std::map<unsigned long,std::function<Any()>> m_getterMap;
			std::map<unsigned long,std::function<void(Any)>> m_setterMap;
			std::map<unsigned long,std::function<void()>> m_unsetterMap;
			std::map<unsigned long,std::function<Any(std::shared_ptr<Bag<Any>>)>> m_invocationMap;
	};
}
#endif /* end of include guard: UML4CPPPROFILE_GETTERNAME_GETTERNAMEIMPL_HPP */


text:
aliases: ["/engine/misc/deprecated/"]
title: "Deprecated Engine Features"
description: "Deprecated Features."
keywords: "docker, documentation, about, technology, deprecate"
---

<!-- This file is maintained within the docker/docker Github
     repository at https://github.com/docker/docker/. Make all
     pull requests against that repo. If you see this file in
     another repository, consider it read-only there, as it will
     periodically be overwritten by the definitive file. Pull
     requests which include edits to this file in other repositories
     will be rejected.
-->

# Deprecated Engine Features

The following list of features are deprecated in Engine.
To learn more about Docker Engine's deprecation policy,
see [Feature Deprecation Policy](https://docs.docker.com/engine/#feature-deprecation-policy).

### `-g` and `--graph` flags on `dockerd`

**Deprecated In Release: v17.05.0**

The `-g` or `--graph` flag for the `dockerd` or `docker daemon` command was
used to indicate the directory in which to store persistent data and resource
configuration and has been replaced with the more descriptive `--data-root`
flag.

These flags were added before Docker 1.0, so will not be _removed_, only
_hidden_, to discourage their use.

### Top-level network properties in NetworkSettings

**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

**Target For Removal In Release: v17.12**

When inspecting a container, `NetworkSettings` contains top-level information
about the default ("bridge") network;

`EndpointID`, `Gateway`, `GlobalIPv6Address`, `GlobalIPv6PrefixLen`, `IPAddress`,
`IPPrefixLen`, `IPv6Gateway`, and `MacAddress`.

These properties are deprecated in favor of per-network properties in
`NetworkSettings.Networks`. These properties were already "deprecated" in
docker 1.9, but kept around for backward compatibility.

Refer to [#17538](https://github.com/docker/docker/pull/17538) for further
information.

### `filter` param for `/images/json` endpoint
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

**Target For Removal In Release: v17.12**

The `filter` param to filter the list of image by reference (name or name:tag) is now implemented as a regular filter, named `reference`.

### `repository:shortid` image references
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

**Target For Removal In Release: v17.12**

`repository:shortid` syntax for referencing images is very little used, collides with tag references can be confused with digest references.

### `docker daemon` subcommand
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

**Target For Removal In Release: v17.12**

The daemon is moved to a separate binary (`dockerd`), and should be used instead.

### Duplicate keys with conflicting values in engine labels
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

**Target For Removal In Release: v17.12**

Duplicate keys with conflicting values have been deprecated. A warning is displayed
in the output, and an error will be returned in the future.

### `MAINTAINER` in Dockerfile
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

`MAINTAINER` was an early very limited form of `LABEL` which should be used instead.

### API calls without a version
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

**Target For Removal In Release: v17.12**

API versions should be supplied to all API calls to ensure compatibility with
future Engine versions. Instead of just requesting, for example, the URL
`/containers/json`, you must now request `/v1.25/containers/json`.

### Backing filesystem without `d_type` support for overlay/overlay2
**Deprecated In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

**Target For Removal In Release: v17.12**

The overlay and overlay2 storage driver does not work as expected if the backing
filesystem does not support `d_type`. For example, XFS does not support `d_type`
if it is formatted with the `ftype=0` option.

Please also refer to [#27358](https://github.com/docker/docker/issues/27358) for
further information.

### Three arguments form in `docker import`
**Deprecated In Release: [v0.6.7](https://github.com/docker/docker/releases/tag/v0.6.7)**

**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

The `docker import` command format `file|URL|- [REPOSITORY [TAG]]` is deprecated since November 2013. It's no more supported.

### `-h` shorthand for `--help`

**Deprecated In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

**Target For Removal In Release: v17.09**

The shorthand (`-h`) is less common than `--help` on Linux and cannot be used
on all subcommands (due to it conflicting with, e.g. `-h` / `--hostname` on
`docker create`). For this reason, the `-h` shorthand was not printed in the
"usage" output of subcommands, nor documented, and is now marked "deprecated".

### `-e` and `--email` flags on `docker login`
**Deprecated In Release: [v1.11.0](https://github.com/docker/docker/releases/tag/v1.11.0)**

**Target For Removal In Release: v17.06**

The docker login command is removing the ability to automatically register for an account with the target registry if the given username doesn't exist. Due to this change, the email flag is no longer required, and will be deprecated.

### Separator (`:`) of `--security-opt` flag on `docker run`
**Deprecated In Release: [v1.11.0](https://github.com/docker/docker/releases/tag/v1.11.0)**

**Target For Removal In Release: v17.06**

The flag `--security-opt` doesn't use the colon separator(`:`) anymore to divide keys and values, it uses the equal symbol(`=`) for consistency with other similar flags, like `--storage-opt`.

### `/containers/(id or name)/copy` endpoint

**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)**

**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

The endpoint `/containers/(id or name)/copy` is deprecated in favor of `/containers/(id or name)/archive`.

### Ambiguous event fields in API
**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**

The fields `ID`, `Status` and `From` in the events API have been deprecated in favor of a more rich structure.
See the events API documentation for the new format.

### `-f` flag on `docker tag`
**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**

**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

To make tagging consistent across the various `docker` commands, the `-f` flag on the `docker tag` command is deprecated. It is not longer necessary to specify `-f` to move a tag from one image to another. Nor will `docker` generate an error if the `-f` flag is missing and the specified tag is already in use.

### HostConfig at API container start
**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**

**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

Passing an `HostConfig` to `POST /containers/{name}/start` is deprecated in favor of
defining it at container creation (`POST /containers/create`).

### `--before` and `--since` flags on `docker ps`

**Deprecated In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**

**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

The `docker ps --before` and `docker ps --since` options are deprecated.
Use `docker ps --filter=before=...` and `docker ps --filter=since=...` instead.

### `--automated` and `--stars` flags on `docker search`

**Deprecated in Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

**Target For Removal In Release: v17.09**

The `docker search --automated` and `docker search --stars` options are deprecated.
Use `docker search --filter=is-automated=...` and `docker search --filter=stars=...` instead.

### Driver Specific Log Tags
**Deprecated In Release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)**

**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

Log tags are now generated in a standard way across different logging drivers.
Because of which, the driver specific log tag options `syslog-tag`, `gelf-tag` and
`fluentd-tag` have been deprecated in favor of the generic `tag` option.

```bash
{% raw %}
docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}"
{% endraw %}
```

### LXC built-in exec driver
**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)**

**Removed In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**

The built-in LXC execution driver, the lxc-conf flag, and API fields have been removed.

### Old Command Line Options
**Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)**

**Removed In Release: [v1.10.0](https://github.com/docker/docker/releases/tag/v1.10.0)**

The flags `-d` and `--daemon` are deprecated in favor of the `daemon` subcommand:

    docker daemon -H ...

The following single-dash (`-opt`) variant of certain command line options
are deprecated and replaced with double-dash options (`--opt`):

    docker attach -nostdin
    docker attach -sig-proxy
    docker build -no-cache
    docker build -rm
    docker commit -author
    docker commit -run
    docker events -since
    docker history -notrunc
    docker images -notrunc
    docker inspect -format
    docker ps -beforeId
    docker ps -notrunc
    docker ps -sinceId
    docker rm -link
    docker run -cidfile
    docker run -dns
    docker run -entrypoint
    docker run -expose
    docker run -link
    docker run -lxc-conf
    docker run -n
    docker run -privileged
    docker run -volumes-from
    docker search -notrunc
    docker search -stars
    docker search -t
    docker search -trusted
    docker tag -force

The following double-dash options are deprecated and have no replacement:

    docker run --cpuset
    docker run --networking
    docker ps --since-id
    docker ps --before-id
    docker search --trusted

**Deprecated In Release: [v1.5.0](https://github.com/docker/docker/releases/tag/v1.5.0)**

**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

The single-dash (`-help`) was removed, in favor of the double-dash `--help`

    docker -help
    docker [COMMAND] -help

### `--run` flag on docker commit

**Deprecated In Release: [v0.10.0](https://github.com/docker/docker/releases/tag/v0.10.0)**

**Removed In Release: [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0)**

The flag `--run` of the docker commit (and its short version `-run`) were deprecated in favor
of the `--changes` flag that allows to pass `Dockerfile` commands.

### Interacting with V1 registries

**Disabled By Default In Release: v17.06**

**Target For Removal In Release: v17.12**

Version 1.9 adds a flag (`--disable-legacy-registry=false`) which prevents the
docker daemon from `pull`, `push`, and `login` operations against v1
registries.  Though enabled by default, this signals the intent to deprecate
the v1 protocol.

Support for the v1 protocol to the public registry was removed in 1.13. Any
mirror configurations using v1 should be updated to use a
[v2 registry mirror](https://docs.docker.com/registry/recipes/mirror/).

### Docker Content Trust ENV passphrase variables name change
**Deprecated In Release: [v1.9.0](https://github.com/docker/docker/releases/tag/v1.9.0)**

**Removed In Release: [v1.12.0](https://github.com/docker/docker/releases/tag/v1.12.0)**

Since 1.9, Docker Content Trust Offline key has been renamed to Root key and the Tagging key has been renamed to Repository key. Due to this renaming, we're also changing the corresponding environment variables

- DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE is now named DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE
- DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE is now named DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE

### `--api-enable-cors` flag on dockerd

**Deprecated In Release: [v1.6.0](https://github.com/docker/docker/releases/tag/v1.6.0)**

**Target For Removal In Release: v17.09**

The flag `--api-enable-cors` is deprecated since v1.6.0. Use the flag
`--api-cors-header` instead.


text:
layout: about
navigation_title: About
title: About Lucas Gatsas
permalink: /about/
---


text:
var consumptionsReducers = require("reducers/consumptions");

describe("`consumptions` reducer", () => {

    describe("`fullPath` reducer", () => {

        const pathReducer = consumptionsReducers.__get__("fullPath");

        it("should return the correct object [CASE: type SELECT_SINGLE_ELECTRICAL_SENSOR_CHART]", () => {
            const valuePassedFromAction = {
                type: "SELECT_SINGLE_ELECTRICAL_SENSOR_CHART",
                payload: ["siteId", "podId", "sensorId"]
            };
            const ret = pathReducer(null, valuePassedFromAction);
            expect(ret).to.deep.equal(["siteId", "podId", "sensorId"]);
        });

        it("should return the correct object [CASE: type SELECT_SINGLE_ELECTRICAL_SENSOR_REAL_TIME]", () => {
            const valuePassedFromAction = {
                type: "SELECT_SINGLE_ELECTRICAL_SENSOR_REAL_TIME",
                payload: ["siteId", "podId", "sensorId"]
            };
            const ret = pathReducer(null, valuePassedFromAction);
            expect(ret).to.deep.equal(["siteId", "podId", "sensorId"]);
        });

        it("should return the correct object [CASE: type SELECT_SINGLE_ELECTRICAL_SENSOR_CONSUMPTION]", () => {
            const valuePassedFromAction = {
                type: "SELECT_SINGLE_ELECTRICAL_SENSOR_CONSUMPTION",
                payload: ["siteId", "podId", "sensorId"]
            };
            const ret = pathReducer(null, valuePassedFromAction);
            expect(ret).to.deep.equal(["siteId", "podId", "sensorId"]);
        });

        it("should return the previous state if any correct `type` is checked", () => {
            const valuePassedFromAction = {
                type: "NOT_A_CORRECT_TYPE_CASE"
            };
            const previousState = {
                site: "siteId",
                fullPath: ["siteId", "podId", "sensorId"]
            };
            const ret = pathReducer(previousState, valuePassedFromAction);
            expect(ret).to.deep.equal(previousState);
        });

    });

    describe("`period` reducer", () => {

        const periodReducer = consumptionsReducers.__get__("period");

        it("should return a string with the selected period [CASE: state is null]", () => {
            const valuePassedFromAction = {
                type: "SELECT_CONSUMPTIONS_PERIOD",
                payload: "period"
            };
            const ret = periodReducer(null, valuePassedFromAction);
            expect(ret).to.equal("period");
        });

        it("should return a string with the selected period [CASE: state is a string]", () => {
            const valuePassedFromAction = {
                type: "SELECT_CONSUMPTIONS_PERIOD",
                payload: "another-period"
            };
            const ret = periodReducer("period", valuePassedFromAction);
            expect(ret).to.equal("another-period");
        });

        it("should return the previous state if any correct `type` is checked", () => {
            const valuePassedFromAction = {
                type: "NOT_A_CORRECT_TYPE_CASE"
            };
            const previousState = {
                site: "siteId",
                fullPath: ["siteId", "podId", "sensorId"]
            };
            const ret = periodReducer(previousState, valuePassedFromAction);
            expect(ret).to.deep.equal(previousState);
        });

    });

});


text:
nao_tracker
===========

Track NAOs positions using overhead camera

Requirements
============

* Aruco

Installation
============

```
$ mkdir build
$ cd build
$ cmake ..
$ make
```