text:
<?php
namespace universal;

class WebUtilities extends BaseClass {

	const PARAMETR_HTML_PRO_XLS = 'xmlns:o="urn:schemas-microsoft-com:office:office"
									xmlns:x="urn:schemas-microsoft-com:office:excel"
									xmlns="http://www.w3.org/TR/REC-html40"';
	const PARAMETR_TABULKY_PRO_XLS = 'x:str';
	const DOCTYPE_STRICT = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>";
	const DOCTYPE = self::DOCTYPE_STRICT;

	const XMLNS = 'xmlns="http://www.w3.org/1999/xhtml"';

	//konstanty typu jsou cislovany binarne pro zajisteni unikatnosti a kombinovatelnosti
	const JAVASCRIPT = 1;
	const TYPE_TEXT_JAVASCRIPT = 'type="text/javascript"';
	const ZNAKOVA_SADA = self::WINDOWS_1250;
	const WINDOWS_1250 = 'windows-1250';
	const CP_1250 = self::WINDOWS_1250;
	const UTF8 = 'UTF-8';
	const ISO_8859_2 = 'iso-8859-2';

	private $znakovaSada;
	private $jazyk;
	private $hlavicka;
	private $vypisKonecDokumentu = false;
	private $vycentrujText = false;

	public function __construct($znakovaSada = self::ZNAKOVA_SADA, $jazyk = 'cs', $vycentrujText = true){
		$this->znakovaSada = self::dejZnakovouSadu($znakovaSada);
		$this->jazyk = $jazyk;
		$this->vycentrujText = $vycentrujText;
	}

	public function __destruct(){
		if($this->vypisKonecDokumentu){
			$this->zobrazHtmlKonec();
		}
	}

	public function dejXmlVersion(){
		$xmlVersion = "<?xml version='1.0' encoding='$this->znakovaSada' ?>";
		return $xmlVersion;
	}

	public static function dejUmisteniKlienta(){
		$umisteni = false;
		$ip = $_SERVER['REMOTE_ADDR'];

		if (!empty($ip)) {
			$umisteni = file_get_contents("http://api.hostip.info/get_html.php?ip=$ip&position=true");
		}
		return umisteni;
	}

	public static function vytvorTabulkuZDat($data,$zahlavi = array()){//data musi byt dvourozmerne pole
		$tabulka = "
\n";
		if(sizeof($zahlavi) > 0){//pokud jsme dostali nadpisy sloupcu
			$tabulka .= '
';
			foreach($zahlavi as $nadpis){
				$tabulka .= "$nadpis	";
			}
			$tabulka .= '
';
		}
		foreach($data as $radek){
			$tabulka .= '
';
			foreach($radek as $prvek){
				$tabulka .= "$prvek	";
			}
			$tabulka .= '
';
		}
		$tabulka .= '
';
		return $tabulka;
	}

	public function zobrazHtmlZacatek($hlavicka = false,$nastavXml = true,$parametryHtml = false,$parametryBody = false,$vycentrujText = true,$priZruseniTridyVypsatKonecDokumetu = true){
		$this->vycentrujText = $vycentrujText;
		$this->vypisKonecDokumentu = $priZruseniTridyVypsatKonecDokumetu;
		$dokument = '';
		if($nastavXml){
			$dokument .= $this->dejXmlVersion()."\n";
			$parametryHtml .= ' '.self::XMLNS." xml:lang='$this->jazyk'";
		}
		$dokument .= self::DOCTYPE."\n";
		$dokument .= "jazyk'>\n";
		if($hlavicka !== false){
			$dokument .= $hlavicka;
			$dokument .= "\t\n";//nebudeme-li vypisovat hlavicku, nevypiseme ani tag body
			if($this->vycentrujText){
				$dokument .= "\t\t
";
				$dokument .= "\n\t\t\t
\n";
			}
		}
		echo($dokument);
	}

	public function zobrazHtmlKonec(){
		$dokument = '';
		if($this->vycentrujText){
			$dokument .= "\n\t\t\t</div";
			$dokument .= "\n\t\t</div";
		}
		$dokument .= "\n\t\n";
		echo($dokument);
	}

	public static function sendRedirectionHeader($target, $pathIsAbsolute = TRUE, $safety = FALSE){
		$header = 'Location: ';
		if(!$pathIsAbsolute){
			$includeProtocol = TRUE;
			$includeServer = TRUE;
			$notIncludeTrailingFiles = FALSE;
			$includeQueryComponent = FALSE;
			$target = self::getActualUrl($includeProtocol = TRUE, $includeServer = TRUE, $notIncludeTrailingFiles = FALSE,	$includeQueryComponent = FALSE) . ltrim($target,'/');
		}
		$header .= $target;
		if (headers_sent())//any header was already sent, redirection can not be performed
			throw new Exception('Rediretion can not be started cause of already sent headers', E_USER_WARNING);
		header($header);
		if ($safety)
			exit;
	}

	public function presmeruj($target, $pathIsAbsolute = false, $pojistka = true){
		$header = 'HTTP/1.1 302 Found';//PHP Location bez dalsich uprav header vysle sice 302, ale s textem Not Found, coz je chybne
		header($header);
		self::sendRedirectionHeader($target, $pathIsAbsolute);
		if($pojistka){
			exit;
		}
	}

	public function presmerujDocasne($cil,$pathIsAbsolute = false,$pojistka = true){
		$header = 'HTTP/1.1 307 Temporaly Redirect';
		header($header);
		self::sendRedirectionHeader($cil,$pathIsAbsolute);
		if($pojistka){
			exit;
		}
	}

	public function presmerujTrvale($cil,$pathIsAbsolute = false,$pojistka = true){
		$header = 'HTTP/1.1 301 Moved Permanently';
		header($header);
		self::sendRedirectionHeader($cil,$pathIsAbsolute);
		if($pojistka){
			exit;
		}
	}

	public static function zobrazSamooznacovaciText($text,$nazev,$nazevJeId = false){
		if($nazevJeId){
			$funkce = 'setInputById';
		}else{
			$funkce = 'setInputByName';
		}
		$text = "$text";
		echo($text);
	}

	public static function prevedPoleNaGet($data){
		$a = false;
		$get = '';
		foreach($data as $index=>$udaj){
			$index = htmlspecialchars($index);
			$udaj = htmlspecialchars((string)$udaj);
			$get .= ($a ? '&': '')."$index=$udaj";
			$a = true;
		}
		return $get;
	}

	public static function zobrazDoctype(){
		echo(self::DOCTYPE."\n");
	}

	public static function jsemNaServeruHbi(){
		return $_SERVER['HTTP_HOST'] == 'web06.hbi.cz';
	}

	public static function jsemNaSvemPocitaci(){
		if(isset($_SERVER['SERVER_ADMIN']) and strpos($_SERVER['SERVER_ADMIN'],'tyc.j') === 0){//jestlize poustim skript z osobniho pocitace
			return true;
		}else{
			return false;
		}
	}

	public static function pripravExportDoSouboru($nazev,$pridatDatumKNazvu = false,$typSouboru='txt'){
		if($pridatDatumKNazvu){
			$nazev .= date('_j_n_Y');
		}
		$nazev .= '.'.$typSouboru;
		header("Content-type: plain/text");
		header("Content-Disposition: attachment;filename=$nazev");
	}

	public static function exportujDoSouboru($data,$nazev,$pridatDatumKNazvu = false,$typSouboru='txt'){
		self::pripravExportDoSouboru($nazev,$pridatDatumKNazvu,$typSouboru);
		echo($data);//vypiseme data pro export - hlavicky zajisti, ze obsah bude vlozen do souboru a nahran k uzivateli
	}

