text:
package mcjty.rftools.blocks.environmental;

import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import mcjty.lib.api.information.IMachineInformation;
import mcjty.lib.container.ContainerFactory;
import mcjty.lib.container.DefaultSidedInventory;
import mcjty.lib.container.InventoryHelper;
import mcjty.lib.tileentity.GenericEnergyReceiverTileEntity;
import mcjty.lib.gui.widgets.ImageChoiceLabel;
import mcjty.lib.gui.widgets.ScrollableLabel;
import mcjty.lib.varia.Logging;
import mcjty.lib.varia.ModuleSupport;
import mcjty.lib.varia.RedstoneMode;
import mcjty.rftools.RFTools;
import mcjty.rftools.blocks.environmental.modules.EnvironmentModule;
import mcjty.theoneprobe.api.IProbeHitData;
import mcjty.theoneprobe.api.IProbeInfo;
import mcjty.theoneprobe.api.ProbeMode;
import mcjty.lib.typed.Key;
import mcjty.lib.typed.Type;
import mcjty.lib.typed.TypedMap;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.passive.IAnimals;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import net.minecraftforge.fml.common.Optional;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;

@Optional.InterfaceList({
        @Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers"),
//        @Optional.Interface(iface = "dan200.computercraft.api.peripheral.IPeripheral", modid = "ComputerCraft")
})
public class EnvironmentalControllerTileEntity extends GenericEnergyReceiverTileEntity implements DefaultSidedInventory, ITickable,
        IMachineInformation, SimpleComponent /*, IPeripheral*/ {

    public static final String CMD_SETRADIUS = "env.setRadius";
    public static final String CMD_RSMODE = "env.setRsMode";

    public static final String CMD_SETBOUNDS = "env.setBounds";
    public static final Key<Integer> PARAM_MIN = new Key<>("min", Type.INTEGER);
    public static final Key<Integer> PARAM_MAX = new Key<>("max", Type.INTEGER);

    public static final String CMD_SETMODE = "env.setBlacklist";
    public static final Key<Integer> PARAM_MODE = new Key<>("mode", Type.INTEGER);

    public static final String CMD_ADDPLAYER = "env.addPlayer";
    public static final String CMD_DELPLAYER = "env.delPlayer";
    public static final Key<String> PARAM_NAME = new Key<>("name", Type.STRING);

    public static final String CMD_GETPLAYERS = "getPlayers";
    public static final String CLIENTCMD_GETPLAYERS = "getPlayers";

    public static final String COMPONENT_NAME = "environmental_controller";

    public static final int ENV_MODULES = 7;
    public static final ContainerFactory CONTAINER_FACTORY = new ContainerFactory(new ResourceLocation(RFTools.MODID, "gui/environmental.gui"));
    public static final int SLOT_MODULES = 0;

    public static final ModuleSupport MODULE_SUPPORT = new ModuleSupport(SLOT_MODULES, SLOT_MODULES + ENV_MODULES - 1) {
        @Override
        public boolean isModule(ItemStack itemStack) {
            return itemStack.getItem() instanceof EnvModuleProvider;
        }
    };
    public static final String CONTAINER_INVENTORY = "container";

    private InventoryHelper inventoryHelper = new InventoryHelper(this, CONTAINER_FACTORY, ENV_MODULES);

    public enum EnvironmentalMode {
        MODE_BLACKLIST,
        MODE_WHITELIST,
        MODE_HOSTILE,
        MODE_PASSIVE,
        MODE_MOBS,
        MODE_ALL
    }

    // Cached server modules
    private List<EnvironmentModule> environmentModules = null;
    Set<String> players = new HashSet<>();
    private EnvironmentalMode mode = EnvironmentalMode.MODE_BLACKLIST;
    private int totalRfPerTick = 0;     // The total rf per tick for all modules.
    private int radius = 50;
    private int miny = 30;
    private int maxy = 70;
    private int volume = -1;
    private boolean active = false;

    private int powerTimeout = 0;

    public EnvironmentalControllerTileEntity() {
        super(EnvironmentalConfiguration.ENVIRONMENTAL_MAXENERGY.get(), EnvironmentalConfiguration.ENVIRONMENTAL_RECEIVEPERTICK.get());
    }

    @Override
    public long getEnergyDiffPerTick() {
        return isActive() ? -getTotalRfPerTick() : 0;
    }

    @Nullable
    @Override
    public String getEnergyUnitName() {
        return "RF";
    }

    @Override
    public boolean isMachineActive() {
        return isActive();
    }

    @Override
    public boolean isMachineRunning() {
        return isActive();
    }

    @Nullable
    @Override
    public String getMachineStatus() {
        return isActive() ? "active" : "idle";
    }

    @Override
    protected boolean needsRedstoneMode() {
        return true;
    }

    @Override
    protected boolean needsCustomInvWrapper() {
        return true;
    }

    //    @Override
//    @Optional.Method(modid = "ComputerCraft")
//    public String getType() {
//        return COMPONENT_NAME;
//    }
//
//    @Override
//    @Optional.Method(modid = "ComputerCraft")
//    public String[] getMethodNames() {
//        return new String[] { "getRedstoneMode", "setRedstoneMode" };
//    }
//
//    @Override
//    @Optional.Method(modid = "ComputerCraft")
//    public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws LuaException, InterruptedException {
//        switch (method) {
//            case 0: return new Object[] { getRedstoneMode().getDescription() };
//            case 1: return setRedstoneMode((String) arguments[0]);
//        }
//        return new Object[0];
//    }
//
//    @Override
//    @Optional.Method(modid = "ComputerCraft")
//    public void attach(IComputerAccess computer) {
//
//    }
//
//    @Override
//    @Optional.Method(modid = "ComputerCraft")
//    public void detach(IComputerAccess computer) {
//
//    }
//
//    @Override
//    @Optional.Method(modid = "ComputerCraft")
//    public boolean equals(IPeripheral other) {
//        return false;
//    }

    @Override
    @Optional.Method(modid = "opencomputers")
    public String getComponentName() {
        return COMPONENT_NAME;
    }

    @Callback(doc = "Get or set the current redstone mode. Values are 'Ignored', 'Off', or 'On'", getter = true, setter = true)
    @Optional.Method(modid = "opencomputers")
    public Object[] redstoneMode(Context context, Arguments args) {
        if (args.count() == 0) {
            return new Object[]{getRSMode().getDescription()};
        } else {
            String mode = args.checkString(0);
            return setRedstoneMode(mode);
        }
    }

    public EnvironmentalMode getMode() {
        return mode;
    }

    public void setMode(EnvironmentalMode mode) {
        this.mode = mode;
        markDirtyClient();
    }

    private float getPowerMultiplier() {
        switch (mode) {
            case MODE_BLACKLIST:
            case MODE_WHITELIST:
                return 1.0f;
            case MODE_HOSTILE:
            case MODE_PASSIVE:
            case MODE_MOBS:
            case MODE_ALL:
                return (float) EnvironmentalConfiguration.mobsPowerMultiplier.get();
        }
        return 1.0f;
    }

    public boolean isEntityAffected(Entity entity) {
        switch (mode) {
            case MODE_BLACKLIST:
                if (entity instanceof EntityPlayer) {
                    return isPlayerAffected((EntityPlayer) entity);
                } else {
                    return false;
                }
            case MODE_WHITELIST:
                if (entity instanceof EntityPlayer) {
                    return isPlayerAffected((EntityPlayer) entity);
                } else {
                    return false;
                }
            case MODE_HOSTILE:
                return entity instanceof IMob;
            case MODE_PASSIVE:
                return entity instanceof IAnimals && !(entity instanceof IMob);
            case MODE_MOBS:
                return entity instanceof IAnimals;
            case MODE_ALL:
                if (entity instanceof EntityPlayer) {
                    return isPlayerAffected((EntityPlayer) entity);
                } else {
                    return true;
                }
        }
        return false;
    }

    public boolean isPlayerAffected(EntityPlayer player) {
        if (mode == EnvironmentalMode.MODE_WHITELIST) {
            return players.contains(player.getName());
        } else if (mode == EnvironmentalMode.MODE_BLACKLIST) {
            return !players.contains(player.getName());
        } else {
            return mode == EnvironmentalMode.MODE_ALL;
        }
    }

    private List<String> getPlayersAsList() {
        return new ArrayList<>(players);
    }

    private void addPlayer(String player) {
        if (!players.contains(player)) {
            players.add(player);
            markDirtyClient();
        }
    }

    private void delPlayer(String player) {
        if (players.contains(player)) {
            players.remove(player);
            markDirtyClient();
        }
    }

    public boolean isActive() {
        return active;
    }

    public int getTotalRfPerTick() {
        if (environmentModules == null) {
            getEnvironmentModules();
        }
        int rfNeeded = (int) (totalRfPerTick * getPowerMultiplier() * (4.0f - getInfusedFactor()) / 4.0f);
        if (environmentModules.isEmpty()) {
            return rfNeeded;
        }
        if (rfNeeded < EnvironmentalConfiguration.MIN_USAGE.get()) {
            rfNeeded = EnvironmentalConfiguration.MIN_USAGE.get();
        }
        return rfNeeded;
    }

    public int getVolume() {
        if (volume == -1) {
            volume = (int) ((radius * radius * Math.PI) * (maxy - miny + 1));
        }
        return volume;
    }

    public int getRadius() {
        return radius;
    }

    public void setRadius(int radius) {
        this.radius = radius;
        volume = -1;
        environmentModules = null;
        markDirtyClient();
    }

    public int getMiny() {
        return miny;
    }

    public void setMiny(int miny) {
        this.miny = miny;
        volume = -1;
        environmentModules = null;
        markDirtyClient();
    }

    public int getMaxy() {
        return maxy;
    }

    public void setMaxy(int maxy) {
        this.maxy = maxy;
        volume = -1;
        environmentModules = null;
        markDirtyClient();
    }

    @Override
    public void update() {
        if (!getWorld().isRemote) {
            checkStateServer();
        }
    }

    private void checkStateServer() {
        if (powerTimeout > 0) {
            powerTimeout--;
            return;
        }

        long rf = getStoredPower();
        if (!isMachineEnabled()) {
            rf = 0;
        }

        getEnvironmentModules();

        int rfNeeded = getTotalRfPerTick();
        if (rfNeeded > rf || environmentModules.isEmpty()) {
            deactivate();
            powerTimeout = 20;
        } else {
            consumeEnergy(rfNeeded);
            for (EnvironmentModule module : environmentModules) {
                module.activate(true);
                module.tick(getWorld(), getPos(), radius, miny, maxy, this);
            }
            if (!active) {
                active = true;
                markDirtyClient();
            }
        }
    }

    public void deactivate() {
        for (EnvironmentModule module : environmentModules) {
            module.activate(false);
        }
        if (active) {
            active = false;
            markDirtyClient();
        }
    }

    private Object[] setRedstoneMode(String mode) {
        RedstoneMode redstoneMode = RedstoneMode.getMode(mode);
        if (redstoneMode == null) {
            throw new IllegalArgumentException("Not a valid mode");
        }
        setRSMode(redstoneMode);
        return null;
    }

    @Override
    public void setPowerInput(int powered) {
        if (powerLevel != powered) {
            powerTimeout = 0;
        }
        super.setPowerInput(powered);
    }

    // This is called server side.
    public List<EnvironmentModule> getEnvironmentModules() {
        if (environmentModules == null) {
            int volume = getVolume();
            totalRfPerTick = 0;
            environmentModules = new ArrayList<>();
            for (int i = 0; i < inventoryHelper.getCount(); i++) {
                ItemStack itemStack = inventoryHelper.getStackInSlot(i);
                if (!itemStack.isEmpty() && itemStack.getItem() instanceof EnvModuleProvider) {
                    EnvModuleProvider moduleProvider = (EnvModuleProvider) itemStack.getItem();
                    Class<? extends EnvironmentModule> moduleClass = moduleProvider.getServerEnvironmentModule();
                    EnvironmentModule environmentModule;
                    try {
                        environmentModule = moduleClass.newInstance();
                    } catch (InstantiationException e) {
                        Logging.log("Failed to instantiate controller module!");
                        continue;
                    } catch (IllegalAccessException e) {
                        Logging.log("Failed to instantiate controller module!");
                        continue;
                    }
                    environmentModules.add(environmentModule);
                    totalRfPerTick += (int) (environmentModule.getRfPerTick() * volume);
                }
            }

        }
        return environmentModules;
    }

    @Override
    public int[] getSlotsForFace(EnumFacing side) {
        return CONTAINER_FACTORY.getAccessibleSlots();
    }

    @Override
    public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
        return CONTAINER_FACTORY.isOutputSlot(index);
    }

    @Override
    public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
        return CONTAINER_FACTORY.isInputSlot(index);
    }

    @Override
    public ItemStack decrStackSize(int index, int amount) {
        environmentModules = null;
        return inventoryHelper.decrStackSize(index, amount);
    }

    @Override
    public void setInventorySlotContents(int index, ItemStack stack) {
        inventoryHelper.setInventorySlotContents(getInventoryStackLimit(), index, stack);
        environmentModules = null;
    }

    @Override
    public int getInventoryStackLimit() {
        return 1;
    }

    @Override
    public boolean isUsableByPlayer(EntityPlayer player) {
        return canPlayerAccess(player);
    }

    @Override
    public InventoryHelper getInventoryHelper() {
        return inventoryHelper;
    }

    @Override
    public boolean isItemValidForSlot(int index, ItemStack stack) {
        return true;
    }

    @Override
    public void readFromNBT(NBTTagCompound tagCompound) {
        super.readFromNBT(tagCompound);
        totalRfPerTick = tagCompound.getInteger("rfPerTick");
        active = tagCompound.getBoolean("active");
    }

    @Override
    public void readRestorableFromNBT(NBTTagCompound tagCompound) {
        super.readRestorableFromNBT(tagCompound);
        readBufferFromNBT(tagCompound, inventoryHelper);
        radius = tagCompound.getInteger("radius");
        miny = tagCompound.getInteger("miny");
        maxy = tagCompound.getInteger("maxy");
        volume = -1;

        // Compatibility
        if (tagCompound.hasKey("whitelist")) {
            boolean wl = tagCompound.getBoolean("whitelist");
            mode = wl ? EnvironmentalMode.MODE_WHITELIST : EnvironmentalMode.MODE_BLACKLIST;
        } else {
            int m = tagCompound.getInteger("mode");
            mode = EnvironmentalMode.values()[m];
        }

        players.clear();
        NBTTagList playerList = tagCompound.getTagList("players", Constants.NBT.TAG_STRING);
        if (playerList != null) {
            for (int i = 0; i < playerList.tagCount(); i++) {
                String player = playerList.getStringTagAt(i);
                players.add(player);
            }
        }
    }

    @Override
    public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
        super.writeToNBT(tagCompound);
        tagCompound.setInteger("rfPerTick", totalRfPerTick);
        tagCompound.setBoolean("active", active);
        return tagCompound;
    }

    @Override
    public void writeRestorableToNBT(NBTTagCompound tagCompound) {
        super.writeRestorableToNBT(tagCompound);
        writeBufferToNBT(tagCompound, inventoryHelper);
        tagCompound.setInteger("radius", radius);
        tagCompound.setInteger("miny", miny);
        tagCompound.setInteger("maxy", maxy);

        tagCompound.setInteger("mode", mode.ordinal());

        NBTTagList playerTagList = new NBTTagList();
        for (String player : players) {
            playerTagList.appendTag(new NBTTagString(player));
        }
        tagCompound.setTag("players", playerTagList);
    }

    @Override
    public boolean execute(EntityPlayerMP playerMP, String command, TypedMap params) {
        boolean rc = super.execute(playerMP, command, params);
        if (rc) {
            return true;
        }
        if (CMD_ADDPLAYER.equals(command)) {
            addPlayer(params.get(PARAM_NAME));
            return true;
        } else if (CMD_DELPLAYER.equals(command)) {
            delPlayer(params.get(PARAM_NAME));
            return true;
        } else if (CMD_RSMODE.equals(command)) {
            setRSMode(RedstoneMode.values()[params.get(ImageChoiceLabel.PARAM_CHOICE_IDX)]);
            return true;
        } else if (CMD_SETRADIUS.equals(command)) {
            setRadius(params.get(ScrollableLabel.PARAM_VALUE));
            return true;
        } else if (CMD_SETMODE.equals(command)) {
            setMode(EnvironmentalMode.values()[params.get(PARAM_MODE)]);
            return true;
        } else if (CMD_SETBOUNDS.equals(command)) {
            setMiny(params.get(PARAM_MIN));
            setMaxy(params.get(PARAM_MAX));
            return true;
        }
        return false;
    }

    @Nonnull
    @Override
    public <T> List<T> executeWithResultList(String command, TypedMap args, Type<T> type) {
        List<T> rc = super.executeWithResultList(command, args, type);
        if (!rc.isEmpty()) {
            return rc;
        }
        if (CMD_GETPLAYERS.equals(command)) {
            return type.convert(getPlayersAsList());
        }
        return Collections.emptyList();
    }

    @Override
    public <T> boolean receiveListFromServer(String command, List<T> list, Type<T> type) {
        boolean rc = super.receiveListFromServer(command, list, type);
        if (rc) {
            return true;
        }
        if (CLIENTCMD_GETPLAYERS.equals(command)) {
            players = new HashSet<>(Type.STRING.convert(list));
            return true;
        }
        return false;
    }

    @Override
    public boolean shouldRenderInPass(int pass) {
        return pass == 1;
    }

    @Override
    public boolean isEmpty() {
        return false;
    }

    @Override
    public void onBlockBreak(World world, BlockPos pos, IBlockState state) {
        deactivate();
    }

    @Override
    @Optional.Method(modid = "theoneprobe")
    public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
        super.addProbeInfo(mode, probeInfo, player, world, blockState, data);
        int rfPerTick = getTotalRfPerTick();
        int volume = getVolume();
        if (isActive()) {
            probeInfo.text(TextFormatting.GREEN + "Active " + rfPerTick + " RF/tick (" + volume + " blocks)");
        } else {
            probeInfo.text(TextFormatting.GREEN + "Inactive (" + volume + " blocks)");
        }
        int radius = getRadius();
        int miny = getMiny();
        int maxy = getMaxy();
        probeInfo.text(TextFormatting.GREEN + "Area: radius " + radius + " (between " + miny + " and " + maxy + ")");
    }

    @SideOnly(Side.CLIENT)
    @Override
    @Optional.Method(modid = "waila")
    public void addWailaBody(ItemStack itemStack, List<String> currenttip, IWailaDataAccessor accessor, IWailaConfigHandler config) {
        super.addWailaBody(itemStack, currenttip, accessor, config);
        NBTTagCompound tagCompound = accessor.getNBTData();
        if (tagCompound != null) {
            int rfPerTick = getTotalRfPerTick();
            int volume = getVolume();
            if (isActive()) {
                currenttip.add(TextFormatting.GREEN + "Active " + rfPerTick + " RF/tick (" + volume + " blocks)");
            } else {
                currenttip.add(TextFormatting.GREEN + "Inactive (" + volume + " blocks)");
            }
            int radius = getRadius();
            int miny = getMiny();
            int maxy = getMaxy();
            currenttip.add(TextFormatting.GREEN + "Area: radius " + radius + " (between " + miny + " and " + maxy + ")");
        }
    }

}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>vn.ducquoc.cc</groupId>
  <artifactId>execute-cc</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>execute-cc</name>
  <url>https://bitbucket.org/dqprotected/dq-protected/src/master/cc-dq/</url>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.7</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.16.12</version>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <url>https://jcenter.bintray.com/</url>
      <id>jcenter</id>
    </repository>
    <repository>
      <url>https://repository.sonatype.org/content/groups/public/</url>
      <id>sonatype</id>
    </repository>
    <repository>
      <url>https://repo.spring.io/libs-milestone/</url>
      <id>spring-libs-milestone</id>
    </repository>
  </repositories>
