text:
package org.jbehave.core.parsers;

import static java.util.regex.Pattern.DOTALL;
import static java.util.regex.Pattern.compile;
import static org.apache.commons.lang3.StringUtils.removeStart;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.lang3.StringUtils;
import org.jbehave.core.annotations.AfterScenario.Outcome;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.configuration.Keywords;
import org.jbehave.core.i18n.LocalizedKeywords;
import org.jbehave.core.model.Description;
import org.jbehave.core.model.ExamplesTable;
import org.jbehave.core.model.ExamplesTableFactory;
import org.jbehave.core.model.GivenStories;
import org.jbehave.core.model.Lifecycle;
import org.jbehave.core.model.Lifecycle.Steps;
import org.jbehave.core.model.Meta;
import org.jbehave.core.model.Narrative;
import org.jbehave.core.model.Scenario;
import org.jbehave.core.model.Story;
import org.jbehave.core.model.TableTransformers;

/**
 * Pattern-based story parser, which uses the keywords provided to parse the
 * textual story into a {@link Story}.
 */
public class RegexStoryParser implements StoryParser {

    private static final String NONE = "";
    private final Keywords keywords;
    private final ExamplesTableFactory tableFactory;

    public RegexStoryParser() {
        this(new TableTransformers());
    }

    public RegexStoryParser(TableTransformers tableTransformers) {
        this(new LocalizedKeywords(), tableTransformers);
    }

    public RegexStoryParser(Keywords keywords, TableTransformers tableTransformers) {
        this(keywords, new ExamplesTableFactory(keywords, tableTransformers));
    }

    public RegexStoryParser(ExamplesTableFactory tableFactory) {
        this(tableFactory.keywords(), tableFactory);
    }

    public RegexStoryParser(Keywords keywords, ExamplesTableFactory tableFactory) {
        this.keywords = keywords;
        this.tableFactory = tableFactory;
        // must ensure that both are using same keywords
        this.tableFactory.useKeywords(keywords);
    }

    public RegexStoryParser(Configuration configuration) {
    	this.keywords = configuration.keywords();
    	this.tableFactory = new ExamplesTableFactory(configuration);
    }

    public Story parseStory(String storyAsText) {
        return parseStory(storyAsText, null);
    }

    public Story parseStory(String storyAsText, String storyPath) {
        Description description = parseDescriptionFrom(storyAsText);
        Meta meta = parseStoryMetaFrom(storyAsText);
        Narrative narrative = parseNarrativeFrom(storyAsText);
        GivenStories givenStories = parseGivenStories(storyAsText);
        Lifecycle lifecycle = parseLifecycle(storyAsText);
        List<Scenario> scenarios = parseScenariosFrom(storyAsText);
        Story story = new Story(storyPath, description, meta, narrative, givenStories, lifecycle, scenarios);
        if (storyPath != null) {
            story.namedAs(new File(storyPath).getName());
        }
        return story;
    }

    private Description parseDescriptionFrom(String storyAsText) {
        Matcher findingDescription = findingDescription().matcher(storyAsText);
        if (findingDescription.matches()) {
            return new Description(findingDescription.group(1).trim());
        }
        return Description.EMPTY;
    }

    private Meta parseStoryMetaFrom(String storyAsText) {
        Matcher findingMeta = findingStoryMeta().matcher(preScenarioText(storyAsText));
        if (findingMeta.matches()) {
            String meta = findingMeta.group(1).trim();
            return Meta.createMeta(meta, keywords);
        }
        return Meta.EMPTY;
    }

    private String preScenarioText(String storyAsText) {
        String[] split = storyAsText.split(keywords.scenario());
        return split.length > 0 ? split[0] : storyAsText;
    }

    private Narrative parseNarrativeFrom(String storyAsText) {
        Matcher findingNarrative = findingNarrative().matcher(storyAsText);
        if (findingNarrative.matches()) {
            String narrative = findingNarrative.group(1).trim();
            return createNarrative(narrative);
        }
        return Narrative.EMPTY;
    }

    private Narrative createNarrative(String narrative) {
        Matcher findingElements = findingNarrativeElements().matcher(narrative);
        if (findingElements.matches()) {
            String inOrderTo = findingElements.group(1).trim();
            String asA = findingElements.group(2).trim();
            String iWantTo = findingElements.group(3).trim();
            return new Narrative(inOrderTo, asA, iWantTo);
        }
        Matcher findingAlternativeElements = findingAlternativeNarrativeElements().matcher(narrative);
        if (findingAlternativeElements.matches()) {
            String asA = findingAlternativeElements.group(1).trim();
            String iWantTo = findingAlternativeElements.group(2).trim();
            String soThat = findingAlternativeElements.group(3).trim();
            return new Narrative("", asA, iWantTo, soThat);
        }
        return Narrative.EMPTY;
    }

    private GivenStories parseGivenStories(String storyAsText) {
        String scenarioKeyword = keywords.scenario();
        // use text before scenario keyword, if found
        String beforeScenario = "";
        if (StringUtils.contains(storyAsText, scenarioKeyword)) {
            beforeScenario = StringUtils.substringBefore(storyAsText, scenarioKeyword);
        }
        Matcher findingGivenStories = findingStoryGivenStories().matcher(beforeScenario);
        String givenStories = findingGivenStories.find() ? findingGivenStories.group(1).trim() : NONE;
        return new GivenStories(givenStories);
    }

    private Lifecycle parseLifecycle(String storyAsText) {
        String scenarioKeyword = keywords.scenario();
        // use text before scenario keyword, if found
        String beforeScenario = "";
        if (StringUtils.contains(storyAsText, scenarioKeyword)) {
            beforeScenario = StringUtils.substringBefore(storyAsText, scenarioKeyword);
        }
        Matcher findingLifecycle = findingLifecycle().matcher(beforeScenario);
        String lifecycle = findingLifecycle.find() ? findingLifecycle.group(1).trim() : NONE;
        Matcher findingBeforeAndAfter = compile(".*" + keywords.before() + "(.*)\\s*" + keywords.after() + "(.*)\\s*", DOTALL).matcher(lifecycle);
        if ( findingBeforeAndAfter.matches() ){
            String beforeLifecycle = findingBeforeAndAfter.group(1).trim();
			Steps beforeSteps = parseBeforeLifecycle(beforeLifecycle);
            String afterLifecycle = findingBeforeAndAfter.group(2).trim();
			Steps[] afterSteps = parseAfterLifecycle(afterLifecycle);
            return new Lifecycle(beforeSteps, afterSteps);
        }
        Matcher findingBefore = compile(".*" + keywords.before() + "(.*)\\s*", DOTALL).matcher(lifecycle);
        if ( findingBefore.matches() ){
            String beforeLifecycle = findingBefore.group(1).trim();
			Steps beforeSteps = parseBeforeLifecycle(beforeLifecycle);
            return new Lifecycle(beforeSteps, new Steps(new ArrayList<String>()));
        }
        Matcher findingAfter = compile(".*" + keywords.after() + "(.*)\\s*", DOTALL).matcher(lifecycle);
        if ( findingAfter.matches() ){
            Steps beforeSteps = Steps.EMPTY;
            String afterLifecycle = findingAfter.group(1).trim();
			Steps[] afterSteps = parseAfterLifecycle(afterLifecycle);
            return new Lifecycle(beforeSteps, afterSteps);
        }
        return Lifecycle.EMPTY;
    }

	private Steps parseBeforeLifecycle(String lifecycleAsText) {
		return new Steps(findSteps(startingWithNL(lifecycleAsText)));
	}

	private Steps[] parseAfterLifecycle(String lifecycleAsText) {
		List<Steps> list = new ArrayList<Steps>();
		for (String byOutcome : lifecycleAsText.split(keywords.outcome()) ){
			byOutcome = byOutcome.trim();
			if ( byOutcome.isEmpty() ) continue;
			String outcomeAsText = findOutcome(byOutcome);
			String filtersAsText = findFilters(removeStart(byOutcome, outcomeAsText));
			List<String> steps = findSteps(startingWithNL(removeStart(byOutcome, filtersAsText)));
			list.add(new Steps(parseOutcome(outcomeAsText), parseFilters(filtersAsText), steps));
		}
		return list.toArray(new Steps[list.size()]);
	}

	private String findOutcome(String stepsByOutcome) {
    	Matcher findingOutcome = findingLifecycleOutcome().matcher(stepsByOutcome);
    	if ( findingOutcome.matches() ){
    		return findingOutcome.group(1).trim();
    	}
		return keywords.outcomeAny();
    }

	private Outcome parseOutcome(String outcomeAsText) {
    	if ( outcomeAsText.equals(keywords.outcomeSuccess()) ){
    		return Outcome.SUCCESS;
    	} else if ( outcomeAsText.equals(keywords.outcomeFailure()) ){
    		return Outcome.FAILURE;
    	}
		return Outcome.ANY;
	}

	private String findFilters(String stepsByFilters) {
    	Matcher findingFilters = findingLifecycleFilters().matcher(stepsByFilters.trim());
    	if ( findingFilters.matches() ){
    		return findingFilters.group(1).trim();
    	}
		return NONE;
    }

    private String parseFilters(String filtersAsText) {
		return removeStart(filtersAsText, keywords.metaFilter()).trim();
	}

	private List<Scenario> parseScenariosFrom(String storyAsText) {
        List<Scenario> parsed = new ArrayList<Scenario>();
        for (String scenarioAsText : splitScenarios(storyAsText)) {
            parsed.add(parseScenario(scenarioAsText));
        }
        return parsed;
    }

    private List<String> splitScenarios(String storyAsText) {
        List<String> scenarios = new ArrayList<String>();
        String scenarioKeyword = keywords.scenario();

        // use text after scenario keyword, if found
        if (StringUtils.contains(storyAsText, scenarioKeyword)) {
            storyAsText = StringUtils.substringAfter(storyAsText, scenarioKeyword);
        }

        for (String scenarioAsText : storyAsText.split(scenarioKeyword)) {
            if (scenarioAsText.trim().length() > 0) {
                scenarios.add(scenarioKeyword + "\n" + scenarioAsText);
            }
        }

        return scenarios;
    }

    private Scenario parseScenario(String scenarioAsText) {
        String title = findScenarioTitle(scenarioAsText);
        String scenarioWithoutKeyword = removeStart(scenarioAsText, keywords.scenario()).trim();
        String scenarioWithoutTitle = removeStart(scenarioWithoutKeyword, title);
        scenarioWithoutTitle = startingWithNL(scenarioWithoutTitle);
        Meta meta = findScenarioMeta(scenarioWithoutTitle);
        ExamplesTable examplesTable = findExamplesTable(scenarioWithoutTitle);
        GivenStories givenStories = findScenarioGivenStories(scenarioWithoutTitle);
        if (givenStories.requireParameters()) {
            givenStories.useExamplesTable(examplesTable);
        }
        List<String> steps = findSteps(scenarioWithoutTitle);
        return new Scenario(title, meta, givenStories, examplesTable, steps);
    }

    private String startingWithNL(String text) {
        if ( !text.startsWith("\n") ){ // always ensure starts with newline
            return "\n" + text;
        }
        return text;
    }

    private String findScenarioTitle(String scenarioAsText) {
        Matcher findingTitle = findingScenarioTitle().matcher(scenarioAsText);
        return findingTitle.find() ? findingTitle.group(1).trim() : NONE;
    }

    private Meta findScenarioMeta(String scenarioAsText) {
        Matcher findingMeta = findingScenarioMeta().matcher(scenarioAsText);
        if (findingMeta.matches()) {
            String meta = findingMeta.group(1).trim();
            return Meta.createMeta(meta, keywords);
        }
        return Meta.EMPTY;
    }

    private ExamplesTable findExamplesTable(String scenarioAsText) {
        Matcher findingTable = findingExamplesTable().matcher(scenarioAsText);
        String tableInput = findingTable.find() ? findingTable.group(1).trim() : NONE;
        return tableFactory.createExamplesTable(tableInput);
    }

    private GivenStories findScenarioGivenStories(String scenarioAsText) {
        Matcher findingGivenStories = findingScenarioGivenStories().matcher(scenarioAsText);
        String givenStories = findingGivenStories.find() ? findingGivenStories.group(1).trim() : NONE;
        return new GivenStories(givenStories);
    }