	public function exportujDoExcelu($zdrojDat,$nazevSouboru = 'export',$znakovaSada = false){
		if($znakovaSada === false){
			$znakovaSada = $this->znakovaSada;
		}
		$WebUtilities = new WebUtilities($znakovaSada);
		$WebUtilities->pripravExportDoSouboru($nazevSouboru,true,Nazvy::XLS);//pripravime prohlizec na prijeti souboru
		echo($WebUtilities->zobrazHtmlZacatek($WebUtilities->dejHlavicku('','',false,false,false),false,self::PARAMETR_HTML_PRO_XLS,false,false));
		echo("
\n");
		while($radek = fgets($zdrojDat)){
		echo($radek);
		}
		fclose($zdrojDat);
		echo("
\n");
	}

	public function dejHlavickuHtml($nadpis = '', $popis = '', $zobrazIkonu = true){//opousteno
		return $this->dejHlavicku($nadpis, $popis, $zobrazIkonu);
	}

	public static function dejZnakovouSadu($znakovaSada){//pojistka pro pripady, kdy uzivatel zapomene pouzit format s pomlckou
		preg_match_all('#[[:alpha:]]+|[[:digit:]]+#',$znakovaSada,$htmlZnakovaSada);
		$htmlZnakovaSada = UtilitkyProPole::orezPole($htmlZnakovaSada);
		$htmlZnakovaSada = implode($htmlZnakovaSada,'-');
		return $htmlZnakovaSada;
	}

	public static function dejZvuk($umisteniZvuku, $vyska = 0, $sirka = 0, $autostart = true){
		$zvuk = '';
		$umisteniZvuku = str_replace('\\','/',strtolower((string)$umisteniZvuku));
		/*if($autostart){
			$autostart = 'true';
		}else{
			$autostart = 'false';
		}*/
		if(!empty($umisteniZvuku)){
			//$typ = substr(strrchr($umisteniZvuku,'.'),1);
			/*if(strpos($_SERVER['HTTP_USER_AGENT'],'Opera') === 0){
				$zvuk .= "<embed src='$umisteniZvuku' controller='true' autoplay='".(string)$autostart."' autostart='False' type='audio/wav' height='$vyska' width='$sirka'/>";
			}else{*/
				$zvuk .= "<embed src='$umisteniZvuku' type='application/x-mplayer2' autostart='".(int)$autostart."' playcount='1' height='$vyska' width='$sirka'>";
			//}
		}else{
			trigger_error("Cesta ke zvuku je prázdná",E_USER_WARNING);
		}
		return $zvuk;
	}

	public static function dejObjekt($umisteniObjektu, $vyska = 0, $sirka = 0, $autoplay = false){
		$objekt = '';
		$umisteniObjektu = str_replace('\\','/',strtolower((string)$umisteniObjektu));
		if($autoplay){
			$autoplay = 'true';
		}else{
			$autoplay = 'false';
		}
		if(!empty($umisteniObjektu)){
			$typ = substr(strrchr($umisteniObjektu,'.'),1);
			switch($typ){
				case 'wav':
					$typ = 'audio/wav';
					break;
				default :
					trigger_error("Neznámý typ ($typ) objektu.",E_USER_WARNING);
			}
			if(preg_match("|^audio/|",$typ)){// type='$typ' data='$umisteniObjektu'
				$objekt .= "
					<object width='$sirka' height='$vyska'>
						<param name='autostart' value='$autoplay'>
						<param name='src' value='$umisteniObjektu'>
						<param name='autoplay' value='$autoplay'>
						<param name='controller' value='$autoplay'>
						alt : ".substr(strrchr($umisteniObjektu,'/'),1)."
						<embed src='$umisteniObjektu' controller='true' autoplay='$autoplay' autostart='$autoplay' type='$typ' />
					</object>";
			}else{
				trigger_error("Neznámý typ ($typ) objektu.",E_USER_WARNING);
			}
		}else{
			trigger_error("Cesta k objektu je prázdná",E_USER_WARNING);
		}
		return $objekt;
	}

	public function rozsirHlavicku($rozsireni,$druh = 0){
		if($druh){//mame pozadavek na typ polozky v hlavicce
			if(($druh & self::JAVASCRIPT) === self::JAVASCRIPT){//jestlize bitovy kod pro JAVASCRIPT je obsazen v pozadavku na druh rozsireni hlavicky, pridame tento druh do hlavicky
				$tag = 'script';
				$nastaveniTagu = self::TYPE_TEXT_JAVASCRIPT;
			}
		}
		if($druh !== 0){
			$this->hlavicka .= "\n<$tag $nastaveniTagu>";
		}
		$this->hlavicka .= $rozsireni;
		if($druh !== 0){
			$this->hlavicka .= "\n</$tag>";
		}
	}

	public function dejHlavicku($nadpis = '', $popis = '', $zobrazIkonu = true, $beznyCss = true, $beznyJs = true){
		$this->hlavicka .= "\n\t\t<meta http-equiv='Content-Language' content='$this->jazyk'/>";
		$this->hlavicka .= "\n\t\t<meta http-equiv='Content-Type' content='text/html; charset=$this->znakovaSada'/>";
		/*$cestaVolanehoScriptu = dirname($_SERVER['PHP_SELF']);
		$htmlCestaKeTridam = str_replace(str_replace('\\','/',$_SERVER['DOCUMENT_ROOT']),'',str_replace('\\','/',dirname(__FILE__)));
		$htmlCestaKUniverzal = str_replace('\\','/',$_SERVER['HTTP_HOST']).str_replace('/Tridy','',$htmlCestaKeTridam);*/
		if($beznyCss){
			$mozneAdresareStylopisu = array('css','styles','styly');
			$mozneUmisteniAdresaru = array(
				dirname(__FILE__).'/../'=>'../univerzal/'
				,dirname($_SERVER['SCRIPT_FILENAME'])=>''
			);
			foreach($mozneUmisteniAdresaru as $souborovaCestaKAdresariStylopisu=>$htmlCestaKAdresariStylopisu){
				foreach($mozneAdresareStylopisu as $moznyAdresarStylopisu){
					$stylopisy = \universal\FolderUtilities\FolderUtilities::dejSouboryZAdresare($souborovaCestaKAdresariStylopisu."/$moznyAdresarStylopisu",'css');//vyhledame soubor se styly v univerzal
					if($stylopisy){
						foreach($stylopisy as $css){
							$this->hlavicka .= "\n\t\t<link rel='stylesheet' type='text/css' href='$htmlCestaKAdresariStylopisu$moznyAdresarStylopisu/$css' media='all'/>";
						}
					}
				}
			}
		}
		if($beznyJs){
			$mozneAdresare = array('js');
			$mozneUmisteniAdresaru = array(
				dirname(__FILE__).'/../'=>'../univerzal/'
				,dirname($_SERVER['SCRIPT_FILENAME'])=>''
			);
			foreach($mozneUmisteniAdresaru as $souborovaCestaKAdresari=>$htmlCestaKAdresari){
				foreach($mozneAdresare as $moznyAdresar){
					$javascripty = \universal\FolderUtilities\FolderUtilities::dejSouboryZAdresare($souborovaCestaKAdresari."/$moznyAdresar",'js');//vyhledame soubor se styly v univerzal
					if($javascripty){
						foreach($javascripty as $js){
							$this->hlavicka .= "\n\t\t";
						}
					}
				}
			}
		}
		/*if($beznyJS){
			$this->hlavicka .= "\n\t\t";
			foreach(\universal\FolderUtilities\FolderUtilities::dejSouboryZAdresare(dirname(__FILE__).'/../js','js') as $js){
				$this->hlavicka .= "\n\t\t";
			}
		}*/
		if($zobrazIkonu and file_exists(self::$materskyAdresar.'/grafika/favicon.ico')){
			preg_match_all('|/[[:alnum:]]+$|',str_replace('\\','/',self::$materskyAdresar),$cesta);
			$cesta = UtilitkyProPole::orezPole($cesta);
		}else{
			$cesta = false;
		}
		if($cesta !== false){
			$this->hlavicka .= "\n\t\t<link rel='shortcut icon' href='$cesta/grafika/favicon.ico'/>";
		}
		$this->hlavicka .= "\n\t\t<title>$nadpis</title>";
		$this->hlavicka .= "\n\t\t<meta name='description' content='$popis'/>";
		$this->hlavicka = "\t$this->hlavicka\n\t\n";
		return $this->hlavicka;
	}

	public function dejPocetUrovniAdresaru($volaneAdresy = true){
		if($volaneAdresy){
			$cesta = $_SERVER['REQUEST_URI'];
		}else{
			$cesta = $_SERVER['SCRIPT_NAME'];
		}
		$pocet = substr_count($cesta,'/')-1;
		return $pocet;
	}

	/** Gives actual URL in desired format
	 *
	 * @param $includeProtocol Bool if protocol string should be a starting part of URL
	 * @param $notIncludeTrailingFiles mixed Bool or String or Array of strings, TRUE means no trailing file, FALSE means any trailing file, String or Array of strings with list of file names NOT involve to URL
	 * @param $includeQueryComponent Bool if append query string / query component / parameters
	 *
	 * @return string builded URL
	 */
	public static function getActualUrl($includeProtocol = TRUE, $includeServer = TRUE, $notIncludeTrailingFiles = array(), $includeQueryComponent = TRUE){
		if (!isset($_SERVER['HTTP_HOST']))//pokud poustime skript mimo webovy prostor
			throw new Exception('Url can not be determined out of web space', E_USER_WARNING);
		$url = '';
		if ($includeProtocol)
			$url .= strtolower(strstr($_SERVER['SERVER_PROTOCOL'],'/',TRUE)) . '://';
		if ($includeServer)
			$url .= $_SERVER['HTTP_HOST'];
		$adress = rtrim(str_replace('\\','/',dirname($_SERVER['PHP_SELF'])), '/');//lomitka likvidujeme kvuli pozici v korenovem adresari, po kterem lomitko zustava
		$url .= $adress . '/';
		if ($notIncludeTrailingFiles !== TRUE && $notIncludeTrailingFiles === FALSE || !in_array(basename($_SERVER['PHP_SELF']), (array)$notIncludeTrailingFiles))
			$url .= basename($_SERVER['PHP_SELF']);
		if ($includeQueryComponent)
			$url .= $_SERVER['QUERY_STRING'] !== '' ?  '?' . $_SERVER['QUERY_STRING'] : '';

		return $url;
	}

	public function dejObsahSouboru($plnyNazevSouboru,$udajeVPromenneFiles = false){
		$obsah = \universal\FolderUtilities\FolderUtilities::dejObsahSouboru($plnyNazevSouboru,$udajeVPromenneFiles = false);
		$formatovanyObsah = '';
		foreach($obsah as $radek){
			$formatovanyObsah .= "$radek
\n";
		}
		return $formatovanyObsah;
	}

	public function dejUdajeZeSouboru($odstranPrazdno = true, $ocekavanyPocet = -1, $zavaznostOdchylky = E_USER_ERROR){//vrati pole s hodnotami ze souboru, nactenych pri file upload
		$pozadavky = array();
		if(isset($_FILES)){//pokud je co
			foreach($_FILES as $nazevPozadavku=>$soubor){//kazdy soubor je popsan svym kodem a spoustu dalsich parametru
				if($_FILES[$nazevPozadavku]['tmp_name'] != ''){
					if(!$_FILES[$nazevPozadavku]['error']){
						if($_FILES[$nazevPozadavku]['size'] > 0){//pokud byl soubor skutecne prijat a neni prazdny
							$pozadavky[$nazevPozadavku] = \universal\FolderUtilities\FolderUtilities::dejObsahSouboru($_FILES[$nazevPozadavku]['tmp_name']);//vsechny radky ze souboru ulozime jako prvky pole s nazvem puvodniho kodu pozadavku
						}else{
							trigger_error("Soubor s identifikací '$nazevPozadavku' byl nahrán, ale má nulovou velikost! Bude ignorován.",E_USER_WARNING);
						}
					}else{
						trigger_error("Nahrání souboru s identifikací '$nazevPozadavku' se nezdařilo kvůli ".(implode(',',$_FILES[$nazevPozadavku]['error']))."! Soubor bude ignorován.",E_USER_WARNING);
					}
				}else{
					trigger_error("Nahraný soubor s identifikací '$nazevPozadavku' nemá název! Bude ignorován.",E_USER_WARNING);
				}
				//unset($_FILES[$nazevPozadavku]);//zlikvidujeme zaznam o souboru, at nas uz nikde neplete
			}
		}
		if(($ocekavanyPocet >= 0) and (sizeof($pozadavky) != $ocekavanyPocet)){
			trigger_error("Počet nahraných souborů ".((sizeof($pozadavky) > $ocekavanyPocet) ? 'přesáhl' : 'nedosáhl')." očekávanému počtu $ocekavanyPocet",$zavaznostOdchylky);
		}
		if($odstranPrazdno){
			$pozadavky = UtilitkyProPole::smazPrvkySPrazdnymiRetezci($pozadavky);
		}
		return $pozadavky;
	}
}


text:
module MissingMetadata
  class Fetcher
    class MissingDocumentError < StandardError
    end

    def initialize(publishing_api)
      @publishing_api = publishing_api
    end

    def add_metadata(result)
      index_name = result[:index]
      document_id = result[:_id]
      raise MissingDocumentError, "Missing index name or id in search results" if index_name.nil? || document_id.nil?

      content_id = result[:content_id] || lookup_content_id(document_id)

      update_metadata(content_id, index_name, document_id)
    end

    def lookup_content_id(document_id)
      base_path = document_id
      base_path = "/#{base_path}" unless base_path.start_with?("/")

      content_id = publishing_api.lookup_content_id(base_path: base_path)

      content_id || raise(MissingDocumentError, "Failed to look up base path")
    rescue GdsApi::TimedOutException
      puts "Publishing API timed out getting content_id... retrying"
      sleep(1)
      retry
    end

    def update_metadata(content_id, index_name, document_id)
      response = publishing_api.get_content(content_id)

      Indexer::AmendWorker.perform_async(
        index_name,
        document_id,
        content_store_document_type: response["document_type"],
        publishing_app: response["publishing_app"],
        rendering_app: response["rendering_app"],
        content_id: content_id,
      )
    rescue GdsApi::TimedOutException
      puts "Publishing API timed out getting content... retrying"
      sleep(1)
      retry
    end

  private

    attr_reader :publishing_api
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.configx.client.env;

import com.configx.client.item.ConfigItemList;
import com.configx.client.listener.ConfigItemChangeEvent;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.PropertySource;

/**
 * 多版本的{@link PropertySource}的工厂类,用于添加版本属性源到多版本属性源中
 *
 * @author zhirong.zou
 */
public abstract class MultiVersionPropertySourceFactory {

    public static final String MULTIVERSION_PROPERTY_SOURCE_NAME = "multiVersionProperties";

    /**
     * 创建多版本属性源
     *
     * @return
     */
    private static MultiVersionPropertySource createMultiVersionPropertySource() {
        return new MultiVersionPropertySource(MULTIVERSION_PROPERTY_SOURCE_NAME);
    }

    /**
     * 返回Environment中的多版本属性源,不存在则创建
     *
     * @param environment
     * @return
     */
    public static MultiVersionPropertySource getMultiVersionPropertySource(ConfigurableEnvironment environment) {
        PropertySource<?> multiVersionPropertySource = environment.getPropertySources().get(MULTIVERSION_PROPERTY_SOURCE_NAME);

        // 不存在多版本属性源,则创建
        if (multiVersionPropertySource == null) {
            multiVersionPropertySource = createMultiVersionPropertySource();
            environment.getPropertySources().addLast(multiVersionPropertySource);
        }

        return (MultiVersionPropertySource) multiVersionPropertySource;
    }

    /**
     * 向Environment中添加版本属性源
     *
     * @param versionPropertySource
     * @param applicationContext
     * @param environment
     */
    public static void addVersionPropertySource(VersionPropertySource<ConfigItemList> versionPropertySource,
                                                ApplicationContext applicationContext,
                                                ConfigurableEnvironment environment) {
        if (versionPropertySource == null) {
            return;
        }

        MultiVersionPropertySource multiVersionPropertySource = getMultiVersionPropertySource(environment);
        multiVersionPropertySource.addPropertySource(versionPropertySource);
    }

    /**
     * 返回Environment的多版本属性源中,指定版本的属性源
     *
     * @param version
     * @param environment
     * @return
     */
    public static VersionPropertySource<?> getVersionPropertySource(long version, ConfigurableEnvironment environment) {
        MultiVersionPropertySource multiVersionPropertySource = getMultiVersionPropertySource(environment);
        return multiVersionPropertySource.getPropertySource(version);
    }

}


text:
using System.Collections.Generic;
using JetBrains.Annotations;
using JetBrains.ProjectModel;
using JetBrains.ReSharper.Feature.Services.Bulbs;
using JetBrains.ReSharper.Feature.Services.ContextActions;
using JetBrains.ReSharper.Feature.Services.CSharp.ContextActions;
using JetBrains.ReSharper.Feature.Services.Intentions;
using JetBrains.ReSharper.Plugins.Unity.CSharp.Daemon.Stages.BurstCodeAnalysis.Analyzers;
using JetBrains.ReSharper.Plugins.Unity.CSharp.Feature.Services.ContextActions;
using JetBrains.ReSharper.Plugins.Unity.Resources;
using JetBrains.ReSharper.Psi.CSharp.Tree;
using JetBrains.Util;

namespace JetBrains.ReSharper.Plugins.Unity.CSharp.Feature.Services.CallGraph.BurstCodeAnalysis.AddDiscardAttribute
{
    [ContextAction(
        Group = UnityContextActions.GroupID,
        ResourceType = typeof(Strings), NameResourceName = nameof(Strings.AddDiscardAttributeContextAction_Name), DescriptionResourceName = nameof(Strings.AddDiscardAttributeContextAction_Name),
        Disabled = false,
        AllowedInNonUserFiles = false,
        Priority = 1)]
    public sealed class AddDiscardAttributeContextAction : BurstContextActionBase
    {
        private readonly BurstGutterMarkProvider myBurstGutterMarkProvider;

        public AddDiscardAttributeContextAction([NotNull] ICSharpContextActionDataProvider dataProvider)
            : base(dataProvider)
        {
            myBurstGutterMarkProvider = dataProvider.Solution.GetComponent<BurstGutterMarkProvider>();
        }

        protected override IEnumerable<IntentionAction> GetIntentions(IMethodDeclaration containingMethod)
        {
            return new AddDiscardAttributeBulbAction(containingMethod).ToContextActionIntentions();
        }

        protected override bool IsAvailable(IUserDataHolder holder, IMethodDeclaration methodDeclaration)
        {
            return !myBurstGutterMarkProvider.IsGutterMarkEnabled
                   && base.IsAvailable(holder, methodDeclaration);
        }
    }
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0">

	<title>SuperheroAdmin - Bootstrap Admin Template</title>

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

	<link href="css/libs/font-awesome.css" type="text/css" rel="stylesheet" />

	<link rel="stylesheet" type="text/css" href="css/compiled/layout.css">
	<link rel="stylesheet" type="text/css" href="css/compiled/elements.css">

	<link rel="stylesheet" type="text/css" href="css/libs/jquery.nouislider.css">

	<link href='../fonts.googleapis.com/cssf58a.css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'>

				 SuperheroAdmin

			<button class="navbar-toggle" data-target=".navbar-ex1-collapse" data-toggle="collapse" type="button">
				Toggle navigation

			</button>

							<form role="search">

									<input type="text" class="form-control" placeholder="Search...">

							</form>

							8

You have 6 new notifications

									New comment on 'Awesome P...
									13 min.

									New user registration
									13 min.

									New Message from George
									13 min.

									New purchase
									13 min.

									New order
									13 min.

									View all notifications

							16

											George Clooney

											Look, just because I don't be givin' no man a foot massage don't make it
											right for Marsellus to throw...

									13 min.

											Emma Watson

											Look, just because I don't be givin' no man a foot massage don't make it
											right for Marsellus to throw...

									13 min.

											Robert Downey Jr.

											Look, just because I don't be givin' no man a foot massage don't make it
											right for Marsellus to throw...

									13 min.

									View all messages

							Scarlett Johansson

Profile

Settings

Messages

Logout

									Dashboard

									Users

											User list

											User profile

									Tables

									Graphs

											Morris & Mixed

											Flot

											xCharts

									Forms

											Form elements

											Form wizard

											Form wizard popup

											WYSIWYG

											WYSIWYG CKEditor

											Drop File Upload

									Pricing

									Calendar

									Typography

									UI Elements

											Elements

											Nestable

									Gallery

									3 Level Menu

											2nd Level

													3rd Level

													3rd Level

													3rd Level

											2nd Level

													3rd Level

													3rd Level

													3rd Level

											2nd Level

									Extra pages

											FAQ

											Login

											Login full

											Invoice

											Emails

											Error 404

											Error 404 Nested

											Error 500

											Awesome Icons

											Halflings Icons

											Grid

UI Elements

Buttons

											<button type="button" class="btn btn-default">Default</button>

											<button type="button" class="btn btn-primary">Primary</button>

											<button type="button" class="btn btn-success">Success</button>

											<button type="button" class="btn btn-info">Info</button>

											<button type="button" class="btn btn-warning">Warning</button>

											<button type="button" class="btn btn-danger">Danger</button>

											<button type="button" class="btn btn-link">Link</button>

												<button type="button" class="btn btn-default">Left</button>
												<button type="button" class="btn btn-default">Middle</button>
												<button type="button" class="btn btn-default">Right</button>

												<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
													Action
												</button>

Action

Another action

Something else here

Separated link

												<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
													Action
												</button>

Action

Another action

Something else here

Separated link

												<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
													Action
												</button>

Action

Another action

Something else here

Separated link

												<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
													Action
												</button>

Action

Another action

Something else here

Separated link

												<button type="button" class="btn btn-default">Action</button>
												<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">

												</button>

Action

Another action

Something else here

Separated link

												<button type="button" class="btn btn-primary">Action</button>
												<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">

												</button>

Action

Another action

Something else here

Separated link

												<button type="button" class="btn btn-success">Action</button>
												<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">

												</button>

Action

Another action

Something else here

Separated link

												<button type="button" class="btn btn-danger">Action</button>
												<button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">

												</button>

Action

Another action

Something else here

Separated link

												<button type="button" class="btn btn-info"></button>
												<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown">

												</button>

Action

Another action

Something else here

Separated link

											<button type="button" class="btn btn-primary btn-lg">
												 Icon button
											</button>

											<button type="button" class="btn btn-success btn-lg">
												 Icon button
											</button>

											<button type="button" data-loading-text="Loading..." class="btn btn-primary btn-lg" id="btn-loading-demo">
												Loading button
											</button>

Alerts

										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

										Well done! You successfully read this important alert message.

										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

										Heads up! This alert needs your attention, but it's not super important.

										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

										Warning! Best check yo self, you're not looking too good.

										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

										Oh snap! Change a few things up and try submitting again.

										<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

Oh snap! You got an error!

Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

											Take this action Or do this

Pagination

1

2

3

4

5

← Older

Newer →

Labels

									Default
									Primary
									Success
									Info
									Warning
									Danger

									Default
									Primary
									Success
									Info
									Warning
									Danger

Progress bars

Basic

											60% Complete

											40% Complete (success)

											20% Complete

											60% Complete (warning)

											80% Complete

Striped

											40% Complete (success)

											20% Complete

											60% Complete (warning)

											80% Complete (danger)

Animated & Stacked

											45% Complete

											35% Complete (success)

											20% Complete (warning)

											10% Complete (danger)

Other dimensions

											60% Complete

											40% Complete (success)

											55% Complete

List group

Badges

													14
													Default badge

													2
													Danger badge (.badge-danger)

													112
													Success badge (.badge-success)

													928
													Primary badge (.badge-primary)

													8
													Warning badge (.badge-warning)

													392
													Info badge (.badge-inf)

Linked items

													Cras justo odio

												Dapibus ac facilisis in
												Morbi leo risus
												Porta ac consectetur ac
												Vestibulum at eros
												Morbi leo risus

Linked items with custom content

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

Tabs

Home

Help

													Dropdown

Action

Another action

Something else here

Separated link

													Normally, both your asses would be dead as fucking fried chicken, but you happen
													to pull this shit while I'm in a transitional period so I don't wanna kill you,
													I wanna help you. But I can't give you this case, it don't belong to me.

												Besides, I've already been through too much shit this morning over this case to hand
												it over to your dumb ass.

												Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense!

												In a comic, you know how you can tell who the arch-villain's going to be?

												He's the exact opposite of the hero. And most times they're friends, like you and me!

												I should've known way back when... You know why, David? Because of the kids.
												They called me Mr Glass.

Modal windows

									Launch demo modal

													<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Modal title

													<form role="form">

															Email address
															<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">

															Password
															<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">

															Textarea
															<textarea class="form-control" id="exampleTextarea" rows="3"></textarea>

																<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">

																<select class="form-control">
																	<option>Active</option>
																	<option>Inactive</option>
																</select>

															<button type="submit" class="btn btn-link"> Preview</button>

													</form>

													<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
													<button type="button" class="btn btn-primary">Save changes</button>

Popovers

											<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">
												Popover on left
											</button>
											<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">
												Popover on top
											</button>
											<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">
												Popover on bottom
											</button>
											<button type="button" class="btn btn-default" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus." data-original-title="" title="">
												Popover on right
											</button>

Collapse

														Collapsible Group Item #1

													Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

														Collapsible Group Item #2

													Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

														Collapsible Group Item #3

													Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

Sliders - fully responsive

Basic slider

Min/Max slider

Range slider

Disable slider

													<input type="checkbox" id="disable-checkbox" value="1"> Disable this slider

Vertical sliders

			© 2014 Adbee digital. Powered by SuperheroAdmin.


text:
ACCEPTED

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

#### Published in
Bryologist 89(4): 257 (1987)

#### Original name
Psora californica Timdal

### Remarks
null


text:
{% extends "leprikon/default.html" %}
{% load i18n %}

{% block content %}

{% block title %}{% trans 'Email with instructions sent' %}{% endblock %}

{% trans "We've emailed you instructions for setting your password. You should be receiving them shortly." %}

{% trans "If you don't receive an email, please make sure you've entered the address you registered with, and check your spam folder." %}

{% endblock %}


text:
package org.apache.sling.caconfig.impl.def;

import static org.apache.sling.caconfig.impl.def.ConfigurationDefNameConstants.PROPERTY_CONFIG_PROPERTY_INHERIT;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.wrappers.ValueMapDecorator;
import org.apache.sling.caconfig.impl.ConfigurationResourceWrapper;
import org.apache.sling.caconfig.resource.impl.util.PropertyUtil;
import org.apache.sling.caconfig.spi.ConfigurationInheritanceStrategy;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.metatype.annotations.AttributeDefinition;
import org.osgi.service.metatype.annotations.Designate;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Component(service=ConfigurationInheritanceStrategy.class)
@Designate(ocd=DefaultConfigurationInheritanceStrategy.Config.class)
public class DefaultConfigurationInheritanceStrategy implements ConfigurationInheritanceStrategy {

    @ObjectClassDefinition(name="Apache Sling Context-Aware Configuration Default Inheritance Strategy",
            description="Standardized resource inheritance for configurations.")
    public static @interface Config {

        @AttributeDefinition(name="Enabled",
                description = "Enable this configuration inheritance strategy.")
        boolean enabled() default true;

        @AttributeDefinition(name="Config property inheritance property names",
                description = "Additional property names to " + PROPERTY_CONFIG_PROPERTY_INHERIT + " to handle property inheritance. The names are used in the order defined, "
                     + "always starting with " + PROPERTY_CONFIG_PROPERTY_INHERIT + ". Once a property with a value is found, that value is used and the following property names are skipped.")
        String[] configPropertyInheritancePropertyNames();

    }

    private Config config;

    private static final Logger log = LoggerFactory.getLogger(DefaultConfigurationInheritanceStrategy.class);

    @Activate
    private void activate(final Config config) {
        this.config = config;
    }

    @Override
    public Resource getResource(Iterator<Resource> configResources) {
        if (!config.enabled()) {
            return null;
        }
        if (!configResources.hasNext()) {
            return null;
        }
        Resource primary = configResources.next();
        if (!isPropertyInheritance(primary) || !configResources.hasNext()) {
            return primary;
        }
        Map<String,Object> mergedProps = getInheritedProperties(primary.getValueMap(), configResources);
        return new ConfigurationResourceWrapper(primary, new ValueMapDecorator(mergedProps));
    }

    private boolean isPropertyInheritance(Resource resource) {
        return PropertyUtil.getBooleanValueAdditionalKeys(resource.getValueMap(), PROPERTY_CONFIG_PROPERTY_INHERIT,
                config.configPropertyInheritancePropertyNames());
    }

    private Map<String,Object> getInheritedProperties(Map<String,Object> parentProps, Iterator<Resource> inheritanceChain) {
        if (!inheritanceChain.hasNext()) {
            return parentProps;
        }
        Resource next = inheritanceChain.next();
        log.trace("! Property inheritance: Merge with properties from {}", next.getPath());
        Map<String,Object> merged = new HashMap<>(next.getValueMap());
        merged.putAll(parentProps);
        if (isPropertyInheritance(next)) {
            return getInheritedProperties(merged, inheritanceChain);
        }
        else {
            return merged;
        }
    }

}


text:
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Component, Input, Output, EventEmitter, ViewChild, ChangeDetectionStrategy } from '@angular/core';
import { XAxisTicksComponent } from './x-axis-ticks.component';
var XAxisComponent = /** @class */ (function () {
    function XAxisComponent() {
        this.showGridLines = false;
        this.xOrient = 'bottom';
        this.xAxisOffset = 0;
        this.dimensionsChanged = new EventEmitter();
        this.xAxisClassName = 'x axis';
        this.labelOffset = 0;
        this.fill = 'none';
        this.stroke = 'stroke';
        this.tickStroke = '#ccc';
        this.strokeWidth = 'none';
        this.padding = 5;
    }
    XAxisComponent.prototype.ngOnChanges = function (changes) {
        this.update();
    };
    XAxisComponent.prototype.update = function () {
        this.transform = "translate(0," + (this.xAxisOffset + this.padding + this.dims.height) + ")";
        if (typeof this.xAxisTickCount !== 'undefined') {
            this.tickArguments = [this.xAxisTickCount];
        }
    };
    XAxisComponent.prototype.emitTicksHeight = function (_a) {
        var _this = this;
        var height = _a.height;
        var newLabelOffset = height + 25 + 5;
        if (newLabelOffset !== this.labelOffset) {
            this.labelOffset = newLabelOffset;
            setTimeout(function () {
                _this.dimensionsChanged.emit({ height: height });
            }, 0);
        }
    };
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "xScale", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "dims", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "tickFormatting", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "showGridLines", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "showLabel", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "labelText", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Array)
    ], XAxisComponent.prototype, "ticks", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "xAxisTickInterval", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "xAxisTickCount", void 0);
    __decorate([
        Input(),
        __metadata("design:type", String)
    ], XAxisComponent.prototype, "xOrient", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Number)
    ], XAxisComponent.prototype, "xAxisOffset", void 0);
    __decorate([
        Output(),
        __metadata("design:type", Object)
    ], XAxisComponent.prototype, "dimensionsChanged", void 0);
    __decorate([
        ViewChild(XAxisTicksComponent),
        __metadata("design:type", XAxisTicksComponent)
    ], XAxisComponent.prototype, "ticksComponent", void 0);
    XAxisComponent = __decorate([
        Component({
            selector: 'g[ngx-charts-x-axis]',
            template: "\n    <svg:g\n      [attr.class]=\"xAxisClassName\"\n      [attr.transform]=\"transform\">\n      <svg:g ngx-charts-x-axis-ticks\n        *ngIf=\"xScale\"\n        [tickFormatting]=\"tickFormatting\"\n        [tickArguments]=\"tickArguments\"\n        [tickStroke]=\"tickStroke\"\n        [scale]=\"xScale\"\n        [orient]=\"xOrient\"\n        [showGridLines]=\"showGridLines\"\n        [gridLineHeight]=\"dims.height\"\n        [width]=\"dims.width\"\n        [tickValues]=\"ticks\"\n        (dimensionsChanged)=\"emitTicksHeight($event)\"\n      />\n      <svg:g ngx-charts-axis-label\n        *ngIf=\"showLabel\"\n        [label]=\"labelText\"\n        [offset]=\"labelOffset\"\n        [orient]=\"'bottom'\"\n        [height]=\"dims.height\"\n        [width]=\"dims.width\">\n      </svg:g>\n    </svg:g>\n  ",
            changeDetection: ChangeDetectionStrategy.OnPush
        })
    ], XAxisComponent);
    return XAxisComponent;
}());
export { XAxisComponent };
//# sourceMappingURL=x-axis.component.js.map


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