<!-- https://mvnrepository.com/repos/central -->

<!--
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
-->

</project>

redpajama_set_name: RedPajamaGithub


text:
from __future__ import absolute_import, division, unicode_literals

from collections import OrderedDict

import pytest

import html5lib
from html5lib.filters.alphabeticalattributes import Filter
from html5lib.serializer import HTMLSerializer

@pytest.mark.parametrize('msg, attrs, expected_attrs', [
    (
        'no attrs',
        {},
        {}
    ),
    (
        'one attr',
        {(None, 'alt'): 'image'},
        OrderedDict([((None, 'alt'), 'image')])
    ),
    (
        'multiple attrs',
        {
            (None, 'src'): 'foo',
            (None, 'alt'): 'image',
            (None, 'style'): 'border: 1px solid black;'
        },
        OrderedDict([
            ((None, 'alt'), 'image'),
            ((None, 'src'), 'foo'),
            ((None, 'style'), 'border: 1px solid black;')
        ])
    ),
])
def test_alphabetizing(msg, attrs, expected_attrs):
    tokens = [{'type': 'StartTag', 'name': 'img', 'data': attrs}]
    output_tokens = list(Filter(tokens))

    attrs = output_tokens[0]['data']
    assert attrs == expected_attrs

def test_with_different_namespaces():
    tokens = [{
        'type': 'StartTag',
        'name': 'pattern',
        'data': {
            (None, 'id'): 'patt1',
            ('http://www.w3.org/1999/xlink', 'href'): '#patt2'
        }
    }]
    output_tokens = list(Filter(tokens))

    attrs = output_tokens[0]['data']
    assert attrs == OrderedDict([
        ((None, 'id'), 'patt1'),
        (('http://www.w3.org/1999/xlink', 'href'), '#patt2')
    ])

def test_with_serializer():
    """Verify filter works in the context of everything else"""
    parser = html5lib.HTMLParser()
    dom = parser.parseFragment('<svg><pattern xlink:href="#patt2" id="patt1"></svg>')
    walker = html5lib.getTreeWalker('etree')
    ser = HTMLSerializer(
        alphabetical_attributes=True,
        quote_attr_values='always'
    )

    # FIXME(willkg): The "xlink" namespace gets dropped by the serializer. When
    # that gets fixed, we can fix this expected result.
    assert (
        ser.render(walker(dom)) ==
        '<svg><pattern id="patt1" href="#patt2"></pattern></svg>'
    )


text:
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ash/tether/fake_tether_service.h"

