text:
<?php

namespace ONGR\CookiesBundle\Tests\Functional\Cookie\Model;

use ONGR\CookiesBundle\Cookie\Model\GenericCookie;

/**
 * Class GenericCookieTest.
 */
class GenericCookieTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test general instantiation of GenericCookie.
     */
    public function testCookieCreation()
    {
        $cookie = new GenericCookie('testCookie');

        $this->assertEquals('testCookie', $cookie->getName());
    }

    /**
     * Test loaded value into GenericCookie.
     */
    public function testLoadValue()
    {
        $cookie = new GenericCookie('test');
        $cookie->load('someValue');

        $this->assertEquals('someValue', $cookie->getValue(), 'Wrong value loaded');
        $this->assertTrue($cookie->isLoaded(), 'cookie should be loaded');
    }

    /**
     * Test if second call to GenericCookie::load() doesn't change the cookie.
     */
    public function testDoubleRawValue()
    {
        $cookie = new GenericCookie('test');
        $cookie->load('someValue');
        $cookie->load('anotherValue');

        $this->assertEquals('someValue', $cookie->getValue());
        $this->assertEquals('someValue', $cookie->getRawValue());
    }

    /**
     * Test if GenericCookie::toCookie() works as expected.
     */
    public function testToCookie()
    {
        $cookie = new GenericCookie('test');
        $cookie->load('someValue');

        $cookie = $cookie->toCookie();

        $this->assertInstanceOf('\Symfony\Component\HttpFoundation\Cookie', $cookie);
        $this->assertEquals('someValue', $cookie->getValue());
    }

    /**
     * Test if GenericCookie::setValue() overrides GenericCookie::$rawValue.
     */
    public function testToCookieWithSetValue()
    {
        $cookie = new GenericCookie('test');
        $cookie->load('someValue');
        $cookie->setValue('anotherValue');

        $cookie = $cookie->toCookie();

        $this->assertEquals('anotherValue', $cookie->getValue());
    }

    /**
     * Test getValue throws exception, if cookie value has not been loaded.
     */
    public function testGetValueBeforeInjection()
    {
        $this->setExpectedException('\ONGR\CookiesBundle\Exception\CookieNotLoadedException');

        $cookie = new GenericCookie('test');
        $cookie->getValue();
    }

    /**
     * Test setValue throws exception, if cookie value has not been loaded.
     */
    public function testSetValueBeforeInjection()
    {
        $this->setExpectedException('\ONGR\CookiesBundle\Exception\CookieNotLoadedException');

        $cookie = new GenericCookie('test');
        $cookie->setValue('someValue');
    }

    /**
     * Test if getValue returns null, if value is null (should not throw exception).
     */
    public function testNullValue()
    {
        $cookie = new GenericCookie('test');
        $cookie->load(null);
        $this->assertNull($cookie->getValue());
    }

    /**
     * Test cookie returns not dirty status, when not modified.
     */
    public function testNotDirtyWhenLoaded()
    {
        $cookie = new GenericCookie('test');
        $cookie->load('someValue');
        $this->assertFalse($cookie->isDirty());
    }

    /**
     * Test cookie returns dirty status, when modified.
     */
    public function testDirtyWhenModified()
    {
        $cookie = new GenericCookie('test');
        $cookie->load('someValue');
        $cookie->setValue('anotherValue');
        $this->assertTrue($cookie->isDirty());
    }

    /**
     * Test cookie returns not dirty status, when not modified.
     */
    public function testNotDirtyWhenModifiedWithSameValue()
    {
        $cookie = new GenericCookie('test');
        $cookie->load('someValue');
        $cookie->setValue('someValue');
        $this->assertFalse($cookie->isDirty());
    }

    /**
     * Test can set clear flag.
     */
    public function testClear()
    {
        $cookie = new GenericCookie('test');
        $cookie->load('someValue');
        $cookie->setClear(true);
        $this->assertTrue($cookie->getClear());
    }

    /**
     * Test can set 'expires_interval' value and it overrides 'expires_time' value.
     */
    public function testInterval()
    {
        $cookie = new GenericCookie('test');
        $cookie->setDefaults(['expires_time' => 1000000000, 'expires_interval' => 'P5D']);
        $cookie->load('someValue');
        $this->assertGreaterThan(time() + 5 * 24 * 3600 - 5, $cookie->getExpiresTime());
        $this->assertLessThan(time() + 5 * 24 * 3600 + 5, $cookie->getExpiresTime());
    }

    /**
     * Test defaults setter and getter.
     */
    public function testDefaultsSetter()
    {
        $defaults = ['expires_time' => 1000000000, 'expires_interval' => 'P5D'];

        $cookie = new GenericCookie('test');
        $this->assertEquals([], $cookie->getDefaults());

        $cookie->setDefaults($defaults);
        $this->assertEquals($defaults, $cookie->getDefaults());
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>MagickCore: _PrimaryInfo Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

MagickCore
    7.0.0

Data Fields

_PrimaryInfo Struct Reference

#include <image.h>

Data Fields

double 	x

double 	y

double 	z

Detailed Description

Definition at line 94 of file image.h.

Field Documentation

          double _PrimaryInfo::x

Definition at line 97 of file image.h.

Referenced by AcquireImage(), IdentifyImage(), SetImageColorspace(), SetImageProperty(), ShadeImage(), sRGBTransformImage(), and SyncImageSettings().

          double _PrimaryInfo::y

Definition at line 97 of file image.h.

Referenced by AcquireImage(), IdentifyImage(), SetImageColorspace(), SetImageProperty(), ShadeImage(), sRGBTransformImage(), and SyncImageSettings().

          double _PrimaryInfo::z

Definition at line 97 of file image.h.

Referenced by AcquireImage(), SetImageColorspace(), SetImageProperty(), ShadeImage(), and sRGBTransformImage().

The documentation for this struct was generated from the following file:

image.h

_PrimaryInfo

Generated by

     1.8.3.1

redpajama_set_name: RedPajamaGithub


text:
package com.wangyin.ak47.pipes.dubbo;

import com.wangyin.ak47.pipes.dubbo.DubboHeader;

/**
 *
 * @author wyhubingyin
 */
public class DubboHessianResponse {
	private DubboHeader dubboHeader;
	private Object result;

	public DubboHessianResponse() {
	    dubboHeader = new DubboHeader();
	}

	public DubboHeader getDubboHeader() {
		return dubboHeader;
	}

	public void setDubboHeader(DubboHeader dubboHeader) {
		this.dubboHeader = dubboHeader;
	}

	public Object getResult() {
		return result;
	}

	public void setResult(Object result) {
		this.result = result;
	}

}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cinematicserver;

/**
 *
 * @author Oz
 */
public class TCPServer {
    private String ClientMessage;

}


text:
local EconPanel = {}

EconPanel.optionEnable = Menu.AddOption({ "Awareness", "Econ Panel" }, "Enable Econ Panel", "show hero ranking of total item price")
EconPanel.key = Menu.AddKeyOption({ "Awareness", "Econ Panel" }, "Turn On/Off Key", Enum.ButtonCode.KEY_L)
EconPanel.font = Renderer.LoadFont("Tahoma", 16, Enum.FontWeight.EXTRABOLD)
EconPanel.isOpen = true
EconPanel.heroIconPath = "resource/flash3/images/heroes/"
handlers = {}

EconPanel.item2price = {}
EconPanel.item2price["item_aegis"] = 0 --"Aegis of the Immortal"
EconPanel.item2price["item_courier"] = 100 -- "Animal Courier"
EconPanel.item2price["item_boots_of_elves"] = 450 -- "Band of Elvenskin"
EconPanel.item2price["item_belt_of_strength"] = 450 -- "Belt of Strength"
EconPanel.item2price["item_blade_of_alacrity"] = 1000 -- "Blade of Alacrity"
EconPanel.item2price["item_blades_of_attack"] = 420 -- "Blades of Attack"
EconPanel.item2price["item_blight_stone"] = 300 -- "Blight Stone"
EconPanel.item2price["item_blink"] = 2250 -- "Blink Dagger"
EconPanel.item2price["item_boots"] = 400 -- "Boots of Speed"
EconPanel.item2price["item_bottle"] = 660 -- "Bottle"
EconPanel.item2price["item_broadsword"] = 1200 -- "Broadsword"
EconPanel.item2price["item_chainmail"] = 550 -- "Chainmail"
EconPanel.item2price["item_cheese"] = 0 -- "Cheese"
EconPanel.item2price["item_circlet"] = 165 -- "Circlet"
EconPanel.item2price["item_clarity"] = 50 -- "Clarity"
EconPanel.item2price["item_claymore"] = 1400 -- "Claymore"
EconPanel.item2price["item_cloak"] = 550 -- "Cloak"
EconPanel.item2price["item_demon_edge"] = 2400 -- "Demon Edge"
EconPanel.item2price["item_dust"] = 180 -- "Dust of Appearance"
EconPanel.item2price["item_eagle"] = 3200 -- "Eaglesong"
EconPanel.item2price["item_enchanted_mango"] = 110 -- "Enchanted Mango"
EconPanel.item2price["item_energy_booster"] = 900 -- "Energy Booster"
EconPanel.item2price["item_faerie_fire"] = 75 -- "Faerie Fire"
EconPanel.item2price["item_flying_courier"] = 250 -- "Flying Courier"
EconPanel.item2price["item_gauntlets"] = 150 -- "Gauntlets of Strength"
EconPanel.item2price["item_gem"] = 900 -- "Gem of True Sight"
EconPanel.item2price["item_ghost"] = 1500 -- "Ghost Scepter"
EconPanel.item2price["item_gloves"] = 500 -- "Gloves of Haste"
EconPanel.item2price["item_flask"] = 110 -- "Healing Salve"
EconPanel.item2price["item_helm_of_iron_will"] = 900 -- "Helm of Iron Will"
EconPanel.item2price["item_hyperstone"] = 2000 -- "Hyperstone"
EconPanel.item2price["item_infused_raindrop"] = 225 -- "Infused Raindrop"
EconPanel.item2price["item_branches"] = 50 -- "Iron Branch"
EconPanel.item2price["item_javelin"] = 1500 -- "Javelin"
EconPanel.item2price["item_magic_stick"] = 200 -- "Magic Stick"
EconPanel.item2price["item_mantle"] = 150 -- "Mantle of Intelligence"
EconPanel.item2price["item_mithril_hammer"] = 1600 -- "Mithril Hammer"
EconPanel.item2price["item_lifesteal"] = 1200 -- "Morbid Mask"
EconPanel.item2price["item_mystic_staff"] = 2700 -- "Mystic Staff"
EconPanel.item2price["item_ward_observer"] = 65 -- "Observer Ward"
EconPanel.item2price["item_ogre_axe"] = 1000 -- "Ogre Club"
EconPanel.item2price["item_orb_of_venom"] = 275 -- "Orb of Venom"
EconPanel.item2price["item_platemail"] = 1400 -- "Platemail"
EconPanel.item2price["item_point_booster"] = 1200 -- "Point Booster"
EconPanel.item2price["item_quarterstaff"] = 875 -- "Quarterstaff"
EconPanel.item2price["item_quelling_blade"] = 200 -- "Quelling Blade"
EconPanel.item2price["item_reaver"] = 3000 -- "Reaver"
EconPanel.item2price["item_ring_of_health"] = 850 -- "Ring of Health"
EconPanel.item2price["item_ring_of_protection"] = 175 -- "Ring of Protection"
EconPanel.item2price["item_ring_of_regen"] = 325 -- "Ring of Regen"
EconPanel.item2price["item_robe"] = 450 -- "Robe of the Magi"
EconPanel.item2price["item_relic"] = 3800 -- "Sacred Relic"
EconPanel.item2price["item_sobi_mask"] = 325 -- "Sage's Mask"
EconPanel.item2price["item_ward_sentry"] = 100 -- "Sentry Ward"
EconPanel.item2price["item_shadow_amulet"] = 1300 -- "Shadow Amulet"
EconPanel.item2price["item_slippers"] = 150 -- "Slippers of Agility"
EconPanel.item2price["item_smoke_of_deceit"] = 50 -- "Smoke of Deceit"
EconPanel.item2price["item_staff_of_wizardry"] = 1000 -- "Staff of Wizardry"
EconPanel.item2price["item_stout_shield"] = 200 -- "Stout Shield"
EconPanel.item2price["item_talisman_of_evasion"] = 1450 -- "Talisman of Evasion"
EconPanel.item2price["item_tango"] = 125 -- "Tango"
EconPanel.item2price["item_tango_single"] = 0 -- "Tango (Shared)"
EconPanel.item2price["item_tome_of_knowledge"] = 150 -- "Tome of Knowledge"
EconPanel.item2price["item_tpscroll"] = 50 -- "Town Portal Scroll"
EconPanel.item2price["item_ultimate_orb"] = 2100 -- "Ultimate Orb"
EconPanel.item2price["item_vitality_booster"] = 1100 -- "Vitality Booster"
EconPanel.item2price["item_void_stone"] = 850 -- "Void Stone"
EconPanel.item2price["item_wind_lace"] = 250 -- "Wind Lace"
EconPanel.item2price["item_abyssal_blade"] = 6400 -- "Abyssal Blade"
EconPanel.item2price["item_aether_lens"] = 2350 -- "Aether Lens"
EconPanel.item2price["item_ultimate_scepter"] = 4200 -- "Aghanim's Scepter"
EconPanel.item2price["item_arcane_boots"] = 1300 -- "Arcane Boots"
EconPanel.item2price["item_armlet"] = 2370 -- "Armlet of Mordiggian"
EconPanel.item2price["item_assault"] = 5250 -- "Assault Cuirass"
EconPanel.item2price["item_bfury"] = 4500 -- "Battle Fury"
EconPanel.item2price["item_black_king_bar"] = 3975 -- "Black King Bar"
EconPanel.item2price["item_blade_mail"] = 2200 -- "Blade Mail"
EconPanel.item2price["item_bloodstone"] = 4900 -- "Bloodstone"
EconPanel.item2price["item_bloodthorn"] = 7195 -- "Bloodthorn"
EconPanel.item2price["item_travel_boots"] = 2400 -- "Boots of Trave 1"
EconPanel.item2price["item_travel_boots_2"] = 4400 -- "Boots of Trave 2"
EconPanel.item2price["item_bracer"] = 505 -- "Bracer"
EconPanel.item2price["item_buckler"] = 800 -- "Buckler"
EconPanel.item2price["item_butterfly"] = 5525 -- "Butterfly"
EconPanel.item2price["item_crimson_guard"] = 3550 -- "Crimson Guard"
EconPanel.item2price["item_lesser_crit"] = 2120 -- "Crystalys"
EconPanel.item2price["item_greater_crit"] = 5520 -- "Daedalus"
EconPanel.item2price["item_dagon"] = 2720 -- "Dagon 1"
EconPanel.item2price["item_dagon_2"] = 3972 -- "Dagon 2"
EconPanel.item2price["item_dagon_3"] = 5220 -- "Dagon 3"
EconPanel.item2price["item_dagon_4"] = 6470 -- "Dagon 4"
EconPanel.item2price["item_dagon_5"] = 7720 -- "Dagon 5"
EconPanel.item2price["item_desolator"] = 3500 -- "Desolator"
EconPanel.item2price["item_diffusal_blade"] = 3150 -- "Diffusal Blade 1"
EconPanel.item2price["item_diffusal_blade_2"] = 3850 -- "Diffusal Blade 2"
EconPanel.item2price["item_dragon_lance"] = 1900 -- "Dragon Lance"
EconPanel.item2price["item_ancient_janggo"] = 1780 -- "Drum of Endurance"
EconPanel.item2price["item_echo_sabre"] = 2650 -- "Echo Sabre"
EconPanel.item2price["item_ethereal_blade"] = 4700 -- "Ethereal Blade"
EconPanel.item2price["item_cyclone"] = 2750 -- "Eul's Scepter of Divinity"
EconPanel.item2price["item_skadi"] = 5675 -- "Eye of Skadi"
EconPanel.item2price["item_force_staff"] = 2225 -- "Force Staff"
EconPanel.item2price["item_glimmer_cape"] = 1850 -- "Glimmer Cape"
EconPanel.item2price["item_guardian_greaves"] = 5275 -- "Guardian Greaves"
EconPanel.item2price["item_hand_of_midas"] = 2050 -- "Hand of Midas"
EconPanel.item2price["item_headdress"] = 575 -- "Headdress"
EconPanel.item2price["item_heart"] = 5500 -- "Heart of Tarrasque"
EconPanel.item2price["item_heavens_halberd"] = 3500 -- "Heaven's Halberd"
EconPanel.item2price["item_helm_of_the_dominator"] = 1800 -- "Helm of the Dominator"
EconPanel.item2price["item_hood_of_defiance"] = 1725 -- "Hood of Defiance"
EconPanel.item2price["item_hurricane_pike"] = 4375 -- "Hurricane Pike"
EconPanel.item2price["item_iron_talon"] = 500 -- "Iron Talon"
EconPanel.item2price["item_sphere"] = 4800 -- "Linken's Sphere"
EconPanel.item2price["item_lotus_orb"] = 4000 -- "Lotus Orb"
EconPanel.item2price["item_maelstrom"] = 2800 -- "Maelstrom"
EconPanel.item2price["item_magic_wand"] = 465 -- "Magic Wand"
EconPanel.item2price["item_manta"] = 4950 -- "Manta Style"
EconPanel.item2price["item_mask_of_madness"] = 1900 -- "Mask of Madness"
EconPanel.item2price["item_medallion_of_courage"] = 1175 -- "Medallion of Courage"
EconPanel.item2price["item_mekansm"] = 2275 -- "Mekansm"
EconPanel.item2price["item_mjollnir"] = 5700 -- "Mjollnir"
EconPanel.item2price["item_monkey_king_bar"] = 5400 -- "Monkey King Bar"
EconPanel.item2price["item_moon_shard"] = 4000 -- "Moon Shard"
EconPanel.item2price["item_necronomicon"] = 2650 -- "Necronomicon 1"
EconPanel.item2price["item_necronomicon_2"] = 3850 -- "Necronomicon 2"
EconPanel.item2price["item_necronomicon_3"] = 5050 -- "Necronomicon 3"
EconPanel.item2price["item_null_talisman"] = 470 -- "Null Talisman"
EconPanel.item2price["item_oblivion_staff"] = 1650 -- "Oblivion Staff"
EconPanel.item2price["item_ward_dispenser"] = 165 -- "Observer and Sentry Wards"
EconPanel.item2price["item_octarine_core"] = 5900 -- "Octarine Core"
EconPanel.item2price["item_orchid"] = 4075 -- "Orchid Malevolence"
EconPanel.item2price["item_pers"] = 1700 -- "Perseverance"
EconPanel.item2price["item_phase_boots"] = 1240 -- "Phase Boots"
EconPanel.item2price["item_pipe"] = 3100 -- "Pipe of Insight"
EconPanel.item2price["item_poor_mans_shield"] = 500 -- "Poor Man's Shield"
EconPanel.item2price["item_power_treads"] = 1350 -- "Power Treads"
EconPanel.item2price["item_radiance"] = 5150 -- "Radiance"
EconPanel.item2price["item_rapier"] = 6200 -- "Divine Rapier"
EconPanel.item2price["item_refresher"] = 5200 -- "Refresher Orb"
EconPanel.item2price["item_ring_of_aquila"] = 985 -- "Ring of Aquila"
EconPanel.item2price["item_ring_of_basilius"] = 500 -- "Ring of Basilius"
EconPanel.item2price["item_rod_of_atos"] = 3100 -- "Rod of Atos"
EconPanel.item2price["item_sange"] = 2050 -- "Sange"
EconPanel.item2price["item_sange_and_yasha"] = 4100 -- "Sange and Yasha"
EconPanel.item2price["item_satanic"] = 5800 -- "Satanic"
EconPanel.item2price["item_sheepstick"] = 5650 -- "Scythe of Vyse"
EconPanel.item2price["item_invis_sword"] = 2700 -- "Shadow Blade"
EconPanel.item2price["item_shivas_guard"] = 4700 -- "Shiva's Guard"
EconPanel.item2price["item_silver_edge"] = 5100 -- "Silver Edge"
EconPanel.item2price["item_basher"] = 2700 -- "Skull Basher"
EconPanel.item2price["item_solar_crest"] = 2625 -- "Solar Crest"
EconPanel.item2price["item_soul_booster"] = 3200 -- "Soul Booster"
EconPanel.item2price["item_soul_ring"] = 800 -- "Soul Ring"
EconPanel.item2price["item_tranquil_boots"] = 900 -- "Tranquil Boots"
EconPanel.item2price["item_urn_of_shadows"] = 875 -- "Urn of Shadows"
EconPanel.item2price["item_vanguard"] = 2150 -- "Vanguard"
EconPanel.item2price["item_veil_of_discord"] = 2240 -- "Veil of Discord"
EconPanel.item2price["item_vladmir"] = 2275 -- "Vladmir's Offering"
EconPanel.item2price["item_wraith_band"] = 485 -- "Wraith Band"
EconPanel.item2price["item_yasha"] = 2050 -- "Yasha"

function EconPanel.OnUpdate()
	if Menu.IsEnabled(EconPanel.optionEnable) and Menu.IsKeyDownOnce(EconPanel.key) then
		EconPanel.isOpen = not EconPanel.isOpen
	end
end

local econTable = {} -- econTable = { {heroName_1, econValue_1}, {heroName_2, econValue_2}, ...}
local isSameTeamTable = {} -- isSameTeamTable[heroName] = True/False

function EconPanel.OnDraw()
	if not Menu.IsEnabled(EconPanel.optionEnable) or not EconPanel.isOpen then return end

	local myHero = Heroes.GetLocal()
	if not myHero then return end

	for i = 1, Heroes.Count() do
		local hero = Heroes.Get(i)
		if not NPC.IsIllusion(hero) then
			-- local heroName = EconPanel.heroes[NPC.GetUnitName(hero)]
			local heroName = NPC.GetUnitName(hero)
			isSameTeamTable[heroName] = Entity.IsSameTeam(myHero, hero)
			econTable[i] = {heroName, EconPanel.GetEcon(hero)}
		end
	end

	-- sort econTable by econValue in descending order
	table.sort(econTable, function(a, b) return a[2] > b[2] end)

	-- draw parameters
	local drawX = 10
	local drawY = 100
	local lineGap = 20
	local wordGap = 10
	local maxWidth = 200
	local maxGold = 1
	local rectHeight = lineGap - 1
	local heroIconWidth = math.floor(rectHeight * 128 / 72) -- original image is 128 * 72 (pixels)

	local myTeamEcon = 0
	local enemyTeamEcon = 0

	for i, v in ipairs(econTable) do
		local heroName = v[1]
		local econValue = v[2]
		maxGold = econValue >= maxGold and econValue or maxGold

		if isSameTeamTable[heroName] then
			Renderer.SetDrawColor(0, 255, 0, 125)
			myTeamEcon = myTeamEcon + econValue
		else
			Renderer.SetDrawColor(255, 0, 0, 125)
			enemyTeamEcon = enemyTeamEcon + econValue
		end

		drawY = drawY + lineGap
		-- draw bar
		local rectWidth = math.floor(maxWidth * econValue / maxGold)
		Renderer.DrawFilledRect(drawX, drawY, rectWidth, rectHeight)

		-- draw text
		local drawText = econValue -- .." - "..heroName
		Renderer.SetDrawColor(255, 255, 255, 255)
		Renderer.DrawText(EconPanel.font, drawX+heroIconWidth+wordGap, drawY, drawText, 1)

		-- draw hero icon
		local tmpHeroName = string.gsub(heroName, "npc_dota_hero_", "")
		local imageHandle
		if handlers[tmpHeroName] then -- need to cache image handlers, instead of calling LoadImage() evrytime
			imageHandle = handlers[tmpHeroName]
		else
			imageHandle = Renderer.LoadImage(EconPanel.heroIconPath .. tmpHeroName .. ".png")
			handlers[tmpHeroName] = imageHandle
		end
		Renderer.SetDrawColor(255, 255, 255, 255)
		Renderer.DrawImage(imageHandle, drawX, drawY, heroIconWidth, rectHeight)

	end

	local econDiff = myTeamEcon - enemyTeamEcon
	if econDiff > 0 then
		Renderer.SetDrawColor(0, 255, 0, 255)
	else
		Renderer.SetDrawColor(255, 0, 0, 255)
	end
	drawY = drawY - #econTable * lineGap
	Renderer.DrawText(EconPanel.font, drawX+wordGap, drawY, "Economic Difference: "..econDiff, 1)

	-- reallocate
	econTable = {}
end

-- doesnt include gold of recipes
function EconPanel.GetEcon(hero)
	local totalEcon = 0
	local slotNum = 9
	for i = 0, slotNum-1 do
		myItem = NPC.GetItemByIndex(hero, i) -- index starts from 0
		if myItem then
			itemName = Ability.GetName(myItem)
			if EconPanel.item2price[itemName] then -- database doesnt include all itemName, such as recipes.
				totalEcon = totalEcon + EconPanel.item2price[itemName]
			end
		end
	end

	return totalEcon
end

return EconPanel


text:
/**
 * FOUNDATION 5 LONG CLICK BUTTONS
 *
 * @author Robin "Lynesth" GOMES
 * @mail lyn@tweefox.nc
 *
 * ** THIS PLUGIN IS IN DEVELOPMENT -- EARLY STAGE ** *
 */

(function($) {

	function clazz(SuperClass, methods) {
        var constructor = function () {};
        constructor.prototype = new SuperClass;
        constructor.prototype.constructor = constructor;
        constructor.prototype.parent = SuperClass.prototype;
        constructor.prototype = $.extend(constructor.prototype, methods);
        return constructor;
    }

	F5LCB = clazz(Object, {

		// Will make a css and all
		progBarStyle: {
			top: "position: absolute; height: 0.625rem; top: 0; left: 0; width: 100%",
			bottom: "position: absolute; height: 0.625rem; bottom: 0; left: 0; width: 100%; margin: 0",
			inner: "position: absolute; height: 0.625rem; top: 0; left: 0; height: 100%; width: 100%; opacity: 0.3"
		},

		init: function(options) {

			var self = this;

			self.element = options.element;
			self.complete = false;

			// allowed positions : "top", "bottom", "inner"
			self.position = options.position || "top";
			self.timer = options.timer || 1000;

			self.progBarClass = self.pBC = options.progBarClass || "prog-bar";
			// propagate button classes to progress bar
			var foundationClasses = ['secondary', 'alert', 'success', 'radius', 'round'];
			for (var k = 0; k < foundationClasses.length; ++k) {
				if (self.element.hasClass(foundationClasses[k])) {
					self.pBC += " "+foundationClasses[k];
				}
			}

			self.tooltipShowing = false;
			if (typeof options.tooltip == 'undefined') {
				self.tooltip = {
					'show': true,
					'ttl': 2000,
					'text': "This button needs to be kept pressed in order to work !"
				}
			} else {
				self.tooltip = {
					'show': typeof options.tooltip.show == 'boolean' ? options.tooltip.show : true,
					'ttl': options.tooltip.ttl || 2000,
					'text': options.tooltip.text || "This button needs to be kept pressed in order to work !"
				}
			}

			self.callback = options.callback || null;
			self.resetOnMouseUp = options.resetOnMouseUp === false ? false : true;

			if (self.position != "inner") {
				var rem = parseInt($('html').css('font-size'));
				var diff = self.position == "top" ? 0.25 : -0.25;
				var padTop = parseInt(self.element.css('padding-top')) / rem + diff;
				var padBottom = parseInt(self.element.css('padding-bottom')) / rem - diff;
				self.element.css('padding-top', padTop.toString()+"rem")
							.css('padding-bottom', padBottom.toString()+"rem")
							.css('vertical-align', 'bottom');
			}
			self.element.css('overflow', 'hidden');

			self.element.append('

');
			self.progBar = self.element.children("div."+self.progBarClass).children('.meter');

			self.element.on('mousedown touchstart', function() {
				if (!self.complete) {
					var timer = self.resetOnMouseUp ? self.timer : ((100 - parseInt(self.progBar[0].style.width)) * self.timer) / 100;
					self.progBar.stop();
					self.progBar.animate({ width: "100%" }, timer, function() {
						self.complete = true;
						if (typeof self.callback === 'function') {
							self.callback(self.element, self.progBar);
						} else {
							self.element[0].click();
						}
						$(document).trigger('mouseup');
					});
					return false; // Prevent draging and failed mouseup
				}
			}).on('click touchleave', function(e) {
				if (self.tooltip.show && (parseInt(self.progBar[0].style.width) * self.timer) / 100 < 100) {
					e.preventDefault();
					return self.getTooltip(self.element);
				}
				if (!self.complete || self.callback != null) {
					return false;
				}
			});

			$(document).on('mouseup touchend touchcancel', function() {
				self.progBar.stop();
				if (self.progBar[0].style.width != "100%") {
					if (self.resetOnMouseUp == false) {
						var timer = (parseInt(self.progBar[0].style.width) * self.timer) / 100;
						self.progBar.animate({ width: "0%" }, timer);
					} else {
						self.progBar.css('width', "0%");
					}
				}
			});

			self.getTooltip = function(element) {
				if (!self.tooltipShowing) {
					var offset = self.element.offset();
					self.tooltipShowing = true;
					self.tooltip.element = $('
', { class: "tooltip", text: self.tooltip.text });
					self.tooltip.element.css({
						'top': offset.top + self.element.outerHeight() + 10,
						'left': offset.left + 10,
						'display': 'block',
						'width': 'auto',
						'max-width': self.element.outerWidth() > 200 ? self.element.outerWidth() : "200px"
					}).append('');
					$("body").append(self.tooltip.element)
					setTimeout(function() {
						self.tooltip.element.remove();
						self.tooltipShowing = false;
					}, self.tooltip.ttl);
				}
				return false;
			}

		}

	});

	$.fn.f5lcb = function(options) {
		var options = options || {};
		this.each(function() {
			options.element = $(this);
			f5lcb = new F5LCB();
			f5lcb.init(options);
		});
	};

})( jQuery );


text:
package org.baswell.routes;

import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.List;

class RouteNode implements Comparable<RouteNode>
{
  final int index;

  final Method method;

  final RouteConfiguration routeConfiguration;

  final RouteInstance instance;

  final Criteria criteria;

  final List<MethodParameter> parameters;

  final ResponseType responseType;

  final ContentConversionType contentConversionType;

  final List<BeforeRouteNode> beforeRouteNodes;

  final List<AfterRouteNode> afterRouteNodes;

  RouteNode(int index, Method method, RouteConfiguration routeConfiguration, RouteInstance instance, Criteria criteria, List<MethodParameter> parameters, ResponseType responseType, ContentConversionType contentConversionType, List<BeforeRouteNode> beforeRouteNodes, final List<AfterRouteNode> afterRouteNodes)
  {
    this.index = index;
    this.method = method;
    this.routeConfiguration = routeConfiguration;
    this.instance = instance;
    this.criteria = criteria;
    this.parameters = parameters;
    this.responseType = responseType;
    this.contentConversionType = contentConversionType;
    this.beforeRouteNodes = beforeRouteNodes;
    this.afterRouteNodes = afterRouteNodes;
  }

  Type getRequestContentType()
  {
    for (MethodParameter parameter : parameters)
    {
      if (parameter.type == MethodRouteParameterType.REQUEST_CONTENT)
      {
        return parameter.requestContentType;
      }
    }

    for (BeforeRouteNode beforeRouteNode : beforeRouteNodes)
    {
      for (MethodParameter parameter : beforeRouteNode.parameters)
      {
        if (parameter.type == MethodRouteParameterType.REQUEST_CONTENT)
        {
          return parameter.requestContentType;
        }
      }
    }

    for (AfterRouteNode afterRouteNode : afterRouteNodes)
    {
      for (MethodParameter parameter : afterRouteNode.parameters)
      {
        if (parameter.type == MethodRouteParameterType.REQUEST_CONTENT)
        {
          return parameter.requestContentType;
        }
      }
    }

    return null;
  }

  @Override
  public int compareTo(RouteNode routeNode)
  {
    int criteriaCompare = criteria.compareTo(routeNode.criteria);
    if (criteriaCompare == 0)
    {
      return index - routeNode.index;
    }
    else
    {
      return criteriaCompare;
    }
  }
}


text:
module Azure::Storage::Mgmt::V2018_03_01_preview
  module Models
    #
    # The Storage Account ManagementPolicies Rules, in JSON format. See more
    # details in:
    # https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
    #
    class ManagementPoliciesRulesSetParameter

      include MsRestAzure

      # @return The Storage Account ManagementPolicies Rules, in JSON format.
      # See more details in:
      # https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.
      attr_accessor :policy

      #
      # Mapper for ManagementPoliciesRulesSetParameter class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ManagementPoliciesRulesSetParameter',
          type: {
            name: 'Composite',
            class_name: 'ManagementPoliciesRulesSetParameter',
            model_properties: {
              policy: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.policy',
                type: {
                  name: 'Object'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
<?php
/**
 * Created by PhpStorm.
 * User: Samuel
 * Date: 17-02-08
 * Time: 7:24 PM
 */

namespace AppBundle\Manager;

use AppBundle\Entity\Bible;
use AppBundle\Entity\Book;
use AppBundle\Entity\Chapter;
use AppBundle\Entity\Verse;
use Doctrine\ORM\EntityManager;
use Symfony\Component\HttpKernel\Kernel;

class BookManager extends BaseManager
{
    public function __construct(EntityManager $em, Kernel $kernel, $className)
    {
        parent::__construct($em, $kernel, $className);
    }
}


text:
package WWW::Wookie::Widget::Category;    # -*- cperl; cperl-indent-level: 4 -*-
use strict;
use warnings;

# $Id: Category.pm 363 2010-11-24 14:52:58Z roland $
# $Revision: 363 $
# $HeadURL: svn+ssh://ipenburg.xs4all.nl/srv/svnroot/barclay/trunk/lib/WWW/Wookie/Widget/Category.pm $
# $Date: 2010-11-24 15:52:58 +0100 (Wed, 24 Nov 2010) $

use utf8;
use 5.006000;

our $VERSION = '0.03';

use Moose qw/around has/;
use MooseX::AttributeHelpers;

has '_name' => (
    is      => 'ro',
    isa     => 'Str',
    reader  => 'getName',
);

has '_widgets' => (
    metaclass => 'Collection::Hash',
    is        => 'rw',
    isa       => 'HashRef[WWW::Wookie::Widget]',
    default   => sub { {} },
);

sub put {
    my ( $self, $widget ) = @_;
    $self->_widgets->{ $widget->getIdentifier } = $widget;
    return;
}

sub get {
    my $self = shift;
    return $self->_widgets;
}

around BUILDARGS => sub {
    my $orig  = shift;
    my $class = shift;

    if ( @_ == 1 && !ref $_[0] ) {
        my ( $name ) = @_;
        return $class->$orig(
            _name    => $name,
        );
    }
    return $class->$orig(@_);
};

no Moose;

## no critic qw(RequireExplicitInclusion)
__PACKAGE__->meta->make_immutable;
## use critic

1;

__END__

=encoding utf8

=for stopwords Roland van Ipenburg plugins login url

=head1 NAME

WWW::Wookie::Widget::Category - client side representation of a widget service
category

=head1 VERSION

This document describes WWW::Wookie::Widget::Category version 0.03

=head1 SYNOPSIS

    use WWW::Wookie::Widget::Category;
    $c = WWW::Wookie::Widget::Category->new($name);
    $c->getName;

=head1 DESCRIPTION

=head1 SUBROUTINES/METHODS

=head2 C<new>

Create a new service type.

=over

=item 1. Service name as string

=back

=head2 C<getName>

Gets the name of the service. Returns the name of the service as string.

=head2 C<get>

Gets the widgets available for this service. Returns an array of
L<WWW::Wookie::Widget|WWW::Wookie::Widget> objects.

=head2 C<put>

Adds a L<WWW::Wookie::Widget|WWW::Wookie::Widget> object to this service.

=head1 CONFIGURATION AND ENVIRONMENT

=head1 DEPENDENCIES

L<Moose|Moose>
L<MooseX::AttributeHelpers|MooseX::AttributeHelpers>

=head1 INCOMPATIBILITIES

=head1 DIAGNOSTICS

=head1 BUGS AND LIMITATIONS

Please report any bugs or feature requests at L<RT for
rt.cpan.org|https://rt.cpan.org/Dist/Display.html?Queue=WWW-Wookie>.

=head1 AUTHOR

Roland van Ipenburg  C<< <ipenburg@xs4all.nl> >>

=head1 LICENSE AND COPYRIGHT

    Copyright 2010 Roland van Ipenburg

    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

=head1 DISCLAIMER OF WARRANTY

    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.

=cut


text:
package org.necros.paging;

import java.util.List;

public class Pager<T> {
	public static final int DEFAULT_PAGE_SIZE = 10;
	public static final int DEFAUTL_LIST_SIZE = 10;
	public static final int MIN_PAGE_SIZE = 2;
	public static final int MIN_LIST_SIZE = 5;

	private int pageNum = 1;
	private int pageSize = DEFAULT_PAGE_SIZE;
	private int pageCount = 0;
	private int listSize = DEFAUTL_LIST_SIZE;
	private int listFirst;
	private int listLast;

	private int recordCount;

	private List<T> result;

	public void calcPages() {
		if (recordCount > 0) {
			pageCount = (recordCount + pageSize - 1) / pageSize;
		}
		int diff = (listSize + 1) / 2;
		listFirst = pageNum - diff;
		if (listFirst < 1) listFirst = 1;
		listLast = listFirst + listSize - 1;
		diff = listLast - pageCount;
		if (diff > 0) {
			listLast = listLast - diff;
			listFirst = listFirst - diff;
			if (listFirst < 1) listFirst = 1;
		}
	}

	public int getListFirst() {
		return listFirst;
	}

	public int getListLast() {
		return listLast;
	}

	public int getQueryFirst() {
		return (pageNum - 1) * pageSize;
	}

	public int getRecordCount() {
		return recordCount;
	}

	public void setRecordCount(int recordCount) {
		this.recordCount = recordCount;
		calcPages();
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount < 0 ? 0 : pageCount;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize < MIN_PAGE_SIZE ? MIN_PAGE_SIZE : pageSize;
	}

	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum(int pageNum) {
		this.pageNum = pageNum < 1 ? 1 : pageNum;
	}

	public int getListSize() {
		return listSize;
	}

	public void setListSize(int listSize) {
		this.listSize = listSize < MIN_LIST_SIZE ? MIN_LIST_SIZE : listSize;
	}

	public void setResult(List<T> result) {
		this.result = result;
	}

	public List<T> getResult() {
		return result;
	}

	@Override
	public String toString() {
		StringBuilder buff = new StringBuilder();
		buff.append("class: ").append(Pager.class).append('\n');
		buff.append("pageNum").append(pageNum).append('\n');
		buff.append("pageSize: ").append(pageSize).append('\n');
		buff.append("pageCount: ").append(pageCount).append('\n');
		buff.append("listSize: ").append(listSize).append('\n');
		buff.append("listFirst: ").append(listFirst).append('\n');
		buff.append("listLast: ").append(listLast).append('\n');
		buff.append("recordCount: ").append(recordCount).append('\n');
		return buff.toString();
	}
}


text:
<?php

namespace Zend\Mvc\I18n;

use Zend\I18n\Translator\TranslatorInterface as I18nTranslatorInterface;

class DummyTranslator implements I18nTranslatorInterface
{
    public function translate($message, $textDomain = 'default', $locale = null)
    {
        return $message;
    }

    public function translatePlural($singular, $plural, $number, $textDomain = 'default', $locale = null)
    {
        return ($number == 1 ? $singular : $plural);
    }
}


text:
+++
Date = "2014-10-06"
Title = "Billy Butler Stole a Base"

+++

<div class="video-container">
<video controls loop>
  <source src="http://drops.albush.com/billystealssecond.mov" type="video/mp4">
  Your browser does not support the video tag.
</video>
</div>

So this happened. Crazy world we live in. Crazy world.

[yaketyfied via YaketyLapse, a silly idea from H. Wade Minter][1].

[1]: //yacketylapse.com/


text:
exports.forward = require('./forward');
exports.respond = require('./respond');


text:
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
    <name>Facility_Type__c</name>
    <help>Wählen Sie die Art der Räumlichkeit aus, z. B. Computerlabor, Gesundheitszentrum, Hörsaal usw.</help>
    <label>Typ der Räumlichkeit</label>
    <picklistValues>
        <masterLabel>Building</masterLabel>
        <translation>Gebäude</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Cafeteria/Food Hall</masterLabel>
        <translation>Cafeteria/Mensa</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Classroom</masterLabel>
        <translation>Unterrichtsraum</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Computer Lab</masterLabel>
        <translation>Computerlabor</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Gymnasium</masterLabel>
        <translation>Sporthalle</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Health Center</masterLabel>
        <translation>Gesundheitszentrum</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Laboratory</masterLabel>
        <translation>Labor</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Lecture Hall</masterLabel>
        <translation>Hörsaal</translation>
    </picklistValues>
    <picklistValues>
        <masterLabel>Library</masterLabel>
        <translation>Bibliothek</translation>
    </picklistValues>
</CustomFieldTranslation>


text:
<?php
declare(strict_types=1);

namespace Lookyman\NetteOAuth2Server\Tests\Mock;

use Lookyman\NetteOAuth2Server\UI\ApproveControl;
use Lookyman\NetteOAuth2Server\UI\ApprovePresenterTrait;
use Nette\Application\UI\Presenter;

class ApprovePresenterMock extends Presenter
{

	use ApprovePresenterTrait;

	public function getApproveComponent(): ApproveControl
	{
		return $this['approve'];
	}

}


text:
{%extends 'base/base.html'%}

{%block title%}{{title_complete|lower}}{%endblock%}
{%block content%}

    {% include 'base/title_header.html' %}

              {{title_complete}}

Campos marcados com * são obrigatórios.

          <form id="addfornecedor_form" role="form" action="" method="post" enctype="multipart/form-data">
            {% csrf_token %}

                {% include 'cadastro/produto/produto_tab_list.html' %}

                    {% include 'cadastro/produto/produto_tab_dados_gerais.html' %}

                    {% include 'cadastro/produto/produto_tab_estoque.html' %}

                    {% include 'cadastro/produto/produto_tab_fiscal.html' %}

              <button class="btn btn-success foot-btn" type="submit"> SALVAR</button>

          </form>

{%endblock%}

{% block js %}

    {% include 'cadastro/produto/produto_jsblock.html' %}

{% endblock %}


text:
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { Response } from '@angular/http';
import { DataService } from './blocks/data/data.service';
import { AuthService } from './services/auth.service';

@Component({
    selector: 'my-app',
    template: `<router-outlet></router-outlet>`
})
export class AppComponent {
    constructor(
        router: Router,
        dataService: DataService,
        authService: AuthService
    ) {
        dataService.setInterceptor(
            (res: Response) => {
                if (res.status === 401) {
                    authService.logout();
                    router.navigate(['/login']);
                    return null;
                }
                return res;
            }
        );
    }
}


text:
using System.Threading.Tasks;
using Xunit;
using static Testify.Assertions;

namespace Testify.Tests
{
    public class TestCollectionTests
    {
        [Fact]
        public void Run_PassingTests_ShouldNotThrow()
        {
            var tests = new TestCollection();
            tests.AddTest("Test1", () => { });
            tests.AddTest("Test2", () => { });

            tests.RunTests("MyTests");
        }

        [Fact]
        public void Run_OneFailingTest_ShouldThrow()
        {
            var tests = new TestCollection();
            tests.AddTest("Test1", () => { });
            tests.AddTest("Test2", () => throw new AssertionException("xyzzy"));

            try
            {
                tests.RunTests("MyTests");
            }
            catch (AssertionException e)
            {
                e.ExpectMessage("MyTests");
                e.ExpectInnerAssertion("Test2 failed.");
                e.ExpectInnerAssertion("xyzzy");
                return;
            }

            Fail("RunTests did not throw.");
        }

        [Fact]
        public void Run_PassingAsyncTests_ShouldNotThrow()
        {
            var tests = new TestCollection();
            tests.AddTest("Test1", async () => await Task.Delay(1).ConfigureAwait(false));
            tests.AddTest("Test2", async () => await Task.Delay(1).ConfigureAwait(false));

            tests.RunTests("MyTests");
        }

        [Fact]
        public void Run_OneFailingAsyncTest_ShouldThrow()
        {
            var tests = new TestCollection();
            tests.AddTest("Test1", async () => await Task.Delay(1).ConfigureAwait(false));
            tests.AddTest("Test2", async () =>
            {
                await Task.Delay(1).ConfigureAwait(false);
                throw new AssertionException("xyzzy");
            });

            try
            {
                tests.RunTests("MyTests");
            }
            catch (AssertionException e)
            {
                e.ExpectMessage("MyTests");
                e.ExpectInnerAssertion("Test2 failed.");
                e.ExpectInnerAssertion("xyzzy");
                return;
            }

            Fail("RunTests did not throw.");
        }
    }
}


text:
<?php

// Namespace

namespace fbenard\Zero\Services\Factories;

/**
 *
 */

class LoggerFactory
extends \fbenard\Zero\Classes\AbstractService
{
	/**
	 *
	 */

	public function buildLogger($channel, $handlers = null)
	{
		// Create a new logger

		$logger = new \Monolog\Logger($channel);

		// Setup processors

		$logger->pushProcessor(new \Monolog\Processor\IntrospectionProcessor());
		$logger->pushProcessor(new \Monolog\Processor\ProcessIdProcessor());
		$logger->pushProcessor(new \Monolog\Processor\WebProcessor());

		// Are we in CLI/verbose mode?

		if (\z\app()->isCli() === true)
		{
			// Define the level

			if (\z\app()->isVerbose() === true)
			{
				$level = \Monolog\Logger::DEBUG;
			}
			else
			{
				$level = \Monolog\Logger::INFO;
			}

			// Redirect to standard output

			$handler = new \Monolog\Handler\StreamHandler
			(
				'php://stdout',
				$level
			);

			// Format for CLI

			$handler->setFormatter(new \fbenard\Zero\Services\Formatters\CliLogFormatter());
		}
		else
		{
			// Redirect to /dev/null

			$handler = new \Monolog\Handler\NullHandler();
		}

		// Push the handler

		$logger->pushHandler($handler);

		// Parse each handler

		if (is_array($handlers) === true)
		{
			foreach ($handlers as $handler)
			{
				// Push the handler

				$logger->pushHandler($handler);
			}
		}

		return $logger;
	}
}

?>


text:
.. _thanks:

======
Thanks
======

- Facebook and Ben Darnell -- for Tornado and some help, for pre-2.0.0 that used
  Tornado.
- Daniele Varrazzo -- for setproctitle, which was used pre-2.0.0
- The PyPy devs -- for PyPy and some help
- Richard Noble -- for giving me the idea
- David Winterbottom -- ideas/thoughts


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace Modelo.Models
{
    [Table("Servico")]
    public class Servico
    {
        [Key]
        public long ServicoId { get; set; }

        public string Tipo { get; set; }
        public string Nome { get; set; }
        public int Tempo { get; set; }
        [DataType(DataType.DateTime)]
        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd hh:mm", ApplyFormatInEditMode = true)]
        public DateTime Vencimento { get; set; }

        public virtual ICollection<OrdemServico> OrdensServico { get; set; }
    }
}


text:
#ifndef SkTransparentShader_DEFINED
#define SkTransparentShader_DEFINED

#include "SkShader.h"

class SK_API SkTransparentShader : public SkShader {
public:
    SkTransparentShader() {}

    virtual SkShader::Context* createContext(const SkBitmap& device, const SkPaint& paint,
                                             const SkMatrix& matrix, void* storage) const
            SK_OVERRIDE;
    virtual size_t contextSize() const SK_OVERRIDE;

    class TransparentShaderContext : public SkShader::Context {
    public:
        TransparentShaderContext(const SkTransparentShader& shader, const SkBitmap& device,
                                 const SkPaint& paint, const SkMatrix& matrix);
        virtual ~TransparentShaderContext();

        virtual uint32_t getFlags() const SK_OVERRIDE;
        virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE;
        virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE;

    private:
        const SkBitmap* fDevice;

        typedef SkShader::Context INHERITED;
    };

    SK_TO_STRING_OVERRIDE()
    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransparentShader)

private:
    SkTransparentShader(SkReadBuffer& buffer) : INHERITED(buffer) {}

    typedef SkShader INHERITED;
};

#endif


text:
class GraphTest : public ::testing::Test
{
    struct Data {
        explicit Data(int data = 0): data(data) {}
        int data;
    };
protected:
    using GraphData = Graph<Data, Data>;
    using Vertex = GraphData::VertexPtr;
    using Edge = GraphData::EdgePtr;

    virtual void SetUp() {
        graph = std::make_shared<GraphData>();
        v1 = graph->addVertex(1);
        v2 = graph->addVertex(2);
        v3 = graph->addVertex(3);
        v4 = graph->addVertex(4);
    }

    virtual void TearDown() {
        graph.reset();
    }

    std::shared_ptr<GraphData> graph;
    Vertex v1, v2, v3, v4;
};

TEST_F(GraphTest, DataTest)
{
    EXPECT_EQ(1, v1->data);
    EXPECT_EQ(2, v2->data);

    graph->addEdge(v1, v2, 3);
    auto edge_pair = graph->edge(v1, v2);
    bool edge_found = edge_pair.second;
    ASSERT_EQ(true, edge_found);
    auto edge = edge_pair.first;
    EXPECT_EQ(1, edge->src->data);
    EXPECT_EQ(2, edge->dst->data);
    EXPECT_EQ(3, edge->data);
}

TEST_F(GraphTest, DeleteEdgesTest)
{
    graph->addEdge(v1, v2);
    graph->deleteEdge(v1, v2);
    EXPECT_TRUE(graph->edges().empty());

    graph->addEdge(v1, v4);
    graph->addEdge(v2, v4);
    graph->addEdge(v3, v4);
    EXPECT_EQ(3u, graph->edges().size());

    graph->deleteOutEdges(v1);
    EXPECT_EQ(0u, graph->outDegree(v1));
    EXPECT_EQ(2u, graph->inDegree(v4));

    graph->deleteInEdges(v4);
    EXPECT_EQ(0u, graph->inDegree(v2));
    EXPECT_EQ(0u, graph->inDegree(v3));
    EXPECT_EQ(0u, graph->inDegree(v4));
    EXPECT_TRUE(graph->edges().empty());
}

class InitDependencyGraphTest : public ::testing::Test
                              , public TwoSwitchNetwork
{
protected:
    virtual void SetUp() {
        initNetwork();
        dependency_graph = std::make_shared<DependencyGraph>(network);
    }

    virtual void TearDown() {
        destroyNetwork();
        dependency_graph.reset();
    }

    std::shared_ptr<DependencyGraph> dependency_graph;
};

TEST_F(InitDependencyGraphTest, CreationTest)
{
    network->deleteRule(rule1->id());
    network->deleteRule(rule2->id());
    network->deleteRule(rule3->id());
    network->deleteRule(rule4->id());
    network->deleteRule(rule5->id());
    network->deleteRule(rule11->id());

    // Add special rules
    dependency_graph->addRule(network->dropRule());
    EXPECT_TRUE(dependency_graph->popEdgeDiff().empty());
    dependency_graph->addRule(network->controllerRule());
    EXPECT_TRUE(dependency_graph->popEdgeDiff().empty());
    for (auto port : {port11, port12, port21, port22}) {
        dependency_graph->addRule(port->sourceRule());
        EXPECT_TRUE(dependency_graph->popEdgeDiff().empty());
        dependency_graph->addRule(port->sinkRule());
        EXPECT_TRUE(dependency_graph->popEdgeDiff().empty());
    }

    // Add table miss rules
    dependency_graph->addRule(table_miss);
    auto diff = dependency_graph->popEdgeDiff();
    ASSERT_EQ(1u, diff.new_edges.size());
    auto new_edge = diff.new_edges.begin();
    EXPECT_EQ(table_miss->id(), new_edge->src->id());
    EXPECT_EQ(network->dropRule(), new_edge->dst);
    ASSERT_EQ(2u, diff.new_dependent_edges.size());
    std::set<std::pair<RulePtr, RulePtr>> new_dependent_edges {
        {port11->sourceRule(), table_miss},
        {port12->sourceRule(), table_miss}
    };
    for (const auto& edge : diff.new_dependent_edges) {
        auto it = new_dependent_edges.find({edge.src, edge.dst});
        EXPECT_NE(new_dependent_edges.end(), it);
        new_dependent_edges.erase(it);
    }
    EXPECT_TRUE(new_dependent_edges.empty());
    dependency_graph->addRule(table_miss_sw2);
    dependency_graph->popEdgeDiff();

    // Add link
    dependency_graph->addLink(link);
    auto link_diff = dependency_graph->popEdgeDiff();
    EXPECT_TRUE(link_diff.new_edges.empty());
    EXPECT_TRUE(link_diff.new_dependent_edges.empty());
    EXPECT_TRUE(link_diff.changed_edges.empty());
    ASSERT_EQ(2u, link_diff.removed_edges.size());
    std::list<Dependency> expected_edges {
        {port12->sourceRule(), table_miss},
        {port21->sourceRule(), table_miss_sw2}
    };
    for (auto edge : link_diff.removed_edges) {
        auto it = std::find(expected_edges.begin(),
                            expected_edges.end(),
                            edge);
        EXPECT_NE(expected_edges.end(), it);
        expected_edges.erase(it);
    }
    EXPECT_TRUE(expected_edges.empty());
}

class DependencyGraphTest : public ::testing::Test
                          , public SimpleTwoSwitchNetwork
{
protected:
    virtual void SetUp() {
        initNetwork();
        dependency_graph = std::make_shared<DependencyGraph>(network);
        dependency_graph->addRule(network->dropRule());
        dependency_graph->addRule(network->controllerRule());
        for (auto port : {port11, port12, port21, port22}) {
            dependency_graph->addRule(port->sourceRule());
            dependency_graph->addRule(port->sinkRule());
        }
        dependency_graph->addRule(table_miss1);
        dependency_graph->addRule(table_miss2);
        dependency_graph->popEdgeDiff();
    }

    virtual void TearDown() {
        destroyNetwork();
        dependency_graph.reset();
    }

    //using Desc = EdgePtr;
    struct EdgeInfo {RulePtr src_rule, dst_rule; N domain;};
    EdgeInfo getEdgeInfo(Dependency dependency) const {
        auto src_rule = dependency.src;
        auto dst_rule = dependency.dst;
        auto domain = dependency.domain;
        return EdgeInfo{src_rule, dst_rule, domain};
    }
    EdgeInfo findEdgeFrom(const std::list<Dependency>& edges,
                          RulePtr rule) const {
        auto it = std::find_if(edges.begin(), edges.end(),
            [rule](Dependency dependency) -> bool {
                return rule == dependency.src;
            }
        );
        return it != edges.end() ? getEdgeInfo(*it)
                                 : EdgeInfo{nullptr, nullptr, N::emptySpace()};
    }
    EdgeInfo findEdgeTo(const std::list<Dependency>& edges,
                        RulePtr rule) const {
        auto it = std::find_if(edges.begin(), edges.end(),
            [rule](Dependency dependency) -> bool {
               return rule == dependency.dst;
            }
        );
        return it != edges.end() ? getEdgeInfo(*it)
                                 : EdgeInfo{nullptr, nullptr, N::emptySpace()};
    }

    std::shared_ptr<DependencyGraph> dependency_graph;
};

TEST_F(DependencyGraphTest, AddRuleTest)
{
    dependency_graph->addRule(rule1);
    auto rule_diff = dependency_graph->popEdgeDiff();
    ASSERT_EQ(1u, rule_diff.new_edges.size());
    ASSERT_EQ(1u, rule_diff.new_dependent_edges.size());
    ASSERT_EQ(1u, rule_diff.changed_edges.size());
    EXPECT_TRUE(rule_diff.removed_edges.empty());

    auto in_edge = findEdgeFrom(
        rule_diff.new_dependent_edges, port11->sourceRule()
    );
    EXPECT_EQ(port11->sourceRule(), in_edge.src_rule);
    EXPECT_EQ(rule1, in_edge.dst_rule);
    EXPECT_EQ(N(1, H("0000xxxx")), in_edge.domain);

    auto out_edge = findEdgeFrom(rule_diff.new_edges, rule1);
    EXPECT_EQ(rule1, out_edge.src_rule);
    EXPECT_EQ(port12->sinkRule(), out_edge.dst_rule);
    EXPECT_EQ(N(2, H("0000xxxx")), out_edge.domain);

    auto changed_edge = *rule_diff.changed_edges.begin();
    EXPECT_EQ(port11->sourceRule(), changed_edge.src);
    EXPECT_EQ(table_miss1, changed_edge.dst);
    EXPECT_EQ(N(port11->id()) - N(1, H("0000xxxx")), changed_edge.domain);

    auto top_rule = network->addRule(1, 0, 2, 0x0, M(1, B("00000011")),
                                     ActionsBase::portAction(2));
    dependency_graph->addRule(top_rule);
    auto top_diff = dependency_graph->popEdgeDiff();
    ASSERT_EQ(1u, top_diff.changed_edges.size());
    auto last_edge = findEdgeTo(top_diff.changed_edges, rule1);
    EXPECT_EQ(port11->sourceRule(), last_edge.src_rule);
    EXPECT_EQ(rule1, last_edge.dst_rule);
    EXPECT_EQ(N(1, H("0000xxxx")) - N(1, H("00000011")), last_edge.domain);
}

TEST_F(DependencyGraphTest, DeleteRuleTest)
{
    dependency_graph->addRule(rule1);
    dependency_graph->popEdgeDiff();
    dependency_graph->deleteRule(rule1);
    auto rule_diff = dependency_graph->popEdgeDiff();
    EXPECT_TRUE(rule_diff.new_edges.empty());
    EXPECT_TRUE(rule_diff.new_dependent_edges.empty());
    ASSERT_EQ(1u, rule_diff.changed_edges.size());
    ASSERT_EQ(1u, rule_diff.removed_edges.size());
    ASSERT_EQ(1u, rule_diff.removed_dependent_edges.size());

    auto& changed_table_miss_edge = *rule_diff.changed_edges.begin();
    EXPECT_EQ(port11->sourceRule(), changed_table_miss_edge.src);
    EXPECT_EQ(table_miss1, changed_table_miss_edge.dst);
    EXPECT_EQ(N(1, H("xxxxxxxx")), changed_table_miss_edge.domain);

    auto deleted_out_edge = *rule_diff.removed_edges.begin();
    EXPECT_EQ(rule1, deleted_out_edge.src);
    EXPECT_EQ(port12->sinkRule(), deleted_out_edge.dst);

    auto deleted_in_edge = *rule_diff.removed_dependent_edges.begin();
    EXPECT_EQ(port11->sourceRule(), deleted_in_edge.src);
    EXPECT_EQ(rule1, deleted_in_edge.dst);

}

TEST_F(DependencyGraphTest, AddLinkTest)
{
    dependency_graph->addRule(rule1);
    dependency_graph->addRule(rule2);
    dependency_graph->popEdgeDiff();

    auto link = network->addLink({1,2}, {2,1}).first;
    dependency_graph->addLink(link);
    auto diff = dependency_graph->popEdgeDiff();
    ASSERT_EQ(2u, diff.new_edges.size());
    EXPECT_EQ(0u, diff.changed_edges.size());
    EXPECT_EQ(4u, diff.removed_edges.size());

    auto link_edge_to2 = findEdgeTo(diff.new_edges, rule2);
    EXPECT_EQ(rule1, link_edge_to2.src_rule);
    EXPECT_EQ(rule2, link_edge_to2.dst_rule);
    EXPECT_EQ(N(1, H("000000xx")), link_edge_to2.domain);

    auto link_edge_to_miss = findEdgeTo(diff.new_edges, table_miss2);
    EXPECT_EQ(rule1, link_edge_to_miss.src_rule);
    EXPECT_EQ(table_miss2, link_edge_to_miss.dst_rule);
    EXPECT_EQ(N(1, H("0000xxxx")) - N(1, H("000000xx")),
              link_edge_to_miss.domain);

    auto port12_source_range = dependency_graph->outEdges(port12->sourceRule());
    auto port12_sink_range = dependency_graph->inEdges(port12->sinkRule());
    auto port21_source_range = dependency_graph->outEdges(port21->sourceRule());
    auto port21_sink_range = dependency_graph->inEdges(port21->sinkRule());
    EXPECT_TRUE(port12_source_range.empty());
    EXPECT_TRUE(port12_sink_range.empty());
    EXPECT_TRUE(port21_source_range.empty());
    EXPECT_TRUE(port21_sink_range.empty());
}

TEST_F(DependencyGraphTest, ExistingLinkTest)
{
    dependency_graph->addRule(rule2);
    network->deleteRule(rule1->id());
    auto link = network->addLink({1,2}, {2,1}).first;
    dependency_graph->addLink(link);
    dependency_graph->popEdgeDiff();

    auto rule = network->addRule(1, 0, 1, 0x0, M(1, B("0000xxxx")),
                                 ActionsBase::portAction(2));
    dependency_graph->addRule(rule);
    auto diff = dependency_graph->popEdgeDiff();

    auto link_edge_to2 = findEdgeTo(diff.new_edges, rule2);
    EXPECT_EQ(rule, link_edge_to2.src_rule);
    EXPECT_EQ(rule2, link_edge_to2.dst_rule);
    EXPECT_EQ(N(1, H("000000xx")), link_edge_to2.domain);

    auto link_edge_to_miss = findEdgeTo(diff.new_edges, table_miss2);
    EXPECT_EQ(rule, link_edge_to_miss.src_rule);
    EXPECT_EQ(table_miss2, link_edge_to_miss.dst_rule);
    EXPECT_EQ(N(1, H("0000xxxx")) - N(1, H("000000xx")),
              link_edge_to_miss.domain);
}

TEST_F(DependencyGraphTest, DeleteLinkTest)
{
    dependency_graph->addRule(rule1);
    dependency_graph->addRule(rule2);
    auto new_link = network->addLink({1,2}, {2,1}).first;
    dependency_graph->addLink(new_link);
    dependency_graph->popEdgeDiff();

    auto deleted_link = network->deleteLink({1,2}, {2,1}).first;
    dependency_graph->deleteLink(deleted_link);
    auto diff = dependency_graph->popEdgeDiff();
    EXPECT_EQ(4u, diff.new_edges.size());
    EXPECT_EQ(0u, diff.changed_edges.size());
    EXPECT_EQ(2u, diff.removed_edges.size());

    auto edge_from_rule1 = findEdgeFrom(diff.new_edges, rule1);
    EXPECT_EQ(rule1, edge_from_rule1.src_rule);
    EXPECT_EQ(port12->sinkRule(), edge_from_rule1.dst_rule);
    EXPECT_EQ(N(2, H("0000xxxx")), edge_from_rule1.domain);

    auto edge_to_table_miss1 = findEdgeTo(diff.new_edges, table_miss1);
    EXPECT_EQ(port12->sourceRule(), edge_to_table_miss1.src_rule);
    EXPECT_EQ(table_miss1, edge_to_table_miss1.dst_rule);
    EXPECT_EQ(N(2), edge_to_table_miss1.domain);

    auto edge_to_rule2 = findEdgeTo(diff.new_edges, rule2);
    EXPECT_EQ(port21->sourceRule(), edge_to_rule2.src_rule);
    EXPECT_EQ(rule2, edge_to_rule2.dst_rule);
    EXPECT_EQ(N(1, H("000000xx")), edge_to_rule2.domain);

    auto edge_to_table_miss2 = findEdgeTo(diff.new_edges, table_miss2);
    EXPECT_EQ(port21->sourceRule(), edge_to_table_miss2.src_rule);
    EXPECT_EQ(table_miss2, edge_to_table_miss2.dst_rule);
    EXPECT_EQ(N(1, H("xxxxxxxx") - H("000000xx")), edge_to_table_miss2.domain);

    std::set<std::pair<RulePtr, RulePtr>> expected_removed_edges {
        {rule1, rule2}, {rule1, table_miss2}
    };
    for (auto edge : diff.removed_edges) {
        auto src_rule = edge.src;
        auto dst_rule = edge.dst;
        auto it = expected_removed_edges.find({src_rule, dst_rule});
        EXPECT_NE(expected_removed_edges.end(), it);
        expected_removed_edges.erase(it);
    }
    EXPECT_TRUE(expected_removed_edges.empty());
}

TEST_F(DependencyGraphTest, EdgeCleanUpTest)
{
    network->deleteRule(rule1->id());
    network->deleteRule(rule2->id());
    auto rule = network->addRule(1, 0, 1, 0x0, M(1, B("xxxxxxxx")),
                                 ActionsBase::portAction(2));
    dependency_graph->addRule(rule);
    auto diff = dependency_graph->popEdgeDiff();
    ASSERT_EQ(1u, diff.removed_edges.size());
    EXPECT_TRUE(diff.changed_edges.empty());
    auto edge = *diff.removed_edges.begin();
    EXPECT_EQ(port11->sourceRule(), edge.src);
    EXPECT_EQ(table_miss1, edge.dst);
    EXPECT_NE(rule, edge.dst);
}

TEST_F(DependencyGraphTest, TableRuleTest)
{
    dependency_graph->addRule(rule1);
    dependency_graph->addRule(rule2);
    dependency_graph->addRule(
        network->getSwitch(1)->addTable(1)->tableMissRule()
    );

    auto table1_rule = network->addRule(1, 1, 1, 0x0, M(1, B("000000xx")),
                                        ActionsBase::portAction(2));
    dependency_graph->addRule(table1_rule);
    dependency_graph->popEdgeDiff();
    // TODO: check this test, may be wrong
    auto rule = network->addRule(1, 0, 2, 0x0, M(1, B("00000011")),
                                 ActionsBase::tableAction(1));
    dependency_graph->addRule(rule);
    auto diff = dependency_graph->popEdgeDiff();
    ASSERT_EQ(1u, diff.new_edges.size());
    ASSERT_EQ(1u, diff.new_dependent_edges.size());
    ASSERT_EQ(1u, diff.changed_edges.size());
    EXPECT_TRUE(diff.removed_edges.empty());
    auto in_edge = findEdgeTo(
        diff.changed_edges, rule1
    );
    EXPECT_EQ(port11->sourceRule(), in_edge.src_rule);
    EXPECT_EQ(rule1, in_edge.dst_rule);
    EXPECT_EQ(N(1, H("0000xxxx")) - N(1, H("00000011")), in_edge.domain);
    auto out_edge = findEdgeFrom(
        diff.new_edges, rule
    );
    EXPECT_EQ(rule, out_edge.src_rule);
    EXPECT_EQ(table1_rule, out_edge.dst_rule);
    EXPECT_EQ(N(1, H("00000011")), out_edge.domain);
}


text:
using namespace fwk;

CoreException::CoreException(const std::string& msg) noexcept:
  Exception(msg)
{}

CoreException::~CoreException() {}


text:
package files

import (
	"compress/bzip2"
	"compress/gzip"
	"fmt"
	"io"
	"os"
	"strings"
)

// NewReader creates a buffered Scanner for
// plain or gzipped/bzipped files for ruther processing.
func NewReader(filePath string) (io.Reader, error) {
	f, err := os.Open(filePath)
	if err != nil {
		return nil, err
	}
	finfo, err := f.Stat()
	if err != nil {
		return nil, err
	}
	if !finfo.Mode().IsRegular() {
		return nil, fmt.Errorf("Path %s is not a regular file", filePath)
	}

	var rd io.Reader
	var err2 error
	if strings.HasSuffix(filePath, ".gz") {
		rd, err2 = gzip.NewReader(f)
		if err2 != nil {
			return nil, err2
		}

	} else if strings.HasSuffix(filePath, ".bz2") {
		rd = bzip2.NewReader(f)

	} else {
		rd = f
	}
	return rd, nil
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/compute/v1/compute.proto

package com.google.cloud.compute.v1;

/**
 *
 *
 *

 *

 *
 * Protobuf type {@code google.cloud.compute.v1.GlobalSetLabelsRequest}
 */
public final class GlobalSetLabelsRequest extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.compute.v1.GlobalSetLabelsRequest)
    GlobalSetLabelsRequestOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use GlobalSetLabelsRequest.newBuilder() to construct.
  private GlobalSetLabelsRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private GlobalSetLabelsRequest() {
    labelFingerprint_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new GlobalSetLabelsRequest();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.compute.v1.Compute
        .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(int number) {
    switch (number) {
      case 500195327:
        return internalGetLabels();
      default:
        throw new RuntimeException("Invalid map field number: " + number);
    }
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.compute.v1.Compute
        .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.compute.v1.GlobalSetLabelsRequest.class,
            com.google.cloud.compute.v1.GlobalSetLabelsRequest.Builder.class);
  }

  private int bitField0_;
  public static final int LABEL_FINGERPRINT_FIELD_NUMBER = 178124825;
  private volatile java.lang.Object labelFingerprint_;
  /**
   *
   *
   *

   * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
   *

   *
   * optional string label_fingerprint = 178124825;
   *
   * @return Whether the labelFingerprint field is set.
   */
  @java.lang.Override
  public boolean hasLabelFingerprint() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   *
   *
   *

   * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
   *

   *
   * optional string label_fingerprint = 178124825;
   *
   * @return The labelFingerprint.
   */
  @java.lang.Override
  public java.lang.String getLabelFingerprint() {
    java.lang.Object ref = labelFingerprint_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      labelFingerprint_ = s;
      return s;
    }
  }
  /**
   *
   *
   *

   * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
   *

   *
   * optional string label_fingerprint = 178124825;
   *
   * @return The bytes for labelFingerprint.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getLabelFingerprintBytes() {
    java.lang.Object ref = labelFingerprint_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      labelFingerprint_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LABELS_FIELD_NUMBER = 500195327;

  private static final class LabelsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
        com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
            com.google.cloud.compute.v1.Compute
                .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_LabelsEntry_descriptor,
            com.google.protobuf.WireFormat.FieldType.STRING,
            "",
            com.google.protobuf.WireFormat.FieldType.STRING,
            "");
  }

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

  private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
    if (labels_ == null) {
      return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
    }
    return labels_;
  }

  public int getLabelsCount() {
    return internalGetLabels().getMap().size();
  }
  /**
   *
   *
   *

   * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
   *

   *
   * map<string, string> labels = 500195327;
   */
  @java.lang.Override
  public boolean containsLabels(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    return internalGetLabels().getMap().containsKey(key);
  }
  /** Use {@link #getLabelsMap()} instead. */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.String> getLabels() {
    return getLabelsMap();
  }
  /**
   *
   *
   *

   * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
   *

   *
   * map<string, string> labels = 500195327;
   */
  @java.lang.Override
  public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
    return internalGetLabels().getMap();
  }
  /**
   *
   *
   *

   * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
   *

   *
   * map<string, string> labels = 500195327;
   */
  @java.lang.Override
  public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.String defaultValue) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   *
   *
   *

   * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
   *

   *
   * map<string, string> labels = 500195327;
   */
  @java.lang.Override
  public java.lang.String getLabelsOrThrow(java.lang.String key) {
    if (key == null) {
      throw new NullPointerException("map key");
    }
    java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (((bitField0_ & 0x00000001) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 178124825, labelFingerprint_);
    }
    com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
        output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 500195327);
    getUnknownFields().writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (((bitField0_ & 0x00000001) != 0)) {
      size +=
          com.google.protobuf.GeneratedMessageV3.computeStringSize(178124825, labelFingerprint_);
    }
    for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
        internalGetLabels().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
          LabelsDefaultEntryHolder.defaultEntry
              .newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(500195327, labels__);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof com.google.cloud.compute.v1.GlobalSetLabelsRequest)) {
      return super.equals(obj);
    }
    com.google.cloud.compute.v1.GlobalSetLabelsRequest other =
        (com.google.cloud.compute.v1.GlobalSetLabelsRequest) obj;

    if (hasLabelFingerprint() != other.hasLabelFingerprint()) return false;
    if (hasLabelFingerprint()) {
      if (!getLabelFingerprint().equals(other.getLabelFingerprint())) return false;
    }
    if (!internalGetLabels().equals(other.internalGetLabels())) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasLabelFingerprint()) {
      hash = (37 * hash) + LABEL_FINGERPRINT_FIELD_NUMBER;
      hash = (53 * hash) + getLabelFingerprint().hashCode();
    }
    if (!internalGetLabels().getMap().isEmpty()) {
      hash = (37 * hash) + LABELS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetLabels().hashCode();
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseDelimitedFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(com.google.cloud.compute.v1.GlobalSetLabelsRequest prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   *

   *

   *
   * Protobuf type {@code google.cloud.compute.v1.GlobalSetLabelsRequest}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.compute.v1.GlobalSetLabelsRequest)
      com.google.cloud.compute.v1.GlobalSetLabelsRequestOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 500195327:
          return internalGetLabels();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
      switch (number) {
        case 500195327:
          return internalGetMutableLabels();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.compute.v1.GlobalSetLabelsRequest.class,
              com.google.cloud.compute.v1.GlobalSetLabelsRequest.Builder.class);
    }

    // Construct using com.google.cloud.compute.v1.GlobalSetLabelsRequest.newBuilder()
    private Builder() {}

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      labelFingerprint_ = "";
      bitField0_ = (bitField0_ & ~0x00000001);
      internalGetMutableLabels().clear();
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.cloud.compute.v1.Compute
          .internal_static_google_cloud_compute_v1_GlobalSetLabelsRequest_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.GlobalSetLabelsRequest getDefaultInstanceForType() {
      return com.google.cloud.compute.v1.GlobalSetLabelsRequest.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.GlobalSetLabelsRequest build() {
      com.google.cloud.compute.v1.GlobalSetLabelsRequest result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.compute.v1.GlobalSetLabelsRequest buildPartial() {
      com.google.cloud.compute.v1.GlobalSetLabelsRequest result =
          new com.google.cloud.compute.v1.GlobalSetLabelsRequest(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        to_bitField0_ |= 0x00000001;
      }
      result.labelFingerprint_ = labelFingerprint_;
      result.labels_ = internalGetLabels();
      result.labels_.makeImmutable();
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.compute.v1.GlobalSetLabelsRequest) {
        return mergeFrom((com.google.cloud.compute.v1.GlobalSetLabelsRequest) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.compute.v1.GlobalSetLabelsRequest other) {
      if (other == com.google.cloud.compute.v1.GlobalSetLabelsRequest.getDefaultInstance())
        return this;
      if (other.hasLabelFingerprint()) {
        bitField0_ |= 0x00000001;
        labelFingerprint_ = other.labelFingerprint_;
        onChanged();
      }
      internalGetMutableLabels().mergeFrom(other.internalGetLabels());
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 1424998602:
              {
                labelFingerprint_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 1424998602
            case -293404678:
              {
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ =
                    input.readMessage(
                        LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
                        extensionRegistry);
                internalGetMutableLabels()
                    .getMutableMap()
                    .put(labels__.getKey(), labels__.getValue());
                break;
              } // case -293404678
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private java.lang.Object labelFingerprint_ = "";
    /**
     *
     *
     *

     * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
     *

     *
     * optional string label_fingerprint = 178124825;
     *
     * @return Whether the labelFingerprint field is set.
     */
    public boolean hasLabelFingerprint() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     *

     * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
     *

     *
     * optional string label_fingerprint = 178124825;
     *
     * @return The labelFingerprint.
     */
    public java.lang.String getLabelFingerprint() {
      java.lang.Object ref = labelFingerprint_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        labelFingerprint_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     *

     * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
     *

     *
     * optional string label_fingerprint = 178124825;
     *
     * @return The bytes for labelFingerprint.
     */
    public com.google.protobuf.ByteString getLabelFingerprintBytes() {
      java.lang.Object ref = labelFingerprint_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        labelFingerprint_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     *

     * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
     *

     *
     * optional string label_fingerprint = 178124825;
     *
     * @param value The labelFingerprint to set.
     * @return This builder for chaining.
     */
    public Builder setLabelFingerprint(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000001;
      labelFingerprint_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
     *

     *
     * optional string label_fingerprint = 178124825;
     *
     * @return This builder for chaining.
     */
    public Builder clearLabelFingerprint() {
      bitField0_ = (bitField0_ & ~0x00000001);
      labelFingerprint_ = getDefaultInstance().getLabelFingerprint();
      onChanged();
      return this;
    }
    /**
     *
     *
     *

     * The fingerprint of the previous set of labels for this resource, used to detect conflicts. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update labels. You must always provide an up-to-date fingerprint hash when updating or changing labels, otherwise the request will fail with error 412 conditionNotMet. Make a get() request to the resource to get the latest fingerprint.
     *

     *
     * optional string label_fingerprint = 178124825;
     *
     * @param value The bytes for labelFingerprint to set.
     * @return This builder for chaining.
     */
    public Builder setLabelFingerprintBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      bitField0_ |= 0x00000001;
      labelFingerprint_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() {
      if (labels_ == null) {
        return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      return labels_;
    }

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableLabels() {
      onChanged();
      ;
      if (labels_ == null) {
        labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
      }
      if (!labels_.isMutable()) {
        labels_ = labels_.copy();
      }
      return labels_;
    }

    public int getLabelsCount() {
      return internalGetLabels().getMap().size();
    }
    /**
     *
     *
     *

     * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
     *

     *
     * map<string, string> labels = 500195327;
     */
    @java.lang.Override
    public boolean containsLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetLabels().getMap().containsKey(key);
    }
    /** Use {@link #getLabelsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getLabels() {
      return getLabelsMap();
    }
    /**
     *
     *
     *

     * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
     *

     *
     * map<string, string> labels = 500195327;
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() {
      return internalGetLabels().getMap();
    }
    /**
     *
     *
     *

     * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
     *

     *
     * map<string, string> labels = 500195327;
     */
    @java.lang.Override
    public java.lang.String getLabelsOrDefault(
        java.lang.String key, java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     *

     * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
     *

     *
     * map<string, string> labels = 500195327;
     */
    @java.lang.Override
    public java.lang.String getLabelsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearLabels() {
      internalGetMutableLabels().getMutableMap().clear();
      return this;
    }
    /**
     *
     *
     *

     * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
     *

     *
     * map<string, string> labels = 500195327;
     */
    public Builder removeLabels(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      internalGetMutableLabels().getMutableMap().remove(key);
      return this;
    }
    /** Use alternate mutation accessors instead. */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() {
      return internalGetMutableLabels().getMutableMap();
    }
    /**
     *
     *
     *

     * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
     *

     *
     * map<string, string> labels = 500195327;
     */
    public Builder putLabels(java.lang.String key, java.lang.String value) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      if (value == null) {
        throw new NullPointerException("map value");
      }

      internalGetMutableLabels().getMutableMap().put(key, value);
      return this;
    }
    /**
     *
     *
     *

     * A list of labels to apply for this resource. Each label must comply with the requirements for labels. For example, "webserver-frontend": "images". A label value can also be empty (e.g. "my-label": "").
     *

     *
     * map<string, string> labels = 500195327;
     */
    public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) {
      internalGetMutableLabels().getMutableMap().putAll(values);
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }

    // @@protoc_insertion_point(builder_scope:google.cloud.compute.v1.GlobalSetLabelsRequest)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.compute.v1.GlobalSetLabelsRequest)
  private static final com.google.cloud.compute.v1.GlobalSetLabelsRequest DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.compute.v1.GlobalSetLabelsRequest();
  }

  public static com.google.cloud.compute.v1.GlobalSetLabelsRequest getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<GlobalSetLabelsRequest> PARSER =
      new com.google.protobuf.AbstractParser<GlobalSetLabelsRequest>() {
        @java.lang.Override
        public GlobalSetLabelsRequest parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

  public static com.google.protobuf.Parser<GlobalSetLabelsRequest> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<GlobalSetLabelsRequest> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.compute.v1.GlobalSetLabelsRequest getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}