import Accounts = require('./Accounts');
import Api = require('./Api');
import Autopilot = require('./Autopilot');
import Bulkexports = require('./Bulkexports');
import Chat = require('./Chat');
import Content = require('./Content');
import Conversations = require('./Conversations');
import Events = require('./Events');
import FlexApi = require('./FlexApi');
import FrontlineApi = require('./FrontlineApi');
import Insights = require('./Insights');
import IpMessaging = require('./IpMessaging');
import Lookups = require('./Lookups');
import Media = require('./Media');
import Messaging = require('./Messaging');
import Microvisor = require('./Microvisor');
import Monitor = require('./Monitor');
import Notify = require('./Notify');
import Numbers = require('./Numbers');
import Oauth = require('./Oauth');
import Preview = require('./Preview');
import Pricing = require('./Pricing');
import Proxy = require('./Proxy');
import RequestClient = require('../base/RequestClient');
import Routes = require('./Routes');
import Serverless = require('./Serverless');
import Studio = require('./Studio');
import Supersim = require('./Supersim');
import Sync = require('./Sync');
import Taskrouter = require('./Taskrouter');
import Trunking = require('./Trunking');
import Trusthub = require('./Trusthub');
import Verify = require('./Verify');
import Video = require('./Video');
import Voice = require('./Voice');
import Wireless = require('./Wireless');