    private List<String> findSteps(String stepsAsText) {
        Matcher matcher = findingSteps().matcher(stepsAsText);
        List<String> steps = new ArrayList<String>();
        int startAt = 0;
        while (matcher.find(startAt)) {
            steps.add(StringUtils.substringAfter(matcher.group(1), "\n"));
            startAt = matcher.start(4);
        }
        return steps;
    }

    // Regex Patterns

    private Pattern findingDescription() {
        String metaOrNarrativeOrLifecycleOrScenario = concatenateWithOr(keywords.meta(), keywords.narrative(), keywords.lifecycle(), keywords.scenario());
        return compile("(.*?)(" + metaOrNarrativeOrLifecycleOrScenario + ").*", DOTALL);
    }

    private Pattern findingStoryMeta() {
        String narrativeOrLifecycleOrGivenStories = concatenateWithOr(keywords.narrative(), keywords.lifecycle(), keywords.givenStories());
        return compile(".*" + keywords.meta() + "(.*?)\\s*(\\Z|" + narrativeOrLifecycleOrGivenStories + ").*", DOTALL);
    }

    private Pattern findingNarrative() {
        String givenStoriesOrLifecycleOrScenario = concatenateWithOr(keywords.givenStories(), keywords.lifecycle(), keywords.scenario());
        return compile(".*" + keywords.narrative() + "(.*?)\\s*(" + givenStoriesOrLifecycleOrScenario + ").*", DOTALL);
    }

    private Pattern findingNarrativeElements() {
        return compile(".*" + keywords.inOrderTo() + "(.*)\\s*" + keywords.asA() + "(.*)\\s*" + keywords.iWantTo()
                + "(.*)", DOTALL);
    }

    private Pattern findingAlternativeNarrativeElements() {
        return compile(".*" + keywords.asA() + "(.*)\\s*" + keywords.iWantTo() + "(.*)\\s*" + keywords.soThat()
                + "(.*)", DOTALL);
    }

    private Pattern findingStoryGivenStories() {
        String lifecycleOrScenario = concatenateWithOr(keywords.lifecycle(), keywords.scenario());
        return compile(".*" + keywords.givenStories() + "(.*?)\\s*(\\Z|" + lifecycleOrScenario + ").*", DOTALL);
    }

    private Pattern findingLifecycle() {
        return compile(".*" + keywords.lifecycle() + "\\s*(.*)", DOTALL);
    }

    private Pattern findingLifecycleOutcome() {
        String startingWords = concatenateWithOr("\\n", "", keywords.startingWords());
        String outcomes = concatenateWithOr(keywords.outcomeAny(), keywords.outcomeSuccess(), keywords.outcomeFailure());
        return compile("\\s*("+ outcomes +")\\s*(" + keywords.metaFilter() + "|" + startingWords + ").*", DOTALL);
    }

    private Pattern findingLifecycleFilters() {
        String startingWords = concatenateWithOr("\\n", "", keywords.startingWords());
        String filters = concatenateWithOr(keywords.metaFilter());
        return compile("\\s*("+ filters +"[\\w\\+\\-\\_\\s]*)(" + startingWords + ").*", DOTALL);
    }

    private Pattern findingScenarioTitle() {
        String startingWords = concatenateWithOr("\\n", "", keywords.startingWords());
        return compile(keywords.scenario() + "((.)*?)\\s*(" + keywords.meta() + "|" + startingWords + ").*", DOTALL);
    }

    private Pattern findingScenarioMeta() {
        String startingWords = concatenateWithOr("\\n", "", keywords.startingWords());
        return compile(".*" + keywords.meta() + "(.*?)\\s*(" + keywords.givenStories() + "|" + startingWords + ").*",
                DOTALL);
    }

    private Pattern findingScenarioGivenStories() {
        String startingWords = concatenateWithOr("\\n", "", keywords.startingWords());
        return compile("\\n" + keywords.givenStories() + "((.|\\n)*?)\\s*(" + startingWords + ").*", DOTALL);
    }

    private Pattern findingSteps() {
        String initialStartingWords = concatenateWithOr("\\n", "", keywords.startingWords());
        String followingStartingWords = concatenateWithOr("\\n", "\\s", keywords.startingWords());
        return compile(
                "((" + initialStartingWords + ")\\s(.)*?)\\s*(\\Z|" + followingStartingWords + "|\\n"
                        + keywords.examplesTable() + ")", DOTALL);
    }

    private Pattern findingExamplesTable() {
        return compile("\\n" + keywords.examplesTable() + "\\s*(.*)", DOTALL);
    }

    private String concatenateWithOr(String... keywords) {
        return concatenateWithOr(null, null, keywords);
    }

    private String concatenateWithOr(String beforeKeyword, String afterKeyword, String[] keywords) {
        StringBuilder builder = new StringBuilder();
        String before = beforeKeyword != null ? beforeKeyword : NONE;
        String after = afterKeyword != null ? afterKeyword : NONE;
        for (String keyword : keywords) {
            builder.append(before).append(keyword).append(after).append("|");
        }
        return StringUtils.removeEnd(builder.toString(), "|"); // remove last "|"
    }

}


text:
import adjustTicks from '../../../../adjustTicks';
import rangePolygon from './onResize/rangePolygon';

export default function onResize() {
    this.multiples.chart.on('resize', function() {
        //Resize text manually.
        this.wrap.select('.wc-chart-title').style('font-size', '12px');
        this.svg.selectAll('.axis .tick text').style('font-size', '10px');

        //Draw normal range.
        if (this.filtered_data.length) rangePolygon.call(this);

        //Axis tweaks
        this.svg
            .select('.x.axis')
            .select('.axis-title')
            .remove();

        //Delete legend.
        this.legend.remove();

        //Rotate ticks.
        adjustTicks.call(this);
    });
}

redpajama_set_name: RedPajamaGithub


text:
/*!
 * \file src/relay/op/nn/convolution.h
 * \brief Properties def of convlution operator for sharing.
 */
#ifndef TVM_RELAY_OP_NN_POOLING_H_
#define TVM_RELAY_OP_NN_POOLING_H_

#include <tvm/relay/attrs/nn.h>
#include <tvm/relay/op.h>

#include <utility>

namespace tvm {
namespace relay {

template <typename T>
inline Expr MakeMaxPool(Expr data, Array<IndexExpr> pool_size, Array<IndexExpr> strides,
                        Array<IndexExpr> dilation, Array<IndexExpr> padding, String layout,
                        String out_layout, bool ceil_mode, String op_name) {
  auto attrs = make_object<T>();
  attrs->pool_size = std::move(pool_size);
  attrs->strides = std::move(strides);
  attrs->dilation = std::move(dilation);
  attrs->padding = std::move(padding);
  attrs->layout = std::move(layout);
  attrs->out_layout = std::move(out_layout);
  attrs->ceil_mode = ceil_mode;
  static const Op& op = Op::Get(op_name);
  return Call(op, {data}, Attrs(attrs), {});
}

template <typename T>
inline Expr MakeAvgPool(Expr data, Array<IndexExpr> pool_size, Array<IndexExpr> strides,
                        Array<IndexExpr> dilation, Array<IndexExpr> padding, String layout,
                        String out_layout, bool ceil_mode, bool count_include_pad, String op_name) {
  auto attrs = make_object<T>();
  attrs->pool_size = std::move(pool_size);
  attrs->strides = std::move(strides);
  attrs->dilation = std::move(dilation);
  attrs->padding = std::move(padding);
  attrs->layout = std::move(layout);
  attrs->out_layout = std::move(out_layout);
  attrs->ceil_mode = ceil_mode;
  attrs->count_include_pad = count_include_pad;
  static const Op& op = Op::Get(op_name);
  return Call(op, {data}, Attrs(attrs), {});
}

}  // namespace relay
}  // namespace tvm
#endif  // TVM_RELAY_OP_NN_POOLING_H_


text:
package ua.in.badparking.events;

import ua.in.badparking.model.User;

public class UserUpdatedEvent {
    private final User user;

    public UserUpdatedEvent(User user) {
        this.user = user;
    }

    public User getUser() {
        return user;
    }
}


text:
namespace gpu {
namespace {

void Noop() {}

}  // namespace

GpuMemoryBufferImplSharedMemory::GpuMemoryBufferImplSharedMemory(
    gfx::GpuMemoryBufferId id,
    const gfx::Size& size,
    gfx::BufferFormat format,
    const DestructionCallback& callback,
    scoped_ptr<base::SharedMemory> shared_memory,
    size_t offset,
    int stride)
    : GpuMemoryBufferImpl(id, size, format, callback),
      shared_memory_(std::move(shared_memory)),
      offset_(offset),
      stride_(stride) {
  DCHECK(IsSizeValidForFormat(size, format));
}

GpuMemoryBufferImplSharedMemory::~GpuMemoryBufferImplSharedMemory() {}

// static
scoped_ptr<GpuMemoryBufferImplSharedMemory>
GpuMemoryBufferImplSharedMemory::Create(gfx::GpuMemoryBufferId id,
                                        const gfx::Size& size,
                                        gfx::BufferFormat format,
                                        const DestructionCallback& callback) {
  size_t buffer_size = 0u;
  if (!gfx::BufferSizeForBufferFormatChecked(size, format, &buffer_size))
    return nullptr;

  scoped_ptr<base::SharedMemory> shared_memory(new base::SharedMemory());
  if (!shared_memory->CreateAndMapAnonymous(buffer_size))
    return nullptr;

  return make_scoped_ptr(new GpuMemoryBufferImplSharedMemory(
      id, size, format, callback, std::move(shared_memory), 0,
      gfx::RowSizeForBufferFormat(size.width(), format, 0)));
}

// static
gfx::GpuMemoryBufferHandle
GpuMemoryBufferImplSharedMemory::AllocateForChildProcess(
    gfx::GpuMemoryBufferId id,
    const gfx::Size& size,
    gfx::BufferFormat format,
    base::ProcessHandle child_process) {
  size_t buffer_size = 0u;
  if (!gfx::BufferSizeForBufferFormatChecked(size, format, &buffer_size))
    return gfx::GpuMemoryBufferHandle();

  base::SharedMemory shared_memory;
  if (!shared_memory.CreateAnonymous(buffer_size))
    return gfx::GpuMemoryBufferHandle();

  gfx::GpuMemoryBufferHandle handle;
  handle.type = gfx::SHARED_MEMORY_BUFFER;
  handle.id = id;
  handle.offset = 0;
  handle.stride = static_cast<int32_t>(
      gfx::RowSizeForBufferFormat(size.width(), format, 0));
  shared_memory.GiveToProcess(child_process, &handle.handle);
  return handle;
}

// static
scoped_ptr<GpuMemoryBufferImplSharedMemory>
GpuMemoryBufferImplSharedMemory::CreateFromHandle(
    const gfx::GpuMemoryBufferHandle& handle,
    const gfx::Size& size,
    gfx::BufferFormat format,
    gfx::BufferUsage usage,
    const DestructionCallback& callback) {
  DCHECK(base::SharedMemory::IsHandleValid(handle.handle));

  return make_scoped_ptr(new GpuMemoryBufferImplSharedMemory(
      handle.id, size, format, callback,
      make_scoped_ptr(new base::SharedMemory(handle.handle, false)),
      handle.offset, handle.stride));
}

// static
bool GpuMemoryBufferImplSharedMemory::IsUsageSupported(gfx::BufferUsage usage) {
  switch (usage) {
    case gfx::BufferUsage::GPU_READ:
    case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE:
    case gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT:
      return true;
    case gfx::BufferUsage::SCANOUT:
      return false;
  }
  NOTREACHED();
  return false;
}

// static
bool GpuMemoryBufferImplSharedMemory::IsConfigurationSupported(
    gfx::BufferFormat format,
    gfx::BufferUsage usage) {
  return IsUsageSupported(usage);
}

// static
bool GpuMemoryBufferImplSharedMemory::IsSizeValidForFormat(
    const gfx::Size& size,
    gfx::BufferFormat format) {
  switch (format) {
    case gfx::BufferFormat::ATC:
    case gfx::BufferFormat::ATCIA:
    case gfx::BufferFormat::DXT1:
    case gfx::BufferFormat::DXT5:
    case gfx::BufferFormat::ETC1:
      // Compressed images must have a width and height that's evenly divisible
      // by the block size.
      return size.width() % 4 == 0 && size.height() % 4 == 0;
    case gfx::BufferFormat::R_8:
    case gfx::BufferFormat::RGBA_4444:
    case gfx::BufferFormat::RGBA_8888:
    case gfx::BufferFormat::RGBX_8888:
    case gfx::BufferFormat::BGRA_8888:
    case gfx::BufferFormat::BGRX_8888:
      return true;
    case gfx::BufferFormat::YUV_420:
    case gfx::BufferFormat::YUV_420_BIPLANAR: {
      size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format);
      for (size_t i = 0; i < num_planes; ++i) {
        size_t factor = gfx::SubsamplingFactorForBufferFormat(format, i);
        if (size.width() % factor || size.height() % factor)
          return false;
      }
      return true;
    }
    case gfx::BufferFormat::UYVY_422:
      return size.width() % 2 == 0;
  }