namespace ash {
namespace tether {

namespace {

constexpr char kTetherGuidPrefix[] = "tether-guid-";
constexpr char kTetherNamePrefix[] = "tether";
constexpr char kCarrier[] = "FakeCarrier";

}  // namespace

FakeTetherService::FakeTetherService(
    Profile* profile,
    chromeos::PowerManagerClient* power_manager_client,
    chromeos::device_sync::DeviceSyncClient* device_sync_client,
    chromeos::secure_channel::SecureChannelClient* secure_channel_client,
    chromeos::multidevice_setup::MultiDeviceSetupClient*
        multidevice_setup_client,
    chromeos::NetworkStateHandler* network_state_handler,
    session_manager::SessionManager* session_manager)
    : TetherService(profile,
                    power_manager_client,
                    device_sync_client,
                    secure_channel_client,
                    multidevice_setup_client,
                    network_state_handler,
                    session_manager) {}

void FakeTetherService::StartTetherIfPossible() {
  if (GetTetherTechnologyState() !=
      chromeos::NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED) {
    return;
  }

  for (int i = 0; i < num_tether_networks_; ++i) {
    network_state_handler()->AddTetherNetworkState(
        kTetherGuidPrefix + std::to_string(i),
        kTetherNamePrefix + std::to_string(i), kCarrier,
        100 /* battery_percentage */, 100 /* signal_strength */,
        false /* has_connected_to_host */);
  }
}

void FakeTetherService::StopTetherIfNecessary() {
  for (int i = 0; i < num_tether_networks_; ++i) {
    network_state_handler()->RemoveTetherNetworkState(kTetherGuidPrefix + i);
  }
}

bool FakeTetherService::HasSyncedTetherHosts() const {
  return true;
}

}  // namespace tether
}  // namespace ash


text:
using SharpDebug.Engine;
using SharpDebug.Engine.Debuggers;
using DbgEng;

namespace SharpDebug
{
    /// <summary>
    /// Class Describing Debugger Event.
    /// </summary>
    public class DebugEventInfo
    {
        /// <summary>
        /// Event Type.
        /// </summary>
        public DebugEvent Type;

        /// <summary>
        /// Process where Event occurred.
        /// </summary>
        public Process Process;

        /// <summary>
        /// Thread where Event occurred.
        /// </summary>
        public Thread Thread;

        /// <summary>
        /// Event description.
        /// </summary>
        public string Description;

        /// <summary>
        /// Serialized Event Details.
        /// </summary>
        public byte[] EventExtraInfo;

        /// <summary>
        /// Get Last occurred Event or Exception.
        /// </summary>
        public static DebugEventInfo LastEvent => ((DbgEngDll)Context.Debugger).GetLastEventInfo();
    }
}


text:
function number_format(number, decimals, dec_point, thousands_sep) {
    //   example 1: number_format(1234.56);
    //   returns 1: '1,235'
    //   example 2: number_format(1234.56, 2, ',', ' ');
    //   returns 2: '1 234,56'
    //   example 3: number_format(1234.5678, 2, '.', '');
    //   returns 3: '1234.57'
    //   example 4: number_format(67, 2, ',', '.');
    //   returns 4: '67,00'
    //   example 5: number_format(1000);
    //   returns 5: '1,000'
    //   example 6: number_format(67.311, 2);
    //   returns 6: '67.31'
    //   example 7: number_format(1000.55, 1);
    //   returns 7: '1,000.6'
    //   example 8: number_format(67000, 5, ',', '.');
    //   returns 8: '67.000,00000'
    //   example 9: number_format(0.9, 0);
    //   returns 9: '1'
    //  example 10: number_format('1.20', 2);
    //  returns 10: '1.20'
    //  example 11: number_format('1.20', 4);
    //  returns 11: '1.2000'
    //  example 12: number_format('1.2000', 3);
    //  returns 12: '1.200'
    //  example 13: number_format('1 000,50', 2, '.', ' ');
    //  returns 13: '100 050.00'
    //  example 14: number_format(1e-8, 8, '.', '');
    //  returns 14: '0.00000001'

    number = (number + '')
        .replace(/[^0-9+\-Ee.]/g, '');
    var n = !isFinite(+number) ? 0 : +number,
        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
        sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
        dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
        s = '',
        toFixedFix = function(n, prec) {
            var k = Math.pow(10, prec);
            return '' + (Math.round(n * k) / k)
                .toFixed(prec);
        };
    // Fix for IE parseFloat(0.55).toFixed(0) = 0;
    s = (prec ? toFixedFix(n, prec) : '' + Math.round(n))
        .split('.');
    if (s[0].length > 3) {
        s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
    }
    if ((s[1] || '')
        .length < prec) {
        s[1] = s[1] || '';
        s[1] += new Array(prec - s[1].length + 1)
            .join('0');
    }
    return s.join(dec);
}