declare class Twilio {
  /**
   * Twilio Client to interact with the Rest API
   *
   * @param username - The username used for authentication. This is normally account sid, but if using key/secret auth will be the api key sid.
   * @param password - The password used for authentication. This is normally auth token, but if using key/secret auth will be the secret.
   * @param opts - The options argument
   */
  constructor(username: string, password: string, opts?: Twilio.TwilioClientOptions);

  accounts: Accounts;
  addresses: (typeof Api.prototype.account.addresses);
  api: Api;
  applications: (typeof Api.prototype.account.applications);
  authorizedConnectApps: (typeof Api.prototype.account.authorizedConnectApps);
  autopilot: Autopilot;
  availablePhoneNumbers: (typeof Api.prototype.account.availablePhoneNumbers);
  balance: (typeof Api.prototype.account.balance);
  bulkexports: Bulkexports;
  calls: (typeof Api.prototype.account.calls);
  chat: Chat;
  conferences: (typeof Api.prototype.account.conferences);
  connectApps: (typeof Api.prototype.account.connectApps);
  content: Content;
  conversations: Conversations;
  events: Events;
  flexApi: FlexApi;
  frontlineApi: FrontlineApi;
  httpClient?: RequestClient;
  incomingPhoneNumbers: (typeof Api.prototype.account.incomingPhoneNumbers);
  insights: Insights;
  ipMessaging: IpMessaging;
  keys: (typeof Api.prototype.account.keys);
  lookups: Lookups;
  media: Media;
  messages: (typeof Api.prototype.account.messages);
  messaging: Messaging;
  microvisor: Microvisor;
  monitor: Monitor;
  newKeys: (typeof Api.prototype.account.newKeys);
  newSigningKeys: (typeof Api.prototype.account.newSigningKeys);
  notifications: (typeof Api.prototype.account.notifications);
  notify: Notify;
  numbers: Numbers;
  oauth: Oauth;
  outgoingCallerIds: (typeof Api.prototype.account.outgoingCallerIds);
  preview: Preview;
  pricing: Pricing;
  proxy: Proxy;
  queues: (typeof Api.prototype.account.queues);
  recordings: (typeof Api.prototype.account.recordings);
  /**
   * Makes a request to the Twilio API using the configured http client.
   * Authentication information is automatically added if none is provided.
   *
   * @param opts - The options argument
   */
  request(opts: Twilio.RequestOptions): Promise<any>;
  routes: Routes;
  serverless: Serverless;
  shortCodes: (typeof Api.prototype.account.shortCodes);
  signingKeys: (typeof Api.prototype.account.signingKeys);
  sip: (typeof Api.prototype.account.sip);
  studio: Studio;
  supersim: Supersim;
  sync: Sync;
  taskrouter: Taskrouter;
  tokens: (typeof Api.prototype.account.tokens);
  transcriptions: (typeof Api.prototype.account.transcriptions);
  trunking: Trunking;
  trusthub: Trusthub;
  usage: (typeof Api.prototype.account.usage);
  /**
   * Validates that a request to the new SSL certificate is successful.
   *
   * @throws {RestException} if the request fails
   */
  validateSslCert(): Promise<any>;
  validationRequests: (typeof Api.prototype.account.validationRequests);
  verify: Verify;
  video: Video;
  voice: Voice;
  wireless: Wireless;
}