  NOTREACHED();
  return false;
}

// static
base::Closure GpuMemoryBufferImplSharedMemory::AllocateForTesting(
    const gfx::Size& size,
    gfx::BufferFormat format,
    gfx::BufferUsage usage,
    gfx::GpuMemoryBufferHandle* handle) {
  base::SharedMemory shared_memory;
  bool rv = shared_memory.CreateAnonymous(
      gfx::BufferSizeForBufferFormat(size, format));
  DCHECK(rv);
  handle->type = gfx::SHARED_MEMORY_BUFFER;
  handle->offset = 0;
  handle->stride = static_cast<int32_t>(
      gfx::RowSizeForBufferFormat(size.width(), format, 0));
  handle->handle = base::SharedMemory::DuplicateHandle(shared_memory.handle());
  return base::Bind(&Noop);
}

bool GpuMemoryBufferImplSharedMemory::Map() {
  DCHECK(!mapped_);

  // Map the buffer first time Map() is called then keep it mapped for the
  // lifetime of the buffer. This avoids mapping the buffer unless necessary.
  if (!shared_memory_->memory()) {
    DCHECK_EQ(static_cast<size_t>(stride_),
              gfx::RowSizeForBufferFormat(size_.width(), format_, 0));
    size_t buffer_size = gfx::BufferSizeForBufferFormat(size_, format_);
    // Note: offset_ != 0 is not common use-case. To keep it simple we
    // map offset + buffer_size here but this can be avoided using MapAt().
    size_t map_size = offset_ + buffer_size;
    if (!shared_memory_->Map(map_size))
      base::TerminateBecauseOutOfMemory(map_size);
  }
  mapped_ = true;
  return true;
}

void* GpuMemoryBufferImplSharedMemory::memory(size_t plane) {
  DCHECK(mapped_);
  DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
  return reinterpret_cast<uint8_t*>(shared_memory_->memory()) + offset_ +
         gfx::BufferOffsetForBufferFormat(size_, format_, plane);
}

void GpuMemoryBufferImplSharedMemory::Unmap() {
  DCHECK(mapped_);
  mapped_ = false;
}

int GpuMemoryBufferImplSharedMemory::stride(size_t plane) const {
  DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
  return gfx::RowSizeForBufferFormat(size_.width(), format_, plane);
}

gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSharedMemory::GetHandle() const {
  gfx::GpuMemoryBufferHandle handle;
  handle.type = gfx::SHARED_MEMORY_BUFFER;
  handle.id = id_;
  handle.offset = offset_;
  handle.stride = stride_;
  handle.handle = shared_memory_->handle();
  return handle;
}

}  // namespace gpu


text:
interface EpicEditorOptions {
    container?: any;
    textarea?: any;
    basePath?: string;
    clientSideStorage?: bool;
    localStorageName?: string;
    useNativeFullsreen?: bool;
    parser?: any;
    file?: {
        name: string;
        defaultContent: string;
        autoSave: any;
    };
    theme?: {
        base: string;
        preview: string;
        editor: string;
    };
    focusOnLoad?: bool;
    shortcut?: {
        modifier: number;
        fullscreen: number;
        preview: number;
    };
    string?: {
        togglePreview: string;
        toggleEdit: string;
        toggleFullscreen: string;
    };
}

class EpicEditor {
    constructor();
    constructor(options: EpicEditorOptions);

    load(callback?: Function): EpicEditor;
    unload(callback?: Function): EpicEditor;
    getElement(element: string): any;
    is(state: string): bool;
    open(filename: string);
    importFile(filename?: string, content?: string): void;
    exportFile(filename?: string, type?: string): any;
    rename(oldName: string, newName: string): void;
    save(): void;
    remove(filename: string): void;
    getFiles(filename?: string): any;
    on(event: string, handler: Function): void;
    emit(event: string): void;
    removeListener(event: string, handler?: Function): void;
    preview(): void;
    edit(): void;
    enterFullscreen(): void;
    exitFullscreen(): void;
    reflow(type?: string): void;
}


text:
<?php namespace Octommerce\Octommerce\Controllers;

use BackendMenu;
use Backend\Classes\Controller;

/**
 * Order Statuses Back-end Controller
 */
class OrderStatuses extends Controller
{
    public $implement = [
        'Backend.Behaviors.FormController',
        'Backend.Behaviors.ListController'
    ];

    public $formConfig = 'config_form.yaml';
    public $listConfig = 'config_list.yaml';

    public function __construct()
    {
        parent::__construct();

        BackendMenu::setContext('Octommerce.Octommerce', 'commerce', 'orderstatuses');
    }
}


text:
matrix
======

.. testsetup::

    from matrix import *

.. automodule:: matrix
    :members:


text:
* [ ] Comments contain US/DE info
* [ ] I understand the requirement and code satisfies the requirement.
* [ ] New unit tests added where needed.


text:
using DnDGen.TreasureGen.Items;
using DnDGen.TreasureGen.Tables;
using NUnit.Framework;

namespace DnDGen.TreasureGen.Tests.Integration.Tables.Items.Magical.Armor.Minor
{
    [TestFixture]
    public class MinorArmorTypesTests : PercentileTests
    {
        protected override string tableName
        {
            get { return string.Format(TableNameConstants.Percentiles.Formattable.POWERArmorTypes, PowerConstants.Minor); }
        }

        [Test]
        public override void ReplacementStringsAreValid()
        {
            AssertReplacementStringsAreValid();
        }

        [Test]
        public override void TableIsComplete()
        {
            AssertTableIsComplete();
        }

        [TestCase(AttributeConstants.Shield, 1, 60)]
        [TestCase(ItemTypeConstants.Armor, 61, 80)]
        [TestCase(AttributeConstants.Shield, 81, 85)]
        [TestCase(ItemTypeConstants.Armor, 86, 89)]
        [TestCase(AttributeConstants.Shield, 90, 96)]
        [TestCase(ItemTypeConstants.Armor, 97, 100)]
        public override void Percentile(string type, int lower, int upper)
        {
            base.Percentile(type, lower, upper);
        }
    }
}


text:
@implementation CCMPreferencesControllerTest

- (void)setUp
{
	controller = [[[CCMPreferencesController alloc] init] autorelease];

	defaultsManagerMock = [OCMockObject mockForClass:[CCMUserDefaultsManager class]];
	[controller setValue:defaultsManagerMock forKey:@"defaultsManager"];

	serverUrlComboBoxMock = [OCMockObject mockForClass:[NSComboBox class]];
	[controller setValue:serverUrlComboBoxMock forKey:@"serverUrlComboBox"];

	serverTypeMatrixMock = [OCMockObject mockForClass:[NSMatrix class]];
	[controller setValue:serverTypeMatrixMock forKey:@"serverTypeMatrix"];
}

- (void)tearDown
{
	[defaultsManagerMock verify];
	[serverUrlComboBoxMock verify];
	[serverTypeMatrixMock verify];
}

- (void)testSelectsServerTypeWhenHistoryURLIsSelected
{
	[[[serverUrlComboBoxMock stub] andReturn:@"http://localhost/cctray.xml"] stringValue];
	[[serverTypeMatrixMock expect] selectCellWithTag:CCMCruiseControlDashboard];

	[controller historyURLSelected:nil];
}

- (void)testAddsHttpSchemeAndFilenameWhenSettingServerType
{
	[[[serverUrlComboBoxMock stub] andReturn:@"test"] stringValue];
	[[[serverTypeMatrixMock stub] andReturn:CCMCruiseControlDashboard] selectedTag];
	[[serverUrlComboBoxMock expect] setStringValue:@"http://test/cctray.xml"];

	[controller serverTypeChanged:nil];
}

- (void)testSwapsFilenamesWhenChangingsServerTypes
{
	[[[serverUrlComboBoxMock stub] andReturn:@"test/xml"] stringValue];
	[[[serverTypeMatrixMock stub] andReturn:CCMCruiseControlDashboard] selectedTag];
	[[serverUrlComboBoxMock expect] setStringValue:@"http://test/cctray.xml"];

	[controller serverTypeChanged:nil];
}

- (void)testAddsProjectWithServerUrlAndNameToDefaults
{
	OCMockObject *viewControllerMock = [OCMockObject mockForClass:[NSArrayController class]];
	[controller setValue:viewControllerMock forKey:@"chooseProjectsViewController"];
	NSArray *selectedObjects = [@"( { name = new; server = 'http://test/cctray.xml'; } )" propertyList];
	[[[viewControllerMock stub] andReturn:selectedObjects] selectedObjects];

	[[defaultsManagerMock expect] addProject:@"new" onServerWithURL:@"http://test/cctray.xml"];
	[[defaultsManagerMock expect] addServerURLToHistory:@"http://test/cctray.xml"];

	[controller addProjectsSheetDidEnd:nil returnCode:1 contextInfo:0];
}

@end


text:
"""A helper function for parsing event type skills."""

import logging

from opsdroid.events import Event

_LOGGER = logging.getLogger(__name__)

async def match_event(event, event_opts):
    """Filter and matches the event."""
    event_type = event_opts.get("type", None)

    if event_type:
        # The event type can be specified with a string
        if isinstance(event_type, str):
            # pylint: disable=invalid-name
            et = Event.event_registry.get(event_type, None)
            if et is None:
                raise ValueError(
                    "{event_type} is not a valid opsdroid"
                    " event representation.".format(event_type=event_type)
                )
            event_type = et

        # TODO: Add option to match all subclasses as well
        # if isinstance(event, event_type):
        # pylint: disable=unidiomatic-typecheck
        if type(event) is event_type:
            for key in event_opts:
                if key != "type":
                    event_value = event_opts.get(key, None)
                    entity_value = event.entities.get(key, {}).get("value", None)

                    if (
                        isinstance(event_value, list)
                        and isinstance(entity_value, list)
                        and sorted(event_value) != sorted(entity_value)
                    ):
                        return False

                    if event_value != entity_value:
                        return False

            return True

    return False

async def parse_event_type(opsdroid, event):
    """Parse an event if it's of a certain type."""
    for skill in opsdroid.skills:
        for constraint in skill.constraints:
            if not constraint(event):
                return
        for matcher in skill.matchers:
            event_opts = matcher.get("event_type", {})
            result = await match_event(event, event_opts)
            if result:
                await opsdroid.run_skill(skill, skill.config, event)


text:
// Copyright (c) 2013-2015 Rapptz and contributors

// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#ifndef SOL_USERTYPE_TRAITS_HPP
#define SOL_USERTYPE_TRAITS_HPP

#include "demangle.hpp"

namespace old_sol {

template<typename T>
struct usertype_traits {
    static const std::string name;
    static const std::string metatable;
    static const std::string gctable;
};

template<typename T>
const std::string usertype_traits<T>::name = detail::demangle(typeid(T));

template<typename T>
const std::string usertype_traits<T>::metatable = std::string("old_sol.").append(detail::demangle(typeid(T)));

template<typename T>
const std::string usertype_traits<T>::gctable = std::string("old_sol.").append(detail::demangle(typeid(T))).append(".\xE2\x99\xBB");

}

