text:
The MIT License

Copyright (c) 2012 Olivine Labs

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.
]]
-- lustache: Lua mustache template parsing.
-- Copyright 2013 Olivine Labs, LLC <projects@olivinelabs.com>
-- MIT Licensed.

local string_gmatch = string.gmatch
function string.split(str, sep)
  local out = {}
  for m in string_gmatch(str, "[^"..sep.."]+") do out[#out+1] = m end
  return out
end

local lustache_renderer
do
    local Scanner
    do
        local string_find, string_match, string_sub =
              string.find, string.match, string.sub

        local scanner = {}

        -- Returns `true` if the tail is empty (end of string).
        function scanner:eos()
          return self.tail == ""
        end

        -- Tries to match the given regular expression at the current position.
        -- Returns the matched text if it can match, `null` otherwise.
        function scanner:scan(pattern)
          local match = string_match(self.tail, pattern)

          if match and string_find(self.tail, pattern) == 1 then
            self.tail = string_sub(self.tail, #match + 1)
            self.pos = self.pos + #match

            return match
          end

        end

        -- Skips all text until the given regular expression can be matched. Returns
        -- the skipped string, which is the entire tail of this scanner if no match
        -- can be made.
        function scanner:scan_until(pattern)

          local match
          local pos = string_find(self.tail, pattern)

          if pos == nil then
            match = self.tail
            self.pos = self.pos + #self.tail
            self.tail = ""
          elseif pos == 1 then
            match = nil
          else
            match = string_sub(self.tail, 1, pos - 1)
            self.tail = string_sub(self.tail, pos)
            self.pos = self.pos + #match
          end

          return match
        end

        function scanner:new(str)
          local out = {
            str  = str,
            tail = str,
            pos  = 1
          }
          return setmetatable(out, { __index = self } )
        end

        Scanner = scanner
    end

    local Context
    do
        local string_find, string_split, tostring, type =
              string.find, string.split, tostring, type

        local context = {}
        context.__index = context

        function context:clear_cache()
          self.cache = {}
        end

        function context:push(view)
          return self:new(view, self)
        end

        function context:lookup(name)
          local value = self.cache[name]

          if not value then
            if name == "." then
              value = self.view
            else
              local context = self

              while context do
                if string_find(name, ".") > 0 then
                  local names = string_split(name, ".")
                  local i = 0

                  value = context.view

                  if(type(value)) == "number" then
                    value = tostring(value)
                  end

                  while value and i < #names do
                    i = i + 1
                    value = value[names[i]]
                  end
                else
                  value = context.view[name]
                end

                if value then
                  break
                end

                context = context.parent
              end
            end

            self.cache[name] = value
          end

          return value
        end

        function context:new(view, parent)
          local out = {
            view   = view,
            parent = parent,
            cache  = {},
          }
          return setmetatable(out, context)
        end

        Context = context
    end

    local error, ipairs, loadstring, pairs, setmetatable, tostring, type =
          error, ipairs, loadstring, pairs, setmetatable, tostring, type
    local math_floor, math_max, string_find, string_gsub, string_split, string_sub, table_concat, table_insert, table_remove =
          math.floor, math.max, string.find, string.gsub, string.split, string.sub, table.concat, table.insert, table.remove

    local patterns = {
      white = "%s*",
      space = "%s+",
      nonSpace = "%S",
      eq = "%s*=",
      curly = "%s*}",
      tag = "[#\\^/>{&=!]"
    }

    local html_escape_characters = {
      ["&"] = "&",
      ["<"] = "<",
      [">"] = ">",
      ['"'] = """,
      ["'"] = "'",
      ["/"] = "/"
    }

    local function is_array(array)
      if type(array) ~= "table" then return false end
      local max, n = 0, 0
      for k, _ in pairs(array) do
        if not (type(k) == "number" and k > 0 and math_floor(k) == k) then
          return false
        end
        max = math_max(max, k)
        n = n + 1
      end
      return n == max
    end

    -- Low-level function that compiles the given `tokens` into a
    -- function that accepts two arguments: a Context and a
    -- Renderer.

    local function compile_tokens(tokens, originalTemplate)
      local subs = {}

      local function subrender(i, tokens)
        if not subs[i] then
          local fn = compile_tokens(tokens, originalTemplate)
          subs[i] = function(ctx, rnd) return fn(ctx, rnd) end
        end
        return subs[i]
      end

      local function render(ctx, rnd)
        local buf = {}
        local token, section
        for i, token in ipairs(tokens) do
          local t = token.type
          buf[#buf+1] =
            t == "#" and rnd:_section(
              token, ctx, subrender(i, token.tokens), originalTemplate
            ) or
            t == "^" and rnd:_inverted(
              token.value, ctx, subrender(i, token.tokens)
            ) or
            t == ">" and rnd:_partial(token.value, ctx, originalTemplate) or
            (t == "{" or t == "&") and rnd:_name(token.value, ctx, false) or
            t == "name" and rnd:_name(token.value, ctx, true) or
            t == "text" and token.value or ""
        end
        return table_concat(buf)
      end
      return render
    end

    local function escape_tags(tags)

      return {
        string_gsub(tags[1], "%%", "%%%%").."%s*",
        "%s*"..string_gsub(tags[2], "%%", "%%%%"),
      }
    end

    local function nest_tokens(tokens)
      local tree = {}
      local collector = tree
      local sections = {}
      local token, section

      for i,token in ipairs(tokens) do
        if token.type == "#" or token.type == "^" then
          token.tokens = {}
          sections[#sections+1] = token
          collector[#collector+1] = token
          collector = token.tokens
        elseif token.type == "/" then
          if #sections == 0 then
            error("Unopened section: "..token.value)
          end

          -- Make sure there are no open sections when we're done
          section = table_remove(sections, #sections)

          if not section.value == token.value then
            error("Unclosed section: "..section.value)
          end

          section.closingTagIndex = token.startIndex

          if #sections > 0 then
            collector = sections[#sections].tokens
          else
            collector = tree
          end
        else
          collector[#collector+1] = token
        end
      end

      section = table_remove(sections, #sections)

      if section then
        error("Unclosed section: "..section.value)
      end

      return tree
    end

    -- Combines the values of consecutive text tokens in the given `tokens` array
    -- to a single token.
    local function squash_tokens(tokens)
      local out, txt = {}, {}
      local txtStartIndex, txtEndIndex
      for _, v in ipairs(tokens) do
        if v.type == "text" then
          if #txt == 0 then
            txtStartIndex = v.startIndex
          end
          txt[#txt+1] = v.value
          txtEndIndex = v.endIndex
        else
          if #txt > 0 then
            out[#out+1] = { type = "text", value = table_concat(txt), startIndex = txtStartIndex, endIndex = txtEndIndex }
            txt = {}
          end
          out[#out+1] = v
        end
      end
      if #txt > 0 then
        out[#out+1] = { type = "text", value = table_concat(txt), startIndex = txtStartIndex, endIndex = txtEndIndex  }
      end
      return out
    end

    local function make_context(view)
      if not view then return view end
      return getmetatable(view) == Context and view or Context:new(view)
    end

    local renderer = { }

    function renderer:clear_cache()
      self.cache = {}
      self.partial_cache = {}
    end

    function renderer:compile(tokens, tags, originalTemplate)
      tags = tags or self.tags
      if type(tokens) == "string" then
        tokens = self:parse(tokens, tags)
      end

      local fn = compile_tokens(tokens, originalTemplate)

      return function(view)
        return fn(make_context(view), self)
      end
    end

    function renderer:render(template, view, partials)
      if type(self) == "string" then
        error("Call mustache:render, not mustache.render!")
      end

      if partials then
        -- remember partial table
        -- used for runtime lookup & compile later on
        self.partials = partials
      end

      if not template then
        return ""
      end

      local fn = self.cache[template]

      if not fn then
        fn = self:compile(template, self.tags, template)
        self.cache[template] = fn
      end

      return fn(view)
    end

    function renderer:_section(token, context, callback, originalTemplate)
      local value = context:lookup(token.value)

      if type(value) == "table" then
        if is_array(value) then
          local buffer = ""

          for i,v in ipairs(value) do
            buffer = buffer .. callback(context:push(v), self)
          end

          return buffer
        end

        return callback(context:push(value), self)
      elseif type(value) == "function" then
        local section_text = string_sub(originalTemplate, token.endIndex+1, token.closingTagIndex - 1)

        local scoped_render = function(template)
          return self:render(template, context)
        end

        return value(section_text, scoped_render) or ""
      else
        if value then
          return callback(context, self)
        end
      end

      return ""
    end

    function renderer:_inverted(name, context, callback)
      local value = context:lookup(name)

      -- From the spec: inverted sections may render text once based on the
      -- inverse value of the key. That is, they will be rendered if the key
      -- doesn't exist, is false, or is an empty list.

      if value == nil or value == false or (type(value) == "table" and is_array(value) and #value == 0) then
        return callback(context, self)
      end

      return ""
    end

    function renderer:_partial(name, context, originalTemplate)
      local fn = self.partial_cache[name]

      -- check if partial cache exists
      if (not fn and self.partials) then

        local partial = self.partials[name]
        if (not partial) then
          return ""
        end

        -- compile partial and store result in cache
        fn = self:compile(partial, nil, originalTemplate)
        self.partial_cache[name] = fn
      end
      return fn and fn(context, self) or ""
    end

    function renderer:_name(name, context, escape)
      local value = context:lookup(name)

      if type(value) == "function" then
        value = value(context.view)
      end

      local str = value == nil and "" or value
      str = tostring(str)

      if escape then
        return string_gsub(str, '[&<>"\'/]', function(s) return html_escape_characters[s] end)
      end

      return str
    end

    -- Breaks up the given `template` string into a tree of token objects. If
    -- `tags` is given here it must be an array with two string values: the
    -- opening and closing tags used in the template (e.g. ["<%", "%>"]). Of
    -- course, the default is to use mustaches (i.e. Mustache.tags).
    function renderer:parse(template, tags)
      tags = tags or self.tags
      local tag_patterns = escape_tags(tags)
      local scanner = Scanner:new(template)
      local tokens = {} -- token buffer
      local spaces = {} -- indices of whitespace tokens on the current line
      local has_tag = false -- is there a {{tag} on the current line?
      local non_space = false -- is there a non-space char on the current line?

      -- Strips all whitespace tokens array for the current line if there was
      -- a {{#tag}} on it and otherwise only space
      local function strip_space()
        if has_tag and not non_space then
          while #spaces > 0 do
            table_remove(tokens, table_remove(spaces))
          end
        else
          spaces = {}
        end
        has_tag = false
        non_space = false
      end

      local type, value, chr

      while not scanner:eos() do
        local start = scanner.pos

        value = scanner:scan_until(tag_patterns[1])

        if value then
          for i = 1, #value do
            chr = string_sub(value,i,i)

            if string_find(chr, "%s+") then
              spaces[#spaces+1] = #tokens + 1
            else
              non_space = true
            end

            tokens[#tokens+1] = { type = "text", value = chr, startIndex = start, endIndex = start }
            start = start + 1
            if chr == "\n" then
              strip_space()
            end
          end
        end

        if not scanner:scan(tag_patterns[1]) then
          break
        end

        has_tag = true
        type = scanner:scan(patterns.tag) or "name"

        scanner:scan(patterns.white)

        if type == "=" then
          value = scanner:scan_until(patterns.eq)
          scanner:scan(patterns.eq)
          scanner:scan_until(tag_patterns[2])
        elseif type == "{" then
          local close_pattern = "%s*}"..tags[2]
          value = scanner:scan_until(close_pattern)
          scanner:scan(patterns.curly)
          scanner:scan_until(tag_patterns[2])
        else
          value = scanner:scan_until(tag_patterns[2])
        end

        if not scanner:scan(tag_patterns[2]) then
          error("Unclosed tag at " .. scanner.pos)
        end

        tokens[#tokens+1] = { type = type, value = value, startIndex = start, endIndex = scanner.pos - 1 }
        if type == "name" or type == "{" or type == "&" then
          non_space = true --> what does this do?
        end

        if type == "=" then
          tags = string_split(value, patterns.space)
          tag_patterns = escape_tags(tags)
        end
      end

      return nest_tokens(squash_tokens(tokens))
    end

    function renderer:new()
      local out = {
        cache         = {},
        partial_cache = {},
        tags          = {"{{", "}}"}
      }
      return setmetatable(out, { __index = self })
    end

    lustache_renderer = renderer
end

local string_gmatch = string.gmatch

local lustache = {
  name     = "lustache",
  version  = "1.3.1-0",
  renderer = lustache_renderer:new(),
}

mUI.lustache = setmetatable(lustache, {
  __index = function(self, idx)
    if self.renderer[idx] then return self.renderer[idx] end
  end,
  __newindex = function(self, idx, val)
    if idx == "partials" then self.renderer.partials = val end
    if idx == "tags" then self.renderer.tags = val end
  end
})


text:
package net.oneandone.troilus.example;

public interface AddressType  {

    public static final String STREET = "street";
    public static final String CITY = "city";
    public static final String POST_CODE = "post_code";

    public static final String DDL = "com/unitedinternet/troilus/example/address.ddl";
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef __ACPI_NUMA_H
#define __ACPI_NUMA_H

#ifdef CONFIG_ACPI_NUMA
#include <linux/kernel.h>

/* Proximity bitmap length */
#if MAX_NUMNODES > 256
#define MAX_PXM_DOMAINS MAX_NUMNODES
#else
#define MAX_PXM_DOMAINS (256)	/* Old pxm spec is defined 8 bit */
#endif

extern int pxm_to_node(int);
extern int node_to_pxm(int);
extern void __acpi_map_pxm_to_node(int, int);
extern int acpi_map_pxm_to_node(int);

#endif				/* CONFIG_ACPI_NUMA */
#endif				/* __ACP_NUMA_H */


text:
package fakes

import (
	"fmt"
	"os/exec"
	"time"

	"github.com/cloudfoundry-incubator/cf-test-helpers/internal"
	"github.com/onsi/ginkgo"
	"github.com/onsi/gomega/gexec"
)

type callToStartMethod struct {
	Executable string
	Args       []string
	Reporter   internal.Reporter
}

type startMethodStub struct {
	Output    string
	Err       error
	ExitCode  int
	SleepTime int
}

type FakeCmdStarter struct {
	CalledWith        []callToStartMethod
	ToReturn          []startMethodStub
	TotalCallsToStart int
}

func NewFakeCmdStarter() *FakeCmdStarter {
	return &FakeCmdStarter{
		CalledWith: []callToStartMethod{},
		ToReturn:   make([]startMethodStub, 10),
	}
}

func (s *FakeCmdStarter) Start(reporter internal.Reporter, executable string, args ...string) (*gexec.Session, error) {
	output := s.ToReturn[s.TotalCallsToStart].Output
	if output == "" {
		output = `\{\}`
	}
	sleepTime := s.ToReturn[s.TotalCallsToStart].SleepTime
	exitCode := s.ToReturn[s.TotalCallsToStart].ExitCode
	err := s.ToReturn[s.TotalCallsToStart].Err

	s.TotalCallsToStart += 1

	callToStart := callToStartMethod{
		Executable: executable,
		Args:       args,
		Reporter:   reporter,
	}
	s.CalledWith = append(s.CalledWith, callToStart)

	reporter.Report(time.Now(), exec.Command(executable, args...))
	cmd := exec.Command(
		"bash",
		"-c",
		fmt.Sprintf(
			"echo %s; sleep %d; exit %d",
			output,
			sleepTime,
			exitCode,
		),
	)
	session, _ := gexec.Start(cmd, ginkgo.GinkgoWriter, ginkgo.GinkgoWriter)
	return session, err
}


text:
/**
 * Test case for shapeElm.
 * Runs with mocha.
 */
'use strict'

const shapeElm = require('../lib/element/shape_elm.js')
const assert = require('assert')

describe('shape-elm', () => {
  before(async () => {

  })

  after(async () => {

  })

  it('Shape elm', async () => {

  })
})

/* global describe, before, after, it */


text:
<?php

namespace Tests;

use Mockery;
use org\bovigo\vfs\vfsStream;
use TightenCo\Jigsaw\Console\ConsoleSession;
use TightenCo\Jigsaw\File\Filesystem;
use TightenCo\Jigsaw\Scaffold\CustomInstaller;
use TightenCo\Jigsaw\Scaffold\PresetPackage;
use TightenCo\Jigsaw\Scaffold\PresetScaffoldBuilder;
use TightenCo\Jigsaw\Scaffold\ProcessRunner;

class CustomScaffoldInstallerTest extends TestCase
{
    /**
     * @test
     */
    public function custom_installer_installs_basic_scaffold_files()
    {
        $vfs = vfsStream::setup('virtual', null, []);
        $builder = new PresetScaffoldBuilder(new Filesystem(), Mockery::mock(PresetPackage::class), new ProcessRunner());
        $builder->setBase($vfs->url());

        $this->assertCount(0, $vfs->getChildren());

        (new CustomInstaller())->install($builder)
            ->setup();

        $this->assertNotNull($vfs->getChild('source'));
        $this->assertNotNull($vfs->getChild('package.json'));
        $this->assertNotNull($vfs->getChild('webpack.mix.js'));
        $this->assertNotNull($vfs->getChild('config.php'));
    }

    /**
     * @test
     */
    public function installer_deletes_single_base_file_specified_in_delete_array()
    {
        $vfs = vfsStream::setup('virtual', null, []);
        $builder = new PresetScaffoldBuilder(new Filesystem(), Mockery::mock(PresetPackage::class), new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->delete('config.php');

        $this->assertNull($vfs->getChild('config.php'));
        $this->assertNotNull($vfs->getChild('source'));
    }

    /**
     * @test
     */
    public function installer_deletes_multiple_base_files_specified_in_delete_array()
    {
        $vfs = vfsStream::setup('virtual', null, []);
        $builder = new PresetScaffoldBuilder(new Filesystem(), Mockery::mock(PresetPackage::class), new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->delete([
                'config.php',
                'package.json',
            ]);

        $this->assertNull($vfs->getChild('config.php'));
        $this->assertNull($vfs->getChild('package.json'));
        $this->assertNotNull($vfs->getChild('source'));
    }

    /**
     * @test
     */
    public function installer_deletes_base_directories_specified_in_delete_array()
    {
        $vfs = vfsStream::setup('virtual', null, []);
        $builder = new PresetScaffoldBuilder(new Filesystem(), Mockery::mock(PresetPackage::class), new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->delete([
                'source',
            ]);

        $this->assertNull($vfs->getChild('source'));
    }

    /**
     * @test
     */
    public function installer_copies_all_preset_files_if_copy_has_no_parameter()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                '.dotfile' => '',
                'preset-file.php' => '',
                'source' => [
                    'source-file.md' => '',
                ],
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->copy();

        $this->assertNotNull($vfs->getChild('.dotfile'));
        $this->assertNotNull($vfs->getChild('preset-file.php'));
        $this->assertNotNull($vfs->getChild('source/source-file.md'));
    }

    /**
     * @test
     */
    public function installer_copies_individual_preset_file_if_copy_parameter_is_string()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                '.dotfile' => '',
                'preset-file.php' => '',
                'source' => [
                    'source-file.md' => '',
                ],
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->copy('preset-file.php');

        $this->assertNotNull($vfs->getChild('preset-file.php'));
        $this->assertNull($vfs->getChild('.dotfile'));
        $this->assertNull($vfs->getChild('source/source-file.md'));
    }

    /**
     * @test
     */
    public function installer_copies_multiple_preset_files_if_copy_parameter_is_array()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                '.dotfile' => '',
                'preset-file.php' => '',
                'source' => [
                    'source-file.md' => '',
                ],
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->copy([
                'preset-file.php',
                'source/source-file.md',
            ]);

        $this->assertNotNull($vfs->getChild('preset-file.php'));
        $this->assertNotNull($vfs->getChild('source/source-file.md'));
        $this->assertNull($vfs->getChild('.dotfile'));
    }

    /**
     * @test
     */
    public function installer_can_copy_files_using_a_wildcard()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                '.dotfile' => '',
                'preset-file-1.php' => '',
                'preset-file-2.php' => '',
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->copy([
                'preset-file-*.php',
            ]);

        $this->assertNotNull($vfs->getChild('preset-file-1.php'));
        $this->assertNotNull($vfs->getChild('preset-file-1.php'));
        $this->assertNull($vfs->getChild('.dotfile'));
    }

    /**
     * @test
     */
    public function installer_can_call_copy_multiple_times()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                '.dotfile' => '',
                'preset-file.php' => '',
                'source' => [
                    'source-file.md' => '',
                ],
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->copy('.dotfile')
            ->copy('source');

        $this->assertNotNull($vfs->getChild('.dotfile'));
        $this->assertNotNull($vfs->getChild('source/source-file.md'));
        $this->assertNull($vfs->getChild('preset-file.php'));
    }

    /**
     * @test
     */
    public function installer_copies_from_specified_directory_to_root_if_from_is_specified()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                'config.php' => 'config root',
                'themes' => [
                    'directory-1' => [
                        'config.php' => 'config 1',
                    ],
                    'directory-2' => [
                        'config.php' => 'config 2',
                    ],
                ],
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->from('themes/directory-2')
            ->copy();

        $this->assertNotNull($vfs->getChild('config.php'));
        $this->assertEquals('config 2', $vfs->getChild('config.php')->getContent());
    }

    /**
     * @test
     */
    public function installer_can_ignore_preset_files_when_copying()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                '.dotfile' => '',
                'preset-file.php' => '',
                'source' => [
                    'source-file.md' => '',
                ],
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->ignore('.dotfile')
            ->copy();

        $this->assertNotNull($vfs->getChild('preset-file.php'));
        $this->assertNotNull($vfs->getChild('source/source-file.md'));
        $this->assertNull($vfs->getChild('.dotfile'));
    }

    /**
     * @test
     */
    public function installer_can_call_ignore_multiple_times()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                '.dotfile' => '',
                'preset-file.php' => '',
                'source' => [
                    'source-file.md' => '',
                ],
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->ignore('.dotfile')
            ->ignore('preset-file.php')
            ->copy();

        $this->assertNotNull($vfs->getChild('source/source-file.md'));
        $this->assertNull($vfs->getChild('preset-file.php'));
        $this->assertNull($vfs->getChild('.dotfile'));
    }

    /**
     * @test
     */
    public function original_composer_json_is_not_deleted()
    {
        $old_composer = [
            'require' => [
                'tightenco/jigsaw' => '^1.2',
                'test/preset' => '1.0',
            ],
        ];
        $vfs = vfsStream::setup('virtual', null, [
            'composer.json' => json_encode($old_composer),
            'package' => [
                'preset-file.php' => '',
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->delete('composer.json');

        $this->assertNotNull($vfs->getChild('composer.json'));
        $this->assertEquals(
            $old_composer,
            json_decode($vfs->getChild('composer.json')->getContent(), true)
        );
    }

    /**
     * @test
     */
    public function original_composer_json_is_merged_with_new_composer_json_after_copy()
    {
        $old_composer = [
            'require' => [
                'tightenco/jigsaw' => '^1.2',
                'test/preset' => '1.0',
            ],
        ];
        $vfs = vfsStream::setup('virtual', null, [
            'composer.json' => json_encode($old_composer),
            'package' => [
                'composer.json' => json_encode([
                    'require' => [
                        'other/package' => '2.0',
                    ],
                ]),
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->copy();

        $this->assertEquals(
            [
                'require' => [
                    'tightenco/jigsaw' => '^1.2',
                    'test/preset' => '1.0',
                    'other/package' => '2.0',
                ],
            ],
            json_decode($vfs->getChild('composer.json')->getContent(), true)
        );
    }

    /**
     * @test
     */
    public function composer_json_files_are_merged_when_copying_multiple_times()
    {
        $old_composer = [
            'require' => [
                'tightenco/jigsaw' => '^1.2',
                'test/preset' => '1.0',
            ],
        ];
        $vfs = vfsStream::setup('virtual', null, [
            'composer.json' => json_encode($old_composer),
            'package' => [
                'composer.json' => json_encode([
                    'require' => [
                        'other/package' => '2.0',
                    ],
                ]),
                'theme' => [
                    'composer.json' => json_encode([
                        'require' => [
                            'another/package' => '3.0',
                        ],
                    ]),
                ],
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->copy()
            ->from('theme')
            ->copy();

        $this->assertEquals(
            [
                'require' => [
                    'tightenco/jigsaw' => '^1.2',
                    'test/preset' => '1.0',
                    'other/package' => '2.0',
                    'another/package' => '3.0',
                ],
            ],
            json_decode($vfs->getChild('composer.json')->getContent(), true)
        );
    }

    /**
     * @test
     */
    public function empty_composer_json_is_created_if_it_was_not_present_before_preset_was_installed()
    {
        $vfs = vfsStream::setup('virtual', null, [
            'package' => [
                'package-file.php' => '',
            ],
        ]);
        $package = Mockery::mock(PresetPackage::class);
        $package->path = $vfs->url() . '/package';
        $builder = new PresetScaffoldBuilder(new Filesystem(), $package, new ProcessRunner());
        $builder->setBase($vfs->url());

        (new CustomInstaller())->install($builder)
            ->setup()
            ->copy();

        $this->assertEquals(
            [
                'require' => [],
            ],
            json_decode($vfs->getChild('composer.json')->getContent(), true)
        );
    }

    /**
     * @test
     * @doesNotPerformAssertions
     */
    public function installer_can_ask_for_user_input()
    {
        $console = Mockery::spy(ConsoleSession::class);
        $builder = Mockery::spy(PresetScaffoldBuilder::class);

        (new CustomInstaller())->setConsole($console)
            ->install($builder)
            ->setup()
            ->ask('What is your name?');

        $console->shouldHaveReceived('ask')
            ->with('What is your name?', null, null, null);
    }

    /**
     * @test
     * @doesNotPerformAssertions
     */
    public function installer_can_ask_for_user_input_with_choices()
    {
        $console = Mockery::spy(ConsoleSession::class);
        $builder = Mockery::spy(PresetScaffoldBuilder::class);

        (new CustomInstaller())->setConsole($console)
            ->install($builder)
            ->setup()
            ->ask(
                'What theme would you like to use?',
                ['l' => 'light', 'd' => 'dark'],
                $default = 'l'
            );

        $console->shouldHaveReceived('ask')
            ->with(
                'What theme would you like to use?',
                ['l' => 'light', 'd' => 'dark'],
                'l',
                null
            );
    }

    /**
     * @test
     * @doesNotPerformAssertions
     */
    public function installer_can_ask_for_user_confirmation()
    {
        $console = Mockery::spy(ConsoleSession::class);
        $builder = Mockery::spy(PresetScaffoldBuilder::class);

        (new CustomInstaller())->setConsole($console)
            ->install($builder)
            ->setup()
            ->confirm('Continue?');

        $console->shouldHaveReceived('confirm')
            ->with('Continue?', null);
    }

    /**
     * @test
     * @doesNotPerformAssertions
     */
    public function installer_runs_specified_commands_from_init()
    {
        $package = Mockery::mock(PresetPackage::class);
        $builder = Mockery::spy(PresetScaffoldBuilder::class);

        (new CustomInstaller())->setConsole(null)
            ->install($builder)
            ->setup()
            ->run('yarn');

        $builder->shouldHaveReceived('runCommands')->with('yarn');
    }
}


text:
apetools.commands.rotate.RotateParameters.angles
================================================

.. currentmodule:: apetools.commands.rotate

.. autoattribute:: RotateParameters.angles


text:
namespace blink {

class DOMPointInit;

class CORE_EXPORT DOMPoint : public DOMPointReadOnly {
  DEFINE_WRAPPERTYPEINFO();

 public:
  static DOMPoint* Create(double x, double y, double z = 0, double w = 1);
  static DOMPoint* fromPoint(const DOMPointInit*);

  DOMPoint(double x, double y, double z, double w);

  virtual void setX(double x) { x_ = x; }
  virtual void setY(double y) { y_ = y; }
  void setZ(double z) { z_ = z; }
  void setW(double w) { w_ = w; }
};

}  // namespace blink

#endif


text:
package org.fastnate.data.properties;

import org.apache.commons.lang3.StringUtils;

/**
 * Converts a string in an import file to an {@link Enum} value.
 *
 * @author Tobias Liefke
 */
public class EnumConverter implements PropertyConverter<Enum<?>> {

	@Override
	@SuppressWarnings("rawtypes")
	public Enum<?> convert(final Class<? extends Enum<?>> targetType, final String value) {
		return StringUtils.isBlank(value) ? null : Enum.valueOf((Class) targetType, value.trim());
	}
}


text:
// ==========================================================================
//                 SeqAn - The Library for Sequence Analysis
// ==========================================================================
// Copyright (c) 2006-2012, Knut Reinert, FU Berlin
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of Knut Reinert or the FU Berlin nor the names of
//       its contributors may be used to endorse or promote products derived
//       from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
// DAMAGE.
//
// ==========================================================================
// Author: David Weese <david.weese@fu-berlin.de>
// ==========================================================================
// Concept definitions for containers.
// ==========================================================================

// SEQAN_NO_GENERATED_FORWARDS

#ifndef SEQAN_CORE_INCLUDE_SEQAN_BASIC_CONTAINER_CONCEPT_H_
#define SEQAN_CORE_INCLUDE_SEQAN_BASIC_CONTAINER_CONCEPT_H_

namespace seqan {

// ============================================================================
// Forwards
// ============================================================================

template <typename T> struct Infix;
template <typename T> struct Prefix;
template <typename T> struct Suffix;

// ============================================================================
// Concepts
// ============================================================================

// Forwards.
struct Standard_;
typedef Tag<Standard_> const Standard;
template <typename TContainer, typename TSpec> struct Iterator;

/**
.Concept.Container
..baseconcept:Concept.Assignable
..baseconcept:Concept.DefaultConstructible
..baseconcept:Concept.CopyConstructible
..signature:ContainerConcept
..summary:Concept for mutable containers.
..include:seqan/basic.h
*/

// mutable container concept
template <typename TContainer>
struct ContainerConcept :
    Assignable<TContainer>,
    DefaultConstructible<TContainer>,
    CopyConstructible<TContainer>
{
    typedef typename Value<TContainer>::Type                TValue;
    typedef typename GetValue<TContainer>::Type             TGetValue;
    typedef typename Reference<TContainer>::Type            TReference;
    typedef typename Size<TContainer>::Type                 TSize;
    typedef typename Position<TContainer>::Type             TPosition;
    typedef typename Difference<TContainer>::Type           TDifference;
    typedef typename Iterator<TContainer, Standard>::Type   TIterator;

    TContainer  c, c2;
    TValue      val;
    TSize       size;
    TPosition   pos;
    TDifference diff;
    TIterator   iter;

    SEQAN_CONCEPT_ASSERT((AlphabetConcept<TValue>));
    SEQAN_CONCEPT_ASSERT((SignedIntegerConcept<TDifference>));
    SEQAN_CONCEPT_ASSERT((UnsignedIntegerConcept<TSize>));

    SEQAN_CONCEPT_USAGE(ContainerConcept)
    {
        // test return of const values
        sameType(getValue(c, 0), val);

        // TODO(holtgrew): Index based access requires random-access and *linear* container.
        // test whether returned references/proxies
        // can be assigned to val and vice versa
        val = value(c, 0);
        value(c, 0) = val;
        moveValue(c, pos, val);

        // sameType(value(str, 0), val); would not work
        // for Strings returning proxies, e.g. String<.., Packed>

        // TODO(holtgrew): Too strong assumption about random access iterators IMO.
        // test iterators
        sameType(iter, begin(c, Standard()));
        sameType(iter, end(c, Standard()));
        sameType(diff, end(c, Standard()) - begin(c, Standard()));

        // length and empty
        sameType(size, length(c));
        sameType(true, empty(c));

        // clear
        clear(c);

        // TODO: infix/suffix/prefix
        // maybe we need a SequenceConcept between Container and String

        // swap containers
//        swap(c, c2);          // swap is not yet supported by every string
    }
};

/**
.Concept.Sequence
..baseconcept:Concept.Container
..summary:Concept for sequences.
..include:seqan/basic.h
*/

SEQAN_CONCEPT_REFINE(SequenceConcept, (TString), (ContainerConcept))
{
    typedef typename Value<TString>::Type                 TValue;
    typedef typename Size<TString>::Type                  TSize;
    typedef typename Position<TString>::Type              TPos;
    typedef typename Difference<TString>::Type            TDifference;
    typedef typename Iterator<TString, Standard>::Type    TIterator;

    TValue      val;
    TSize       size;
    TPos        pos;

    TString     str, str2;

    SEQAN_CONCEPT_USAGE(SequenceConcept)
    {
        pos = 0u;

        // append
        append(str, str2);
        appendValue(str, val);

        // capacity
        sameType(size, capacity(str));
    }
};

//void testStringConcepts()
//{
//    SEQAN_CONCEPT_ASSERT((StringConcept<String<char, Alloc<> > >));
//    SEQAN_CONCEPT_ASSERT((StringConcept<String<Pair<int, double>, Alloc<> > >));
////    SEQAN_CONCEPT_ASSERT((StringConcept<String<bool, Packed<> > >));  // doesn't compile yet
////    SEQAN_CONCEPT_ASSERT((StringConcept<String<Dna5, Packed<> > >));
//    SEQAN_CONCEPT_ASSERT((StringConcept<String<int, Array<50> > >));
//}

}  // namespace seqan

#endif  // #ifndef SEQAN_CORE_INCLUDE_SEQAN_BASIC_CONTAINER_CONCEPT_H_


text:
CaptureImg *CaptureImg::m_sInStance = NULL;
char CaptureImg::m_szPatientImgPath[512] = {0};

CaptureImg::CaptureImg()
{
    ;
}

CaptureImg::~CaptureImg()
{
	;
}

CaptureImg *CaptureImg::GetInstance() {
    if (!m_sInStance) {
        m_sInStance = new CaptureImg;
    }

    return m_sInStance;
}

void CaptureImg::FreeInstance() {
    if (m_sInStance) {
        delete m_sInStance;
        m_sInStance = NULL;
    }
}

void CaptureImg::SetPatientImgPath(const char *patientImgPath)
{
    strcpy(m_szPatientImgPath, patientImgPath);
}

bool CaptureImg::CaptureImgRequest()
{
	// TODO return MSGSENDER->SendCaptureImgRequest();
    return true;
}

bool CaptureImg::DownloadImageFromHP(const char* name)
{
    if (NULL == name) {
        return false;
    }
	CkFtp2 ftp;
	bool success = false;

	// Any string unlocks the component for the 1st 30-days.
	success = ftp.UnlockComponent("Anything for 30-day trial");
	if (success != true) {
		return false;
	}

	ftp.put_Hostname("127.0.0.1");
	ftp.put_Username("123");
	ftp.put_Password("123");

	// The default data transfer mode is "Active" as opposed to "Passive".

	// Connect and login to the FTP server.
	success = ftp.Connect();
	if (success != true) {
		return false;
	}

	// Change to the remote directory where the file is located.
	// This step is only necessary if the file is not in the root directory
	// for the FTP account.
	success = ftp.ChangeRemoteDir("/images");
	if (success != true) {
		return false;
	}

	// Download a file.
	char remoteFilename[128] = {0};
    char localFileName[512] = {0};

    strcpy(remoteFilename, name);
    strcpy(localFileName, m_szPatientImgPath);
    strcat(localFileName, name);

    memcpy(remoteFilename, name, strlen(name));

	success = ftp.GetFile(remoteFilename,localFileName);
	if (success != true) {
        char errorText[512] = {0};
        memcpy(errorText, ftp.lastErrorText(), 512);
		return false;
	}

	ftp.Disconnect();
	return success;
}


text:
<?php

namespace App\Controller;

use Slim\Container;
class BaseController
{
    protected $view;
    protected $logger;
    protected $flash;
    protected $em;  // Entities Manager

    public function __construct(Container $c)
    {
        $this->view = $c->get('view');
        $this->logger = $c->get('logger');
        $this->flash = $c->get('flash');
        $this->em = $c->get('em');
    }
}


text:
package main

type Session struct {
	Id string
}

func NewSession(id string) *Session {
	s := new(Session)
	s.Id = id
	return s
}


text:
// Copyright 2009 the Sputnik authors.  All rights reserved.
/**
 * The global object does not have a [[Construct]] property
 *
 * @path ch15/15.1/S15.1_A1_T2.js
 * @description It is not possible to use the global object as a constructor
 * with the new operator
 * @negative
 */

new this();


text:
using System;

namespace Transloadit.Log
{
    /// <summary>
    /// Default Transloadit logger implementation
    /// </summary>
    class TransloaditLogger : ITransloaditLogger
    {
        #region Private constants

        /// <summary>
        /// Enables logging
        /// </summary>
        private const bool Enabled = true;

        #endregion

        #region Public methods

        /// <summary>
        /// Logs information during application processes
        /// </summary>
        /// <param name="type">Type of the class, where the log is proceed</param>
        /// <param name="message">Parameterized info message</param>
        /// <param name="parameters">Parameters for the passed info message</param>
        public void LogInfo(Type type, string message, params object[] parameters)
        {
            if (TransloaditLogger.Enabled)
            {
                Console.Write("Info: ");
                Console.Write(type.Name);
                Console.Write(" | ");
                Console.WriteLine(String.Format(message, parameters));
                Console.WriteLine("-------------");
            }
        }

        /// <summary>
        /// Logs errors during application processes
        /// </summary>
        /// <param name="type">Type of the class, where the log is proceed</param>
        /// <param name="exception">Exception, which is the reason of the error</param>
        /// <param name="message">Parameterized error message</param>
        /// <param name="parameters">Parameters for the passed error message</param>
        public void LogError(Type type, Exception exception, string message, params object[] parameters)
        {
            if (TransloaditLogger.Enabled)
            {
                Console.Write("Error: ");
                Console.WriteLine(type.Name);
                Console.Write(" | ");
                Console.WriteLine(String.Format(message, parameters));
                Console.Write("Exception message: ");
                Console.WriteLine(exception.Message);
                Console.WriteLine("-------------");
            }
        }

        /// <summary>
        /// Logs errors during application processes
        /// </summary>
        /// <param name="type">Type of the class, where the log is proceed</param>
        /// <param name="message">Parameterized error message</param>
        /// <param name="parameters">Parameters for the passed error message</param>
        public void LogError(Type type, string message, params object[] parameters)
        {
            if (TransloaditLogger.Enabled)
            {
                Console.Write("Error: ");
                Console.WriteLine(type.Name);
                Console.Write(" | ");
                Console.WriteLine(String.Format(message, parameters));
                Console.WriteLine("-------------");
            }
        }

        /// <summary>
        /// Logs errors during application processes
        /// </summary>
        /// <param name="type">Type of the class, where the log is proceed</param>
        /// <param name="exception">Exception, which is the reason of the error</param>
        public void LogError(Type type, Exception exception)
        {
            if (TransloaditLogger.Enabled)
            {
                Console.Write("Error: ");
                Console.WriteLine(type.Name);
                Console.Write(" | ");
                Console.Write("Exception message: ");
                Console.WriteLine(exception.Message);
                Console.WriteLine("-------------");
            }
        }

        #endregion
    }
}


text:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Shouldly;

namespace QueryBuilder.Test
{
    [TestClass]
    public class SelectTests : QueryBuilderTestBase
    {
        [TestMethod]
        public void Selecting_WhenThereIsNoColumnsProvided_ThenExceptionIsThrown()
        {
            Should.Throw<ArgumentNullException>(() => GetQueryBuilder().Select(null));
            Should.Throw<ArgumentException>(() => GetQueryBuilder().Select());
        }
    }
}


text:
import numpy as np
from sklearn.svm import LinearSVC

from logs import logger

class SVMClassifier:
    def load(self, dataset):
        logger.info("[svm classifier start loading dataset]")
        dataset.create_tfidf_dataset()
        self.dataset = dataset

    def fit(self):
        logger.info("[svm classifier start creating model]")
        self.clf = LinearSVC().fit(self.dataset.X_train_tfidf, self.dataset.y_train_labels)

    def evaluate(self):
        logger.info("[svm classifier start evaluating model]")
        predicted = self.clf.predict(self.dataset.X_test_tfidf)
        logger.info(np.mean(predicted==self.dataset.y_test_labels))


text:
<?php

namespace Zend\Config\Writer;

use Zend\Config\Exception;
use Zend\Json\Json as JsonFormat;

class Json extends AbstractWriter
{
    /**
     * processConfig(): defined by AbstractWriter.
     *
     * @param  array $config
     * @return string
     * @throws Exception\RuntimeException if encoding errors occur.
     */
    public function processConfig(array $config)
    {
        $serialized = json_encode($config, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);

        if (false === $serialized) {
            throw new Exception\RuntimeException(json_last_error_msg());
        }

        return $serialized;
    }
}


text:
using UnityEngine;
using System.Collections;

public class Floor2UI : FloorUI {

	public void LoadHipster() {
		controller.Forward("Hipster Shop");
	}

    public void LoadAthletic() {
        controller.Forward("Athletic Shop");
    }

    public void LoadFloor2() {
        controller.Forward("Floor 1");
    }
}


text:
/**
 * Constructor
 * MultiViewerEditorPart
 *
 * @see
 * @since: 2015.07.19
 * @author: hw.shim
 */

// @formatter:off
define([
    'dijit/layout/TabContainer',
    'dijit/layout/ContentPane',
    'external/eventEmitter/EventEmitter',
    'webida-lib/util/genetic',
    'webida-lib/util/logger/logger-client',
    './EditorPart'
], function (
    TabContainer,
    ContentPane,
    EventEmitter,
    genetic,
    Logger,
    EditorPart
) {
    'use strict';
// @formatter:on

    /**
     * @typedef {Object} DataSource
     * @typedef {Object} EditorViewer
     */

    var logger = new Logger();
    //logger.setConfig('level', Logger.LEVELS.log);
    //logger.off();

    function MultiViewerEditorPart(file) {
        logger.info('new MultiViewerEditorPart(' + file + ')');
        EditorPart.apply(this, arguments);

        /** @type {Map.<Object, EditorViewer>} */
        this.viewers = new Map();

        /** @type {Map.<Object, EditorViewer>} */
        this.tabToViewerMap = new Map();

        /** @type {EditorViewer} */
        this.activeViewer = null;
    }

    genetic.inherits(MultiViewerEditorPart, EditorPart, {

        /**
         * @override
         */
        createViewer: function (parent, callback) {
            logger.info('createViewer(' + parent.tagName + ', callback)');
            this.setParentElement(parent);
            this.createCallback = callback;
            this.initialize();
        },

        destroy: function () {
            logger.info('destroy()');
            //unset preferences
            if (this.preferences) {
                this.preferences.destroy();
            }
            //unsubscribe topic
            if (this.fileOpenedHandle) {
                logger.info('this.fileOpenedHandle.remove()', this.fileOpenedHandle);
                this.fileOpenedHandle.remove();
            }
            if (this.fileSavedHandle) {
                this.fileSavedHandle.remove();
            }
        },

        initialize: function () {
            logger.info('initialize()');
            this.createTabContainer();
            this.createViewers();
        },

        /**
         * Create TabContainer
         */
        createTabContainer: function () {
            logger.info('createTabContainer()');
            var parent = this.getParentElement();
            var container = new TabContainer({
                style: 'width: 100%; height: 100%;',
                tabPosition: 'bottom',
                tabStrip: true,
                nested: true
            });
            container.startup();
            parent.appendChild(container.domNode);
            container.resize();

            this.setContainerEvent(container);
            this.tabContainer = container;
        },

        /**
         * Set Container Event
         *
         * If you want different event binding, override this method.
         */
        setContainerEvent: function (container) {
            var that = this;
            container.watch('selectedChildWidget', function (name, oldTab, newTab) {
                var viewer = that.getViewerByTab(newTab);
                if (viewer) {
                    that.setActiveViewer(viewer);
                }
            });
        },

        /**
         * Create EditorViewers
         *
         * @abstract
         */
        createViewers: function () {
            throw new Error('createViewers() should be implemented by ' + this.constructor.name);
        },

        /**
         * @return {Map.<Object, EditorViewer>}
         */
        getViewers: function () {
            return this.viewers;
        },

        /**
         * @return {Map.<Object, EditorViewer>}
         */
        getTabToViewerMap: function () {
            return this.tabToViewerMap;
        },

        /**
         * @param {Object} id
         * @param {string} title
         * @param {EditorViewer} viewer
         * @param {number} index
         * @param {MultiViewerEditorPart~addViewerCallback} callback
         */
        /**
         * @callback MultiViewerEditorPart~addViewerCallback
         * @param {HTMLElement} parentNode
         */
        addViewer: function (id, title, viewer, index, callback) {
            logger.info('addViewer(' + id + ', ' + title + ', ' + viewer + ', ' + index + ', callback)');
            var pane = new ContentPane({
                title: title
            });
            pane.startup();
            this.getTabContainer().addChild(pane, index);
            this.getViewers().set(id, viewer);
            this.getTabToViewerMap().set(pane, viewer);
            if (typeof callback === 'function') {
                callback(pane.domNode);
            }
            if (this.getViewers().size === 1) {
                this.setActiveViewer(viewer);
            }
        },

        /**
         * @param {EditorViewer} viewer
         */
        removeViewer: function (/*viewer*/) {
            //TODO
        },

        /**
         * @param {EditorViewer} viewer
         */
        setActiveViewer: function (viewer) {
            logger.info('setActiveViewer(' + viewer + ')');
            this.activeViewer = viewer;
            //viewer.refresh();
            this.emit(MultiViewerEditorPart.TAB_SELECT, viewer);
        },

        /**
         * @return {EditorViewer} viewer
         */
        getActiveViewer: function () {
            return this.activeViewer;
        },

        /**
         * @param {Object} id
         * @return {EditorViewer}
         */
        getViewerById: function (id) {
            return this.getViewers().get(id);
        },

        /**
         * @param {Object} tab
         * @return {EditorViewer}
         */
        getViewerByTab: function (tab) {
            return this.getTabToViewerMap().get(tab);
        },

        /**
         * @return {TabContainer}
         */
        getTabContainer: function () {
            return this.tabContainer;
        },

        /**
         * TODO refactor
         */
        getContextMenuItems: function (opened, items, menuItems, deferred) {
            var activeViewer = this.getActiveViewer();
            if (activeViewer) {
                activeViewer.getContextMenuItems(opened, items, menuItems, deferred);
            }
        }
    });

    MultiViewerEditorPart.TAB_SELECT = 'tabSelect';

    return MultiViewerEditorPart;
});


text:
require "test_helper"

require "opencensus/trace/integrations/faraday_middleware"

describe OpenCensus::Trace::Integrations::FaradayMiddleware do
  class TestApp
    def initialize code: 200, body: "ok", exception: false
      @code = code
      @body = body
      @exception = exception
    end
    def call env
      env[:status] = @code
      env[:body] = @body
      env[:exception] = @exception
      TestResponse.new env
    end
  end
  class TestResponse
    def initialize env
      @env = env
    end
    def on_complete
      raise Faraday::TimeoutError if @env[:exception]
      yield @env
      @env
    end
  end

  def app code: 200, body: "ok", exception: false
    TestApp.new code: code, body: body, exception: exception
  end
  let(:root_context) { OpenCensus::Trace::SpanContext.create_root }

  describe "span_name option" do
    it "should default to DEFAULT_SPAN_NAME" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app, span_context: root_context
      env = {}
      middleware.call env
      spans = root_context.build_contained_spans

      spans.size.must_equal 1
      spans.first.name.value.must_equal \
        OpenCensus::Trace::Integrations::FaradayMiddleware::DEFAULT_SPAN_NAME
    end

    it "should honor a custom span name" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app, span_context: root_context, span_name: "my-span"
      env = {}
      middleware.call env
      spans = root_context.build_contained_spans

      spans.size.must_equal 1
      spans.first.name.value.must_equal "my-span"
    end

    it "should honor a callable span name" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app, span_context: root_context, span_name: ->(env) { env[:foo] }
      env = {foo: "bar"}
      middleware.call env
      spans = root_context.build_contained_spans

      spans.size.must_equal 1
      spans.first.name.value.must_equal "bar"
    end

    it "should honor per-request span name" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app, span_context: root_context
      env = {span_name: "my-span"}
      middleware.call env
      spans = root_context.build_contained_spans

      spans.size.must_equal 1
      spans.first.name.value.must_equal "my-span"
    end
  end

  describe "default span context" do
    it "should use the thread-scoped span context" do
      OpenCensus::Trace.start_request_trace
      begin
        middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new app
        env = {}
        middleware.call env
        spans = OpenCensus::Trace.span_context.build_contained_spans
        spans.size.must_equal 1
      ensure
        OpenCensus::Trace.unset_span_context
      end
    end

    it "shouldn't fail if there is no span context" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new app
      env = {}
      middleware.call env
    end
  end

  describe "making a request" do
    it "should add attributes to the span" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app(code: 200, body: "ok"), span_context: root_context
      env = {
        method: "POST",
        url: "https://www.google.com/hello/world",
        body: "Hello"
      }
      middleware.call env
      span = root_context.build_contained_spans.first

      span.kind.must_equal :CLIENT
      span.name.value.must_equal "/hello/world"
      span.status.wont_be_nil
      span.status.code.must_equal OpenCensus::Trace::Status::OK
      span.attributes["http.method"].value.must_equal "POST"
      span.attributes["http.host"].value.must_equal "www.google.com"
      span.attributes["http.path"].value.must_equal "/hello/world"
      span.attributes["http.status_code"].must_equal 200
      events = span.time_events
      events.size.must_equal 2
      events[0].must_be_kind_of OpenCensus::Trace::MessageEvent
      events[0].type.must_equal OpenCensus::Trace::MessageEvent::SENT
      events[0].uncompressed_size.must_equal 5
      events[1].must_be_kind_of OpenCensus::Trace::MessageEvent
      events[1].type.must_equal OpenCensus::Trace::MessageEvent::RECEIVED
      events[1].uncompressed_size.must_equal 2
      events[0].id.must_equal events[1].id
    end

    it "should not add body attributes if there is no body" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app(code: 200, body: nil), span_context: root_context
      env = {
        method: "POST",
        url: "https://www.google.com/"
      }
      middleware.call env
      span = root_context.build_contained_spans.first

      events = span.time_events
      events.size.must_equal 2
      events[0].must_be_kind_of OpenCensus::Trace::MessageEvent
      events[0].type.must_equal OpenCensus::Trace::MessageEvent::SENT
      events[0].uncompressed_size.must_equal 0
      events[1].must_be_kind_of OpenCensus::Trace::MessageEvent
      events[1].type.must_equal OpenCensus::Trace::MessageEvent::RECEIVED
      events[1].uncompressed_size.must_equal 0
      events[0].id.must_equal events[1].id
    end

    it "should provide the correct trace context header" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app(code: 200, body: nil), span_context: root_context
      env = {
        method: "POST",
        url: "https://www.google.com/"
      }
      middleware.call env
      span = root_context.build_contained_spans.first

      header = env[:request_headers]["traceparent"]
      header.must_match %r{^00-#{span.trace_id}-#{span.span_id}}
    end

    it "should allow specific trace context formats" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app(code: 200, body: nil), span_context: root_context,
        formatter: OpenCensus::Trace::Formatters::CloudTrace.new
      env = {
        method: "POST",
        url: "https://www.google.com/"
      }
      middleware.call env
      span = root_context.build_contained_spans.first

      header = env[:request_headers]["X-Cloud-Trace"]
      header.must_match %r{^#{span.trace_id}/#{span.span_id.to_i(16)}}
    end

    it "should close span if exception raised" do
      middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
        app(code: 500, body: nil, exception: true), span_context: root_context
      env = {
        method: "POST",
        url: "https://www.google.com/"
      }
      assert_raises Faraday::TimeoutError do
        middleware.call env
      end

      spans = root_context.build_contained_spans
      spans.size.must_equal 1
    end

    describe "global configuration" do
      before do
        @original_formatter = OpenCensus::Trace.config.http_formatter
        OpenCensus::Trace.config.http_formatter =
          OpenCensus::Trace::Formatters::CloudTrace.new
      end
      after do
        OpenCensus::Trace.config.http_formatter = @original_formatter
      end

      it "should allow trace context formats" do
        middleware = OpenCensus::Trace::Integrations::FaradayMiddleware.new \
          app(code: 200, body: nil), span_context: root_context
        env = {
          method: "POST",
          url: "https://www.google.com/"
        }
        middleware.call env
        span = root_context.build_contained_spans.first

        header = env[:request_headers]["X-Cloud-Trace"]
        header.must_match %r{^#{span.trace_id}/#{span.span_id.to_i(16)}}
      end
    end
  end
end


text:
#define __CHILI_ENUM_NAME Color
#include "ChiliEnumInstance.h"


text:
Social Networks

Text for this card.


text:
<?php
 /* CAT:Plot chart */

 /* pChart library inclusions */
 include("../class/pData.class.php");
 include("../class/pDraw.class.php");
 include("../class/pImage.class.php");

 /* Create and populate the pData object */
 $MyData = new pData();
 $MyData->addPoints(array(3,4,7,4,2,5),"User");
 $MyData->addPoints(array(12,17,15,18,19,22),"Group");
 $MyData->setSeriePicture("User","resources/serie1.png");
 $MyData->setSeriePicture("Group","resources/serie2.png");
 $MyData->setSerieWeight("Group",1);
 $MyData->setSerieTicks("Group",4);

 $MyData->setAxisName(0,"Hours");
 $MyData->addPoints(array("Jan","Feb","Mar","Apr","May","Jun"),"Labels");
 $MyData->setSerieDescription("Labels","Months");
 $MyData->setAbscissa("Labels");

 /* Create the pChart object */
 $myPicture = new pImage(700,230,$MyData);

 /* Draw the background */
 $Settings = array("R"=>170, "G"=>183, "B"=>87, "Dash"=>1, "DashR"=>190, "DashG"=>203, "DashB"=>107);
 $myPicture->drawFilledRectangle(0,0,700,230,$Settings);

 /* Overlay with a gradient */
 $Settings = array("StartR"=>219, "StartG"=>231, "StartB"=>139, "EndR"=>1, "EndG"=>138, "EndB"=>68, "Alpha"=>50);
 $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,$Settings);
 $myPicture->drawGradientArea(0,0,700,20,DIRECTION_VERTICAL,array("StartR"=>0,"StartG"=>0,"StartB"=>0,"EndR"=>50,"EndG"=>50,"EndB"=>50,"Alpha"=>80));

 /* Add a border to the picture */
 $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0));

 /* Write the picture title */
 $myPicture->setFontProperties(array("FontName"=>"../fonts/Silkscreen.ttf","FontSize"=>6));
 $myPicture->drawText(10,13,"drawPlotChart() - draw a plot chart",array("R"=>255,"G"=>255,"B"=>255));

 /* Write the chart title */
 $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>11));
 $myPicture->drawText(250,55,"Average time spent on projects",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));

 /* Draw the scale and the 1st chart */
 $myPicture->setGraphArea(60,60,450,190);
 $myPicture->drawFilledRectangle(60,60,450,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
 $myPicture->drawScale(array("DrawSubTicks"=>TRUE));
 $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
 $myPicture->setFontProperties(array("FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6));
 $myPicture->drawSplineChart();
 $myPicture->drawPlotChart(array("DisplayValues"=>TRUE,"DisplayColor"=>DISPLAY_AUTO));
 $myPicture->setShadow(FALSE);

 /* Draw the scale and the 2nd chart */
 $myPicture->setGraphArea(500,60,670,190);
 $myPicture->drawFilledRectangle(500,60,670,190,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
 $myPicture->drawScale(array("Pos"=>SCALE_POS_TOPBOTTOM,"DrawSubTicks"=>TRUE));
 $myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10));
 $myPicture->drawPlotChart();
 $myPicture->setShadow(FALSE);

 /* Write the chart legend */
 $myPicture->drawLegend(590,205,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));

 /* Render the picture (choose the best way) */
 $myPicture->autoOutput("pictures/example.drawPlotChart.icon.png");
?>


text:
package com.amazonaws.services.s3.model;
import java.io.Serializable;

import com.amazonaws.AmazonWebServiceRequest;

/**
 * Contains options for setting the cross origin configuration for a bucket.
 *
 * @see SetBucketCrossOriginConfigurationRequest#SetBucketCrossOriginConfigurationRequest(String, BucketCrossOriginConfiguration)
 */
public class SetBucketCrossOriginConfigurationRequest extends AmazonWebServiceRequest implements Serializable, ExpectedBucketOwnerRequest {

    /**
     * The bucket whose cross origin configuration is being set.
     *
     *

     * When using this API with an access point, you must direct requests
     * to the access point hostname. The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     *

     *

     * When using this operation using an access point through the Amazon Web Services SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about access point
     * ARNs, see
     * Using access points in the Amazon Simple Storage Service Developer Guide.
     *

     */
    private String bucketName;

    /**
     * The new cross origin configuration for the specified bucket.
     */
    private BucketCrossOriginConfiguration crossOriginConfiguration;

    private String expectedBucketOwner;

    /**
     * Constructs a new {@link SetBucketCrossOriginConfigurationRequest}
     * to set the bucket cross origin configuration of
     * the specified bucket.
     *
     *

     * When using this API with an access point, you must direct requests
     * to the access point hostname. The access point hostname takes the form
     * AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com.
     *

     *

     * When using this operation using an access point through the Amazon Web Services SDKs, you provide
     * the access point ARN in place of the bucket name. For more information about access point
     * ARNs, see
     * Using access points in the Amazon Simple Storage Service Developer Guide.
     *

     *
     * @param bucketName
     *            The name of the bucket, or access point ARN, for which to set the cross origin
     *            configuration.
     * @param crossOriginConfiguration
     *            The new cross origin configuration for this bucket, which
     *            completely replaces any existing configuration.
     */
    public SetBucketCrossOriginConfigurationRequest(
            String bucketName, BucketCrossOriginConfiguration crossOriginConfiguration) {
        this.bucketName = bucketName;
        this.crossOriginConfiguration = crossOriginConfiguration;
    }

    public String getExpectedBucketOwner() {
        return expectedBucketOwner;
    }

    public SetBucketCrossOriginConfigurationRequest withExpectedBucketOwner(String expectedBucketOwner) {
        this.expectedBucketOwner = expectedBucketOwner;
        return this;
    }

    public void setExpectedBucketOwner(String expectedBucketOwner) {
        withExpectedBucketOwner(expectedBucketOwner);
    }

    /**
     * Gets the name of the bucket whose cross origin configuration is being
     * set.
     *
     * @return The name of the bucket whose cross origin configuration is being
     *         set.
     *
     * @see SetBucketCrossOriginConfigurationRequest#setBucketName(String)
     */
    public String getBucketName() {
        return bucketName;
    }

    /**
     * Sets the name of the bucket whose cross origin configuration is being set.
     *
     * @param bucketName
     *            The name of the bucket, or access point ARN, whose cross origin configuration is being
     *            set.
     *
     * @see SetBucketCrossOriginConfigurationRequest#getBucketName()
     */
    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }

    /**
     * Sets the name of the bucket whose cross origin configuration is being set,
     * and returns this object so that additional method calls may be chained
     * together.
     *
     * @param bucketName
     *            The name of the bucket, or access point ARN, whose cross origin configuration is being
     *            set.
     *
     * @return This {@link SetBucketCrossOriginConfigurationRequest} object so that
     *         additional method calls may be chained together.
     *
     * @see SetBucketCrossOriginConfigurationRequest#setBucketName(String)
     */
    public SetBucketCrossOriginConfigurationRequest withBucketName(String bucketName) {
        setBucketName(bucketName);
        return this;
    }

    /**
     * Gets the new cross origin configuration for the specified bucket.
     *
     * @return The new cross origin configuration for the specified bucket.
     *
     * @see SetBucketCrossOriginConfigurationRequest#setCrossOriginConfiguration(BucketCrossOriginConfiguration)
     * @see SetBucketCrossOriginConfigurationRequest#withCrossOriginConfiguration(BucketCrossOriginConfiguration)
     */
    public BucketCrossOriginConfiguration getCrossOriginConfiguration() {
        return crossOriginConfiguration;
    }

    /**
     * Sets the new cross origin configuration for the specified bucket.
     *
     * @param crossOriginConfiguration
     *            The new cross origin configuration for the specified bucket.
     *
     * @see SetBucketCrossOriginConfigurationRequest#getCrossOriginConfiguration()
     * @see SetBucketCrossOriginConfigurationRequest#withCrossOriginConfiguration(BucketCrossOriginConfiguration)
     */
    public void setCrossOriginConfiguration(
            BucketCrossOriginConfiguration crossOriginConfiguration) {
        this.crossOriginConfiguration = crossOriginConfiguration;
    }

    /**
     * Sets the new cross origin configuration for the specified bucket and
     * returns this object, enabling additional method calls to be chained
     * together.
     *
     * @param crossOriginConfiguration
     *            The new cross origin configuration for the specified bucket.
     *
     * @return This {@link SetBucketCrossOriginConfigurationRequest} object, enabling that
     *         additional method calls may be chained together.
     *
     * @see SetBucketCrossOriginConfigurationRequest#getCrossOriginConfiguration()
     */
    public SetBucketCrossOriginConfigurationRequest withCrossOriginConfiguration(
            BucketCrossOriginConfiguration crossOriginConfiguration) {
        setCrossOriginConfiguration(crossOriginConfiguration);
        return this;
    }

}


text:
<?php
namespace GrabzIt;

class GrabzItAnimationOptions extends GrabzItBaseOptions
{
	private $customWaterMarkId = null;
	private $width = null;
	private $height = null;
	private $start = null;
	private $duration = null;
	private $speed = null;
	private	$framesPerSecond = null;
	private $repeat = null;
	private $reverse = false;
	private $quality = -1;

	/*
	Set to true if the frames of the animated GIF should be reversed.
	*/
	public function setReverse($value)
	{
		$this->reverse = $value;
	}

	/*
	Get if the frames of the animated GIF should be reversed.
	*/
	public function getReverse()
	{
		return $this->reverse;
	}

	/*
	Set the number of times to loop the animated GIF. If 0 it will loop forever.
	*/
	public function setRepeat($value)
	{
		$this->repeat = $value;
	}

	/*
	Get the number of times to loop the animated GIF.
	*/
	public function getRepeat()
	{
		return $this->repeat;
	}

	/*
	Set the number of frames per second that should be captured from the video. From a minimum of 0.2 to a maximum of 60.
	*/
	public function setFramesPerSecond($value)
	{
		$this->framesPerSecond = $value;
	}

	/*
	Get the number of frames per second that should be captured from the video.
	*/
	public function getFramesPerSecond()
	{
		return $this->framesPerSecond;
	}

	/*
	Set the speed of the animated GIF from 0.2 to 10 times the original speed.
	*/
	public function setSpeed($value)
	{
		$this->speed = $value;
	}

	/*
	Get the speed of the animated GIF.
	*/
	public function getSpeed()
	{
		return $this->speed;
	}

	/*
	Set the length in seconds of the video that should be converted into a animated GIF.
	*/
	public function setDuration($value)
	{
		$this->duration = $value;
	}

	/*
	Get the length in seconds of the video that should be converted into a animated GIF.
	*/
	public function getDuration()
	{
		return $this->duration;
	}

	/*
	Set the starting position of the video that should be converted into an animated GIF.
	*/
	public function setStart($value)
	{
		$this->start = $value;
	}

	/*
	Get the starting position of the video that should be converted into an animated GIF.
	*/
	public function getStart()
	{
		return $this->start;
	}

	/*
	Set the width of the resulting animated GIF in pixels.
	*/
	public function setWidth($value)
	{
		$this->width = $value;
	}

	/*
	Get the width of the resulting animated GIF in pixels.
	*/
	public function getWidth()
	{
		return $this->width;
	}

	/*
	Set the height of the resulting animated GIF in pixels.
	*/
	public function setHeight($value)
	{
		$this->height = $value;
	}

	/*
	Get the height of the resulting animated GIF in pixels.
	*/
	public function getHeight()
	{
		return $this->height;
	}

	/*
	Set a custom watermark to add to the animated GIF.
	*/
	public function setCustomWaterMarkId($value)
	{
		$this->customWaterMarkId = $value;
	}

	/*
	Get the custom watermark id.
	*/
	public function getCustomWaterMarkId()
	{
		return $this->customWaterMarkId;
	}

	/*
	Set the quality of the image where 0 is poor and 100 excellent. The default is -1 which uses the recommended quality.
	*/
	public function setQuality($value)
	{
		$this->quality = $value;
	}

	/*
	Get the quality of the animated GIF.
	*/
	public function getQuality()
	{
		return $this->quality;
	}

	public function _getSignatureString($applicationSecret, $callBackURL, $url = null)
	{
		$urlParam = '';
		if ($url != null)
		{
			$urlParam = $this->nullToEmpty($url)."|";
		}

		$callBackURLParam = '';
		if ($callBackURL != null)
		{
			$callBackURLParam = $this->nullToEmpty($callBackURL);
		}

		return $this->nullToEmpty($applicationSecret)."|". $urlParam . $callBackURLParam .
		"|".$this->nullToEmpty($this->height)."|".$this->nullToEmpty($this->width)."|".$this->nullToEmpty($this->getCustomId())."|".
		$this->nullToEmpty($this->framesPerSecond)."|".$this->nullToEmpty($this->speed)."|".$this->nullToEmpty($this->duration)."|".
		$this->nullToEmpty($this->repeat)."|".$this->nullToEmpty(intval($this->reverse))."|".$this->nullToEmpty($this->start)."|".
		$this->nullToEmpty($this->customWaterMarkId)."|".$this->nullToEmpty($this->getCountry())."|".$this->nullToEmpty($this->quality)."|".
		$this->nullToEmpty($this->getExportURL())."|".$this->nullToEmpty($this->getEncryptionKey()."|".$this->nullToEmpty($this->getProxy()));
	}

	public function _getParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue)
	{
		$params = $this->createParameters($applicationKey, $sig, $callBackURL, $dataName, $dataValue);
		$params['width'] = $this->nullToEmpty($this->width);
		$params['height'] = $this->nullToEmpty($this->height);
		$params['duration'] = $this->nullToEmpty($this->duration);
		$params['speed'] = $this->nullToEmpty($this->speed);
		$params['customwatermarkid'] = $this->nullToEmpty($this->customWaterMarkId);
		$params['start'] = $this->nullToEmpty($this->start);
		$params['fps'] = $this->nullToEmpty($this->framesPerSecond);
		$params['repeat'] = $this->nullToEmpty($this->repeat);
		$params['reverse'] = $this->nullToEmpty(intval($this->reverse));
		$params['quality'] = $this->nullToEmpty($this->quality);

		return $params;
	}
}
?>


text:
// Created by Ron 'Maxwolf' McDowell (ron.mcdowell@gmail.com)
// Timestamp 05/12/2016@5:25 PM

namespace FateBot.Core
{
    using System.Collections.Generic;
    using Module;
    using Telegram.Bot.Types;

    /// <summary>
    ///     Deals with keep track of input to the simulation via whatever form that may end up taking. The default
    ///     implementation is a text user interface (TUI) which allows for the currently accepted commands to be seen and only
    ///     then accepted.
    /// </summary>
    public sealed class InputManager : Module
    {
        /// <summary>
        ///     Holds a constant representation of the string telling the user to press enter key to continue so we don't repeat
        ///     ourselves.
        /// </summary>
        public const string PRESSENTER = "Press ENTER KEY to continue";

        /// <summary>
        ///     Reference to simulation that is controlling the input manager.
        /// </summary>
        private readonly SimulationApp _simUnit;

        /// <summary>
        ///     Holds a series of commands that need to be executed in the order they come out of the collection.
        /// </summary>
        private Queue<Message> _commandQueue;

        /// <summary>
        ///     Initializes a new instance of the <see cref="InputManager" /> class.
        /// </summary>
        /// <param name="simUnit">Core simulation which is controlling the window manager.</param>
        public InputManager(SimulationApp simUnit)
        {
            _simUnit = simUnit;
            _commandQueue = new Queue<Message>();
        }

        /// <summary>
        ///     Fired when the simulation is closing and needs to clear out any data structures that it created so the program can
        ///     exit cleanly.
        /// </summary>
        public override void Destroy()
        {
            // Clear the command queue.
            _commandQueue.Clear();
            _commandQueue = null;
        }

        /// <summary>
        ///     Called when the simulation is ticked by underlying operating system, game engine, or potato. Each of these system
        ///     ticks is called at unpredictable rates, however if not a system tick that means the simulation has processed enough
        ///     of them to fire off event for fixed interval that is set in the core simulation by constant in milliseconds.
        /// </summary>
        /// <remarks>Default is one second or 1000ms.</remarks>
        /// <param name="systemTick">
        ///     TRUE if ticked unpredictably by underlying operating system, game engine, or potato. FALSE if
        ///     pulsed by game simulation at fixed interval.
        /// </param>
        /// <param name="skipDay">
        ///     Determines if the simulation has force ticked without advancing time or down the trail. Used by
        ///     special events that want to simulate passage of time without actually any actual time moving by.
        /// </param>
        public override void OnTick(bool systemTick, bool skipDay = false)
        {
            // Skip if there are no commands to tick.
            if (_commandQueue.Count <= 0)
                return;

            // Dequeue the next command to send and pass along to currently active game Windows if it exists.
            _simUnit.WindowManager.FocusedWindow?.SendCommand(_commandQueue.Dequeue());
        }

        /// <summary>
        ///     Clears the input buffer and submits whatever was in there to the simulation for processing. Implementation is left
        ///     up the game simulation itself entirely.
        /// </summary>
        public void SendCommand(Message command)
        {
            // Send trimmed line buffer to game simulation, if not accepting input we just pass along empty string.
            AddCommandToQueue(command);
        }

        /// <summary>
        ///     Fired by messaging system or user interface that wants to interact with the simulation by sending string command
        ///     that should be able to be parsed into a valid command that can be run on the current game Windows.
        /// </summary>
        /// <param name="command">Passed in command from controller, text was trimmed but nothing more.</param>
        private void AddCommandToQueue(Message command)
        {
            // Skip if we already entered the same command, simulation is state based... no need for flooding.
            if (_commandQueue.Contains(command))
                return;

            // Adds the command to queue to be passed to simulation when input manager is ticked.
            _commandQueue.Enqueue(command);
        }
    }
}


text:
f = CurrentFont()

for g in f:
    g.selected = not g.selected


text:
package patterns.behavioral.visitor.example;

class ConcreteVisitor1 implements Visitor {

    @Override
    public void visitElementA(Element element) {
        System.out.println("Visitando " + element.toString());
    }

    @Override
    public void visitElementB(Element element) {
        throw new UnsupportedOperationException();
    }

}