declare namespace Twilio {

  /**
   * Options for the request
   *
   * @property allowRedirects - Should the client follow redirects
   * @property data - The request data
   * @property headers - The request headers
   * @property logLevel - Show debug logs
   * @property method - The http method
   * @property params - The request params
   * @property password - The password used for auth
   * @property timeout - The request timeout in milliseconds
   * @property uri - The request uri
   * @property username - The username used for auth
   */
  export interface RequestOptions {
    allowRedirects?: boolean;
    data?: object;
    headers?: object;
    logLevel?: string;
    method: string;
    params?: object;
    password?: string;
    timeout?: number;
    uri: string;
    username?: string;
  }

  /**
   * Options to pass to the Twilio Client constructor
   *
   * @property accountSid - The default accountSid. This is set to username if not provided
   * @property edge - Twilio edge to use. Defaults to none
   * @property env - The environment object. Defaults to process.env
   * @property httpClient - The client used for http requests. Defaults to RequestClient
   * @property lazyLoading - Enable lazy loading, loading time will decrease if enabled. Defaults to true
   * @property logLevel - Debug logs will be shown. Defaults to none
   * @property region - Twilio region to use. Defaults to us1 if edge defined
   * @property userAgentExtensions - Additions to the user agent string
   */
  export interface TwilioClientOptions {
    accountSid?: string;
    edge?: string;
    env?: object;
    httpClient?: RequestClient;
    lazyLoading?: boolean;
    logLevel?: string;
    region?: string;
    userAgentExtensions?: string[];
  }
}

export = Twilio;


text:
package com.deepoove.poi.exception;

public class ResolverException extends RuntimeException {

    private static final long serialVersionUID = -7058954483364965161L;

    public ResolverException() {}

    public ResolverException(String msg) {
        super(msg);
    }

    public ResolverException(String msg, Throwable t) {
        super(msg, t);
    }

}