#endif // SOL_USERTYPE_TRAITS_HPP


text:
@interface HRFMDB ()
@property (nonatomic, strong) FMDatabase *db;
@end

@implementation HRFMDB
//初始化fmdb对象
+ (instancetype)shareFMDBManager{
    return [[self alloc] init];
}

- (instancetype)init{
    self = [super init];
    if (self) {
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

        NSString *documentDirectory = [paths objectAtIndex:0];
        //dbPath: 数据库路径,在Document中。
        NSString *dbPath = [documentDirectory stringByAppendingPathComponent:@"wecheck.db"];
//        NSLog(@"数据库路径:%@", dbPath);
        _db = [FMDatabase databaseWithPath:dbPath];
    }
    return self;
}

- (BOOL)createTable {
    if ([_db open]) {
        NSString *sqlCreateTable =  [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS KeyValue (KEY TEXT PRIMARY KEY NOT NULL, VALUE TEXT NOT NULL)"];
        NSString *sqlCreateTable1 =  [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS CheckScene (CHECKSCENE TEXT NOT NULL, PEOPLENAME TEXT NOT NULL, PEOPLENUMBER TEXT NOT NULL, PRIMARY KEY (CHECKSCENE, PEOPLENAME, PEOPLENUMBER))"];
        NSString *sqlCreateTable2 =  [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS CheckRecord (CHECKSCENE TEXT NOT NULL, PEOPLENAME TEXT NOT NULL, PEOPLENUMBER TEXT NOT NULL, PEOPLESTATE TEXT NOT NULL, CHECKTIME TEXT NOT NULL)"];
        BOOL res = [_db executeUpdate:sqlCreateTable];
        BOOL res1 = [_db executeUpdate:sqlCreateTable1];
        BOOL res2 = [_db executeUpdate:sqlCreateTable2];
        if (!res) {
            NSLog(@"建表KeyValue失败");
            return NO;
        } else {
            NSLog(@"建表KeyValue成功");
        }
        if (!res1) {
            NSLog(@"建表CheckScene失败");
            return NO;
        } else {
            NSLog(@"建表CheckScene成功");
        }
        if (!res2) {
            NSLog(@"建表CheckRecord失败");
            return NO;
        } else {
            NSLog(@"建表CheckRecord成功");
        }
        [_db close];
    }
    return YES;
}
#pragma mark - KeyValue表方法
- (BOOL)setInToKeyValueTable:(id)value
                      forKey:(NSString *)key {
    NSError * error;
    NSData * data = [NSJSONSerialization dataWithJSONObject:value options:0 error:&error];
    if (error) {
        NSLog(@"转化json data失败");
        return NO;
    }
    NSString * jsonString = [[NSString alloc] initWithData:data encoding:(NSUTF8StringEncoding)];
    if ([_db open]) {
        NSString *sql = [NSString stringWithFormat:@"REPLACE INTO KeyValue (KEY, VALUE) VALUES (?, ?)"];
        BOOL res = [_db executeUpdate:sql,key,jsonString];
        if (!res) {
            NSLog(@"插入KeyValue失败");
            return NO;
        } else {
            NSLog(@"插入KeyValue成功");
        }
        [_db close];
    }
    return YES;
}
- (id)queryInKeyValueTable:(NSString *)key {
    NSString *json;
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT KEY, VALUE FROM KeyValue WHERE KEY = '%@'", key];
        FMResultSet * rs = [_db executeQuery:sql];
        if ([rs next]) {
            json = [rs stringForColumn:@"VALUE"];
        }
        [_db close];
    }
    if (json) {
        NSError * error;
        id result = [NSJSONSerialization JSONObjectWithData:[json dataUsingEncoding:NSUTF8StringEncoding]
                                                    options:NSJSONReadingAllowFragments error:&error];
        if (error) {
            NSLog(@"转化JSON失败");
            return nil;
        }
        return result;
    }
    return nil;
}
- (BOOL)deleteKeyValueTable:(NSString *)key{
    if ([_db open]) {
        NSString *deleteSql = [NSString stringWithFormat:@"DELETE from KeyValue WHERE KEY = '%@'", key];
        BOOL res = [_db executeUpdate:deleteSql];
        if (!res) {
            NSLog(@"删除KeyValue:%@出错", key);
        } else {
            NSLog(@"删除KeyValue:%@成功", key);
        }
        [_db close];
    }
    return YES;
}
#pragma mark - CheckScene表方法
- (BOOL)insertInToCheckSceneTable:(NSDictionary *)dic objectForKey:(NSString *)key {
    if ([_db open]) {
        NSString *sql = [NSString stringWithFormat:@"INSERT OR IGNORE INTO CheckScene (CHECKSCENE, PEOPLENAME, PEOPLENUMBER) VALUES (?, ?, ?)"];
        BOOL res = [_db executeUpdate:sql,key,dic[@"peopleName"],dic[@"peopleNumber"]];
        if (!res) {
            NSLog(@"插入CheckScene失败");
            return NO;
        } else {
            NSLog(@"插入CheckScene成功");
        }
        [_db close];
    }
    return YES;
}
- (NSString *)queryInCheckSceneTableCheckScene:(NSArray *)array {
    NSString *checkScene;
    NSString *string = @"";
    for (NSString *s in array) {
        string = [string stringByAppendingFormat:@"%@, ", s];
    }
    string = [string substringToIndex:string.length-2];
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT CheckScene, count() AS A FROM CheckScene WHERE PEOPLENUMBER IN (%@) GROUP BY CHECKSCENE ORDER BY A DESC", string];
        FMResultSet *rs = [_db executeQuery:sql];
        if ([rs next]) {
            checkScene = [rs stringForColumn:@"CHECKSCENE"];
        }
        [_db close];
    }
    return checkScene;
}
- (NSString *)queryInCheckSceneTableNum:(NSString *)key {
    NSString *num;
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT count(*) FROM CheckScene WHERE CHECKSCENE = '%@'", key];
        FMResultSet *rs = [_db executeQuery:sql];
        if ([rs next]) {
            num = [NSString stringWithFormat:@"%d", [rs intForColumn:@"count(*)"]];
        }
        [_db close];
    }
    return num;
}
- (id)queryInCheckSceneTable:(NSString *)key {
    NSMutableArray *peopleArr = [NSMutableArray array];
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT * FROM CheckScene WHERE CHECKSCENE = '%@'", key];
        FMResultSet * rs = [_db executeQuery:sql];
        while ([rs next]) {
            NSMutableDictionary *dicPeople = [NSMutableDictionary dictionary];
            [dicPeople setObject:[rs stringForColumn:@"PEOPLENAME"] forKey:@"peopleName"];
            [dicPeople setObject:[rs stringForColumn:@"PEOPLENUMBER"] forKey:@"peopleNumber"];
            [dicPeople setObject:[rs stringForColumn:@"CHECKSCENE"] forKey:@"checkScene"];
            [peopleArr addObject:dicPeople];
        }
        [_db close];
    }
    return peopleArr;
}
- (id)queryInCheckSceneTableCheckPeople:(NSArray *)array objectForKey:(NSString *)key {
    NSMutableArray *peopleArr = [NSMutableArray array];
    NSString *string = @"";
    for (NSString *s in array) {
        string = [string stringByAppendingFormat:@"%@, ", s];
    }
    string = [string substringToIndex:string.length-2];
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT * FROM CheckScene WHERE PEOPLENUMBER IN (%@) AND CHECKSCENE = '%@'",string , key];
        FMResultSet *rs = [_db executeQuery:sql];
        while ([rs next]) {
            NSMutableDictionary *dicPeople = [NSMutableDictionary dictionary];
            [dicPeople setObject:[rs stringForColumn:@"PEOPLENAME"] forKey:@"peopleName"];
            [dicPeople setObject:[rs stringForColumn:@"PEOPLENUMBER"] forKey:@"peopleNumber"];
            [dicPeople setObject:[rs stringForColumn:@"CHECKSCENE"] forKey:@"checkScene"];
            [peopleArr addObject:dicPeople];
        }
        [_db close];
    }
    return peopleArr;
}
- (BOOL)updateCheckSceneTable:(NSDictionary *)dicNew withOld:(NSDictionary *)dicOld {
    if ([_db open]) {
        NSString *sql = [NSString stringWithFormat:@"UPDATE CheckScene SET PEOPLENAME = '%@', PEOPLENUMBER = '%@' WHERE CHECKSCENE = '%@' AND PEOPLENAME = '%@' AND PEOPLENUMBER = '%@'", dicNew[@"peopleName"], dicNew[@"peopleNumber"], dicOld[@"checkScene"], dicOld[@"peopleName"], dicOld[@"peopleNumber"]];
        BOOL res = [_db executeUpdate:sql];
        if (!res) {
            NSLog(@"修改CheckScene失败");
            return NO;
        } else {
            NSLog(@"修改CheckScene成功");
        }
        [_db close];
    }
    return YES;
}
- (BOOL)deleteCheckSceneTable:(NSDictionary *)dic {
    if ([_db open]) {
        NSString *deleteSql = [NSString stringWithFormat:@"DELETE from CheckScene WHERE CHECKSCENE = '%@' AND PEOPLENAME = '%@' AND PEOPLENUMBER = '%@'", dic[@"checkScene"], dic[@"peopleName"], dic[@"peopleNumber"]];
        BOOL res = [_db executeUpdate:deleteSql];
        if (!res) {
            NSLog(@"删除CheckScene:%@出错", dic);
        } else {
            NSLog(@"删除CheckScene:%@成功", dic);
        }
        [_db close];
    }
    return YES;
}
- (BOOL)deleteCheckSceneTableAll:(NSString *)key {
    if ([_db open]) {
        NSString *deleteSql = [NSString stringWithFormat:@"DELETE from CheckScene WHERE CHECKSCENE = '%@'", key];
        BOOL res = [_db executeUpdate:deleteSql];
        if (!res) {
            NSLog(@"删除CheckScene:%@出错", key);
        } else {
            NSLog(@"删除CheckScene:%@成功", key);
        }
        [_db close];
    }
    return YES;
}
#pragma mark - CheckRecord表方法
- (BOOL)insertInToCheckRecordTable:(NSArray *)array allPeople:(NSArray *)arrayAll objectForKey:(NSString *)key {
    if ([_db open]) {
        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
        formatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"];
        formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
        NSString *stringTime = [formatter stringFromDate:[NSDate date]];
        for (NSDictionary *dic in arrayAll) {
            NSString *sql = [NSString stringWithFormat:@"INSERT INTO CheckRecord (CHECKSCENE, PEOPLENAME, PEOPLENUMBER, PEOPLESTATE, CHECKTIME) VALUES (?, ?, ?, ?, ?)"];
            BOOL res;
            if ([array containsObject:dic])
                //0签到 1迟到 2缺席
                res = [_db executeUpdate:sql,key,dic[@"peopleName"],dic[@"peopleNumber"],@"0",stringTime];
            else
                res = [_db executeUpdate:sql,key,dic[@"peopleName"],dic[@"peopleNumber"],@"2",stringTime];
            if (!res) {
                NSLog(@"插入CheckScene失败");
                return NO;
            } else {
                NSLog(@"插入CheckScene成功");
            }
        }
        [_db close];
    }
    return YES;
}
- (id)queryInCheckRecordTable {
    NSMutableArray *checkRecords = [NSMutableArray array];
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT CHECKSCENE,CHECKTIME FROM CheckRecord GROUP BY CHECKTIME"];
        FMResultSet * rs = [_db executeQuery:sql];
        while ([rs next]) {
            NSMutableDictionary *checkRecord = [NSMutableDictionary dictionary];
            [checkRecord setObject:[rs stringForColumn:@"CHECKSCENE"] forKey:@"checkScene"];
            [checkRecord setObject:[rs stringForColumn:@"CHECKTIME"] forKey:@"checkTime"];
            [checkRecords addObject:checkRecord];
        }
        [_db close];
    }
    return checkRecords;
}
- (id)queryInCheckRecordTableForAllScene {
    NSMutableDictionary *checkRecord = [NSMutableDictionary dictionary];
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT PEOPLESTATE, count() AS A FROM CheckRecord GROUP BY PEOPLESTATE"];
        FMResultSet * rs = [_db executeQuery:sql];
        while ([rs next]) {
            [checkRecord setObject:[rs stringForColumn:@"A"] forKey:[rs stringForColumn:@"PEOPLESTATE"]];
        }
        [_db close];
    }
    return checkRecord;
}
- (id)queryInCheckRecordTableForEachScene {
    NSMutableArray *eachScenes = [NSMutableArray array];
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT DISTINCT CHECKSCENE FROM CheckRecord"];
        FMResultSet * rs = [_db executeQuery:sql];
        while ([rs next]) {
            NSMutableDictionary *eachScene = [NSMutableDictionary dictionary];
            [eachScene setObject:[rs stringForColumn:@"CHECKSCENE"] forKey:@"checkScene"];
            [eachScenes addObject:eachScene];
        }
        [_db close];
    }
    return eachScenes;
}
- (id)queryInCheckRecordTableForEachSceneDetail:(NSMutableArray *)mutArray {
    if ([_db open]) {
        for (NSMutableDictionary *mutDic in mutArray) {
            NSString * sql = [NSString stringWithFormat:@"SELECT PEOPLESTATE, count() AS A FROM CheckRecord WHERE CHECKSCENE = '%@' GROUP BY CHECKSCENE, PEOPLESTATE", mutDic[@"checkScene"]];
            FMResultSet * rs = [_db executeQuery:sql];
            while ([rs next]) {
                [mutDic setObject:[rs stringForColumn:@"A"] forKey:[rs stringForColumn:@"PEOPLESTATE"]];
            }
        }
        [_db close];
    }
    return mutArray;
}
- (id)queryInCheckRecordTableForEachPeople:(NSMutableArray *)mutArray {
    if ([_db open]) {
        for (NSMutableDictionary *mutDic in mutArray) {
            NSString * sql = [NSString stringWithFormat:@"SELECT PEOPLESTATE,count() AS A FROM CheckRecord WHERE CHECKSCENE = '%@' AND PEOPLENUMBER = '%@' GROUP BY PEOPLESTATE", mutDic[@"checkScene"], mutDic[@"peopleNumber"]];
            FMResultSet * rs = [_db executeQuery:sql];
            while ([rs next]) {
                [mutDic setObject:[rs stringForColumn:@"A"] forKey:[rs stringForColumn:@"PEOPLESTATE"]];
            }
        }
        [_db close];
    }
    return mutArray;
}
- (id)queryInCheckRecordTableForEachPeopleDetail:(NSMutableDictionary *)mutDic {
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT PEOPLESTATE,CHECKTIME FROM CheckRecord WHERE CHECKSCENE = '%@' AND PEOPLENUMBER = '%@'", mutDic[@"checkScene"], mutDic[@"peopleNumber"]];
        FMResultSet * rs = [_db executeQuery:sql];
        NSMutableArray *mutArr = [NSMutableArray array];
        while ([rs next]) {
            NSMutableDictionary *mutDicTemp = [NSMutableDictionary dictionary];
            [mutDicTemp setObject:[rs stringForColumn:@"CHECKTIME"] forKey:@"checkTime"];
            [mutDicTemp setObject:[rs stringForColumn:@"PEOPLESTATE"] forKey:@"peopleState"];
            [mutArr addObject:mutDicTemp];
        }
        [mutDic setObject:mutArr forKey:@"checkDetail"];
        [_db close];
    }
    return mutDic;
}
- (id)queryInCheckRecordTableForEachTime:(NSString *)checkTime {
    NSMutableDictionary *checkRecord = [NSMutableDictionary dictionary];
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT PEOPLESTATE, count() AS A FROM CheckRecord WHERE CHECKTIME = '%@'  GROUP BY PEOPLESTATE", checkTime];
        FMResultSet * rs = [_db executeQuery:sql];
        while ([rs next]) {
            [checkRecord setObject:[rs stringForColumn:@"A"] forKey:[rs stringForColumn:@"PEOPLESTATE"]];
        }
        [_db close];
    }
    return checkRecord;
}
- (id)queryInCheckRecordTableForEdit:(NSString *)checkTime  objectForKey:(NSString *)key {
    NSMutableArray *checkRecords = [NSMutableArray array];
    if ([_db open]) {
        NSString * sql = [NSString stringWithFormat:@"SELECT * FROM CheckRecord WHERE CHECKTIME = '%@' AND CHECKSCENE = '%@'", checkTime, key];
        FMResultSet * rs = [_db executeQuery:sql];
        while ([rs next]) {
            NSMutableDictionary *checkRecord = [NSMutableDictionary dictionary];
            [checkRecord setObject:[rs stringForColumn:@"PEOPLENAME"] forKey:@"peopleName"];
            [checkRecord setObject:[rs stringForColumn:@"PEOPLESTATE"] forKey:@"peopleState"];
            [checkRecord setObject:[rs stringForColumn:@"PEOPLENUMBER"] forKey:@"peopleNumber"];
            [checkRecords addObject:checkRecord];
        }
        [_db close];
    }
    return checkRecords;
}
- (BOOL)updateCheckRecordTableForEdit:(NSDictionary *)dicCheck objectForKey:(NSString *)checkTime {
    if ([_db open]) {
        NSString *sql = [NSString stringWithFormat:@"UPDATE CheckRecord SET PEOPLESTATE = '%@' WHERE CHECKTIME = '%@' AND PEOPLENAME = '%@' AND PEOPLENUMBER = '%@'", dicCheck[@"peopleState"], checkTime, dicCheck[@"peopleName"], dicCheck[@"peopleNumber"]];
        BOOL res = [_db executeUpdate:sql];
        if (!res) {
            NSLog(@"修改CheckRecord失败");
            return NO;
        } else {
            NSLog(@"修改CheckRecord成功");
        }
        [_db close];
    }
    return YES;
}
- (BOOL)deleteCheckRecordTable:(NSDictionary *)dic {
    if ([_db open]) {
        NSString *deleteSql = [NSString stringWithFormat:@"DELETE from CheckRecord WHERE CHECKSCENE = '%@' AND CHECKTIME = '%@'", dic[@"checkScene"], dic[@"checkTime"]];
        BOOL res = [_db executeUpdate:deleteSql];
        if (!res) {
            NSLog(@"删除CheckRecord:%@出错", dic);
        } else {
            NSLog(@"删除CheckRecord:%@成功", dic);
        }
        [_db close];
    }
    return YES;
}
@end