$(document).ready(function(){

    $('body').fadeIn(1000);

    //АВТОРИЗАЦИЯ
    /*var auth_form = $(".auth_form");

    auth_form.on('click', 'input[type=submit]', function(e){
        e.preventDefault();

        $(this).attr('disabled', 'disabled');
        $('.loading').css('visibility', 'visible');

        var form = $(".auth_form");
        var email = $("#user_name_email").val();
        var password = $("#user_name_password").val();
        var url = $("#auth_form").attr('action');

        $.post(url,{
                email: email,
                password: password
            },
            function(response){
                if(response.code == 100 && response.success){ //dummy check
                    if(response.error == 'OK'){
                        var user = response.user;
                        var html = '
Добро пожаловать, ' + user.name + '
' + '
Кабинет
' + "
Выйти
";
                        form.fadeOut(500);
                        setTimeout(function(){
                            form.html(html);
                            form.fadeIn(500);
                            $('.nav-main').parent().append('
Добавить авто
');
                        }, 500);
                        if(window.location.href == 'http://localhost/Symfony/web/app_dev.php/add-auto'){
                            window.location.href = 'http://localhost/Symfony/web/app_dev.php/add-auto';
                        }
                        if(window.location.href == 'http://localhost/Symfony/web/app_dev.php/'){
                            window.location.href = 'http://localhost/Symfony/web/app_dev.php/';
                        }
                        if(window.location.href == 'http://localhost/Symfony/web/app_dev.php/profile'){
                            window.location.href = 'http://localhost/Symfony/web/app_dev.php/profile';
                        }

                    }else{
                        $('.loading').css('visibility', 'hidden');
                        auth_form.find('input[type=submit]').removeAttr('disabled');
                        alert(response.error);
                    }

                }else{
                    alert('An undefined error has been occured!');
                }

            }, "json");
    });*/

    //АВТОРИЗАЦИЯ - Выход
    /*auth_form.on('click', '#logout', function(e){
        e.preventDefault();

        var form = $(".auth_form");
        var url = '/Symfony/web/app_dev.php/update/data/from/ajax/call/logout';

        $.post(url,{
          data: 'logout'
        },
            function(response){
                if(response.code == 100 && response.success){ //dummy check
                 var html = '<form action="/Symfony/web/app_dev.php/update/data/from/ajax/call/auth" method="post"  id="auth_form">' + '' + 'E-mail: ' + '<input type="email" id="user_name_email" name="user_name[email]" required="required" />' + 'Пароль: ' + '<input type="password" id="user_name_password" name="user_name[password]" required="required" />' + '<input type="submit" value="Войти" />' + '</form>' + '
Зарегестрироваться
';
                 var add_form_html = '

Для добавления автомобиля необходимо сначала авторизоваться
' + '
Зарегестрироваться

';

                        form.fadeOut(500);
                        $('.add_form').fadeOut(500);
                        $('.nav-add-auto').fadeOut(500);

                    $('.add').after(add_form_html);
                        setTimeout(function(){
                            form.html(html);
                            $('.add_form').remove();
                            $('.nav-add-auto').remove();
                            form.fadeIn(500);
                            $('.notice_wrapper').fadeIn(500);
                        }, 500);

                    if(window.location.href == 'http://localhost/Symfony/web/app_dev.php/'){
                        window.location.href = 'http://localhost/Symfony/web/app_dev.php/';
                    }
                    if(window.location.href == 'http://localhost/Symfony/web/app_dev.php/profile'){
                        window.location.href = 'http://localhost/Symfony/web/app_dev.php/';
                    }
                    if(window.location.href == 'http://localhost/Symfony/web/app_dev.php/cabinet'){
                        window.location.href = 'http://localhost/Symfony/web/app_dev.php/';
                    }
                    if(window.location.href == 'http://localhost/Symfony/web/app_dev.php/zayavka-list'){
                        window.location.href = 'http://localhost/Symfony/web/app_dev.php/';
                    }

                }else{
                    alert('An undefined error has been occured!');
                }

            }, "json");
    });*/

    /* ZAYAVKA FORM */
    var zayavka_form_layout = $('#zayavka_form_layout');
    var zayavka_form = $('#form_zayavka');

    $('#submit_zayavka').click(function(e) {
        e.preventDefault();

        zayavka_form_layout.fadeIn(500);

    });
    $('.close_zayavka_form').click(function(e) {
        e.preventDefault();
        e.stopPropagation();

        if(!zayavka_form_layout.is(':animated')){
            zayavka_form_layout.fadeOut(500);
        }

    });
    // MODEL FIELD
    function gettingModels(select){
        var model_select = $("#add_zayavka_auto_model");
        model_select.attr('disabled', 'disabled');

        var url = select.data('url');
        var mark_id = select.val();
        var model = model_select.data('model');

        getModels(model_select, url, mark_id, model);

    }

        zayavka_form.on('change', '#add_zayavka_auto_mark', function(){
            gettingModels($(this));
        });

        var add_zayavka_mark_select = $("#add_zayavka_auto_mark");
        var add_zayavka_model_select = $("#add_zayavka_auto_model");
            var mark = add_zayavka_mark_select.data('mark');
            var model = add_zayavka_model_select.data('model');
                gettingModels(add_zayavka_mark_select);

    // YEAR FIELD
        zayavka_form.on('change', '#add_zayavka_auto_model', function(){
            if($(this).val() != '0'){
                var year_select = $("#add_zayavka_auto_year");
                year_select.attr('disabled', 'disabled');

                var url = $(this).data('url');
                var model_id = $(this).val();

                getYear(year_select, url, model_id);
            }
        });

        // SENDING ZAYAVKA
            zayavka_form.on('click', '#send_zayavka', function(e){

                $(this).attr('disabled', 'disabled');

                var region = $("#add_zayavka_auto_region option:selected").text();
                var mark = $("#add_zayavka_auto_mark option:selected").text();
                var model = $("#add_zayavka_auto_model option:selected").text();
                var year = $("#add_zayavka_auto_year option:selected").text();
                var body = $("#add_zayavka_auto_body").val();
                var run = $("#add_zayavka_auto_run").val();
                var color = $("#add_zayavka_auto_color").val();
                var new_old;
                if($("#add_zayavka_auto_new").prop("checked")){
                    new_old = '1';
                }else{
                    new_old = '0';
                }
                var price = $("#add_zayavka_auto_price").val();
                var description = $("#add_zayavka_auto_description").val();
                var url = $("#form_zayavka").attr('action');

                //alert(region + ' ' + mark + ' ' + model + ' ' + year + ' ' + body + ' ' + run + ' ' + color + ' ' + price + ' ' + new_old + ' ' + description);

                $.post(url,{
                        region: region,
                        mark: mark,
                        model: model,
                        year: year,
                        body: body,
                        run: run,
                        color: color,
                        price: price,
                        new_old: new_old,
                        description: description
                    },
                    function(response){
                        if(response.code == 100 && response.success){ //dummy check

                            $('#zayavka_form_content').fadeOut(500, function(){
                               $(this).empty().append('
Ваша заявка успешно отправлена! Мы рассмотрим ее в ближайшее время.
').fadeIn(500);
                            });
                            //alert('new: ' + response.new + ' userid: ' + response.user_id + ' region: ' + response.region + ' mark: ' + response.mark + ' model: ' + response.model + ' year: ' + response.year + ' body: ' + response.body + ' run: ' + response.run + ' color: ' + response.color + ' price: ' + response.price +  ' description: ' + response.description);
                        }else{
                            alert(response.error);
                        }
                        zayavka_form.find('input[type=submit]').removeAttr('disabled');
                    }, "json");

                return false;
            });

    function getModels(select, url, mark_id, model){
        select.attr('disabled', 'disabled');
        $.post(url,{
                mark_id: mark_id
            },
            function(response){
                if(response.code == 100 && response.success){ //dummy check
                    //alert(typeof(response.models));
                    var models = response.models;
                    var html = '<option value="0">Выберете модель</option>';
                    for(var i = 0; i < models.length; i++) {
                        html += "<option value='" + models[i].id + "'>" + models[i].model + "</option>"
                    }
                    select.empty().html(html).removeAttr('disabled');
                    if(model != ''){
                        select.find('option:contains('+ model +')').attr('selected', 'selected');
                    }
                }else{
                    alert('An undefined error has been occured!');
                }
                select.removeAttr('disabled');

            }, "json");
    }

    function getYear(select, url, model_id){
        $.post(url,{
                model_id: model_id
            },
            function(response){
                if(response.code == 100 && response.success){ //dummy check
                    //alert(typeof(response.models));
                    var year = response.year;
                    var html = "";
                    for(var i = 0; i < year.length; i++) {
                        html += "<option value='" + year[i].id + "'>" + year[i].year + "</option>"
                    }
                    select.empty().html(html).removeAttr('disabled');
                }else{
                    alert('An undefined error has been occured!');
                }

            }, "json");
    }

    // ДОБАВЛЕНИЕ АВТО - ПОЛЕ ВЫБОРА МОДЕЛИ
        var add_form = $('.add_auto');

        add_form.on('change', '#add_auto_mark', function(){
            var model_select = $("#add_auto_model");

            var url = $(this).data('url');
            var mark_id = $(this).val();
            var model = model_select.data('model');
            getModels(model_select, url, mark_id, model);
        });

        var add_auto_mark_select = $("#add_auto_mark");
        var add_auto_model_select = $("#add_auto_model");
            model = add_auto_model_select.data('model');
            getModels(add_auto_model_select, add_auto_mark_select.data('url'), add_auto_mark_select.val(), model);

    // ДОБАВЛЕНИЕ АВТО - ПОЛЕ ВЫБОРА ГОДА ВЫПУСКА
    add_form.on('change', '#add_auto_model', function(){
        var year_select = $("#add_auto_year");
            year_select.attr('disabled', 'disabled');

        var url = $(this).data('url');
        var model_id = $(this).val();

        getYear(year_select, url, model_id);
    });

    /* ДОБАВЛЕНИЕ АВТО, ЗАЯВКИ -  ПОЛЕ ВЫБОРА ЦВЕТА  */
        $('#add_auto_color, #add_zayavka_auto_color').ColorPicker({
            onSubmit: function(hsb, hex, rgb, el) {
                $(el).val(hex);
                $(el).ColorPickerHide();
            },
            onBeforeShow: function () {
                $(this).ColorPickerSetColor(this.value);
            },
            onChange: function (hsb, hex, rgb) {
                $('.color_box').css('backgroundColor', '#' + hex);
            }
        })
            .bind('keyup', function(){
                $(this).ColorPickerSetColor(this.value);
            });

    // REGISTRATION NEW USER - CITY FORM FIELD
    $('.add_form').on('change', '#user_name_region', function(){
        var city_select = $("#user_name_city");
        city_select.attr('disabled', 'disabled');
        var url = $(this).data('url');
        var region_id = $(this).val();
        $.post(url,{
                region_id: region_id
            },
            function(response){
                if(response.code == 100 && response.success){ //dummy check
                    var city = response.city;
                    var html = "";
                    for(var i = 0; i < city.length; i++) {
                        html += "<option value='" + city[i].id + "'>" + city[i].name + "</option>"
                    }
                    city_select.empty().html(html).removeAttr('disabled');
                }else{
                    alert('An undefined error has been occured!');
                }

            }, "json");
    });

    // SLIDER AUTO =-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=--=-=-=-=-=--=-=-=
    var slider_wrap = $('.slider-wrapper');

        //SLIDER AUTO - tabs switch
        slider_wrap.on('click', '.tab_slider', function(e){
            e.preventDefault();

            $('.tab_slider').removeClass('active_slider');
            $(this).addClass('active_slider');
            $('.slider-block').hide();
            if($(this).data('slider') == 'new'){
                $('.new_slider_block').show();
            }else{
                $('.bu_slider_block').show();
            }

        });

    // FILTER AUTO - MODEL FORM FIELD
    var filter_form = $('.filter_form');

    filter_form.on('change', '#filter_auto_mark', function(){
        var model_select = $("#filter_auto_model");
        model_select.attr('disabled', 'disabled');
        var url = $(this).data('url');
        var mark_id = $(this).val();
        $.post(url,{
                mark_id: mark_id
            },
            function(response){
                if(response.code == 100 && response.success){ //dummy check
                    //alert(typeof(response.models));
                    var models = response.models;
                    var html = '<option value="0" selected >Выберете модель</option>';
                    for(var i = 0; i < models.length; i++) {
                        html += "<option value='" + models[i].id + "'>" + models[i].model + "</option>"
                    }
                    model_select.empty().html(html).removeAttr('disabled');
                }else{
                    alert('An undefined error has been occured!');
                }

            }, "json");
    });

        /* MINI SLIDER-CAROUSEL  BU cars*/
            var bu_mini_slider = $('.bu_mini_slider');
            var bu_items_block = $('.bu_mini_slider .mini_slider_items');
            var bu_header_block = $('.bu_slider_block .headers_slider');

            //ROTATE FORWARD
            bu_mini_slider.on('click', '.next_car', function(){
                if(!bu_items_block.is(':animated')){
                    bu_items_block.animate({'left' : '-=110px'}, 400, function(){
                        bu_items_block
                            .find('.small_car:first')
                            .appendTo(bu_items_block)
                            .parent()
                            .css('left', '0');
                    });
                    bu_header_block.animate({'left' : '-=110px'}, 400, function(){
                        bu_header_block
                            .find('.carname:first')
                            .appendTo(bu_header_block)
                            .parent()
                            .css('left', '0');
                    });
                }
            });

            //ROTATE BACKWARD
            bu_mini_slider.on('click', '.previous_car', function(){
                if(!bu_items_block.is(':animated')){
                    bu_items_block
                        .css('left', '-110px')
                        .find('.small_car:last')
                        .prependTo(bu_items_block)
                        .parent()
                        .animate({'left' : '0'}, 400);
                    bu_header_block
                            .css('left', '-110px')
                            .find('.carname:last')
                            .prependTo(bu_header_block)
                            .parent()
                        .animate({'left' : '0'}, 400);
                }
            });

            // SHOW BIGCAR ONCLICK SMALL PICTURE
            var bu_main_block = $('.bu_slide .large_car');

            bu_mini_slider.on('click', '.small_car', function(e){
                e.preventDefault();
               var info_car = $(this).find('.info_about_car');

               var link = info_car.data('link');
               var mark = info_car.data('mark');
               var model = info_car.data('model');
               var year = info_car.data('year');
               var run = info_car.data('run');
               var price = info_car.data('price');
               var img = $(this).find('img').attr('src');
                //alert(mark + ' ' + model + ' ' + year + ' ' + price + ' ' + img);

                bu_main_block.find('img').attr('src', img).attr('alt', model);
                bu_main_block.find('a').attr('href', link);
                bu_main_block.find('.car_mark').text(mark);
                bu_main_block.find('.car_model').text(model);
                bu_main_block.find('.car_year').text(year);
                bu_main_block.find('.car_run').text(run);
                bu_main_block.find('.car_price').text(price);
            });

        /* MINI SLIDER-CAROUSEL  NEW cars*/
        var new_mini_slider = $('.new_mini_slider');
        var new_items_block = $('.new_mini_slider .mini_slider_items');
        var new_header_block = $('.new_slider_block .headers_slider');

        //ROTATE FORWARD
        new_mini_slider.on('click', '.next_car', function(){
            if(!new_items_block.is(':animated')){
                new_items_block.animate({'left' : '-=110px'}, 400, function(){
                    new_items_block
                        .find('.small_car:first')
                        .appendTo(new_items_block)
                        .parent()
                        .css('left', '0');
                });
                new_header_block.animate({'left' : '-=110px'}, 400, function(){
                    new_header_block
                        .find('.carname:first')
                        .appendTo(new_header_block)
                        .parent()
                        .css('left', '0');
                });
            }
        });

        //ROTATE BACKWARD
        new_mini_slider.on('click', '.previous_car', function(){
            if(!new_items_block.is(':animated')){
                new_items_block
                    .css('left', '-110px')
                    .find('.small_car:last')
                    .prependTo(new_items_block)
                    .parent()
                    .animate({'left' : '0'}, 400);
                new_header_block
                    .css('left', '-110px')
                    .find('.carname:last')
                    .prependTo(new_header_block)
                    .parent()
                    .animate({'left' : '0'}, 400);
            }
        });

        // SHOW BIGCAR ONCLICK SMALL PICTURE
        var new_main_block = $('.new_slide .large_car');

        new_mini_slider.on('click', '.small_car', function(e){
            e.preventDefault();

            var info_car = $(this).find('.info_about_car');

            var link = info_car.data('link');
            var mark = info_car.data('mark');
            var model = info_car.data('model');
            var year = info_car.data('year');
            var run = info_car.data('run');
            var price = info_car.data('price');
            var img = $(this).find('img').attr('src');
            //alert(mark + ' ' + model + ' ' + year + ' ' + price + ' ' + img);

            new_main_block.find('img').attr('src', img).attr('alt', model);
            new_main_block.find('a').attr('href', link);
            new_main_block.find('.car_mark').text(mark);
            new_main_block.find('.car_model').text(model);
            new_main_block.find('.car_year').text(year);
            new_main_block.find('.car_run').text(run);
            new_main_block.find('.car_price').text(price);
        });

    /* ADD COMMENT */
    var comments = $("#comments");

    comments.on('click', 'input[type=submit]', function(e){
        e.preventDefault();

        var form = comments.find('form');
        var level = parseInt(form.prev().data('level'));
            if(isNaN(level)){
                level = 0;
            }

        var parent_id = 0;
        var margin = '0px';
        if (form.hasClass('form_answer')){
            parent_id = form.prev().data('id');
            margin = (level * 50) + 'px';
        }

        var url = form.attr('action');

        var name = form.find('#comment_name').val();
        var email = form.find('#comment_email').val();
        var text = form.find('#comment_text').val();
        var auto_id = comments.data('car');

        $.post(url,{
                auto_id: auto_id,
                parent_id: parent_id,
                name: name,
                email: email,
                text: text
            },
            function(response){
                if(response.code == 100 && response.success){ //dummy check
                    var datalevel = ++level;
                    var html ='';
                    if(parent_id != 0){
                        html += '
';
                    }else{
                        html += '
';
                    }
                    html += '
';
                    html += '';
                    html += '
';
                    html += '
';
                    html += '
';
                    html += '
' + response.name + '
';
                    html += '
' + response.date + '
';
                    html += '

';
                    html += '
';
                    html += '
' + response.text + '
';
                    html += '

';
                    if(level < 4){
                        html += 'Ответить';
                    }
                    html += '
';

                    form[0].reset();
                    form.after(html);
                    form.next('.comment').css('marginLeft', margin).hide().fadeIn(800)
                }else{
                    alert(response.error);
                }

            }, "json");

    });

    // ADD COMENT - ANSWER
    comments.on('click', '.comment_answer', function(e){
        e.preventDefault();

        var form = comments.find('form');
        comments.find('#add_comment_button').remove();
        $(this).parent().after(form);
        var margin = (parseInt(form.prev().data('level')) * 50) + 'px';
        form.addClass('form_answer');
        form.css('marginLeft', margin);
        $(this).parent().parent().prepend('Добавить комментарий');
    });

    comments.on('click', '#add_comment_button', function(e){
        e.preventDefault();

        var form = comments.find('form');
        form.insertAfter($(this));
        form.removeClass('form_answer').css('marginLeft', '0');
        $(this).remove();
    });

}); // end ready


text:
import * as React from 'react';
import { expect } from 'chai';
import { createShallow, getClasses } from '@material-ui/core/test-utils';
import createMount from 'test/utils/createMount';
import describeConformance from '../test-utils/describeConformance';
import DialogTitle from './DialogTitle';

describe('<DialogTitle />', () => {
  const mount = createMount();
  let shallow;
  let classes;

  before(() => {
    shallow = createShallow({ dive: true });
    classes = getClasses(<DialogTitle>foo</DialogTitle>);
  });

  describeConformance(<DialogTitle>foo</DialogTitle>, () => ({
    classes,
    inheritComponent: 'div',
    mount,
    refInstanceof: window.HTMLDivElement,
    skip: ['componentProp'],
  }));

  it('should render JSX children', () => {
    const children =
Hello
;
    const wrapper = shallow(<DialogTitle disableTypography>{children}</DialogTitle>);
    expect(wrapper.childAt(0).equals(children)).to.equal(true);
  });

  it('should render string children as given string', () => {
    const children = 'Hello';
    const wrapper = shallow(<DialogTitle>{children}</DialogTitle>);
    expect(wrapper.childAt(0).props().children).to.equal(children);
  });
});


text:
This is a simple implementaion of paper Neural [Image Caption][^1] based on mxnet.
Some codes refer [where-to-image](https://github.com/mtanti/where-image)

### Usage

1. Prepare the datasets and pre_train params to dirs `datasets` and `pre_train`, here we use pretrain-model is vgg-16, datasets are Filckr8k, you could replace it with your datasets and pretrain_model. For Flickr8k, which includes images and captions, captions are store in dataset.json, looks like following:
```
{"images":
    [
        {"sentids": [0, 1, 2, 3, 4],
        "imgid": 0,
        "sentences": [
        {"tokens": ["a", "black", "dog", "is", "running", "after", "a", "white", "dog", "in", "the", "snow"], "raw": "A black dog is running after a white dog in the snow .", "imgid": 0, "sentid": 0},
        {"tokens": ["black", "dog", "chasing", "brown", "dog", "through", "snow"], "raw": "Black dog chasing brown dog through snow", "imgid": 0, "sentid": 1},
        {"tokens": ["two", "dogs", "chase", "each", "other", "across", "the", "snowy", "ground"], "raw": "Two dogs chase each other across the snowy ground .", "imgid": 0, "sentid": 2},
        {"tokens": ["two", "dogs", "play", "together", "in", "the", "snow"], "raw": "Two dogs play together in the snow .", "imgid": 0, "sentid": 3},
        {"tokens": ["two", "dogs", "running", "through", "a", "low", "lying", "body", "of", "water"], "raw": "Two dogs running through a low lying body of water .", "imgid": 0, "sentid": 4}
                    ],
        "split": "train", "filename": "2513260012_03d33305cf.jpg"}, ...

    ],
"datasets":Flickr8k}
```
or you can download processed data from [here](http://cs.stanford.edu/people/karpathy/deepimagesent/), which image are extracted from vgg networks 4096-dim, and unzip them into dir 'datasets',
then copy file which in "old" dir into root dir, and run it, this is a old version about NIC.

2. After data downloading completes, you can run:
```
python 1_preprocess_data.py
```
when it runs over, there will be a directory named "processed_data" which include train, val and test datasets which are splited by "split" key in dataset.json .

3. `python 2_train_val.py` to train model on your dataset and save you dataset.

4. There are something wrong with test stage(predict), (variable length for sym, I think I should use `mx.mod.BuckingModule`), I am trying~~~~~~~~~~~, if you find the solution, welcome to
issue me.

### Reference
[^1]: Vinyals O, Toshev A, Bengio S, et al. Show and tell: A neural image caption generator[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. 2015: 3156-3164.


text:
require 'rubygems'
require 'bundler'

Bundler.require

file = ARGV[0] || 'demo.psd'

psd = PSD.new(file, parse_layer_images: true)

psd.parse!

psd.tree.descendant_layers.each do |child|
  if child.text
    # puts child.text
    puts "Found text layer — " + child.text[:value]
    puts "Font name:              " + child.text[:font][:name]
    puts "Font size(s) in points: " + child.text[:font][:sizes].join(",")
    puts "Font color(s) in RGBA:  " + child.text[:font][:colors].join(",")
    puts "JSON: "
    puts JSON.generate(child.text)
    puts "\n"
  end
end


text:
package com.facebook.buck.rust;

import static com.facebook.buck.rust.RustLinkables.ruleToCrateName;

import com.facebook.buck.cxx.CxxPlatform;
import com.facebook.buck.cxx.CxxPlatforms;
import com.facebook.buck.cxx.Linker;
import com.facebook.buck.cxx.LinkerProvider;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.rules.AbstractDescriptionArg;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.CellPathResolver;
import com.facebook.buck.rules.Description;
import com.facebook.buck.rules.ImplicitDepsInferringDescription;
import com.facebook.buck.rules.SourcePath;
import com.facebook.buck.rules.SourcePathResolver;
import com.facebook.buck.rules.TargetGraph;
import com.facebook.buck.rules.ToolProvider;
import com.facebook.infer.annotation.SuppressFieldNotInitialized;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableSortedSet;

import java.util.List;
import java.util.Optional;

public class RustLibraryDescription implements
    Description<RustLibraryDescription.Arg>,
    ImplicitDepsInferringDescription<RustLibraryDescription.Arg> {

  private final RustBuckConfig rustBuckConfig;
  private final CxxPlatform cxxPlatform;

  public RustLibraryDescription(
      RustBuckConfig rustBuckConfig,
      CxxPlatform cxxPlatform) {
    this.rustBuckConfig = rustBuckConfig;
    this.cxxPlatform = cxxPlatform;
  }

  @Override
  public Arg createUnpopulatedConstructorArg() {
    return new Arg();
  }

  @Override
  public <A extends Arg> BuildRule createBuildRule(
      TargetGraph targetGraph,
      BuildRuleParams params,
      BuildRuleResolver resolver,
      A args) {
    LinkerProvider linker =
        rustBuckConfig.getLinkerProvider(cxxPlatform, cxxPlatform.getLd().getType());

    ImmutableList.Builder<String> rustcArgs = ImmutableList.builder();

    rustcArgs.addAll(rustBuckConfig.getRustLibraryFlags());
    rustcArgs.addAll(args.rustcFlags);

    return new RustLibrary(
        params,
        new SourcePathResolver(resolver),
        args.crate.orElse(ruleToCrateName(params.getBuildTarget().getShortName())),
        args.crateRoot,
        ImmutableSortedSet.copyOf(args.srcs),
        ImmutableSortedSet.copyOf(args.features),
        rustcArgs.build(),
        () -> rustBuckConfig.getRustCompiler().resolve(resolver),
        () -> linker.resolve(resolver),
        rustBuckConfig.getLinkerArgs(cxxPlatform),
        args.linkStyle.orElse(Linker.LinkableDepType.STATIC));
  }

  @Override
  public Iterable<BuildTarget> findDepsForTargetFromConstructorArgs(
      BuildTarget buildTarget,
      CellPathResolver cellRoots,
      Arg constructorArg) {
    ImmutableSet.Builder<BuildTarget> deps = ImmutableSet.builder();

    ToolProvider compiler = rustBuckConfig.getRustCompiler();
    deps.addAll(compiler.getParseTimeDeps());

    deps.addAll(CxxPlatforms.getParseTimeDeps(cxxPlatform));

    return deps.build();
  }

  @SuppressFieldNotInitialized
  public static class Arg extends AbstractDescriptionArg {
    public ImmutableSortedSet<SourcePath> srcs;
    public ImmutableSortedSet<String> features = ImmutableSortedSet.of();
    public List<String> rustcFlags = ImmutableList.of();
    public ImmutableSortedSet<BuildTarget> deps = ImmutableSortedSet.of();
    public Optional<Linker.LinkableDepType> linkStyle;
    public Optional<String> crate;
    public Optional<SourcePath> crateRoot;
  }
}


text:
package quotapb

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	empty "github.com/golang/protobuf/ptypes/empty"
	_ "google.golang.org/genproto/googleapis/api/annotations"
	field_mask "google.golang.org/genproto/protobuf/field_mask"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

// Possible states of a quota configuration.
type Config_State int32

const (
	// Unknown quota state. Invalid.
	Config_UNKNOWN_CONFIG_STATE Config_State = 0
	// Quota is enabled.
	Config_ENABLED Config_State = 1
	// Quota is disabled (considered infinite).
	Config_DISABLED Config_State = 2
)

var Config_State_name = map[int32]string{
	0: "UNKNOWN_CONFIG_STATE",
	1: "ENABLED",
	2: "DISABLED",
}

var Config_State_value = map[string]int32{
	"UNKNOWN_CONFIG_STATE": 0,
	"ENABLED":              1,
	"DISABLED":             2,
}

func (x Config_State) String() string {
	return proto.EnumName(Config_State_name, int32(x))
}

func (Config_State) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{0, 0}
}

// Possible views for ListConfig.
type ListConfigsRequest_ListView int32

const (
	// Only the Config name gets returned.
	ListConfigsRequest_BASIC ListConfigsRequest_ListView = 0
	// Complete Config.
	ListConfigsRequest_FULL ListConfigsRequest_ListView = 1
)

var ListConfigsRequest_ListView_name = map[int32]string{
	0: "BASIC",
	1: "FULL",
}

var ListConfigsRequest_ListView_value = map[string]int32{
	"BASIC": 0,
	"FULL":  1,
}

func (x ListConfigsRequest_ListView) String() string {
	return proto.EnumName(ListConfigsRequest_ListView_name, int32(x))
}

func (ListConfigsRequest_ListView) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{6, 0}
}

// Configuration of a quota.
//
// Quotas contain a certain number of tokens that get applied to their
// corresponding entities. Global quotas apply to all operations, tree and user
// quotas to certain trees and users, respectively.
//
// Performing an operation costs a certain number of tokens (usually one). Once
// a quota has no more tokens available, requests that would subtract from it
// are denied with a resource_exhausted error.
//
// Tokens may be replenished in two different ways: either by passage of time or
// sequencing progress. Time-based replenishment adds a fixed amount of tokens
// after a certain interval. Sequencing-based adds a token for each leaf
// processed by the sequencer. Sequencing-based replenishment may only be used
// with global and tree quotas.
//
// A quota may be disabled or removed at any time. The effect is the same: a
// disabled or non-existing quota is considered infinite by the quota system.
// (Disabling is handy if you plan to re-enable a quota later on.)
type Config struct {
	// Name of the config, eg, "quotas/trees/1234/read/config".
	// Readonly.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// State of the config.
	State Config_State `protobuf:"varint,2,opt,name=state,proto3,enum=quotapb.Config_State" json:"state,omitempty"`
	// Max number of tokens available for the config.
	MaxTokens int64 `protobuf:"varint,3,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"`
	// Replenishment strategy used by the config.
	//
	// Types that are valid to be assigned to ReplenishmentStrategy:
	//	*Config_SequencingBased
	//	*Config_TimeBased
	ReplenishmentStrategy isConfig_ReplenishmentStrategy `protobuf_oneof:"replenishment_strategy"`
	// Current number of tokens available for the config.
	// May be higher than max_tokens for DISABLED configs, which are considered to
	// have "infinite" tokens.
	// Readonly.
	CurrentTokens        int64    `protobuf:"varint,6,opt,name=current_tokens,json=currentTokens,proto3" json:"current_tokens,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Config) Reset()         { *m = Config{} }
func (m *Config) String() string { return proto.CompactTextString(m) }
func (*Config) ProtoMessage()    {}
func (*Config) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{0}
}

func (m *Config) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Config.Unmarshal(m, b)
}
func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Config.Marshal(b, m, deterministic)
}
func (m *Config) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Config.Merge(m, src)
}
func (m *Config) XXX_Size() int {
	return xxx_messageInfo_Config.Size(m)
}
func (m *Config) XXX_DiscardUnknown() {
	xxx_messageInfo_Config.DiscardUnknown(m)
}

var xxx_messageInfo_Config proto.InternalMessageInfo

func (m *Config) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *Config) GetState() Config_State {
	if m != nil {
		return m.State
	}
	return Config_UNKNOWN_CONFIG_STATE
}

func (m *Config) GetMaxTokens() int64 {
	if m != nil {
		return m.MaxTokens
	}
	return 0
}

type isConfig_ReplenishmentStrategy interface {
	isConfig_ReplenishmentStrategy()
}

type Config_SequencingBased struct {
	SequencingBased *SequencingBasedStrategy `protobuf:"bytes,4,opt,name=sequencing_based,json=sequencingBased,proto3,oneof"`
}

type Config_TimeBased struct {
	TimeBased *TimeBasedStrategy `protobuf:"bytes,5,opt,name=time_based,json=timeBased,proto3,oneof"`
}

func (*Config_SequencingBased) isConfig_ReplenishmentStrategy() {}

func (*Config_TimeBased) isConfig_ReplenishmentStrategy() {}

func (m *Config) GetReplenishmentStrategy() isConfig_ReplenishmentStrategy {
	if m != nil {
		return m.ReplenishmentStrategy
	}
	return nil
}

func (m *Config) GetSequencingBased() *SequencingBasedStrategy {
	if x, ok := m.GetReplenishmentStrategy().(*Config_SequencingBased); ok {
		return x.SequencingBased
	}
	return nil
}

func (m *Config) GetTimeBased() *TimeBasedStrategy {
	if x, ok := m.GetReplenishmentStrategy().(*Config_TimeBased); ok {
		return x.TimeBased
	}
	return nil
}

func (m *Config) GetCurrentTokens() int64 {
	if m != nil {
		return m.CurrentTokens
	}
	return 0
}

// XXX_OneofWrappers is for the internal use of the proto package.
func (*Config) XXX_OneofWrappers() []interface{} {
	return []interface{}{
		(*Config_SequencingBased)(nil),
		(*Config_TimeBased)(nil),
	}
}

// Sequencing-based replenishment strategy settings.
//
// Only global/write and trees/write quotas may use sequencing-based
// replenishment.
type SequencingBasedStrategy struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *SequencingBasedStrategy) Reset()         { *m = SequencingBasedStrategy{} }
func (m *SequencingBasedStrategy) String() string { return proto.CompactTextString(m) }
func (*SequencingBasedStrategy) ProtoMessage()    {}
func (*SequencingBasedStrategy) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{1}
}

func (m *SequencingBasedStrategy) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SequencingBasedStrategy.Unmarshal(m, b)
}
func (m *SequencingBasedStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SequencingBasedStrategy.Marshal(b, m, deterministic)
}
func (m *SequencingBasedStrategy) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SequencingBasedStrategy.Merge(m, src)
}
func (m *SequencingBasedStrategy) XXX_Size() int {
	return xxx_messageInfo_SequencingBasedStrategy.Size(m)
}
func (m *SequencingBasedStrategy) XXX_DiscardUnknown() {
	xxx_messageInfo_SequencingBasedStrategy.DiscardUnknown(m)
}

var xxx_messageInfo_SequencingBasedStrategy proto.InternalMessageInfo

// Time-based replenishment strategy settings.
type TimeBasedStrategy struct {
	// Number of tokens to replenish at every replenish_interval_seconds.
	TokensToReplenish int64 `protobuf:"varint,1,opt,name=tokens_to_replenish,json=tokensToReplenish,proto3" json:"tokens_to_replenish,omitempty"`
	// Interval at which tokens_to_replenish get replenished.
	ReplenishIntervalSeconds int64    `protobuf:"varint,2,opt,name=replenish_interval_seconds,json=replenishIntervalSeconds,proto3" json:"replenish_interval_seconds,omitempty"`
	XXX_NoUnkeyedLiteral     struct{} `json:"-"`
	XXX_unrecognized         []byte   `json:"-"`
	XXX_sizecache            int32    `json:"-"`
}

func (m *TimeBasedStrategy) Reset()         { *m = TimeBasedStrategy{} }
func (m *TimeBasedStrategy) String() string { return proto.CompactTextString(m) }
func (*TimeBasedStrategy) ProtoMessage()    {}
func (*TimeBasedStrategy) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{2}
}

func (m *TimeBasedStrategy) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_TimeBasedStrategy.Unmarshal(m, b)
}
func (m *TimeBasedStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_TimeBasedStrategy.Marshal(b, m, deterministic)
}
func (m *TimeBasedStrategy) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TimeBasedStrategy.Merge(m, src)
}
func (m *TimeBasedStrategy) XXX_Size() int {
	return xxx_messageInfo_TimeBasedStrategy.Size(m)
}
func (m *TimeBasedStrategy) XXX_DiscardUnknown() {
	xxx_messageInfo_TimeBasedStrategy.DiscardUnknown(m)
}

var xxx_messageInfo_TimeBasedStrategy proto.InternalMessageInfo

func (m *TimeBasedStrategy) GetTokensToReplenish() int64 {
	if m != nil {
		return m.TokensToReplenish
	}
	return 0
}

func (m *TimeBasedStrategy) GetReplenishIntervalSeconds() int64 {
	if m != nil {
		return m.ReplenishIntervalSeconds
	}
	return 0
}

// CreateConfig request.
type CreateConfigRequest struct {
	// Name of the config to create.
	// For example, "quotas/global/read/config" (global/read quota) or
	// "quotas/trees/1234/write/config" (write quota for tree 1234).
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Config to be created.
	Config               *Config  `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *CreateConfigRequest) Reset()         { *m = CreateConfigRequest{} }
func (m *CreateConfigRequest) String() string { return proto.CompactTextString(m) }
func (*CreateConfigRequest) ProtoMessage()    {}
func (*CreateConfigRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{3}
}

func (m *CreateConfigRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_CreateConfigRequest.Unmarshal(m, b)
}
func (m *CreateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_CreateConfigRequest.Marshal(b, m, deterministic)
}
func (m *CreateConfigRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CreateConfigRequest.Merge(m, src)
}
func (m *CreateConfigRequest) XXX_Size() int {
	return xxx_messageInfo_CreateConfigRequest.Size(m)
}
func (m *CreateConfigRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_CreateConfigRequest.DiscardUnknown(m)
}

var xxx_messageInfo_CreateConfigRequest proto.InternalMessageInfo

func (m *CreateConfigRequest) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *CreateConfigRequest) GetConfig() *Config {
	if m != nil {
		return m.Config
	}
	return nil
}

// DeleteConfig request.
type DeleteConfigRequest struct {
	// Name of the config to delete.
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *DeleteConfigRequest) Reset()         { *m = DeleteConfigRequest{} }
func (m *DeleteConfigRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteConfigRequest) ProtoMessage()    {}
func (*DeleteConfigRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{4}
}

func (m *DeleteConfigRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_DeleteConfigRequest.Unmarshal(m, b)
}
func (m *DeleteConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_DeleteConfigRequest.Marshal(b, m, deterministic)
}
func (m *DeleteConfigRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_DeleteConfigRequest.Merge(m, src)
}
func (m *DeleteConfigRequest) XXX_Size() int {
	return xxx_messageInfo_DeleteConfigRequest.Size(m)
}
func (m *DeleteConfigRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_DeleteConfigRequest.DiscardUnknown(m)
}

var xxx_messageInfo_DeleteConfigRequest proto.InternalMessageInfo

func (m *DeleteConfigRequest) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

// GetConfig request.
type GetConfigRequest struct {
	// Name of the config to retrieve.
	// For example, "quotas/global/read/config".
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetConfigRequest) Reset()         { *m = GetConfigRequest{} }
func (m *GetConfigRequest) String() string { return proto.CompactTextString(m) }
func (*GetConfigRequest) ProtoMessage()    {}
func (*GetConfigRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{5}
}

func (m *GetConfigRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetConfigRequest.Unmarshal(m, b)
}
func (m *GetConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetConfigRequest.Marshal(b, m, deterministic)
}
func (m *GetConfigRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetConfigRequest.Merge(m, src)
}
func (m *GetConfigRequest) XXX_Size() int {
	return xxx_messageInfo_GetConfigRequest.Size(m)
}
func (m *GetConfigRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_GetConfigRequest.DiscardUnknown(m)
}

var xxx_messageInfo_GetConfigRequest proto.InternalMessageInfo

func (m *GetConfigRequest) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

// ListConfig request.
type ListConfigsRequest struct {
	// Names of the config to retrieve. For example, "quotas/global/read/config".
	// If empty, all configs are listed.
	// Name components may be substituted by "-" to search for all variations of
	// that component. For example:
	// - "quotas/global/-/config" (both read and write global quotas)
	// - "quotas/trees/-/-/config" (all tree quotas)
	Names []string `protobuf:"bytes,1,rep,name=names,proto3" json:"names,omitempty"`
	// View specifies how much data to return.
	View                 ListConfigsRequest_ListView `protobuf:"varint,2,opt,name=view,proto3,enum=quotapb.ListConfigsRequest_ListView" json:"view,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                    `json:"-"`
	XXX_unrecognized     []byte                      `json:"-"`
	XXX_sizecache        int32                       `json:"-"`
}

func (m *ListConfigsRequest) Reset()         { *m = ListConfigsRequest{} }
func (m *ListConfigsRequest) String() string { return proto.CompactTextString(m) }
func (*ListConfigsRequest) ProtoMessage()    {}
func (*ListConfigsRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{6}
}

func (m *ListConfigsRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ListConfigsRequest.Unmarshal(m, b)
}
func (m *ListConfigsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ListConfigsRequest.Marshal(b, m, deterministic)
}
func (m *ListConfigsRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ListConfigsRequest.Merge(m, src)
}
func (m *ListConfigsRequest) XXX_Size() int {
	return xxx_messageInfo_ListConfigsRequest.Size(m)
}
func (m *ListConfigsRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_ListConfigsRequest.DiscardUnknown(m)
}

var xxx_messageInfo_ListConfigsRequest proto.InternalMessageInfo

func (m *ListConfigsRequest) GetNames() []string {
	if m != nil {
		return m.Names
	}
	return nil
}

func (m *ListConfigsRequest) GetView() ListConfigsRequest_ListView {
	if m != nil {
		return m.View
	}
	return ListConfigsRequest_BASIC
}

// ListConfig response.
type ListConfigsResponse struct {
	// Configs matching the request filter.
	Configs              []*Config `protobuf:"bytes,1,rep,name=configs,proto3" json:"configs,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (m *ListConfigsResponse) Reset()         { *m = ListConfigsResponse{} }
func (m *ListConfigsResponse) String() string { return proto.CompactTextString(m) }
func (*ListConfigsResponse) ProtoMessage()    {}
func (*ListConfigsResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{7}
}

func (m *ListConfigsResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ListConfigsResponse.Unmarshal(m, b)
}
func (m *ListConfigsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ListConfigsResponse.Marshal(b, m, deterministic)
}
func (m *ListConfigsResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ListConfigsResponse.Merge(m, src)
}
func (m *ListConfigsResponse) XXX_Size() int {
	return xxx_messageInfo_ListConfigsResponse.Size(m)
}
func (m *ListConfigsResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_ListConfigsResponse.DiscardUnknown(m)
}

var xxx_messageInfo_ListConfigsResponse proto.InternalMessageInfo

func (m *ListConfigsResponse) GetConfigs() []*Config {
	if m != nil {
		return m.Configs
	}
	return nil
}

// Updates a quota config according to the update_mask provided.
//
// Some config changes will cause the current number of tokens to be updated, as
// listed below:
//
// * If max_tokens is reduced and the current number of tokens is greater than
//   the new max_tokens, the current number of tokens is reduced to max_tokens.
//   This happens so the quota is immediately conformant to the new
//   configuration.
//
// * A state transition from disabled to enabled causes the quota to be fully
//   replenished. This happens so the re-enabled quota will enter in action in a
//   known, predictable state.
//
// A "full replenish", also called "reset", may be forced via the reset_quota
// parameter, regardless of any other changes. For convenience, reset only
// requests (name and reset_quota = true) are allowed.
type UpdateConfigRequest struct {
	// Name of the config to update.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Config to update. Only the fields specified by update_mask need to be
	// filled.
	Config *Config `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	// Fields modified by the update request.
	// For example: "state" or "max_tokens".
	UpdateMask *field_mask.FieldMask `protobuf:"bytes,3,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	// If true the updated quota is reset, regardless of the update's contents.
	// A reset quota is replenished to its maximum number of tokens.
	ResetQuota           bool     `protobuf:"varint,4,opt,name=reset_quota,json=resetQuota,proto3" json:"reset_quota,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *UpdateConfigRequest) Reset()         { *m = UpdateConfigRequest{} }
func (m *UpdateConfigRequest) String() string { return proto.CompactTextString(m) }
func (*UpdateConfigRequest) ProtoMessage()    {}
func (*UpdateConfigRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_7358794d7f8089dd, []int{8}
}

func (m *UpdateConfigRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_UpdateConfigRequest.Unmarshal(m, b)
}
func (m *UpdateConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_UpdateConfigRequest.Marshal(b, m, deterministic)
}
func (m *UpdateConfigRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_UpdateConfigRequest.Merge(m, src)
}
func (m *UpdateConfigRequest) XXX_Size() int {
	return xxx_messageInfo_UpdateConfigRequest.Size(m)
}
func (m *UpdateConfigRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_UpdateConfigRequest.DiscardUnknown(m)
}

var xxx_messageInfo_UpdateConfigRequest proto.InternalMessageInfo

func (m *UpdateConfigRequest) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *UpdateConfigRequest) GetConfig() *Config {
	if m != nil {
		return m.Config
	}
	return nil
}

func (m *UpdateConfigRequest) GetUpdateMask() *field_mask.FieldMask {
	if m != nil {
		return m.UpdateMask
	}
	return nil
}

func (m *UpdateConfigRequest) GetResetQuota() bool {
	if m != nil {
		return m.ResetQuota
	}
	return false
}

func init() {
	proto.RegisterEnum("quotapb.Config_State", Config_State_name, Config_State_value)
	proto.RegisterEnum("quotapb.ListConfigsRequest_ListView", ListConfigsRequest_ListView_name, ListConfigsRequest_ListView_value)
	proto.RegisterType((*Config)(nil), "quotapb.Config")
	proto.RegisterType((*SequencingBasedStrategy)(nil), "quotapb.SequencingBasedStrategy")
	proto.RegisterType((*TimeBasedStrategy)(nil), "quotapb.TimeBasedStrategy")
	proto.RegisterType((*CreateConfigRequest)(nil), "quotapb.CreateConfigRequest")
	proto.RegisterType((*DeleteConfigRequest)(nil), "quotapb.DeleteConfigRequest")
	proto.RegisterType((*GetConfigRequest)(nil), "quotapb.GetConfigRequest")
	proto.RegisterType((*ListConfigsRequest)(nil), "quotapb.ListConfigsRequest")
	proto.RegisterType((*ListConfigsResponse)(nil), "quotapb.ListConfigsResponse")
	proto.RegisterType((*UpdateConfigRequest)(nil), "quotapb.UpdateConfigRequest")
}

func init() { proto.RegisterFile("quotapb.proto", fileDescriptor_7358794d7f8089dd) }

var fileDescriptor_7358794d7f8089dd = []byte{
	// 759 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xdd, 0x4e, 0x13, 0x41,
	0x18, 0x65, 0xfb, 0x47, 0xfb, 0x95, 0x9f, 0x32, 0x45, 0x58, 0x0a, 0x86, 0xcd, 0x46, 0xb4, 0x94,
	0xa4, 0x0d, 0xf5, 0xc6, 0x08, 0x26, 0xd2, 0x52, 0xb0, 0xb1, 0x94, 0xb8, 0x2d, 0x7a, 0xb9, 0x99,
	0xb6, 0x43, 0x5d, 0xe9, 0xee, 0x96, 0x9d, 0x29, 0x3f, 0x31, 0x5e, 0x68, 0xe2, 0x13, 0x18, 0xdf,
	0xc3, 0x77, 0xf1, 0x15, 0x7c, 0x03, 0x5f, 0xc0, 0xec, 0xcc, 0xee, 0x5a, 0xda, 0x22, 0x5c, 0x78,
	0xb7, 0xf3, 0x9d, 0xb3, 0xe7, 0x3b, 0xdf, 0xcc, 0x99, 0x81, 0xd9, 0xf3, 0x81, 0xcd, 0x70, 0xbf,
	0x95, 0xef, 0x3b, 0x36, 0xb3, 0xd1, 0xb4, 0xb7, 0xcc, 0xac, 0x75, 0x6d, 0xbb, 0xdb, 0x23, 0x05,
	0xdc, 0x37, 0x0a, 0xd8, 0xb2, 0x6c, 0x86, 0x99, 0x61, 0x5b, 0x54, 0xd0, 0x32, 0xab, 0x1e, 0xca,
	0x57, 0xad, 0xc1, 0x69, 0x81, 0x98, 0x7d, 0x76, 0xed, 0x81, 0xca, 0x28, 0x78, 0x6a, 0x90, 0x5e,
	0x47, 0x37, 0x31, 0x3d, 0x13, 0x0c, 0xf5, 0x77, 0x08, 0x62, 0x65, 0xdb, 0x3a, 0x35, 0xba, 0x08,
	0x41, 0xc4, 0xc2, 0x26, 0x91, 0x25, 0x45, 0xca, 0x26, 0x34, 0xfe, 0x8d, 0xb6, 0x20, 0x4a, 0x19,
	0x66, 0x44, 0x0e, 0x29, 0x52, 0x76, 0xae, 0xf8, 0x20, 0xef, 0x7b, 0x14, 0xff, 0xe4, 0x1b, 0x2e,
	0xa8, 0x09, 0x0e, 0x7a, 0x08, 0x60, 0xe2, 0x2b, 0x9d, 0xd9, 0x67, 0xc4, 0xa2, 0x72, 0x58, 0x91,
	0xb2, 0x61, 0x2d, 0x61, 0xe2, 0xab, 0x26, 0x2f, 0xa0, 0x23, 0x48, 0x51, 0x72, 0x3e, 0x20, 0x56,
	0xdb, 0xb0, 0xba, 0x7a, 0x0b, 0x53, 0xd2, 0x91, 0x23, 0x8a, 0x94, 0x4d, 0x16, 0x95, 0x40, 0xb6,
	0x11, 0x10, 0x4a, 0x2e, 0xde, 0x60, 0x0e, 0x66, 0xa4, 0x7b, 0xfd, 0x6a, 0x4a, 0x9b, 0xa7, 0x37,
	0x21, 0xb4, 0x03, 0xc0, 0x0c, 0x93, 0x78, 0x42, 0x51, 0x2e, 0x94, 0x09, 0x84, 0x9a, 0x86, 0x49,
	0x46, 0x25, 0x12, 0xcc, 0x2f, 0xa2, 0x0d, 0x98, 0x6b, 0x0f, 0x1c, 0x87, 0x58, 0xcc, 0xb7, 0x1b,
	0xe3, 0x76, 0x67, 0xbd, 0xaa, 0xb0, 0xac, 0xee, 0x42, 0x94, 0x4f, 0x88, 0x64, 0x58, 0x3c, 0xa9,
	0xbf, 0xae, 0x1f, 0xbf, 0xab, 0xeb, 0xe5, 0xe3, 0xfa, 0x41, 0xf5, 0x50, 0x6f, 0x34, 0xf7, 0x9a,
	0x95, 0xd4, 0x14, 0x4a, 0xc2, 0x74, 0xa5, 0xbe, 0x57, 0xaa, 0x55, 0xf6, 0x53, 0x12, 0x9a, 0x81,
	0xf8, 0x7e, 0xb5, 0x21, 0x56, 0xa1, 0x92, 0x0c, 0x4b, 0x0e, 0xe9, 0xf7, 0x88, 0x65, 0xd0, 0xf7,
	0xa6, 0xdb, 0x8a, 0x7a, 0x5e, 0xd4, 0x15, 0x58, 0xbe, 0x65, 0x52, 0xf5, 0xb3, 0x04, 0x0b, 0x63,
	0xe6, 0x51, 0x1e, 0xd2, 0xc2, 0xa7, 0xce, 0x6c, 0x3d, 0x10, 0xe5, 0x47, 0x15, 0xd6, 0x16, 0x04,
	0xd4, 0xb4, 0x35, 0x1f, 0x40, 0xbb, 0x90, 0x09, 0x58, 0xba, 0x61, 0x31, 0xe2, 0x5c, 0xe0, 0x9e,
	0x4e, 0x49, 0xdb, 0xb6, 0x3a, 0x94, 0x1f, 0x66, 0x58, 0x93, 0x03, 0x46, 0xd5, 0x23, 0x34, 0x04,
	0xae, 0x6a, 0x90, 0x2e, 0x3b, 0x04, 0x33, 0x22, 0x4e, 0x59, 0x73, 0xad, 0x52, 0x36, 0x31, 0x20,
	0x4f, 0x20, 0xd6, 0xe6, 0x24, 0x2e, 0x9a, 0x2c, 0xce, 0x8f, 0x24, 0x44, 0xf3, 0x60, 0x75, 0x13,
	0xd2, 0xfb, 0xa4, 0x47, 0xee, 0xa1, 0xa9, 0x3e, 0x86, 0xd4, 0x21, 0x61, 0x77, 0xf3, 0xbe, 0x4a,
	0x80, 0x6a, 0x06, 0xf5, 0x98, 0xd4, 0xa7, 0x2e, 0x42, 0xd4, 0x85, 0xa9, 0x2c, 0x29, 0xe1, 0x6c,
	0x42, 0x13, 0x0b, 0xf4, 0x0c, 0x22, 0x17, 0x06, 0xb9, 0xf4, 0x82, 0xfc, 0x28, 0xb0, 0x39, 0x2e,
	0xc0, 0x4b, 0x6f, 0x0d, 0x72, 0xa9, 0xf1, 0x3f, 0xd4, 0x75, 0x88, 0xfb, 0x15, 0x94, 0x80, 0x68,
	0x69, 0xaf, 0x51, 0x2d, 0xa7, 0xa6, 0x50, 0x1c, 0x22, 0x07, 0x27, 0xb5, 0x5a, 0x4a, 0x52, 0x5f,
	0x42, 0xfa, 0x86, 0x0a, 0xed, 0xdb, 0x16, 0x25, 0x68, 0x13, 0xa6, 0xc5, 0xec, 0xc2, 0xc9, 0x84,
	0xbd, 0xf1, 0x71, 0xf5, 0x87, 0x04, 0xe9, 0x93, 0x7e, 0xe7, 0xbf, 0xee, 0x38, 0xda, 0x81, 0xe4,
	0x80, 0x6b, 0xf2, 0xfb, 0xce, 0xef, 0xa3, 0x7b, 0x43, 0xc4, 0x93, 0x90, 0xf7, 0x9f, 0x84, 0xfc,
	0x81, 0xfb, 0x24, 0x1c, 0x61, 0x7a, 0xa6, 0x81, 0xa0, 0xbb, 0xdf, 0x68, 0x1d, 0x92, 0x0e, 0xa1,
	0x84, 0xe9, 0x5c, 0x9c, 0xdf, 0xd3, 0xb8, 0x06, 0xbc, 0xf4, 0xc6, 0xad, 0x14, 0xbf, 0x47, 0x20,
	0xca, 0xbf, 0xd0, 0x07, 0x98, 0x19, 0x4e, 0x0b, 0x5a, 0xfb, 0x6b, 0x68, 0x3c, 0x44, 0x99, 0x51,
	0xbb, 0xea, 0xd6, 0x97, 0x9f, 0xbf, 0xbe, 0x85, 0x36, 0x54, 0xa5, 0x70, 0xb1, 0xdd, 0x22, 0x0c,
	0x6f, 0x17, 0x3e, 0xba, 0x73, 0xbe, 0xe0, 0x34, 0x5a, 0xc8, 0xe5, 0x0a, 0x62, 0x9e, 0x4f, 0xcf,
	0xa5, 0x1c, 0xb2, 0x60, 0x66, 0x38, 0x45, 0x43, 0xbd, 0x26, 0x84, 0x2b, 0xb3, 0x34, 0x36, 0x6c,
	0xc5, 0x7d, 0x1c, 0xd5, 0x2c, 0x6f, 0xa9, 0xe6, 0xee, 0x6c, 0x89, 0x30, 0x24, 0x82, 0x28, 0xa2,
	0x95, 0xa0, 0xd9, 0x68, 0x3c, 0xc7, 0xa7, 0xf2, 0x5a, 0xa0, 0xfb, 0xb4, 0x48, 0x0e, 0xa5, 0x07,
	0xad, 0xfe, 0x23, 0x99, 0x99, 0xb5, 0xc9, 0xa0, 0x08, 0x9c, 0xba, 0xcc, 0x7b, 0x2e, 0xa0, 0xf9,
	0xa0, 0xa7, 0xe8, 0xe6, 0x9e, 0xd0, 0x70, 0xba, 0x86, 0x76, 0x6d, 0x42, 0xe8, 0x6e, 0x3d, 0xa1,
	0xe2, 0x7d, 0x4e, 0xa8, 0x15, 0xe3, 0x7b, 0xfd, 0xf4, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0,
	0x60, 0xf5, 0x62, 0xce, 0x06, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// QuotaClient is the client API for Quota service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QuotaClient interface {
	// Creates a new quota.
	CreateConfig(ctx context.Context, in *CreateConfigRequest, opts ...grpc.CallOption) (*Config, error)
	// Deletes an existing quota. Non-existing quotas are considered infinite by
	// the quota system.
	DeleteConfig(ctx context.Context, in *DeleteConfigRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Retrieves a quota by name.
	GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*Config, error)
	// Lists quotas according to the specified criteria.
	ListConfigs(ctx context.Context, in *ListConfigsRequest, opts ...grpc.CallOption) (*ListConfigsResponse, error)
	// Updates a quota.
	UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*Config, error)
}

type quotaClient struct {
	cc *grpc.ClientConn
}

func NewQuotaClient(cc *grpc.ClientConn) QuotaClient {
	return &quotaClient{cc}
}

func (c *quotaClient) CreateConfig(ctx context.Context, in *CreateConfigRequest, opts ...grpc.CallOption) (*Config, error) {
	out := new(Config)
	err := c.cc.Invoke(ctx, "/quotapb.Quota/CreateConfig", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *quotaClient) DeleteConfig(ctx context.Context, in *DeleteConfigRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
	out := new(empty.Empty)
	err := c.cc.Invoke(ctx, "/quotapb.Quota/DeleteConfig", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *quotaClient) GetConfig(ctx context.Context, in *GetConfigRequest, opts ...grpc.CallOption) (*Config, error) {
	out := new(Config)
	err := c.cc.Invoke(ctx, "/quotapb.Quota/GetConfig", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *quotaClient) ListConfigs(ctx context.Context, in *ListConfigsRequest, opts ...grpc.CallOption) (*ListConfigsResponse, error) {
	out := new(ListConfigsResponse)
	err := c.cc.Invoke(ctx, "/quotapb.Quota/ListConfigs", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *quotaClient) UpdateConfig(ctx context.Context, in *UpdateConfigRequest, opts ...grpc.CallOption) (*Config, error) {
	out := new(Config)
	err := c.cc.Invoke(ctx, "/quotapb.Quota/UpdateConfig", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// QuotaServer is the server API for Quota service.
type QuotaServer interface {
	// Creates a new quota.
	CreateConfig(context.Context, *CreateConfigRequest) (*Config, error)
	// Deletes an existing quota. Non-existing quotas are considered infinite by
	// the quota system.
	DeleteConfig(context.Context, *DeleteConfigRequest) (*empty.Empty, error)
	// Retrieves a quota by name.
	GetConfig(context.Context, *GetConfigRequest) (*Config, error)
	// Lists quotas according to the specified criteria.
	ListConfigs(context.Context, *ListConfigsRequest) (*ListConfigsResponse, error)
	// Updates a quota.
	UpdateConfig(context.Context, *UpdateConfigRequest) (*Config, error)
}

// UnimplementedQuotaServer can be embedded to have forward compatible implementations.
type UnimplementedQuotaServer struct {
}

func (*UnimplementedQuotaServer) CreateConfig(ctx context.Context, req *CreateConfigRequest) (*Config, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateConfig not implemented")
}
func (*UnimplementedQuotaServer) DeleteConfig(ctx context.Context, req *DeleteConfigRequest) (*empty.Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteConfig not implemented")
}
func (*UnimplementedQuotaServer) GetConfig(ctx context.Context, req *GetConfigRequest) (*Config, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetConfig not implemented")
}
func (*UnimplementedQuotaServer) ListConfigs(ctx context.Context, req *ListConfigsRequest) (*ListConfigsResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListConfigs not implemented")
}
func (*UnimplementedQuotaServer) UpdateConfig(ctx context.Context, req *UpdateConfigRequest) (*Config, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateConfig not implemented")
}

func RegisterQuotaServer(s *grpc.Server, srv QuotaServer) {
	s.RegisterService(&_Quota_serviceDesc, srv)
}

func _Quota_CreateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateConfigRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QuotaServer).CreateConfig(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/quotapb.Quota/CreateConfig",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QuotaServer).CreateConfig(ctx, req.(*CreateConfigRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Quota_DeleteConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteConfigRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QuotaServer).DeleteConfig(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/quotapb.Quota/DeleteConfig",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QuotaServer).DeleteConfig(ctx, req.(*DeleteConfigRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Quota_GetConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetConfigRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QuotaServer).GetConfig(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/quotapb.Quota/GetConfig",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QuotaServer).GetConfig(ctx, req.(*GetConfigRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Quota_ListConfigs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListConfigsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QuotaServer).ListConfigs(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/quotapb.Quota/ListConfigs",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QuotaServer).ListConfigs(ctx, req.(*ListConfigsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Quota_UpdateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateConfigRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(QuotaServer).UpdateConfig(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/quotapb.Quota/UpdateConfig",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(QuotaServer).UpdateConfig(ctx, req.(*UpdateConfigRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Quota_serviceDesc = grpc.ServiceDesc{
	ServiceName: "quotapb.Quota",
	HandlerType: (*QuotaServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateConfig",
			Handler:    _Quota_CreateConfig_Handler,
		},
		{
			MethodName: "DeleteConfig",
			Handler:    _Quota_DeleteConfig_Handler,
		},
		{
			MethodName: "GetConfig",
			Handler:    _Quota_GetConfig_Handler,
		},
		{
			MethodName: "ListConfigs",
			Handler:    _Quota_ListConfigs_Handler,
		},
		{
			MethodName: "UpdateConfig",
			Handler:    _Quota_UpdateConfig_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "quotapb.proto",
}


text:
namespace TaskTemplate.Models
{
    public class TaskSolver
    {
        public OutputData GetOutputData(InputData inputData)
        {
            var result = new OutputData
            {
                Servers = inputData.Servers
            };

            // TODO: add some logic here

            return result;
        }
    }
}


text:
@interface AVSignature : NSObject

@property (nonatomic, retain) NSString *signature;
@property (nonatomic, assign) long timestamp;
@property (nonatomic, retain) NSString *nonce;
@property (nonatomic, retain) NSString *action;
@property (nonatomic, retain) NSArray *signedPeerIds;

@end

@protocol AVSignatureDelegate <NSObject>
@optional
- (AVSignature *)createSignature:(NSString *)peerId watchedPeerIds:(NSArray *)watchedPeerIds;
- (AVSignature *)createSessionSignature:(NSString *)peerId watchedPeerIds:(NSArray *)watchedPeerIds action:(NSString *)action;
- (AVSignature *)createGroupSignature:(NSString *)peerId groupPeerIds:(NSArray *)groupPeerIds action:(NSString *)action;
- (AVSignature *)createGroupSignature:(NSString *)peerId groupId:(NSString *)groupId groupPeerIds:(NSArray *)groupPeerIds action:(NSString *)action;
@end