text:
Vim syntax for [TOML](https://github.com/toml-lang/toml). As of Neovim 0.6 and
Vim 8.2.3519, these runtime files are included in the main (Neo)Vim
distribution.

## Installation

### Vim packages (recommended; Vim 8+ only)

Clone or submodule this repo into your Vim packages location. Example:

```
git clone https://github.com/cespare/vim-toml.git ~/.vim/pack/plugins/start/vim-toml
```

### Pathogen

Set up [Pathogen](https://github.com/tpope/vim-pathogen) then clone/submodule
this repo into `~/.vim/bundle/toml`, or wherever you've pointed your Pathogen.

### Vundle

Set up [Vundle](https://github.com/VundleVim/Vundle.vim) then add `Plugin
'cespare/vim-toml'` to your vimrc and run `:PluginInstall` from a fresh vim.

### vim-plug

Set up [vim-plug](https://github.com/junegunn/vim-plug). In your .vimrc, between
the lines for `call plug#begin()` and `call plug#end()`, add the line `Plug
'cespare/vim-toml', { 'branch': 'main' }`. Reload your .vimrc and then run `:PlugInstall`.

### Janus

Set up [Janus](https://github.com/carlhuda/janus) and then clone/submodule this
repo into `~/.janus` and restart vim.

## Contributing

Contributions are very welcome! Just open a PR.


text:
'use strict';

var download = require('../lib/download');
var path = require('path');
var fs = require('fs');
var plist = require('fast-plist');
var cson = require('cson-parser');

function getCommitSha(repoId, repoPath) {
	var commitInfo = 'https://api.github.com/repos/' + repoId + '/commits?path=' + repoPath;
	return download.toString(commitInfo).then(function (content) {
		try {
			let lastCommit = JSON.parse(content)[0];
			return Promise.resolve({
				commitSha : lastCommit.sha,
				commitDate : lastCommit.commit.author.date
			});
		} catch (e) {
			return Promise.resolve(null);
		}
	}, function () {
		console.err('Failed loading ' + commitInfo);
		return Promise.resolve(null);
	});
}

exports.update = function (repoId, repoPath, dest, modifyGrammar) {
	var contentPath = 'https://raw.githubusercontent.com/' + repoId + '/master/' + repoPath;
	console.log('Reading from ' + contentPath);
	return download.toString(contentPath).then(function (content) {
		var ext = path.extname(repoPath);
		var grammar;
		if (ext === '.tmLanguage' || ext === '.plist') {
			grammar = plist.parse(content);
		} else if (ext === '.cson') {
			grammar = cson.parse(content);
		} else if (ext === '.json') {
			grammar = JSON.parse(content);
		} else {
			console.error('Unknown file extension: ' + ext);
			return;
		}
		if (modifyGrammar) {
			modifyGrammar(grammar);
		}
		return getCommitSha(repoId, repoPath).then(function (info) {
			if (info) {
				grammar.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha;
			}
			try {
				fs.writeFileSync(dest, JSON.stringify(grammar, null, '\t'));
				if (info) {
					console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
				} else {
					console.log('Updated ' + path.basename(dest));
				}
			} catch (e) {
				console.error(e);
			}
		});

	}, console.error);
}
if (path.basename(process.argv[1]) === 'update-grammar.js') {
	for (var i = 3; i < process.argv.length; i+=2) {
		exports.update(process.argv[2], process.argv[i], process.argv[i+1]);
	}
}


text:
package Lucy::Store::FileHandle;
use Lucy;
our $VERSION = '0.004000';
$VERSION = eval $VERSION;

1;

__END__


text:
"""Tests for mool.common.utils.resource_utils."""
import os
import subprocess

import common.utils.resource_utils as resource_utils
import common.utils.test_modules.validation_outer as vo

def test_read_resource_from_lib():
    """Test reading resource from a linked library."""
    vo.validate_outer()

def test_read_resource_from_bin():
    """Test reading resource from a binary."""
    validation_bin = os.path.join(
        os.environ['BUILD_OUT_DIR'], 'common', 'utils', 'test_modules',
        'validation_bin')
    subprocess.check_call(validation_bin)

def test_read_resource_linked_directly():
    """Test reading resource linked directly to unit test."""
    assert '789' == resource_utils.read_resource('v_resources/file3.txt')


text:
import json
import threading

from mock import Mock

from c7n.config import Bag
from c7n.exceptions import PolicyValidationError
from c7n.resources import aws, load_resources
from c7n import output

# resolver test needs to patch out thread usage
from c7n.resources.sqs import SQS
from c7n.executor import MainThreadExecutor

from .common import BaseTest

from aws_xray_sdk.core.models.segment import Segment
from aws_xray_sdk.core.models.subsegment import Subsegment

class TraceDoc(Bag):

    def serialize(self):
        return json.dumps(dict(self))

class OutputXrayTracerTest(BaseTest):

    def test_emitter(self):
        emitter = aws.XrayEmitter()
        emitter.client = m = Mock()
        doc = TraceDoc({'good': 'morning'})
        emitter.send_entity(doc)
        emitter.flush()
        m.put_trace_segments.assert_called_with(
            TraceSegmentDocuments=[doc.serialize()])

class TestArnResolver:

    table = [
        ('arn:aws:waf::123456789012:webacl/3bffd3ed-fa2e-445e-869f-a6a7cf153fd3', 'waf'),
        ('arn:aws:waf-regional:us-east-1:123456789012:webacl/3bffd3ed-fa2e-445e-869f-a6a7cf153fd3', 'waf-regional'), # NOQA
        ('arn:aws:acm:region:account-id:certificate/certificate-id', 'acm-certificate'),
        ('arn:aws:cloudwatch:region:account-id:alarm:alarm-name', 'alarm'),
        ('arn:aws:logs:us-east-1:123456789012:log-group:my-log-group', 'log-group'),
        ('arn:aws:codebuild:us-east-1:123456789012:project/my-demo-project', 'codebuild'),
        ('arn:aws:cognito-idp:region:account-id:userpool/user-pool-id', 'user-pool'),
        ('arn:aws:config:region:account-id:config-rule/config-rule-id', 'config-rule'),
        ('arn:aws:directconnect:us-east-1:123456789012:dxcon/dxcon-fgase048', 'directconnect'),
        ('arn:aws:dynamodb:region:account-id:table/tablename', 'dynamodb-table'),
        ('arn:aws:ec2:region:account-id:instance/instance-id', 'ec2'),
        ('arn:aws:ec2:region:account-id:vpc/vpc-id', 'vpc'),
        ('arn:aws:ds:region:account-id:directory/directoryId', 'directory'),
        ('arn:aws:elasticbeanstalk:region:account-id:application/applicationname', 'elasticbeanstalk'), # NOQA
        ('arn:aws:ecr:region:account-id:repository/repository-name', 'ecr'),
        ('arn:aws:elasticache:us-east-2:123456789012:cluster:myCluster', 'cache-cluster'),
        ('arn:aws:es:us-east-1:123456789012:domain/streaming-logs', 'elasticsearch'),
        ('arn:aws:elasticfilesystem:region:account-id:file-system/file-system-id', 'efs'),
        ('arn:aws:ecs:us-east-1:123456789012:task/my-cluster/1abf0f6d-a411-4033-b8eb-a4eed3ad252a', 'ecs-task'), # NOQA
        ('arn:aws:autoscaling:region:account-id:autoScalingGroup:groupid:autoScalingGroupName/groupfriendlyname', 'asg') # NOQA
    ]

    def test_arn_resolve_resources(self, test):
        arns = [
            'arn:aws:sqs:us-east-1:644160558196:origin-dev',
            'arn:aws:lambda:us-east-1:644160558196:function:custodian-sg-modified',
            'arn:aws:lambda:us-east-1:644160558196:function:custodian-s3-tag-creator:$LATEST',
        ]

        factory = test.replay_flight_data('test_arn_resolve_resources')
        p = test.load_policy(
            {'name': 'resolve', 'resource': 'aws.ec2'},
            session_factory=factory)
        resolver = aws.ArnResolver(p.resource_manager)
        load_resources(('aws.sqs', 'aws.lambda'))
        test.patch(SQS, 'executor_factory', MainThreadExecutor)
        arn_map = resolver.resolve(arns)
        assert len(arn_map) == 3
        assert None not in arn_map.values()

    def test_arn_meta(self):

        legacy = set()
        for k, v in aws.AWS.resources.items():
            if getattr(v.resource_type, 'type', None) is not None:
                legacy.add(k)
        assert not legacy

    def test_arn_resolve_type(self):
        for value, expected in self.table:
            # load the resource types to enable resolution.
            aws.AWS.get_resource_types(("aws.%s" % expected,))
            arn = aws.Arn.parse(value)
            result = aws.ArnResolver.resolve_type(arn)
            assert result == expected

    def test_arn_cwe_resolver(self):

        evars = dict(
            Partition='aws',
            Region='us-east-1',
            Account='662108712480',
            FunctionName='func',
            Version='1.1',
            VersionId='1.1',
            ClusterName='abc',
            AutomationDefinitionName='adf',
            TaskDefinitionFamilyName='abc',
            TaskDefinitionRevisionNumber='yz',
            StreamName='kstream',
            AutomationDefinition='abc',
            LogGroupName='loggroup',
            JobQueueName='batchq',
            JobDefinitionName='jobdef',
            Revision='1.1',
            QueueName='inboundq',
            TopicName='outboundt',
            ProjectName="buildstuff",
            PipelineName='pushit',
            StateMachineName='sfxorch'
        )

        event_targets = dict(
            sqs=("arn:{Partition}:sqs:{Region}:{Account}:{QueueName}", 'sqs'),
            function=("arn:{Partition}:lambda:{Region}:{Account}:function:{FunctionName}",
                      'lambda'),
            function_qual=(
                "arn:{Partition}:lambda:{Region}:{Account}:function:{FunctionName}:{Version}",
                "lambda"),
            ecs_cluster=(
                "arn:{Partition}:ecs:{Region}:{Account}:cluster/{ClusterName}",
                "ecs"),
            ecs_task=(
                ("arn:{Partition}:ecs:{Region}:{Account}:task-definition/"
                "{TaskDefinitionFamilyName}:{TaskDefinitionRevisionNumber}"),
                "ecs-task-definition"),
            kinesis=("arn:{Partition}:kinesis:{Region}:{Account}:stream/{StreamName}",
                     "kinesis"),
            log=("arn:{Partition}:logs:{Region}:{Account}:log-group:{LogGroupName}",
                 "log-group"),
            # ssm_adoc=(("arn:{Partition}:ssm:{Region}:{Account}:automation-definition"
            #           "/{AutomationDefinitionName}:{VersionId}"),
            batch_job_def=(
                ("arn:{Partition}:batch:{Region}:{Account}:job-definition"
                 "/{JobDefinitionName}:{Revision}"),
                "batch-definition"),
            batch_queue=("arn:{Partition}:batch:{Region}:{Account}:job-queue/{JobQueueName}",
                         "batch-queue"),
            step_func=(
                "arn:{Partition}:states:{Region}:{Account}:stateMachine:{StateMachineName}",
                "step-machine"),
            code_pipe=(
                "arn:{Partition}:codepipeline:{Region}:{Account}:{PipelineName}",
                "codepipeline"),
            code_build=(
                "arn:{Partition}:codebuild:{Region}:{Account}:project/{ProjectName}",
                "codebuild"),
            sns_topics=(
                "arn:{Partition}:sns:{Region}:{Account}:{TopicName}",
                "sns"),
            sqs_queue=(
                "arn:{Partition}:sqs:{Region}:{Account}:{QueueName}",
                "sqs")
        )
        load_resources(('aws.*',))
        for k, (arn_template, rtype) in event_targets.items():
            rarn = arn_template.format(**evars)
            assert aws.ArnResolver.resolve_type(rarn) == rtype

class ArnTest(BaseTest):

    def test_eb_arn(self):
        arn = aws.Arn.parse(
            'arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnv')
        self.assertEqual(arn.service, 'elasticbeanstalk')
        self.assertEqual(arn.account_id, '123456789012')
        self.assertEqual(arn.region, 'us-east-1')
        self.assertEqual(arn.resource_type, 'environment')
        self.assertEqual(arn.resource, 'My App/MyEnv')

    def test_iam_arn(self):
        arn = aws.Arn.parse(
            'arn:aws:iam::123456789012:user/David')
        self.assertEqual(arn.service, 'iam')
        self.assertEqual(arn.resource, 'David')
        self.assertEqual(arn.resource_type, 'user')

    def test_rds_arn(self):
        arn = aws.Arn.parse(
            'arn:aws:rds:eu-west-1:123456789012:db:mysql-db')
        self.assertEqual(arn.resource_type, 'db')
        self.assertEqual(arn.resource, 'mysql-db')
        self.assertEqual(arn.region, 'eu-west-1')

    def test_s3_key_arn(self):
        arn = aws.Arn.parse(
            'arn:aws:s3:::my_corporate_bucket/exampleobject.png')
        self.assertEqual(arn.resource, 'my_corporate_bucket/exampleobject.png')

class UtilTest(BaseTest):

    def test_default_account_id_assume(self):
        config = Bag(assume_role='arn:aws:iam::644160558196:role/custodian-mu', account_id=None)
        aws._default_account_id(config)
        self.assertEqual(config.account_id, '644160558196')

    def test_validate(self):
        self.assertRaises(
            PolicyValidationError,
            aws.shape_validate,
            {'X': 1},
            'AwsSecurityFindingFilters',
            'securityhub')
        self.assertEqual(
            aws.shape_validate(
                {'Id': [{'Value': 'abc', 'Comparison': 'EQUALS'}]},
                'AwsSecurityFindingFilters',
                'securityhub'),
            None)

class TracerTest(BaseTest):

    def test_context(self):
        store = aws.XrayContext()
        self.assertEqual(store.handle_context_missing(), None)
        x = Segment('foo')
        y = Segment('foo')
        a = Subsegment('bar', 'boo', x)
        b = Subsegment('bar', 'boo', x)
        b.thread_id = '123'
        store.put_segment(x)
        store.put_subsegment(a)
        store.put_subsegment(b)

        self.assertEqual(store._local.entities, [x, a, b])
        self.assertEqual(store.get_trace_entity(), a)
        store.end_subsegment(a)
        self.assertEqual(store.get_trace_entity(), x)
        store.put_segment(y)
        self.assertEqual(store._local.entities, [y])
        self.assertEqual(store.get_trace_entity(), y)
        self.assertFalse(store.end_subsegment(42))

    def test_context_worker_thread_main_acquire(self):
        store = aws.XrayContext()
        x = Segment('foo')
        a = Subsegment('bar', 'boo', x)
        store.put_segment(x)
        store.put_subsegment(a)

        def get_ident():
            return 42

        self.patch(threading, 'get_ident', get_ident)
        self.assertEqual(store.get_trace_entity(), a)

    def test_tracer(self):
        session_factory = self.replay_flight_data('output-xray-trace')
        policy = Bag(name='test', resource_type='ec2')
        ctx = Bag(
            policy=policy,
            session_factory=session_factory,
            options=Bag(account_id='644160558196', region='us-east-1',))
        ctx.get_metadata = lambda *args: {}
        config = Bag()
        tracer = aws.XrayTracer(ctx, config)

        with tracer:
            try:
                with tracer.subsegment('testing') as w:
                    raise ValueError()
            except ValueError:
                pass
            self.assertNotEqual(w.cause, {})

class OutputMetricsTest(BaseTest):

    def test_metrics_destination_dims(self):
        tmetrics = []

        class Metrics(aws.MetricsOutput):

            def _put_metrics(self, ns, metrics):
                tmetrics.extend(metrics)

        conf = Bag({'region': 'us-east-2', 'scheme': 'aws', 'netloc': 'master'})
        ctx = Bag(session_factory=None,
                  options=Bag(account_id='001100', region='us-east-1'),
                  policy=Bag(name='test', resource_type='ec2'))
        moutput = Metrics(ctx, conf)

        moutput.put_metric('Calories', 400, 'Count', Scope='Policy', Food='Pizza')
        moutput.flush()

        tmetrics[0].pop('Timestamp')
        self.assertEqual(tmetrics, [{
            'Dimensions': [{'Name': 'Policy', 'Value': 'test'},
                           {'Name': 'ResType', 'Value': 'ec2'},
                           {'Name': 'Food', 'Value': 'Pizza'},
                           {'Name': 'Region', 'Value': 'us-east-1'},
                           {'Name': 'Account', 'Value': '001100'}],
            'MetricName': 'Calories',
            'Unit': 'Count',
            'Value': 400}])

    def test_metrics(self):
        session_factory = self.replay_flight_data('output-aws-metrics')
        policy = Bag(name='test', resource_type='ec2')
        ctx = Bag(session_factory=session_factory, policy=policy)
        sink = output.metrics_outputs.select('aws', ctx)
        self.assertTrue(isinstance(sink, aws.MetricsOutput))
        sink.put_metric('ResourceCount', 101, 'Count')
        sink.flush()

class OutputLogsTest(BaseTest):
    # cloud watch logging

    def test_default_log_group(self):
        ctx = Bag(session_factory=None,
                  options=Bag(account_id='001100', region='us-east-1'),
                  policy=Bag(name='test', resource_type='ec2'))

        log_output = output.log_outputs.select('custodian/xyz', ctx)
        self.assertEqual(log_output.log_group, 'custodian/xyz')
        self.assertEqual(log_output.construct_stream_name(), 'test')

        log_output = output.log_outputs.select('/custodian/xyz/', ctx)
        self.assertEqual(log_output.log_group, 'custodian/xyz')

        log_output = output.log_outputs.select('aws://somewhere/out/there', ctx)
        self.assertEqual(log_output.log_group, 'somewhere/out/there')

        log_output = output.log_outputs.select('aws:///somewhere/out', ctx)
        self.assertEqual(log_output.log_group, 'somewhere/out')

        log_output = output.log_outputs.select('aws://somewhere', ctx)
        self.assertEqual(log_output.log_group, 'somewhere')

        log_output = output.log_outputs.select(
            "aws:///somewhere/out?stream={region}/{policy}", ctx)
        self.assertEqual(log_output.log_group, 'somewhere/out')
        self.assertEqual(log_output.construct_stream_name(), 'us-east-1/test')

    def test_master_log_handler(self):
        session_factory = self.replay_flight_data('test_log_handler')
        ctx = Bag(session_factory=session_factory,
                  options=Bag(account_id='001100', region='us-east-1'),
                  policy=Bag(name='test', resource_type='ec2'))
        log_output = output.log_outputs.select(
            'aws://master/custodian?region=us-east-2', ctx)
        stream = log_output.get_handler()
        self.assertTrue(stream.log_group == 'custodian')
        self.assertTrue(stream.log_stream == '001100/us-east-1/test')

    def test_stream_override(self):
        session_factory = self.replay_flight_data(
            'test_log_stream_override')
        ctx = Bag(session_factory=session_factory,
            options=Bag(account_id='001100', region='us-east-1'),
            policy=Bag(name='test', resource_type='ec2'))
        log_output = output.log_outputs.select(
            'aws://master/custodian?region=us-east-2&stream=testing', ctx)
        stream = log_output.get_handler()
        self.assertTrue(stream.log_stream == 'testing')


text:
package siterecovery

// Copyright (c) Microsoft and contributors.  All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"context"
	"github.com/Azure/go-autorest/autorest"
	"github.com/Azure/go-autorest/autorest/azure"
	"net/http"
)

// ReplicationvCentersClient is the client for the ReplicationvCenters methods of the Siterecovery service.
type ReplicationvCentersClient struct {
	BaseClient
}

// NewReplicationvCentersClient creates an instance of the ReplicationvCentersClient client.
func NewReplicationvCentersClient(subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient {
	return NewReplicationvCentersClientWithBaseURI(DefaultBaseURI, subscriptionID, resourceGroupName, resourceName)
}

// NewReplicationvCentersClientWithBaseURI creates an instance of the ReplicationvCentersClient client.
func NewReplicationvCentersClientWithBaseURI(baseURI string, subscriptionID string, resourceGroupName string, resourceName string) ReplicationvCentersClient {
	return ReplicationvCentersClient{NewWithBaseURI(baseURI, subscriptionID, resourceGroupName, resourceName)}
}

// Create the operation to create a vCenter object..
// Parameters:
// fabricName - fabric name.
// vCenterName - vCenter name.
// addVCenterRequest - the input to the add vCenter operation.
func (client ReplicationvCentersClient) Create(ctx context.Context, fabricName string, vCenterName string, addVCenterRequest AddVCenterRequest) (result ReplicationvCentersCreateFuture, err error) {
	req, err := client.CreatePreparer(ctx, fabricName, vCenterName, addVCenterRequest)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", nil, "Failure preparing request")
		return
	}

	result, err = client.CreateSender(req)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Create", result.Response(), "Failure sending request")
		return
	}

	return
}

// CreatePreparer prepares the Create request.
func (client ReplicationvCentersClient) CreatePreparer(ctx context.Context, fabricName string, vCenterName string, addVCenterRequest AddVCenterRequest) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"fabricName":        autorest.Encode("path", fabricName),
		"resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
		"resourceName":      autorest.Encode("path", client.ResourceName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
		"vCenterName":       autorest.Encode("path", vCenterName),
	}

	const APIVersion = "2018-01-10"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPut(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vCenterName}", pathParameters),
		autorest.WithJSON(addVCenterRequest),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error.
func (client ReplicationvCentersClient) CreateSender(req *http.Request) (future ReplicationvCentersCreateFuture, err error) {
	var resp *http.Response
	resp, err = autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
	if err != nil {
		return
	}
	err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
	if err != nil {
		return
	}
	future.Future, err = azure.NewFutureFromResponse(resp)
	return
}

// CreateResponder handles the response to the Create request. The method always
// closes the http.Response Body.
func (client ReplicationvCentersClient) CreateResponder(resp *http.Response) (result VCenter, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// Delete the operation to remove(unregister) a registered vCenter server from the vault.
// Parameters:
// fabricName - fabric name.
// vCenterName - vCenter name.
func (client ReplicationvCentersClient) Delete(ctx context.Context, fabricName string, vCenterName string) (result ReplicationvCentersDeleteFuture, err error) {
	req, err := client.DeletePreparer(ctx, fabricName, vCenterName)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", nil, "Failure preparing request")
		return
	}

	result, err = client.DeleteSender(req)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Delete", result.Response(), "Failure sending request")
		return
	}

	return
}

// DeletePreparer prepares the Delete request.
func (client ReplicationvCentersClient) DeletePreparer(ctx context.Context, fabricName string, vCenterName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"fabricName":        autorest.Encode("path", fabricName),
		"resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
		"resourceName":      autorest.Encode("path", client.ResourceName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
		"vCenterName":       autorest.Encode("path", vCenterName),
	}

	const APIVersion = "2018-01-10"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsDelete(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vCenterName}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client ReplicationvCentersClient) DeleteSender(req *http.Request) (future ReplicationvCentersDeleteFuture, err error) {
	var resp *http.Response
	resp, err = autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
	if err != nil {
		return
	}
	err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
	if err != nil {
		return
	}
	future.Future, err = azure.NewFutureFromResponse(resp)
	return
}

// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client ReplicationvCentersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
		autorest.ByClosing())
	result.Response = resp
	return
}

// Get gets the details of a registered vCenter server(Add vCenter server.)
// Parameters:
// fabricName - fabric name.
// vCenterName - vCenter name.
func (client ReplicationvCentersClient) Get(ctx context.Context, fabricName string, vCenterName string) (result VCenter, err error) {
	req, err := client.GetPreparer(ctx, fabricName, vCenterName)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", nil, "Failure preparing request")
		return
	}

	resp, err := client.GetSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure sending request")
		return
	}

	result, err = client.GetResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Get", resp, "Failure responding to request")
	}

	return
}

// GetPreparer prepares the Get request.
func (client ReplicationvCentersClient) GetPreparer(ctx context.Context, fabricName string, vCenterName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"fabricName":        autorest.Encode("path", fabricName),
		"resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
		"resourceName":      autorest.Encode("path", client.ResourceName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
		"vCenterName":       autorest.Encode("path", vCenterName),
	}

	const APIVersion = "2018-01-10"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vCenterName}", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client ReplicationvCentersClient) GetSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
}

// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client ReplicationvCentersClient) GetResponder(resp *http.Response) (result VCenter, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// List lists the vCenter servers registered in the vault.
func (client ReplicationvCentersClient) List(ctx context.Context) (result VCenterCollectionPage, err error) {
	result.fn = client.listNextResults
	req, err := client.ListPreparer(ctx)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", nil, "Failure preparing request")
		return
	}

	resp, err := client.ListSender(req)
	if err != nil {
		result.vcc.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure sending request")
		return
	}

	result.vcc, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "List", resp, "Failure responding to request")
	}

	return
}

// ListPreparer prepares the List request.
func (client ReplicationvCentersClient) ListPreparer(ctx context.Context) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
		"resourceName":      autorest.Encode("path", client.ResourceName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2018-01-10"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationvCenters", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ReplicationvCentersClient) ListSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
}

// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client ReplicationvCentersClient) ListResponder(resp *http.Response) (result VCenterCollection, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// listNextResults retrieves the next set of results, if any.
func (client ReplicationvCentersClient) listNextResults(lastResults VCenterCollection) (result VCenterCollection, err error) {
	req, err := lastResults.vCenterCollectionPreparer()
	if err != nil {
		return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", nil, "Failure preparing next results request")
	}
	if req == nil {
		return
	}
	resp, err := client.ListSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure sending next results request")
	}
	result, err = client.ListResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listNextResults", resp, "Failure responding to next results request")
	}
	return
}

// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client ReplicationvCentersClient) ListComplete(ctx context.Context) (result VCenterCollectionIterator, err error) {
	result.page, err = client.List(ctx)
	return
}

// ListByReplicationFabrics lists the vCenter servers registered in a fabric.
// Parameters:
// fabricName - fabric name.
func (client ReplicationvCentersClient) ListByReplicationFabrics(ctx context.Context, fabricName string) (result VCenterCollectionPage, err error) {
	result.fn = client.listByReplicationFabricsNextResults
	req, err := client.ListByReplicationFabricsPreparer(ctx, fabricName)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", nil, "Failure preparing request")
		return
	}

	resp, err := client.ListByReplicationFabricsSender(req)
	if err != nil {
		result.vcc.Response = autorest.Response{Response: resp}
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure sending request")
		return
	}

	result.vcc, err = client.ListByReplicationFabricsResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "ListByReplicationFabrics", resp, "Failure responding to request")
	}

	return
}

// ListByReplicationFabricsPreparer prepares the ListByReplicationFabrics request.
func (client ReplicationvCentersClient) ListByReplicationFabricsPreparer(ctx context.Context, fabricName string) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"fabricName":        autorest.Encode("path", fabricName),
		"resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
		"resourceName":      autorest.Encode("path", client.ResourceName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
	}

	const APIVersion = "2018-01-10"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsGet(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters", pathParameters),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// ListByReplicationFabricsSender sends the ListByReplicationFabrics request. The method will close the
// http.Response Body if it receives an error.
func (client ReplicationvCentersClient) ListByReplicationFabricsSender(req *http.Request) (*http.Response, error) {
	return autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
}

// ListByReplicationFabricsResponder handles the response to the ListByReplicationFabrics request. The method always
// closes the http.Response Body.
func (client ReplicationvCentersClient) ListByReplicationFabricsResponder(resp *http.Response) (result VCenterCollection, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}

// listByReplicationFabricsNextResults retrieves the next set of results, if any.
func (client ReplicationvCentersClient) listByReplicationFabricsNextResults(lastResults VCenterCollection) (result VCenterCollection, err error) {
	req, err := lastResults.vCenterCollectionPreparer()
	if err != nil {
		return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", nil, "Failure preparing next results request")
	}
	if req == nil {
		return
	}
	resp, err := client.ListByReplicationFabricsSender(req)
	if err != nil {
		result.Response = autorest.Response{Response: resp}
		return result, autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure sending next results request")
	}
	result, err = client.ListByReplicationFabricsResponder(resp)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "listByReplicationFabricsNextResults", resp, "Failure responding to next results request")
	}
	return
}

// ListByReplicationFabricsComplete enumerates all values, automatically crossing page boundaries as required.
func (client ReplicationvCentersClient) ListByReplicationFabricsComplete(ctx context.Context, fabricName string) (result VCenterCollectionIterator, err error) {
	result.page, err = client.ListByReplicationFabrics(ctx, fabricName)
	return
}

// Update the operation to update a registered vCenter.
// Parameters:
// fabricName - fabric name.
// vCenterName - vCeneter name
// updateVCenterRequest - the input to the update vCenter operation.
func (client ReplicationvCentersClient) Update(ctx context.Context, fabricName string, vCenterName string, updateVCenterRequest UpdateVCenterRequest) (result ReplicationvCentersUpdateFuture, err error) {
	req, err := client.UpdatePreparer(ctx, fabricName, vCenterName, updateVCenterRequest)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", nil, "Failure preparing request")
		return
	}

	result, err = client.UpdateSender(req)
	if err != nil {
		err = autorest.NewErrorWithError(err, "siterecovery.ReplicationvCentersClient", "Update", result.Response(), "Failure sending request")
		return
	}

	return
}

// UpdatePreparer prepares the Update request.
func (client ReplicationvCentersClient) UpdatePreparer(ctx context.Context, fabricName string, vCenterName string, updateVCenterRequest UpdateVCenterRequest) (*http.Request, error) {
	pathParameters := map[string]interface{}{
		"fabricName":        autorest.Encode("path", fabricName),
		"resourceGroupName": autorest.Encode("path", client.ResourceGroupName),
		"resourceName":      autorest.Encode("path", client.ResourceName),
		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
		"vCenterName":       autorest.Encode("path", vCenterName),
	}

	const APIVersion = "2018-01-10"
	queryParameters := map[string]interface{}{
		"api-version": APIVersion,
	}

	preparer := autorest.CreatePreparer(
		autorest.AsContentType("application/json; charset=utf-8"),
		autorest.AsPatch(),
		autorest.WithBaseURL(client.BaseURI),
		autorest.WithPathParameters("/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{resourceName}/replicationFabrics/{fabricName}/replicationvCenters/{vCenterName}", pathParameters),
		autorest.WithJSON(updateVCenterRequest),
		autorest.WithQueryParameters(queryParameters))
	return preparer.Prepare((&http.Request{}).WithContext(ctx))
}

// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client ReplicationvCentersClient) UpdateSender(req *http.Request) (future ReplicationvCentersUpdateFuture, err error) {
	var resp *http.Response
	resp, err = autorest.SendWithSender(client, req,
		azure.DoRetryWithRegistration(client.Client))
	if err != nil {
		return
	}
	err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
	if err != nil {
		return
	}
	future.Future, err = azure.NewFutureFromResponse(resp)
	return
}

// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client ReplicationvCentersClient) UpdateResponder(resp *http.Response) (result VCenter, err error) {
	err = autorest.Respond(
		resp,
		client.ByInspecting(),
		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
		autorest.ByUnmarshallingJSON(&result),
		autorest.ByClosing())
	result.Response = autorest.Response{Response: resp}
	return
}


text:
package com.amazonaws.services.ec2.model.transform;

import java.util.Map;
import java.util.Map.Entry;

import javax.xml.stream.events.XMLEvent;

import com.amazonaws.services.ec2.model.*;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.MapEntry;
import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;

/**
 * Available Capacity StAX Unmarshaller
 */
public class AvailableCapacityStaxUnmarshaller implements Unmarshaller<AvailableCapacity, StaxUnmarshallerContext> {

    public AvailableCapacity unmarshall(StaxUnmarshallerContext context) throws Exception {
        AvailableCapacity availableCapacity = new AvailableCapacity();
        int originalDepth = context.getCurrentDepth();
        int targetDepth = originalDepth + 1;

        if (context.isStartOfDocument()) targetDepth += 1;

        while (true) {
            XMLEvent xmlEvent = context.nextEvent();
            if (xmlEvent.isEndDocument()) return availableCapacity;

            if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
                if (context.testExpression("availableInstanceCapacity/item", targetDepth)) {
                    availableCapacity.getAvailableInstanceCapacity().add(InstanceCapacityStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }
                if (context.testExpression("availableVCpus", targetDepth)) {
                    availableCapacity.setAvailableVCpus(IntegerStaxUnmarshaller.getInstance().unmarshall(context));
                    continue;
                }
            } else if (xmlEvent.isEndElement()) {
                if (context.getCurrentDepth() < originalDepth) {
                    return availableCapacity;
                }
            }
        }
    }

    private static AvailableCapacityStaxUnmarshaller instance;
    public static AvailableCapacityStaxUnmarshaller getInstance() {
        if (instance == null) instance = new AvailableCapacityStaxUnmarshaller();
        return instance;
    }
}


text:
package org.camunda.bpm.unittest;

import java.util.logging.Logger;

import org.camunda.bpm.engine.history.HistoricProcessInstance;
import org.camunda.bpm.engine.impl.interceptor.CommandContext;
import org.camunda.bpm.engine.impl.jobexecutor.AsyncContinuationJobHandler;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;

public class AuthenticatedAsyncContinuationJobHandler extends AsyncContinuationJobHandler {

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

  @Override
  public void execute(String configuration, ExecutionEntity execution, CommandContext commandContext) {
    HistoricProcessInstance historicProcessInstance = execution
        .getProcessEngineServices()
        .getHistoryService()
        .createHistoricProcessInstanceQuery()
        .processInstanceId(execution.getProcessInstanceId())
        .singleResult();
    String startUserId = historicProcessInstance.getStartUserId();
    if (startUserId != null) {
      execution.getProcessEngineServices().getIdentityService().setAuthenticatedUserId(startUserId);
      log.info("Continue with authenticatedUserId: " + startUserId);
    } else {
      log.info("No startUserId, no authentication");
    }
    super.execute(configuration, execution, commandContext);
  }

}


text:
'use strict';

var call   = Function.prototype.call
  , assign = require('es5-ext/object/assign');

module.exports = assign(require('./deferred'), {
	invokeAsync:   require('./invoke-async'),
	isPromise:     require('./is-promise'),
	dynamicQueue:  require('./dynamic-queue'),
	validPromise:  require('./valid-promise'),
	callAsync:     call.bind(require('./ext/function/call-async')),
	delay:         call.bind(require('./ext/function/delay')),
	gate:          call.bind(require('./ext/function/gate')),
	monitor:       require('./monitor'),
	promisify:     call.bind(require('./ext/function/promisify')),
	promisifySync: call.bind(require('./ext/function/promisify-sync')),
	every:         call.bind(require('./ext/array/every')),
	find:          call.bind(require('./ext/array/find')),
	map:           call.bind(require('./ext/array/map')),
	reduce:        call.bind(require('./ext/array/reduce')),
	some:          call.bind(require('./ext/array/some'))
}, require('./profiler'));

require('./ext/promise/aside');
require('./ext/promise/catch');
require('./ext/promise/cb');
require('./ext/promise/finally');
require('./ext/promise/get');
require('./ext/promise/invoke');
require('./ext/promise/invoke-async');
require('./ext/promise/map');
require('./ext/promise/spread');
require('./ext/promise/some');
require('./ext/promise/reduce');