text:
define(['exports', 'module'], function (exports, module) {
  // this file is overwritten by `npm run build:pre`
  'use strict';

  var version = '1.1.0-beta.2';
  module.exports = version;
});
//# sourceMappingURL=version.js.map


text:
CREATE PROCEDURE [dbo].[DeleteCustomer]
(
    @CustomerId int
)
AS
BEGIN
    SET NOCOUNT ON

    BEGIN TRANSACTION
        DELETE FROM dbo.AzureBlobPoliciesMap WHERE CustomerId = @CustomerId
        DELETE FROM dbo.AzurePoliciesForBlobAccess WHERE CustomerId = @CustomerId
        DELETE FROM dbo.AzurePoliciesForQueueAccess WHERE CustomerId = @CustomerId
        DELETE FROM dbo.AzureQueuePoliciesMap WHERE CustomerId = @CustomerId
        DELETE FROM dbo.StorageInfoList WHERE CustomerId = @CustomerId
        DELETE FROM dbo.Collector WHERE CustomerId = @CustomerId
        DELETE FROM dbo.Sites WHERE CustomerId = @CustomerId
        DELETE FROM dbo.Customers WHERE CustomerId = @CustomerId
    COMMIT TRANSACTION
END


text:
<?php
namespace App\Http\Middleware;
class CorsMiddleware {
    public function handle($request, \Closure $next)
    {
        $response = $next($request);
        $response->header('Access-Control-Allow-Methods', 'HEAD, GET, POST, PUT, PATCH, DELETE');
        $response->header('Access-Control-Allow-Headers', $request->header('Access-Control-Request-Headers'));
        $response->header('Access-Control-Allow-Origin', '*');
        return $response;
    }
}


text:
<?php

use ondrs\UploadManager\Utils;
use Tester\Assert;

require_once __DIR__ . '/../../bootstrap.php';

class UtilsTest extends Tester\TestCase
{

    function testNormalizePath()
    {
        Assert::same('/aaa/aaaa/vvv', Utils::normalizePath('/////aaa/aaaa//vvv/////'));
    }

    function testMakeDirectoryRecursive()
    {
        $dir = TEMP_DIR . '/a/b/c/d/e';
        Assert::false(is_dir($dir));
        Utils::makeDirectoryRecursive($dir);
        Assert::true(is_dir($dir));
    }

    function testSanitizeLongPHPFileName()
    {
        $filename = TEMP_DIR . '/' . \Nette\Utils\Random::generate(150) . '.php';
        \Nette\Utils\FileSystem::write($filename, '');
        $fileInfo = new SplFileInfo($filename);

        $fileUpload = new \Nette\Http\FileUpload([
            'name' => $fileInfo->getBasename(),
            'type' => $fileInfo->getType(),
            'size' => $fileInfo->getSize(),
            'tmp_name' => $filename,
            'error' => 0
        ]);

        $filename = Utils::sanitizeFileName($fileUpload);

        Assert::equal(64, \Nette\Utils\Strings::length($filename));
        Assert::equal('php', $fileInfo->getExtension());
    }

    function testSanitizeLongHTMLFileName()
    {
        $filename = TEMP_DIR . '/' . \Nette\Utils\Random::generate(150) . '.html';
        \Nette\Utils\FileSystem::write($filename, '');
        $fileInfo = new SplFileInfo($filename);

        $fileUpload = new \Nette\Http\FileUpload([
            'name' => $fileInfo->getBasename(),
            'type' => $fileInfo->getType(),
            'size' => $fileInfo->getSize(),
            'tmp_name' => $filename,
            'error' => 0
        ]);

        $filename = Utils::sanitizeFileName($fileUpload);

        Assert::equal(65, \Nette\Utils\Strings::length($filename));
        Assert::equal('html', $fileInfo->getExtension());
    }

    function testSanitizeShortTXTFileName()
    {
        $filename = TEMP_DIR . '/' . \Nette\Utils\Random::generate(10) . '.txt';
        \Nette\Utils\FileSystem::write($filename, '');
        $fileInfo = new SplFileInfo($filename);

        $fileUpload = new \Nette\Http\FileUpload([
            'name' => $fileInfo->getBasename(),
            'type' => $fileInfo->getType(),
            'size' => $fileInfo->getSize(),
            'tmp_name' => $filename,
            'error' => 0
        ]);

        $filename = Utils::sanitizeFileName($fileUpload);

        Assert::equal(24, \Nette\Utils\Strings::length($filename));
        Assert::equal('txt', $fileInfo->getExtension());
    }

    function testFileUploadFromFileException()
    {
        Assert::exception(function() {
            Utils::fileUploadFromFile('aaa.bbb');
        }, '\ondrs\UploadManager\FileNotExistsException');
    }

    function testFileUploadFromFile()
    {
        $fileUpload = Utils::fileUploadFromFile(__DIR__ . '/data/focus.png');
        Assert::type('\Nette\Http\FileUpload', $fileUpload);
        Assert::true($fileUpload->isImage());
    }

}

run(new UtilsTest());


text:
"""
The base type used by all breeder sources.
"""
abstract BreederSource

"""
The base type used by all breeder source definitions.
"""
abstract BreederSourceDefinition

"""
Provides a definition of a selection breeder source.
"""
type SelectionBreederSourceDefinition <: BreederSourceDefinition
  label::AbstractString
  operator::SelectionDefinition

  SelectionBreederSourceDefinition(label::AbstractString, op::SelectionDefinition) =
    new(label, op)
end

type SelectionBreederSource <: BreederSource
  label::AbstractString
  operator::Selection
  eigen::Type

  SelectionBreederSource(label::AbstractString, s::Selection) =
    new(label, s)
end

"""
Composes a given selection breeder source.
"""
function compose!(
  def::SelectionBreederSourceDefinition,
  ::Species,
  ::Dict{AbstractString, BreederSource}
)
  op = compose!(def.operator)
  s = SelectionBreederSource(def.label, op)
  s.eigen = anonymous_type(breeder)
  s
end

"""
A selection source.
"""
selection_source(label::AbstractString, op::SelectionDefinition) =
  SelectionBreederSourceDefinition(label, op)

"""
Provides a definition of a variation breeder source.
"""
type VariationBreederSourceDefinition <: BreederSourceDefinition
  label::AbstractString
  source::AbstractString
  stage::AbstractString
  operator::VariationDefinition

  VariationBreederSourceDefinition(
    label::AbstractString,
    source::AbstractString,
    stage::AbstractString,
    operator::VariationDefinition
  ) =
    new(label, source, stage, operator)
end

type VariationBreederSource <: BreederSource
  label::AbstractString
  operator::Variation
  source_name::AbstractString
  stage_name::AbstractString
  eigen::Type
  source::BreederSource
  stage_getter::Function

  VariationBreederSource(
    label::AbstractString,
    v::Variation,
    source_name::AbstractString,
    stage_name::AbstractString
  ) =
    new(label, v, source_name, stage_name)
end

"""
Composes a variation breeder source.

**Parameters:**

* `def::VariationBreederSourceDefinition`, a definition of the breeder source
that is to be composed.
* `species::Species`, the species that this breeder belongs to.
* `sources::Dict{AbstractString, Source}`, a dictionary containing the sources
of the breeder that this source belongs to.
"""
function compose!(
  def::VariationBreederSourceDefinition,
  sp::Species,
  sources::Dict{AbstractString, BreederSource}
)
  # Find the stage and representation used by this source.
  stage = sp.stages[def.stage]
  representation = species.rep(stage) # TODO: FIX FIX FIX

  # Build the variation operator.
  op = compose!(def.operator, representation)

  # Build the breeder source.
  v = VariationBreederSource(def.label, op, def.source, def.stage)
  v.eigen = anonymous_type(breeder)
  v.source = sources[def.source]
  v.stage_getter =
    eval(Main, Base.parse("inds -> Wallace.IndividualStage{$(chromosome(representation))}[i.$(def.stage) for i in inds]"))
  v
end

"""
DOCUMENT: breeder.variation
"""
variation_source(
  label::AbstractString,
  source::AbstractString,
  stage::AbstractString,
  op::VariationDefinition
) =
  VariationBreederSourceDefinition(label, source, stage, op)

type MultiBreederSource <: BreederSource
  sources::Vector{BreederSource}
  MultiBreederSource(sources::Vector{BreederSource}) = new(sources)
end


text:
 {{onion.name}}
{{onion.total | number}}

{{onion.core | number}}
 core
(80% commits)

{{onion.regular | number}}
 regular
(15% commits)

{{onion.casual | number}}
 casual
(5% commits)


text:
This styleguide recommends best practices for API development.

## Instance variables

Please do not use instance variables, there is no need for them (we don't need
to access them as we do in Rails views), local variables are fine.

## Entities

Always use an [Entity] to present the endpoint's payload.

## Methods and parameters description

Every method must be described using the [Grape DSL](https://github.com/ruby-grape/grape#describing-methods)
(see https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/api/environments.rb
for a good example):

- `desc` for the method summary. You should pass it a block for additional
  details such as:
  - The GitLab version when the endpoint was added
  - If the endpoint is deprecated, and if so, when will it be removed

- `params` for the method params. This acts as description,
  [validation, and coercion of the parameters]

A good example is as follows:

```ruby
desc 'Get all broadcast messages' do
  detail 'This feature was introduced in GitLab 8.12.'
  success Entities::BroadcastMessage
end
params do
  optional :page,     type: Integer, desc: 'Current page number'
  optional :per_page, type: Integer, desc: 'Number of messages per page'
end
get do
  messages = BroadcastMessage.all

  present paginate(messages), with: Entities::BroadcastMessage
end
```

## Declared params

> Grape allows you to access only the parameters that have been declared by your
`params` block. It filters out the params that have been passed, but are not
allowed.

– https://github.com/ruby-grape/grape#declared

### Exclude params from parent namespaces!

> By default `declared(params) `includes parameters that were defined in all
parent namespaces.

– https://github.com/ruby-grape/grape#include-parent-namespaces

In most cases you will want to exclude params from the parent namespaces:

```ruby
declared(params, include_parent_namespaces: false)
```

### When to use `declared(params)`?

You should always use `declared(params)` when you pass the params hash as
arguments to a method call.

For instance:

```ruby
# bad
User.create(params) # imagine the user submitted `admin=1`... :)

# good
User.create(declared(params, include_parent_namespaces: false).to_h)
```

>**Note:**
`declared(params)` return a `Hashie::Mash` object, on which you will have to
call `.to_h`.

But we can use `params[key]` directly when we access single elements.

For instance:

```ruby
# good
Model.create(foo: params[:foo])
```

[Entity]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/api/entities.rb
[validation, and coercion of the parameters]: https://github.com/ruby-grape/grape#parameter-validation-and-coercion


text:
<?php
require_once dirname(__DIR__, 3) . "/php/classes/autoload.php";
require_once dirname(__DIR__, 3) . "/php/lib/xsrf.php";
require_once "/etc/apache2/capstone-mysql/encrypted-config.php";

use Edu\Cnm\Cannaduceus\StrainFavorite;

/**
 * * api for strainFavorite class
 *
 * @author Nathan Sanchez <nsanchez121@cnm.com>
 **/

// Check the session status. If it is not active, start the session.
if(session_status() !== PHP_SESSION_ACTIVE) {
	session_start();
}

// prepare an empty reply
$reply = new stdClass();
$reply->status = 200;
$reply->data = null;
// Here we create a new stdClass named $reply. A stdClass is basically an empty bucket that we can use to store things in.
// We will use this object named $reply to store the results of the call to our API. The status 200 line adds a state variable to $reply called status and initializes it with the integer 200 (success code). The proceeding line adds a state variable to $reply called data. This is where the result of the API call will be stored. We will also update $reply->message as we proceed through the API.

try {
	//grab the mySQL DataBase connection
	$pdo = connectToEncryptedMySQL("/etc/apache2/capstone-mysql/cannaduceus.ini");

	//determines which HTTP Method needs to be processed and stores the result in $method.
	$method = array_key_exists("HTTP_x_HTTP_METHOD", $_SERVER) ? $_SERVER["HTTP_X_HTTP_METHOD"] : $_SERVER["REQUEST_METHOD"];

	//stores the Primary Key for the GET, DELETE, and PUT methods in $id. This key will come in the URL sent by the front end. If no key is present, $id will remain empty. Note that the input is filtered.
	$id = filter_input(INPUT_GET, "id", FILTER_VALIDATE_INT);

	//Here we check and make sure that we have the Primary Key for the DELETE and PUT requests. If the request is a PUT or DELETE and no key is present in $id, An Exception is thrown.
	if(($method === "DELETE" || $method === "PUT") && (empty($id) === true || $id < 0)) {
		throw(new InvalidArgumentException("id cannot be empty or negative", 405));
	}
	// Here, we determine if the request received is a GET request
	if($method === "GET") {
		//set XSRF cookie
		setXsrfCookie("/");
		// handle GET request - if id is present, that strainFavorite is present, that strainFavorite is returned, otherwise all strainFavorites are returned

		// Here, we determine if a Key was sent in the URL by checking $id. If so, we pull the requested strainFavorite by strainFavorite ID from the DataBase and store it in $strainFavorite.
		if(empty($id) === false) {
			$strainFavorite = StrainFavorite::getStrainFavoriteByStrainFavoriteProfileId($pdo, $id);
			if($strainFavorite !== null) {
				$reply->data = $strainFavorite;
				// Here, we store the retrieved strainFavorite in the $reply->data state variable.
			}
	} else if(empty($strainFavoriteProfileId)) {
			$strainFavorite = StrainFavorite::getStrainFavoriteByStrainFavoriteStrainIdAndStrainFavoriteProfileId($pdo, $id, $strainId);
			if($strainFavorite !== null) {
				$reply->data = $strainFavorite;
			}
		} else if(empty($strainFavoriteStrainId)) {
			$strainFavorite = StrainFavorite::getStrainFavoriteByStrainFavoriteStrainId($pdo, $strainId);
			if($strainFavorite !== null) {
				$reply->data = $strainFavorite;
			}
		}
	} else if($method === "POST") {

		verifyXSRF();
		$requestContent = file_get_contents("php://input");
		$requestObject = json_decode($requestContent); // changed from $requestObject to $requestContent dec 9

		//make sure tweet content is available (required field)
		if(empty($requestObject->strainFavoriteFavoriteId) === true) {
			throw(new \InvalidArgumentException ("no Favorite added", 405));
		}
		//  make sure profileId is available
		if(empty($requestObject->profileIdFavoriteFavoriteId) === true) {
			throw(new \InvalidArgumentException ("No Profile ID.", 405));
		}
		if(empty($_SESSION["profile"]->getProfileId()) === true) {
			throw(new \InvalidArgumentException ("Favorite must be linked to the user", 405)); // add this to dispensary Favorite
		}
	} else if($method === "POST") {
		// create a new favorite and insert into the database
		$strainFavorite = new StrainFavorite($_SESSION["profile"]->getProfileId(),$requestObject->profileId, $requestObject->strainFavorite); // add this to dispensary Favorite
		$strainFavorite->insert($pdo);
		// update dat reply
		$reply->message = "favorite has been created";
	}

}		// update reply with exception information
catch(Exception $exception) {
	$reply->status = $exception->getCode();
	$reply->message = $exception->getMessage();
} catch(TypeError $typeError) {
	$reply->status = $typeError->getCode();
	$reply->message = $typeError->getMessage();
}

header("Content-type: application/json");
if($reply->data === null) {
	unset($reply->data);
}

// encode and return reply to front end caller
echo json_encode($reply);


text:
<?php

/**
 * Abstraction of a list resource from the Twilio API.
 *
 * @category Services
 * @package  Services_Twilio
 * @author   Neuman Vong <neuman@twilio.com>
 * @license  http://creativecommons.org/licenses/MIT/ MIT
 * @link     http://pear.php.net/package/Services_Twilio
 */
abstract class Services_Twilio_ListResource
    extends Services_Twilio_Resource
    implements IteratorAggregate, Countable
{

    public function __construct($client, $uri) {
        $name = $this->getResourceName(true);
        /*
         * By default trim the 's' from the end of the list name to get the
         * instance name (ex Accounts -> Account). This behavior can be
         * overridden by child classes if the rule doesn't work.
         */
        if (!isset($this->instance_name)) {
            $this->instance_name = "Services_Twilio_Rest_" . rtrim($name, 's');
        }
        parent::__construct($client, $uri);
    }

    /**
     * Gets a resource from this list.
     *
     * @param string $sid The resource SID
     * @return Services_Twilio_InstanceResource The resource
     */
    public function get($sid)
    {
        $instance = new $this->instance_name(
            $this->client, $this->uri . "/$sid"
        );
        // XXX check if this is actually a sid in all cases.
        $instance->sid = $sid;
        return $instance;
    }

    /*
     * Construct an InstanceResource with the specified params.
     *
     * @param array params usually a JSON HTTP response from the API
     * @return Services_Twilio_InstanceResource An instance with properties
     *      initialized to the values in the params array.
     */
    public function getObjectFromJson($params, $idParam = "sid")
    {
        if (isset($params->{$idParam})) {
            $uri = $this->uri . "/" . $params->{$idParam};
        } else {
            $uri = $this->uri;
        }
        return new $this->instance_name($this->client, $uri, $params);
    }

    /**
     * Deletes a resource from this list.
     *
     * @param string $sid The resource SID
     * @return null
     */
    public function delete($sid, array $params = array())
    {
        $this->client->deleteData($this->uri . '/' . $sid, $params);
    }

    /**
     * Create a resource on the list and then return its representation as an
     * InstanceResource.
     *
     * @param array $params The parameters with which to create the resource
     *
     * @return Services_Twilio_InstanceResource The created resource
     */
    protected function _create(array $params)
    {
        $params = $this->client->createData($this->uri, $params);
        /* Some methods like verified caller ID don't return sids. */
        if (isset($params->sid)) {
            $resource_uri = $this->uri . '/' . $params->sid;
        } else {
            $resource_uri = $this->uri;
        }
        return new $this->instance_name($this->client, $resource_uri, $params);
    }

    /**
     * Returns a page of InstanceResources from this list.
     *
     * @param int    $page The start page
     * @param int    $size Number of items per page
     * @param array  $filters Optional filters
     * @param string $deep_paging_uri if provided, the $page and $size
     *      parameters will be ignored and this URI will be requested directly.
     *
     * @return Services_Twilio_Page A page
     */
    public function getPage(
        $page = 0, $size = 50, array $filters = array(),
        $deep_paging_uri = null
    ) {
        $list_name = $this->getResourceName();
        if ($deep_paging_uri !== null) {
            $page = $this->client->retrieveData($deep_paging_uri, array(), true);
        } else {
            $page = $this->client->retrieveData($this->uri, array(
                'Page' => $page,
                'PageSize' => $size,
            ) + $filters);
        }

        /* create a new PHP object for each json obj in the api response. */
        $page->$list_name = array_map(
            array($this, 'getObjectFromJson'),
            $page->$list_name
        );
        if (isset($page->next_page_uri)) {
            $next_page_uri = $page->next_page_uri;
        } else {
            $next_page_uri = null;
        }
        return new Services_Twilio_Page($page, $list_name, $next_page_uri);
    }

    /**
     * Get the total number of instance members. Note this will make one small
     * HTTP request to retrieve the total, every time this method is called.
     *
     * If the total is not set or an Exception was thrown, returns 0
     *
     * @return integer
     *
     */
    public function count() {
        try {
            $page = $this->getPage(0, 1);
            return $page ? (int)$page->total : 0;
        } catch (Exception $e) {
            return 0;
        }
    }

    /**
     * Returns an iterable list of InstanceResources
     *
     * @param int   $page The start page
     * @param int   $size Number of items per page
     * @param array $size Optional filters
     *
     * The filter array can accept full datetimes when StartTime or DateCreated
     * are used. Inequalities should be within the key portion of the array and
     * multiple filter parameters can be combined for more specific searches.
     *
     * eg.
     *   array('DateCreated>' => '2011-07-05 08:00:00', 'DateCreated<' => '2011-08-01')
     * or
     *   array('StartTime<' => '2011-07-05 08:00:00')
     *
     * @return Services_Twilio_AutoPagingIterator An iterator
     */
    public function getIterator(
        $page = 0, $size = 50, array $filters = array()
    ) {
        return new Services_Twilio_AutoPagingIterator(
            array($this, 'getPageGenerator'), $page, $size, $filters
        );
    }

    /*
     * Retrieve a new page of API results, and update iterator parameters.
     */
    public function getPageGenerator(
        $page, $size, array $filters = array(), $deep_paging_uri = null
    ) {
        return $this->getPage($page, $size, $filters, $deep_paging_uri);
    }
}


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

namespace Interop\Amqp\Impl;

use Interop\Amqp\AmqpBind as InteropAmqpBind;
use Interop\Amqp\AmqpDestination;

final class AmqpBind implements InteropAmqpBind
{
    /**
     * @var AmqpDestination
     */
    private $target;

    /**
     * @var AmqpDestination
     */
    private $source;

    /**
     * @var null
     */
    private $routingKey;

    /**
     * @var int
     */
    private $flags;

    /**
     * @var array
     */
    private $arguments;

    public function __construct(
        AmqpDestination $target,
        AmqpDestination $source,
        string $routingKey = null,
        int $flags = self::FLAG_NOPARAM,
        array $arguments = []
    ) {
        $this->target = $target;
        $this->source = $source;
        $this->routingKey = $routingKey;
        $this->flags = $flags;
        $this->arguments = $arguments;
    }

    public function getTarget(): AmqpDestination
    {
        return $this->target;
    }

    public function getSource(): AmqpDestination
    {
        return $this->source;
    }

    public function getRoutingKey(): ?string
    {
        return $this->routingKey;
    }

    public function getFlags(): int
    {
        return $this->flags;
    }

    public function getArguments(): array
    {
        return $this->arguments;
    }
}


text:
package io.vertx.ext.auth.impl;

import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.auth.AuthProvider;
import io.vertx.ext.auth.ChainAuth;
import io.vertx.ext.auth.User;

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

public class ChainAuthImpl implements ChainAuth {

  private final List<AuthProvider> providers = new ArrayList<>();

  @Override
  public ChainAuth append(AuthProvider other) {
    providers.add(other);
    return this;
  }

  @Override
  public boolean remove(AuthProvider other) {
    return providers.remove(other);
  }

  @Override
  public void clear() {
    providers.clear();
  }

  @Override
  public void authenticate(final JsonObject authInfo, final Handler<AsyncResult<User>> resultHandler) {
    iterate(0, authInfo, resultHandler);
  }

  private void iterate(final int idx, final JsonObject authInfo, final Handler<AsyncResult<User>> resultHandler) {
    // stop condition
    if (idx >= providers.size()) {
      // no more providers, means that we failed to find a provider capable of performing this operation
      resultHandler.handle(Future.failedFuture("No more providers in the auth chain."));
      return;
    }

    // attempt to perform operation
    providers.get(idx).authenticate(authInfo, res -> {
      if (res.succeeded()) {
        resultHandler.handle(res);
      } else {
        // try again with next provider
        iterate(idx + 1, authInfo, resultHandler);
      }
    });
  }
}


text:
package software.amazon.awssdk.protocols.xml.internal.marshall;

import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.http.SdkHttpFullRequest;

@SdkInternalApi
public final class XmlMarshallerContext {

    private final XmlGenerator xmlGenerator;
    private final XmlProtocolMarshaller protocolMarshaller;
    private final XmlMarshallerRegistry marshallerRegistry;
    private final SdkHttpFullRequest.Builder request;

    public XmlMarshallerContext(Builder builder) {
        this.xmlGenerator = builder.xmlGenerator;
        this.protocolMarshaller = builder.protocolMarshaller;
        this.marshallerRegistry = builder.marshallerRegistry;
        this.request = builder.request;
    }

    public XmlGenerator xmlGenerator() {
        return xmlGenerator;
    }

    public XmlProtocolMarshaller protocolMarshaller() {
        return protocolMarshaller;
    }

    /**
     * @return Marshaller registry to obtain marshaller implementations for nested types (i.e. lists of objects or maps of string
     *     to string).
     */
    public XmlMarshallerRegistry marshallerRegistry() {
        return marshallerRegistry;
    }

    /**
     * @return Mutable {@link SdkHttpFullRequest.Builder} object that can be used to add headers, query params,
     * modify request URI, etc.
     */
    public SdkHttpFullRequest.Builder request() {
        return request;
    }

    /**
     * Convenience method to marshall a nested object (may be simple or structured) at the given location.
     *
     * @param marshallLocation Current {@link MarshallLocation}
     * @param val              Value to marshall.
     */
    public void marshall(MarshallLocation marshallLocation, Object val) {
        marshallerRegistry.getMarshaller(marshallLocation, val).marshall(val, this, null, null);
    }

    /**
     * Convenience method to marshall a nested object (may be simple or structured) at the given location.
     *
     * @param marshallLocation Current {@link MarshallLocation}
     * @param val              Value to marshall.
     * @param paramName        Name of parameter to marshall.
     */
    public <T> void marshall(MarshallLocation marshallLocation, T val, String paramName, SdkField<T> sdkField) {
        marshallerRegistry.getMarshaller(marshallLocation, val).marshall(val, this, paramName, sdkField);
    }

    /**
     * @return Builder instance to construct a {@link XmlMarshallerContext}.
     */
    public static Builder builder() {
        return new Builder();
    }

    /**
     * Builder for a {@link XmlMarshallerContext}.
     */
    public static final class Builder {

        private XmlGenerator xmlGenerator;
        private XmlProtocolMarshaller protocolMarshaller;
        private XmlMarshallerRegistry marshallerRegistry;
        private SdkHttpFullRequest.Builder request;

        private Builder() {
        }

        public Builder xmlGenerator(XmlGenerator xmlGenerator) {
            this.xmlGenerator = xmlGenerator;
            return this;
        }

        public Builder protocolMarshaller(XmlProtocolMarshaller protocolMarshaller) {
            this.protocolMarshaller = protocolMarshaller;
            return this;
        }

        public Builder marshallerRegistry(XmlMarshallerRegistry marshallerRegistry) {
            this.marshallerRegistry = marshallerRegistry;
            return this;
        }

        public Builder request(SdkHttpFullRequest.Builder request) {
            this.request = request;
            return this;
        }

        public XmlMarshallerContext build() {
            return new XmlMarshallerContext(this);
        }
    }
}


text:
<?php
namespace Pingpong\Shortcode;

use Countable;
use Thunder\Shortcode\HandlerContainer\HandlerContainer;
use Thunder\Shortcode\Parser\RegexParser;
use Thunder\Shortcode\Processor\Processor;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;

class Shortcode implements Countable
{
    /** @var HandlerContainer */
    private $handlers;

    /**
     * The constructor.
     */
    public function __construct()
    {
        $this->handlers = new HandlerContainer();
    }

    /**
     * Get all shortcodes.
     *
     * @return array
     */
    public function all()
    {
        return $this->handlers->getNames();
    }

    /**
     * Register new shortcode.
     *
     * @param string $name
     * @param mixed  $callback
     */
    public function register($name, $callback)
    {
        $this->handlers->add($name, $callback);
    }

    /**
     * Unregister the specified shortcode by given name.
     *
     * @param string $name
     */
    public function unregister($name)
    {
        if ($this->exists($name)) {
            $this->handlers->remove($name);
        }

        return $this;
    }

    /**
     * Unregister all shortcodes.
     *
     * @return self
     */
    public function destroy()
    {
        $this->handlers = new HandlerContainer();

        return $this;
    }

    /**
     * Strip any shortcodes.
     *
     * @param string $content
     *
     * @return string
     */
    public function strip($content)
    {
        $handlers = new HandlerContainer();
        $handlers->setDefault(function(ShortcodeInterface $s) { return $s->getContent(); });
        $processor = new Processor(new RegexParser(), $handlers);

        return $processor->process($content);
    }

    /**
     * Get count from all shortcodes.
     *
     * @return int
     */
    public function count()
    {
        return count($this->handlers->getNames());
    }

    /**
     * Return true is the given name exist in shortcodes array.
     *
     * @param string $name
     *
     * @return bool
     */
    public function exists($name)
    {
        return $this->handlers->has($name);
    }

    /**
     * Return true is the given content contain the given name shortcode.
     *
     * @param string $content
     * @param string $name
     *
     * @return bool
     */
    public function contains($content, $name)
    {
        $hasShortcode = false;

        $handlers = new HandlerContainer();
        $handlers->setDefault(function(ShortcodeInterface $s) use($name, &$hasShortcode) {
            if($s->getName() === $name) {
                $hasShortcode = true;
            }
        });
        $processor = new Processor(new RegexParser(), $handlers);
        $processor->process($content);

        return $hasShortcode;
    }

    /**
     * Parse content and replace parts of it using registered handlers
     *
     * @param $content
     *
     * @return string
     */
    public function parse($content)
    {
        $processor = new Processor(new RegexParser(), $this->handlers);

        return $processor->process($content);
    }
}


text:
@implementation DTScrollView

- (void)scrollWheel:(NSEvent *)theEvent {

	BOOL shouldForwardScroll = NO;

	if (self.usesPredominantAxisScrolling) {
		if (fabs(theEvent.deltaX) < fabs(theEvent.deltaY)) {
			// vertical scroll
			if (!self.hasVerticalScroller) {
				shouldForwardScroll	= YES;
			}
		}
	}

	if (shouldForwardScroll) {
		[[self nextResponder] scrollWheel:theEvent];
	} else {
		[super scrollWheel:theEvent];
	}
}

@end


text:
//=================================================================================================

//=================================================================================================

#ifndef _BLAZE_MATH_TRAITS_TRANSEXPRTRAIT_H_
#define _BLAZE_MATH_TRAITS_TRANSEXPRTRAIT_H_

//*************************************************************************************************
// Includes
//*************************************************************************************************

#include <blaze/math/traits/DMatTransExprTrait.h>
#include <blaze/math/traits/DVecTransExprTrait.h>
#include <blaze/math/traits/SMatTransExprTrait.h>
#include <blaze/math/traits/SVecTransExprTrait.h>
#include <blaze/math/traits/TDMatTransExprTrait.h>
#include <blaze/math/traits/TDVecTransExprTrait.h>
#include <blaze/math/traits/TSMatTransExprTrait.h>
#include <blaze/math/traits/TSVecTransExprTrait.h>
#include <blaze/math/typetraits/IsDenseMatrix.h>
#include <blaze/math/typetraits/IsDenseVector.h>
#include <blaze/math/typetraits/IsMatrix.h>
#include <blaze/math/typetraits/IsRowMajorMatrix.h>
#include <blaze/math/typetraits/IsRowVector.h>
#include <blaze/math/typetraits/IsVector.h>
#include <blaze/util/InvalidType.h>
#include <blaze/util/mpl/If.h>
#include <blaze/util/mpl/Or.h>
#include <blaze/util/typetraits/IsConst.h>
#include <blaze/util/typetraits/IsNumeric.h>
#include <blaze/util/typetraits/IsReference.h>
#include <blaze/util/typetraits/IsVolatile.h>
#include <blaze/util/typetraits/RemoveCV.h>
#include <blaze/util/typetraits/RemoveReference.h>

namespace blaze {

//=================================================================================================
//
//  CLASS DEFINITION
//
//=================================================================================================

//*************************************************************************************************
/*!\brief Evaluation of the return type of a transpose expression.
// \ingroup math_traits
//
// Via this type trait it is possible to evaluate the return type of a transpose expression.
// Given the type \a T, which must either be a vector or matrix type, the nested type \a Type
// corresponds to the resulting return type. In case the type of \a T doesn't fit or if
// no transpose operation exists for the type, the resulting data type \a Type is set to
// \a INVALID_TYPE.
*/
template< typename T >  // Type of the transpose operand
struct TransExprTrait
{
 private:
   //**struct Failure******************************************************************************
   /*! \cond BLAZE_INTERNAL */
   struct Failure { typedef INVALID_TYPE  Type; };
   /*! \endcond */
   //**********************************************************************************************

   //**********************************************************************************************
   /*! \cond BLAZE_INTERNAL */
   typedef typename If< IsMatrix<T>
                      , typename If< IsDenseMatrix<T>
                                   , typename If< IsRowMajorMatrix<T>
                                                , DMatTransExprTrait<T>
                                                , TDMatTransExprTrait<T>
                                                >::Type
                                   , typename If< IsRowMajorMatrix<T>
                                                , SMatTransExprTrait<T>
                                                , TSMatTransExprTrait<T>
                                                >::Type
                                   >::Type
                      , typename If< IsVector<T>
                                   , typename If< IsDenseVector<T>
                                                , typename If< IsRowVector<T>
                                                             , TDVecTransExprTrait<T>
                                                             , DVecTransExprTrait<T>
                                                             >::Type
                                                , typename If< IsRowVector<T>
                                                             , TSVecTransExprTrait<T>
                                                             , SVecTransExprTrait<T>
                                                             >::Type
                                                >::Type
                                   , Failure
                                   >::Type
                      >::Type  Tmp;

   typedef typename RemoveReference< typename RemoveCV<T>::Type >::Type  Type1;
   /*! \endcond */
   //**********************************************************************************************

 public:
   //**********************************************************************************************
   /*! \cond BLAZE_INTERNAL */
   typedef typename If< Or< IsConst<T>, IsVolatile<T>, IsReference<T> >
                      , TransExprTrait<Type1>, Tmp >::Type::Type  Type;
   /*! \endcond */
   //**********************************************************************************************
};
//*************************************************************************************************

} // namespace blaze

#endif


text:
package com.castle.integration.webapp.json;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface PathFilter {

	String value() default "";
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jme3.gde.assetpack.browser;

import com.jme3.gde.assetpack.browser.nodes.AssetPackBrowserFolder;
import com.jme3.gde.assetpack.Installer;
import com.jme3.gde.assetpack.XmlHelper;
import com.jme3.gde.core.assets.ProjectAssetManager;
import java.io.File;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.netbeans.api.project.Project;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.nodes.Node;
import org.openide.util.Exceptions;
import org.openide.util.Lookup;
import org.openide.util.NbPreferences;
import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;
import org.openide.xml.XMLUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;

/**
 *
 * @author normenhansen
 */
public class AssetPackLibrary implements Project {

    FileObject library;
    Element[] assetElements = new Element[0];
    InstanceContent content = new InstanceContent();
    Lookup lookup = new AbstractLookup(content);
    private ProjectAssetManager projectAssetManager;
    private List<String> categories = new LinkedList<String>();

    public AssetPackLibrary() {
        content.add(this);
    }

    private void initLibrary() {
        String path = NbPreferences.forModule(Installer.class).get("assetpack_path", null);
        library = FileUtil.toFileObject(new File(path));
    }

    public Node getRootNode() {
        parseLibrary();
        AssetPackBrowserFolder multi = new AssetPackBrowserFolder(assetElements, this);
        return multi;
    }

    public Node getRootNode(String[] categories, String[] tags) {
        parseLibrary();
        AssetPackBrowserFolder multi = new AssetPackBrowserFolder(assetElements, this, categories, tags);
        return multi;
    }

    public Node getRootNode(String category) {
        parseLibrary();
        AssetPackBrowserFolder multi = new AssetPackBrowserFolder(assetElements, this, new String[]{category}, null);
        return multi;
    }

    public Node getRootNode(String[] tags) {
        parseLibrary();
        AssetPackBrowserFolder multi = new AssetPackBrowserFolder(assetElements, this, null, tags);
        return multi;
    }

    private void parseLibrary() {
        initLibrary();
        categories.clear();
        FileObject[] object = library.getChildren();
        List<Element> assetElements = new LinkedList<Element>();
        for (int i = 0; i < object.length; i++) {
            FileObject fileObject = object[i];
            if (fileObject.isFolder()) {
                FileObject config = fileObject.getFileObject("assetpack.xml");
                if (config != null) {

                    InputStream in;
                    try {
                        in = config.getInputStream();
                        Document doc = XMLUtil.parse(new InputSource(in), false, false, null, null);
                        in.close();
                        Element assets = XmlHelper.findChildElement(doc.getDocumentElement(), "assets");
                        if (assets != null) {
                            assetElements.add(assets);
                        }
                    } catch (Exception ex) {
                        Exceptions.printStackTrace(ex);
                    }
                    if (projectAssetManager == null) {
                        projectAssetManager = new ProjectAssetManager(this, fileObject.getNameExt() + "/assets/");
                        content.add(projectAssetManager);
                    } else {
                        projectAssetManager.addFolderLocator(fileObject.getNameExt() + "/assets/");
                    }
                } else {
                    Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error in assetpack, could not load assetpack.xml!");
                }
            }
        }
        this.assetElements = new Element[assetElements.size()];
        for (int i = 0; i < assetElements.size(); i++) {
            Element element = assetElements.get(i);
            this.assetElements[i] = element;
            Element child = XmlHelper.findChildElement(element, "asset");
            while (child != null) {
                String cats = child.getAttribute("categories");
                String[] categs = cats.split(",");
                for (int j = 0; j < categs.length; j++) {
                    String string = categs[j];
                    string = string.trim();
                    if (!categories.contains(string)) {
                        categories.add(string);
                    }
                }
                child = XmlHelper.findNextElement(child, "asset");
            }
        }
    }

    public FileObject getProjectDirectory() {
        return library;
    }

    public Lookup getLookup() {
        return lookup;
    }

    /**
     * @return the projectAssetManager
     */
    public ProjectAssetManager getProjectAssetManager() {
        return projectAssetManager;
    }

    /**
     * @return the categories
     */
    public List<String> getCategories() {
        return categories;
    }
}


text:
<!DOCTYPE html>

Link to bottom


text:
package validation

import (
	"k8s.io/apimachinery/pkg/util/validation/field"

	gatewayv1a2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
)

// ValidateTCPRoute validates TCPRoute according to the Gateway API specification.
// For additional details of the TCPRoute spec, refer to:
// https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1alpha2.TCPRoute
func ValidateTCPRoute(route *gatewayv1a2.TCPRoute) field.ErrorList {
	return validateTCPRouteSpec(&route.Spec, field.NewPath("spec"))
}

// validateTCPRouteSpec validates that required fields of spec are set according to the
// TCPRoute specification.
func validateTCPRouteSpec(spec *gatewayv1a2.TCPRouteSpec, path *field.Path) field.ErrorList {
	path = path.Child("rules")
	var errs field.ErrorList
	for i, rule := range spec.Rules {
		for j, ref := range rule.BackendRefs {
			// Avoid referencing to the loop variable.
			ref := ref
			errs = append(errs, validateBackendRefServicePort(&ref, path.Index(i).Child("backendRefs").Index(j))...)
		}
	}
	return errs
}


VALIDATOR.FIELDREQUIRED: Please fill out "%s", it is required.

HASMANYFILEFIELD.UPLOADING: Uploading... %s

TABLEFIELD.DELETECONFIRMMESSAGE: Are you sure you want to delete this record?

LOADING: loading...

UNIQUEFIELD.SUGGESTED: Changed value to '%s' : %s

UNIQUEFIELD.ENTERNEWVALUE: You will need to enter a new value for this field

UNIQUEFIELD.CANNOTLEAVEEMPTY: This field cannot be left empty

RESTRICTEDTEXTFIELD.CHARCANTBEUSED: The character '%s' cannot be used in this field

UPDATEURL.CONFIRM:
Would you like me to change the URL to:

%s/

Click Ok to change the URL, click Cancel to leave it as:

%s

UPDATEURL.CONFIRMURLCHANGED:
The URL has been changed to
'%s'

FILEIFRAMEFIELD.DELETEFILE: Delete File

FILEIFRAMEFIELD.UNATTACHFILE: Un-Attach File

FILEIFRAMEFIELD.DELETEIMAGE: Delete Image

FILEIFRAMEFIELD.CONFIRMDELETE: Are you sure you want to delete this file?

LeftAndMain.IncompatBrowserWarning: Your browser is not compatible with the CMS interface. Please use Internet Explorer 7+, Google Chrome 10+ or Mozilla Firefox 3.5+.

GRIDFIELD.ERRORINTRANSACTION:
An error occured while fetching data from the server
 Please try again later.

HtmlEditorField.SelectAnchor: Select an anchor

UploadField.ConfirmDelete: Are you sure you want to remove this file from the server filesystem?

UploadField.PHP_MAXFILESIZE: File exceeds upload_max_filesize (php.ini directive)

UploadField.HTML_MAXFILESIZE: File exceeds MAX_FILE_SIZE (HTML form directive)

UploadField.ONLYPARTIALUPLOADED: File was only partially uploaded

UploadField.NOFILEUPLOADED: No File was uploaded

UploadField.NOTMPFOLDER: Missing a temporary folder

UploadField.WRITEFAILED: Failed to write file to disk

UploadField.STOPEDBYEXTENSION: File upload stopped by extension

UploadField.TOOLARGE: Filesize is too large

UploadField.TOOSMALL: Filesize is too small

UploadField.INVALIDEXTENSION: Extension is not allowed

UploadField.MAXNUMBEROFFILESSIMPLE: Max number of files exceeded

UploadField.UPLOADEDBYTES: Uploaded bytes exceed file size

UploadField.EMPTYRESULT: Empty file upload result

UploadField.LOADING: Loading ...

UploadField.Editing: Editing ...

UploadField.Uploaded: Uploaded

UploadField.OVERWRITEWARNING: File with the same name already exists

TreeDropdownField.ENTERTOSEARCH: Press enter to search

TreeDropdownField.OpenLink: Open

TreeDropdownField.FieldTitle: Choose

TreeDropdownField.SearchFieldTitle: Choose or Search