text:
<?php

namespace json2html;

/**
 * Created by PhpStorm.
 * User: i.glazkov
 * Date: 26.11.15
 * Time: 14:03
 */
class PrettyJSON
{
	const COLOR_BRACKET = 'gray';

	private $data = [];
	private $error = '';

	/**
	 * @var array|Options
	 */
	private $options = [];

	/**
	 * PrettyJSON constructor.
	 *
	 * @param array|Options $options
	 */
	public function __construct(Options $options = null)
	{
		$this->options = $options ?? new Options();
	}

	/**
	 * Update options
	 *
	 * @param Options $options
	 */
	public function setOptions(Options $options)
	{
		$this->options = $options;
	}

	/**
	 * @param string $json
	 *
	 * @throws \Exception
	 */
	public function setJsonText($json)
	{
		if (!is_string($json)) {
			throw new \Exception('Param "json" not a string');
		}

		$this->data = json_decode($json, true, 1024);

		if (json_last_error() != JSON_ERROR_NONE) {
			$this->data  = [];
			$this->error = static::descriptionJsonParseErrorByCode(json_last_error());
		}
	}

	/**
	 * Description Error parsing JSON
	 * @see http://php.net/manual/en/function.json-last-error.php
	 *
	 * @param int $jsonErrorCode
	 *
	 * @return string
	 */
	private static function descriptionJsonParseErrorByCode($jsonErrorCode)
	{
		$description = [
			JSON_ERROR_DEPTH          => 'Maximum stack depth exceeded',
			JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch',
			JSON_ERROR_CTRL_CHAR      => 'Unexpected control character found',
			JSON_ERROR_SYNTAX         => 'Syntax error, malformed JSON',
			JSON_ERROR_UTF8           => 'Unknown error'
		];

		return array_key_exists($jsonErrorCode, $description) ? $description[$jsonErrorCode] : 'Undefined error';
	}

	/**
	 * @return bool
	 */
	public function isError()
	{
		return strlen($this->error) > 0;
	}

	/**
	 * @return string
	 */
	public function getError()
	{
		return $this->error;
	}

	/**
	 * @return string
	 */
	public function getHtml()
	{
		if (is_array($this->data)) {
			return $this->printHtml($this->data);
		} else {
			return static::renderSimpleValue($this->data);
		}
	}

	/**
	 * @param array   $data
	 * @param string  $headerKey
	 * @param boolean $isEndComma
	 *
	 * @return string
	 */
	private function printHtml($data, $headerKey = null, $isEndComma = false)
	{
		if (is_null($data)) {
			return static::renderSimpleValue($data);
		}

		$html    = '';
		$isAssoc = static::isAssoc($data);
		$keyHtml = '';

		if ($headerKey) {
			$keyHtml = '"' . $headerKey . '"';
			$keyHtml .= ': ';
		}

		$styleElement = 'padding-left:20px;';

		if ($this->options->getIsOnlyColorize()) {
			$styleElement = 'display: inline;';
		}

		$html .= $this->buildBracket($keyHtml . ($isAssoc ? '{' : '['));
		$html .= "
";

		$count     = count($data);
		$iteration = 0;

		foreach ($data as $key => $value) {
			$isComma = $iteration++ < $count - 1;

			if (is_array($value)) {
				$html .= static::printHtml($value, $isAssoc ? $key : null, $isComma);
			} else {
				$styleBlock = '';

				if ($this->options->getIsOnlyColorize()) {
					$styleBlock = 'display: inline;';
				}

				$html .= "
";

				if ($isAssoc) {
					$html .= '"' . $key . '"';
					$html .= ': ';
				}

				$html .= static::renderSimpleValue($value);

				if ($isComma) {
					$html .= $this->buildComma();
				}

				$html .= '
';
			}
		}

		$html .= '
';

		$comma = $isEndComma ? $this->buildComma(false) : '';
		$html  .= $this->buildBracket(($isAssoc ? '}' : ']') . $comma);

		$html = $this->wrapInMainDiv($html);

		return $html;
	}

	private function buildBracket(string $symbol = '{'): string
	{
		$styleBracket = 'color: ' . static::COLOR_BRACKET . ';';

		if ($this->options->getIsOnlyColorize()) {
			$styleBracket .= 'display: inline-block;';
		}

		return "
$symbol
";
	}

	private function buildComma($wrapTag = true, $s = ','): string
	{
		if ($this->options->getIsOnlyColorize()) {
			$s .= ' ';
		}

		if ($wrapTag) {
			return ',';
		} else {
			return $s;
		}
	}

	private function wrapInMainDiv(string $html): string
	{
		$style = 'font-family: \'droid sans mono\', consolas, monospace, \'courier new\', courier, sans-serif, monospace;';

		if ($this->options->getIsOnlyColorize()) {
			$style .= 'display: inline;';
		} else {
			$style .= 'white-space: pre;';
		}

		$sDiv = "
";
		$eDiv = '
';

		return "$sDiv$html$eDiv";
	}

	/**
	 * Render simple value
	 *
	 * @param $value
	 *
	 * @return string
	 */
	private static function renderSimpleValue($value): string
	{
		$type = gettype($value);

		switch ($type) {
			case 'string':
				return '"' . $value . '"';
			case 'number':
			case 'integer':
			case 'double':
				return '' . $value . '';
			case 'boolean':
				$str = [true => 'true', false => 'false'];

				return '' . $str[$value] . '';
			case 'NULL':
				$color = static::COLOR_BRACKET;

				return "null";
			default:
				return '' . $value . ' (' . $type . ')';
		}
	}

	/**
	 * @param array $array
	 *
	 * @return bool
	 */
	private static function isAssoc(array $array)
	{
		return array_keys($array) !== range(0, count($array) - 1);
	}

}


text:
package org.lib4j.formatter;

import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;

public final class SourceFormat {
  public static SourceFormat getDefaultFormat() {
    return new SourceFormat();
  }

  private List<FormatModule> modules = new LinkedList<>();

  private SourceFormat() {
    addModule(new PackageModule());
    addModule(new DocumentationModule());
    addModule(new ImportModule());
    addModule(new AnnotationModule());
    addModule(new MethodModule());
    addModule(new FieldModule());
    addModule(new ClassModule());
    addModule(new OpenBracketModule());
    addModule(new CloseBracketModule());
    addModule(new DeclarationModule());
    addModule(new StatementModule());
  }

  public void addModule(final FormatModule module) {
    modules.add(module);
  }

  public String format(final String unformated) {
    if (unformated == null)
      return "";

    FormatModule.restetDepth();

    String formated = "";
    final StringTokenizer stringTokenizer = new StringTokenizer(unformated, "\t\n\r\f");
    while (stringTokenizer.hasMoreTokens())
      formated = modules(formated, stringTokenizer.nextToken());

    return formated;
  }

  private String modules(String formated, String token) {
    String formatedToken = token;
    for (int i = 0; i < modules.size(); i++) {
      FormatModule module = modules.get(i);
      token = module.format(formated, token);

      /*if (FormatModule.getLastModule() instanceof OpenBracketModule && !formated.endsWith("\n") && !token.startsWith("\n"))
       {
       for(int j = 0; j < module.getDepth(); j++)
       {
       token = TAB + token;
       }
       token = "\n" + token;
       }*/

      if (!formatedToken.equals(token)) {
        FormatModule.setLastModule(module);
        break;
      }

      formatedToken = token;
    }

    return formated += token;
  }
}

redpajama_set_name: RedPajamaGithub


text:
package r_kvstore

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

// ClusterInfo is a nested struct in r_kvstore response
type ClusterInfo struct {
	ClusterId                 string `json:"ClusterId" xml:"ClusterId"`
	ClusterName               string `json:"ClusterName" xml:"ClusterName"`
	HostNumbers               int    `json:"HostNumbers" xml:"HostNumbers"`
	InstanceNumbers           int    `json:"InstanceNumbers" xml:"InstanceNumbers"`
	CpuOverAllocationRatio    int    `json:"CpuOverAllocationRatio" xml:"CpuOverAllocationRatio"`
	MemoryOverAllocationRatio int    `json:"MemoryOverAllocationRatio" xml:"MemoryOverAllocationRatio"`
	DiskOverAllocationRatio   int    `json:"DiskOverAllocationRatio" xml:"DiskOverAllocationRatio"`
	AllocationPolicy          string `json:"AllocationPolicy" xml:"AllocationPolicy"`
	HostReplacePolicy         string `json:"HostReplacePolicy" xml:"HostReplacePolicy"`
	CreateTime                string `json:"CreateTime" xml:"CreateTime"`
}


text:
import { Http } from "@angular/http";
import { TranslateLoader } from "@ngx-translate/core";
import "rxjs/add/operator/map";
export declare class TranslateHttpLoader implements TranslateLoader {
    private http;
    private prefix;
    private suffix;
    constructor(http: Http, prefix?: string, suffix?: string);
    /**
     * Gets the translations from the server
     * @param lang
     * @returns {any}
     */
    getTranslation(lang: string): any;
}


text:
<?php

/********************************************
GetVerifiedStatus.php

Called by calls.html
Calls  AdaptiveAccounts.php,and APIError.php.
********************************************/

require_once '../../../lib/AdaptiveAccounts.php';
require_once '../../../lib/Stub/AA/AdaptiveAccountsProxy.php' ;
require_once 'web_constants.php';
session_start();

		try {

		       $emailid = $_REQUEST["emailid"];
		       $firstName=$_REQUEST["firstName"];
		       $lastname=$_REQUEST["lastname"];
		       $city=$_REQUEST["city"];

		       /* Make the call to PayPal to get the status of an account
		        If an error occured, show the resulting errors
		        */
		       	$VstatusRequest = new GetVerifiedStatusRequest();

		       	$VstatusRequest->emailAddress = $emailid;
		       	$VstatusRequest->matchCriteria = $city;
		       	$VstatusRequest->firstName = $firstName;
		       	$VstatusRequest->lastName = $lastname;

		       	$rEnvelope = new RequestEnvelope();
				$rEnvelope->errorLanguage = "en_US";
		       	$VstatusRequest->requestEnvelope = $rEnvelope ;

		       	$serverName = $_SERVER['SERVER_NAME'];
		        $serverPort = $_SERVER['SERVER_PORT'];

		        $aa = new AdaptiveAccounts();
		       	//$aa->sandBoxEmailAddress = $sandboxEmail;
				$response=$aa->GetVerifiedStatus($VstatusRequest);

				if(strtoupper($aa->isSuccess) == 'FAILURE')
				{
					$_SESSION['FAULTMSG']=$aa->getLastError();
					$location = "APIError.php";
					header("Location: $location");

				}
				else {

					$location = $response->redirectURL;
					if(!empty($location)) {
						$_SESSION['AddBankFundingSource'] = $response;
						header("Location: $location");
					}

				}

		}
		catch(Exception $ex) {

			$fault = new FaultMessage();
			$errorData = new ErrorData();
			$errorData->errorId = $ex->getFile() ;
  			$errorData->message = $ex->getMessage();
	  		$fault->error = $errorData;
			$_SESSION['FAULTMSG']=$fault;
			$location = "APIError.php";
			header("Location: $location");
		}

?>

Account Verified Status

        accountStatus:
        <?php echo $response->accountStatus ?>

Home


text:
import utils from './utils.js';
import expect from 'expect';
import {getTestState} from './mocha-utils.js';
import {Browser} from 'puppeteer-core/internal/api/Browser.js';
import {BrowserContext} from 'puppeteer-core/internal/api/BrowserContext.js';
import {Page} from 'puppeteer-core/internal/api/Page.js';

describe('OOPIF', function () {
  /* We use a special browser for this test as we need the --site-per-process flag */
  let browser: Browser;
  let context: BrowserContext;
  let page: Page;

  before(async () => {
    const {puppeteer, defaultBrowserOptions} = getTestState();
    browser = await puppeteer.launch(
      Object.assign({}, defaultBrowserOptions, {
        args: (defaultBrowserOptions.args || []).concat([
          '--site-per-process',
          '--remote-debugging-port=21222',
          '--host-rules=MAP * 127.0.0.1',
        ]),
      })
    );
  });

  beforeEach(async () => {
    context = await browser.createIncognitoBrowserContext();
    page = await context.newPage();
  });

  afterEach(async () => {
    await context.close();
  });

  after(async () => {
    await browser.close();
  });

  it('should treat OOP iframes and normal iframes the same', async () => {
    const {server} = getTestState();

    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return frame.url().endsWith('/empty.html');
    });
    await utils.attachFrame(page, 'frame1', server.EMPTY_PAGE);
    await utils.attachFrame(
      page,
      'frame2',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );
    await framePromise;
    expect(page.mainFrame().childFrames()).toHaveLength(2);
  });
  it('should track navigations within OOP iframes', async () => {
    const {server} = getTestState();

    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    await utils.attachFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );
    const frame = await framePromise;
    expect(frame.url()).toContain('/empty.html');
    await utils.navigateFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/assets/frame.html'
    );
    expect(frame.url()).toContain('/assets/frame.html');
  });
  it('should support OOP iframes becoming normal iframes again', async () => {
    const {server} = getTestState();

    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    await utils.attachFrame(page, 'frame1', server.EMPTY_PAGE);

    const frame = await framePromise;
    expect(frame.isOOPFrame()).toBe(false);
    await utils.navigateFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );
    expect(frame.isOOPFrame()).toBe(true);
    await utils.navigateFrame(page, 'frame1', server.EMPTY_PAGE);
    expect(frame.isOOPFrame()).toBe(false);
    expect(page.frames()).toHaveLength(2);
  });
  it('should support frames within OOP frames', async () => {
    const {server} = getTestState();

    await page.goto(server.EMPTY_PAGE);
    const frame1Promise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    const frame2Promise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 2;
    });
    await utils.attachFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/frames/one-frame.html'
    );

    const [frame1, frame2] = await Promise.all([frame1Promise, frame2Promise]);

    expect(
      await frame1.evaluate(() => {
        return document.location.href;
      })
    ).toMatch(/one-frame\.html$/);
    expect(
      await frame2.evaluate(() => {
        return document.location.href;
      })
    ).toMatch(/frames\/frame\.html$/);
  });
  it('should support OOP iframes getting detached', async () => {
    const {server} = getTestState();

    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    await utils.attachFrame(page, 'frame1', server.EMPTY_PAGE);

    const frame = await framePromise;
    expect(frame.isOOPFrame()).toBe(false);
    await utils.navigateFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );
    expect(frame.isOOPFrame()).toBe(true);
    await utils.detachFrame(page, 'frame1');
    expect(page.frames()).toHaveLength(1);
  });

  it('should support wait for navigation for transitions from local to OOPIF', async () => {
    const {server} = getTestState();

    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    await utils.attachFrame(page, 'frame1', server.EMPTY_PAGE);

    const frame = await framePromise;
    expect(frame.isOOPFrame()).toBe(false);
    const nav = frame.waitForNavigation();
    await utils.navigateFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );
    await nav;
    expect(frame.isOOPFrame()).toBe(true);
    await utils.detachFrame(page, 'frame1');
    expect(page.frames()).toHaveLength(1);
  });

  it('should keep track of a frames OOP state', async () => {
    const {server} = getTestState();

    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    await utils.attachFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );
    const frame = await framePromise;
    expect(frame.url()).toContain('/empty.html');
    await utils.navigateFrame(page, 'frame1', server.EMPTY_PAGE);
    expect(frame.url()).toBe(server.EMPTY_PAGE);
  });

  it('should support evaluating in oop iframes', async () => {
    const {server} = getTestState();

    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    await utils.attachFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );
    const frame = await framePromise;
    await frame.evaluate(() => {
      // eslint-disable-next-line @typescript-eslint/ban-ts-comment
      // @ts-ignore
      _test = 'Test 123!';
    });
    const result = await frame.evaluate(() => {
      // eslint-disable-next-line @typescript-eslint/ban-ts-comment
      // @ts-ignore
      return window._test;
    });
    expect(result).toBe('Test 123!');
  });
  it('should provide access to elements', async () => {
    const {server, isHeadless, headless} = getTestState();

    if (!isHeadless || headless === 'chrome') {
      // TODO: this test is partially blocked on crbug.com/1334119. Enable test once
      // the upstream is fixed.
      // TLDR: when we dispatch events ot the frame the compositor might
      // not be up-to-date yet resulting in a misclick (the iframe element
      // becomes the event target instead of the content inside the iframe).
      // The solution is to use InsertVisualCallback on the backend but that causes
      // another issue that events cannot be dispatched to inactive tabs as the
      // visual callback is never invoked.
      // The old headless mode does not have this issue since it operates with
      // special scheduling settings that keep even inactive tabs updating.
      return;
    }

    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    await utils.attachFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );

    const frame = await framePromise;
    await frame.evaluate(() => {
      const button = document.createElement('button');
      button.id = 'test-button';
      button.innerText = 'click';
      button.onclick = () => {
        button.id = 'clicked';
      };
      document.body.appendChild(button);
    });
    await page.evaluate(() => {
      document.body.style.border = '150px solid black';
      document.body.style.margin = '250px';
      document.body.style.padding = '50px';
    });
    await frame.waitForSelector('#test-button', {visible: true});
    await frame.click('#test-button');
    await frame.waitForSelector('#clicked');
  });
  it('should report oopif frames', async () => {
    const {server} = getTestState();

    const frame = page.waitForFrame(frame => {
      return frame.url().endsWith('/oopif.html');
    });
    await page.goto(server.PREFIX + '/dynamic-oopif.html');
    await frame;
    expect(oopifs(context).length).toBe(1);
    expect(page.frames().length).toBe(2);
  });

  it('should wait for inner OOPIFs', async () => {
    const {server} = getTestState();
    await page.goto(`http://mainframe:${server.PORT}/main-frame.html`);
    const frame2 = await page.waitForFrame(frame => {
      return frame.url().endsWith('inner-frame2.html');
    });
    expect(oopifs(context).length).toBe(2);
    expect(
      page.frames().filter(frame => {
        return frame.isOOPFrame();
      }).length
    ).toBe(2);
    expect(
      await frame2.evaluate(() => {
        return document.querySelectorAll('button').length;
      })
    ).toStrictEqual(1);
  });

  it('should load oopif iframes with subresources and request interception', async () => {
    const {server} = getTestState();

    const frame = page.waitForFrame(frame => {
      return frame.url().endsWith('/oopif.html');
    });
    await page.setRequestInterception(true);
    page.on('request', request => {
      return request.continue();
    });
    await page.goto(server.PREFIX + '/dynamic-oopif.html');
    await frame;
    expect(oopifs(context).length).toBe(1);
  });
  it('should support frames within OOP iframes', async () => {
    const {server} = getTestState();

    const oopIframePromise = page.waitForFrame(frame => {
      return frame.url().endsWith('/oopif.html');
    });
    await page.goto(server.PREFIX + '/dynamic-oopif.html');
    const oopIframe = await oopIframePromise;
    await utils.attachFrame(
      oopIframe,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );

    const frame1 = oopIframe.childFrames()[0]!;
    expect(frame1.url()).toMatch(/empty.html$/);
    await utils.navigateFrame(
      oopIframe,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/oopif.html'
    );
    expect(frame1.url()).toMatch(/oopif.html$/);
    await frame1.goto(
      server.CROSS_PROCESS_PREFIX + '/oopif.html#navigate-within-document',
      {waitUntil: 'load'}
    );
    expect(frame1.url()).toMatch(/oopif.html#navigate-within-document$/);
    await utils.detachFrame(oopIframe, 'frame1');
    expect(oopIframe.childFrames()).toHaveLength(0);
  });

  it('clickablePoint, boundingBox, boxModel should work for elements inside OOPIFs', async () => {
    const {server} = getTestState();
    await page.goto(server.EMPTY_PAGE);
    const framePromise = page.waitForFrame(frame => {
      return page.frames().indexOf(frame) === 1;
    });
    await utils.attachFrame(
      page,
      'frame1',
      server.CROSS_PROCESS_PREFIX + '/empty.html'
    );
    const frame = await framePromise;
    await page.evaluate(() => {
      document.body.style.border = '50px solid black';
      document.body.style.margin = '50px';
      document.body.style.padding = '50px';
    });
    await frame.evaluate(() => {
      const button = document.createElement('button');
      button.id = 'test-button';
      button.innerText = 'click';
      document.body.appendChild(button);
    });
    const button = (await frame.waitForSelector('#test-button', {
      visible: true,
    }))!;
    const result = await button.clickablePoint();
    expect(result.x).toBeGreaterThan(150); // padding + margin + border left
    expect(result.y).toBeGreaterThan(150); // padding + margin + border top
    const resultBoxModel = (await button.boxModel())!;
    for (const quad of [
      resultBoxModel.content,
      resultBoxModel.border,
      resultBoxModel.margin,
      resultBoxModel.padding,
    ]) {
      for (const part of quad) {
        expect(part.x).toBeGreaterThan(150); // padding + margin + border left
        expect(part.y).toBeGreaterThan(150); // padding + margin + border top
      }
    }
    const resultBoundingBox = (await button.boundingBox())!;
    expect(resultBoundingBox.x).toBeGreaterThan(150); // padding + margin + border left
    expect(resultBoundingBox.y).toBeGreaterThan(150); // padding + margin + border top
  });

  it('should detect existing OOPIFs when Puppeteer connects to an existing page', async () => {
    const {server, puppeteer} = getTestState();

    const frame = page.waitForFrame(frame => {
      return frame.url().endsWith('/oopif.html');
    });
    await page.goto(server.PREFIX + '/dynamic-oopif.html');
    await frame;
    expect(oopifs(context).length).toBe(1);
    expect(page.frames().length).toBe(2);

    const browserURL = 'http://127.0.0.1:21222';
    const browser1 = await puppeteer.connect({browserURL});
    const target = await browser1.waitForTarget(target => {
      return target.url().endsWith('dynamic-oopif.html');
    });
    await target.page();
    browser1.disconnect();
  });

  it('should support lazy OOP frames', async () => {
    const {server} = getTestState();

    await page.goto(server.PREFIX + '/lazy-oopif-frame.html');
    await page.setViewport({width: 1000, height: 1000});

    expect(
      page.frames().map(frame => {
        return frame._hasStartedLoading;
      })
    ).toEqual([true, true, false]);
  });

  describe('waitForFrame', () => {
    it('should resolve immediately if the frame already exists', async () => {
      const {server} = getTestState();

      await page.goto(server.EMPTY_PAGE);
      await utils.attachFrame(
        page,
        'frame2',
        server.CROSS_PROCESS_PREFIX + '/empty.html'
      );

      await page.waitForFrame(frame => {
        return frame.url().endsWith('/empty.html');
      });
    });
  });
});

function oopifs(context: BrowserContext) {
  return context.targets().filter(target => {
    return target._getTargetInfo().type === 'iframe';
  });
}


text:
// +build !solaris

package tail

import (
	"bytes"
	"context"
	"errors"
	"io"
	"strings"
	"sync"
	"time"

	"github.com/dimchansky/utfbom"
	"github.com/influxdata/tail"
	"github.com/influxdata/telegraf"
	"github.com/influxdata/telegraf/internal/globpath"
	"github.com/influxdata/telegraf/plugins/common/encoding"
	"github.com/influxdata/telegraf/plugins/inputs"
	"github.com/influxdata/telegraf/plugins/parsers"
	"github.com/influxdata/telegraf/plugins/parsers/csv"
)

const (
	defaultWatchMethod = "inotify"
)

var (
	offsets      = make(map[string]int64)
	offsetsMutex = new(sync.Mutex)
)

type empty struct{}
type semaphore chan empty

type Tail struct {
	Files               []string `toml:"files"`
	FromBeginning       bool     `toml:"from_beginning"`
	Pipe                bool     `toml:"pipe"`
	WatchMethod         string   `toml:"watch_method"`
	MaxUndeliveredLines int      `toml:"max_undelivered_lines"`
	CharacterEncoding   string   `toml:"character_encoding"`
	PathTag             string   `toml:"path_tag"`

	Log        telegraf.Logger `toml:"-"`
	tailers    map[string]*tail.Tail
	offsets    map[string]int64
	parserFunc parsers.ParserFunc
	wg         sync.WaitGroup

	acc telegraf.TrackingAccumulator

	MultilineConfig MultilineConfig `toml:"multiline"`
	multiline       *Multiline

	ctx     context.Context
	cancel  context.CancelFunc
	sem     semaphore
	decoder *encoding.Decoder
}

func NewTail() *Tail {
	offsetsMutex.Lock()
	offsetsCopy := make(map[string]int64, len(offsets))
	for k, v := range offsets {
		offsetsCopy[k] = v
	}
	offsetsMutex.Unlock()

	return &Tail{
		FromBeginning:       false,
		MaxUndeliveredLines: 1000,
		offsets:             offsetsCopy,
		PathTag:             "path",
	}
}

const sampleConfig = `
  ## File names or a pattern to tail.
  ## These accept standard unix glob matching rules, but with the addition of
  ## ** as a "super asterisk". ie:
  ##   "/var/log/**.log"  -> recursively find all .log files in /var/log
  ##   "/var/log/*/*.log" -> find all .log files with a parent dir in /var/log
  ##   "/var/log/apache.log" -> just tail the apache log file
  ##   "/var/log/log[!1-2]*  -> tail files without 1-2
  ##   "/var/log/log[^1-2]*  -> identical behavior as above
  ## See https://github.com/gobwas/glob for more examples
  ##
  files = ["/var/mymetrics.out"]

  ## Read file from beginning.
  # from_beginning = false

  ## Whether file is a named pipe
  # pipe = false

  ## Method used to watch for file updates.  Can be either "inotify" or "poll".
  # watch_method = "inotify"

  ## Maximum lines of the file to process that have not yet be written by the
  ## output.  For best throughput set based on the number of metrics on each
  ## line and the size of the output's metric_batch_size.
  # max_undelivered_lines = 1000

  ## Character encoding to use when interpreting the file contents.  Invalid
  ## characters are replaced using the unicode replacement character.  When set
  ## to the empty string the data is not decoded to text.
  ##   ex: character_encoding = "utf-8"
  ##       character_encoding = "utf-16le"
  ##       character_encoding = "utf-16be"
  ##       character_encoding = ""
  # character_encoding = ""

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "influx"

  ## Set the tag that will contain the path of the tailed file. If you don't want this tag, set it to an empty string.
  # path_tag = "path"

  ## multiline parser/codec
  ## https://www.elastic.co/guide/en/logstash/2.4/plugins-filters-multiline.html
  #[inputs.tail.multiline]
    ## The pattern should be a regexp which matches what you believe to be an
	## indicator that the field is part of an event consisting of multiple lines of log data.
    #pattern = "^\s"

    ## This field must be either "previous" or "next".
	## If a line matches the pattern, "previous" indicates that it belongs to the previous line,
	## whereas "next" indicates that the line belongs to the next one.
    #match_which_line = "previous"

    ## The invert_match field can be true or false (defaults to false).
    ## If true, a message not matching the pattern will constitute a match of the multiline
	## filter and the what will be applied. (vice-versa is also true)
    #invert_match = false

    ## After the specified timeout, this plugin sends a multiline event even if no new pattern
	## is found to start a new event. The default timeout is 5s.
    #timeout = 5s
`

func (t *Tail) SampleConfig() string {
	return sampleConfig
}

func (t *Tail) Description() string {
	return "Parse the new lines appended to a file"
}

func (t *Tail) Init() error {
	if t.MaxUndeliveredLines == 0 {
		return errors.New("max_undelivered_lines must be positive")
	}
	t.sem = make(semaphore, t.MaxUndeliveredLines)

	var err error
	t.decoder, err = encoding.NewDecoder(t.CharacterEncoding)
	return err
}

func (t *Tail) Gather(_ telegraf.Accumulator) error {
	return t.tailNewFiles(true)
}

func (t *Tail) Start(acc telegraf.Accumulator) error {
	t.acc = acc.WithTracking(t.MaxUndeliveredLines)

	t.ctx, t.cancel = context.WithCancel(context.Background())

	t.wg.Add(1)
	go func() {
		defer t.wg.Done()
		for {
			select {
			case <-t.ctx.Done():
				return
			case <-t.acc.Delivered():
				<-t.sem
			}
		}
	}()

	var err error
	t.multiline, err = t.MultilineConfig.NewMultiline()

	if err != nil {
		return err
	}

	t.tailers = make(map[string]*tail.Tail)

	err = t.tailNewFiles(t.FromBeginning)

	// clear offsets
	t.offsets = make(map[string]int64)
	// assumption that once Start is called, all parallel plugins have already been initialized
	offsetsMutex.Lock()
	offsets = make(map[string]int64)
	offsetsMutex.Unlock()

	return err
}

func (t *Tail) tailNewFiles(fromBeginning bool) error {
	var poll bool
	if t.WatchMethod == "poll" {
		poll = true
	}

	// Create a "tailer" for each file
	for _, filepath := range t.Files {
		g, err := globpath.Compile(filepath)
		if err != nil {
			t.Log.Errorf("Glob %q failed to compile: %s", filepath, err.Error())
		}
		for _, file := range g.Match() {
			if _, ok := t.tailers[file]; ok {
				// we're already tailing this file
				continue
			}

			var seek *tail.SeekInfo
			if !t.Pipe && !fromBeginning {
				if offset, ok := t.offsets[file]; ok {
					t.Log.Debugf("Using offset %d for %q", offset, file)
					seek = &tail.SeekInfo{
						Whence: 0,
						Offset: offset,
					}
				} else {
					seek = &tail.SeekInfo{
						Whence: 2,
						Offset: 0,
					}
				}
			}

			tailer, err := tail.TailFile(file,
				tail.Config{
					ReOpen:    true,
					Follow:    true,
					Location:  seek,
					MustExist: true,
					Poll:      poll,
					Pipe:      t.Pipe,
					Logger:    tail.DiscardingLogger,
					OpenReaderFunc: func(rd io.Reader) io.Reader {
						r, _ := utfbom.Skip(t.decoder.Reader(rd))
						return r
					},
				})

			if err != nil {
				t.Log.Debugf("Failed to open file (%s): %v", file, err)
				continue
			}

			t.Log.Debugf("Tail added for %q", file)

			parser, err := t.parserFunc()
			if err != nil {
				t.Log.Errorf("Creating parser: %s", err.Error())
				continue
			}

			// create a goroutine for each "tailer"
			t.wg.Add(1)

			go func() {
				defer t.wg.Done()
				t.receiver(parser, tailer)

				t.Log.Debugf("Tail removed for %q", tailer.Filename)

				if err := tailer.Err(); err != nil {
					t.Log.Errorf("Tailing %q: %s", tailer.Filename, err.Error())
				}
			}()

			t.tailers[tailer.Filename] = tailer
		}
	}
	return nil
}

// ParseLine parses a line of text.
func parseLine(parser parsers.Parser, line string, firstLine bool) ([]telegraf.Metric, error) {
	switch parser.(type) {
	case *csv.Parser:
		// The csv parser parses headers in Parse and skips them in ParseLine.
		// As a temporary solution call Parse only when getting the first
		// line from the file.
		if firstLine {
			return parser.Parse([]byte(line))
		}

		m, err := parser.ParseLine(line)
		if err != nil {
			return nil, err
		}

		if m != nil {
			return []telegraf.Metric{m}, nil
		}
		return []telegraf.Metric{}, nil
	default:
		return parser.Parse([]byte(line))
	}
}

// Receiver is launched as a goroutine to continuously watch a tailed logfile
// for changes, parse any incoming msgs, and add to the accumulator.
func (t *Tail) receiver(parser parsers.Parser, tailer *tail.Tail) {
	var firstLine = true

	// holds the individual lines of multi-line log entries.
	var buffer bytes.Buffer

	var timer *time.Timer
	var timeout <-chan time.Time

	// The multiline mode requires a timer in order to flush the multiline buffer
	// if no new lines are incoming.
	if t.multiline.IsEnabled() {
		timer = time.NewTimer(time.Duration(*t.MultilineConfig.Timeout))
		timeout = timer.C
	}

	channelOpen := true
	tailerOpen := true
	var line *tail.Line

	for {
		line = nil

		if timer != nil {
			timer.Reset(time.Duration(*t.MultilineConfig.Timeout))
		}

		select {
		case <-t.ctx.Done():
			channelOpen = false
		case line, tailerOpen = <-tailer.Lines:
			if !tailerOpen {
				channelOpen = false
			}
		case <-timeout:
		}

		var text string

		if line != nil {
			// Fix up files with Windows line endings.
			text = strings.TrimRight(line.Text, "\r")

			if t.multiline.IsEnabled() {
				if text = t.multiline.ProcessLine(text, &buffer); text == "" {
					continue
				}
			}
		}
		if line == nil || !channelOpen || !tailerOpen {
			if text += t.multiline.Flush(&buffer); text == "" {
				if !channelOpen {
					return
				}

				continue
			}
		}

		if line != nil && line.Err != nil {
			t.Log.Errorf("Tailing %q: %s", tailer.Filename, line.Err.Error())
			continue
		}

		metrics, err := parseLine(parser, text, firstLine)
		if err != nil {
			t.Log.Errorf("Malformed log line in %q: [%q]: %s",
				tailer.Filename, text, err.Error())
			continue
		}
		firstLine = false

		if t.PathTag != "" {
			for _, metric := range metrics {
				metric.AddTag(t.PathTag, tailer.Filename)
			}
		}

		// try writing out metric first without blocking
		select {
		case t.sem <- empty{}:
			t.acc.AddTrackingMetricGroup(metrics)
			if t.ctx.Err() != nil {
				return // exit!
			}
			continue // next loop
		default:
			// no room. switch to blocking write.
		}

		// Block until plugin is stopping or room is available to add metrics.
		select {
		case <-t.ctx.Done():
			return
		case t.sem <- empty{}:
			t.acc.AddTrackingMetricGroup(metrics)
		}
	}
}

func (t *Tail) Stop() {
	for _, tailer := range t.tailers {
		if !t.Pipe && !t.FromBeginning {
			// store offset for resume
			offset, err := tailer.Tell()
			if err == nil {
				t.Log.Debugf("Recording offset %d for %q", offset, tailer.Filename)
			} else {
				t.Log.Errorf("Recording offset for %q: %s", tailer.Filename, err.Error())
			}
		}
		err := tailer.Stop()
		if err != nil {
			t.Log.Errorf("Stopping tail on %q: %s", tailer.Filename, err.Error())
		}
	}

	t.cancel()
	t.wg.Wait()

	// persist offsets
	offsetsMutex.Lock()
	for k, v := range t.offsets {
		offsets[k] = v
	}
	offsetsMutex.Unlock()
}

func (t *Tail) SetParserFunc(fn parsers.ParserFunc) {
	t.parserFunc = fn
}

func init() {
	inputs.Add("tail", func() telegraf.Input {
		return NewTail()
	})
}


text:
<?php

namespace Sjdaws\NewRelicApi;

use Sjdaws\NewRelicApi\Account;

class Client extends Resource
{
    /**
     * Create a new account instance
     *
     * @return Account
     */
    public function account()
    {
        return new Account($this->apiKey, $this->logger);
    }
}


text:
export default class Entity
{
    constructor (name)
    {
        this.name = name;
        this.initiative;
        this.alerts = [];
    }

    getInitiative()
    {
        return this.initiative;
    }

    hasAlerts()
    {
        return !!this.alerts.length;
    }

    addAlert(alert)
    {
        this.alerts.push(alert);
    }

    *getAlerts()
    {
        for (let alert of this.alerts) {
            yield alert;

            alert.tick();
            if (alert.getDuration && alert.getDuration() == 0) {
                this.alerts.splice(this.alerts.indexOf(alert), 1);
            }
        }
    }

    toString()
    {
        return `<span class="name">${this.name}</span> (<span class="initiative">${this.initiative}</span>)`;
    }
}


text:
package org.apache.ode.bpel.elang.xpath20.runtime;

import java.util.Iterator;

import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
import javax.xml.xpath.XPathExpression;

import net.sf.saxon.expr.AxisExpression;
import net.sf.saxon.expr.Expression;
import net.sf.saxon.expr.ItemChecker;
import net.sf.saxon.expr.PathExpression;
import net.sf.saxon.expr.VariableReference;
import net.sf.saxon.om.Axis;
import net.sf.saxon.om.NamePool;
import net.sf.saxon.pattern.NameTest;
import net.sf.saxon.pattern.NodeKindTest;
import net.sf.saxon.pattern.NodeTest;
import net.sf.saxon.xpath.XPathExpressionImpl;

import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.NSContext;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

/**
 * A helper utility that modifies XPath Expression in-place.  This is meant
 * to be reusable across the XPath and XQuery runtimes.
 */
public class XPath20ExpressionModifier {
    private NSContext contextUris;
    private NamePool namePool;

    /**
     * Creates a new XPath20ExpressionModifier object.
     *
     * @param contextUris
     * @param namePool
     */
    public XPath20ExpressionModifier(NSContext contextUris, NamePool namePool) {
        this.contextUris = contextUris;
        this.namePool = namePool;
    }

    /**
     * Insert nodes into the specified XPath expression wherever
     * required To be precise, an node is added to its parent if:
     * a) the node is an element...
     * b) that corresponds to an step...
     * c) that has a child axis...
     * d) whose parent had no children with its name...
     * e) and all preceding steps are element name tests.
     *
     * @param xpathExpr
     * @param namePool
     *
     * @throws DOMException
     * @throws TransformerException
     */
    @SuppressWarnings("unchecked")
    public void insertMissingData(XPathExpression xpathExpr, Node contextNode)
        throws DOMException, TransformerException {
        if ((contextNode == null) || !(contextNode instanceof Element) ||
                !(xpathExpr instanceof XPathExpressionImpl)) {
            return;
        }

        Expression expression = ((XPathExpressionImpl) xpathExpr).getInternalExpression();
        Iterator<Expression> subExpressions = (Iterator<Expression>) expression.iterateSubExpressions();

        if (!subExpressions.hasNext()) {
            return;
        }

        Expression subExpr = (Expression) subExpressions.next();

        if (!(subExpr instanceof PathExpression)) {
            return;
        }

        Document document = contextNode.getOwnerDocument();
        PathExpression pathExpr = (PathExpression) subExpr;
        Expression step = pathExpr.getFirstStep();

        while (step != null) {
            if (step instanceof AxisExpression) {
                AxisExpression axisExpr = (AxisExpression) step;

                NodeTest nodeTest = axisExpr.getNodeTest();

                if (!(nodeTest instanceof NameTest)) {
                    break;
                }

                NameTest nameTest = (NameTest) nodeTest;

                QName childName = getQualifiedName(nameTest.getFingerprint(),
                        namePool, contextUris);

                if (Axis.CHILD == axisExpr.getAxis()) {
                    if (NodeKindTest.ELEMENT.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }

                    NodeList children = ((Element) contextNode).getElementsByTagNameNS(childName.getNamespaceURI(),
                            childName.getLocalPart());
                    if ((children == null) || (children.getLength() == 0)) {
                        Node child = document.createElementNS(childName.getNamespaceURI(),
                                DOMUtils.getQualifiedName(childName));
                        contextNode.appendChild(child);
                        contextNode = child;
                    } else if (children.getLength() == 1) {
                        contextNode = children.item(0);
                    } else {
                        break;
                    }
                } else if (Axis.ATTRIBUTE == axisExpr.getAxis()) {
                    if (NodeKindTest.ATTRIBUTE.getNodeKindMask() != nameTest.getNodeKindMask()) {
                        break;
                    }

                    Attr attribute = ((Element) contextNode).getAttributeNodeNS(childName.getNamespaceURI(), childName.getLocalPart());
                    if (attribute == null) {
                    	attribute = document.createAttributeNS(childName.getNamespaceURI(), childName.getLocalPart());
                    	((Element) contextNode).setAttributeNode(attribute);
                    	contextNode = attribute;
                    } else {
                    	break;
                    }

                } else {
                	break;
                }

            } else if (step instanceof ItemChecker) {
                ItemChecker itemChecker = (ItemChecker) step;
                Expression baseExpr = itemChecker.getBaseExpression();

                if (!(baseExpr instanceof VariableReference)) {
                    break;
                }
            } else {
                break;
            }

            if (pathExpr != null) {
                Expression remainingSteps = pathExpr.getRemainingSteps();

                if (remainingSteps instanceof PathExpression) {
                    pathExpr = (PathExpression) remainingSteps;
                    step = pathExpr.getFirstStep();
                } else if (remainingSteps instanceof AxisExpression) {
                    pathExpr = null;
                    step = (AxisExpression) remainingSteps;
                }
            } else {
                break;
            }
        }
    }

    /**
     * Create the QName by running the given finger print against the
     * given context
     *
     * @param fingerprint
     * @param namePool
     * @param nsContext
     *
     * @return The QName corresponding to the finger print
     */
    private QName getQualifiedName(int fingerprint, NamePool namePool,
        NSContext nsContext) {
        String localName = namePool.getLocalName(fingerprint);
        String prefix = namePool.getPrefix(fingerprint);
        String uri = namePool.getURI(fingerprint);

        // Unfortunately, NSContext.getPrefix(String URI) doesn't always work
        // So, we need to find the prefix for the URI the hard way
        if ((prefix == null) || "".equals(prefix)) {
            for (String nsPrefix : nsContext.getPrefixes()) {
                String nsUri = nsContext.getNamespaceURI(nsPrefix);

                if (nsUri.equals(uri)) {
                    prefix = nsPrefix;
                }
            }
        }

        return new QName(uri, localName, prefix);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Hymenogaster asterigmatus Soehner

### Remarks
null


text:
FROM golang:1.9

# Based on https://hub.docker.com/_/golang/
WORKDIR /go/src/app
COPY . .
RUN go-wrapper download
RUN go-wrapper install

# Start app. APPOPTICS_SERVICE_KEY must be set to enable AppOptics.
CMD /go/bin/app -testClients true -addr :8890
EXPOSE 8890


text:
<?xml version="1.0" encoding="UTF-8"  ?>

<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
		 name="classic"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Portrait"
		 pageWidth="595"
		 pageHeight="842"
		 columnWidth="535"
		 columnSpacing="0"
		 leftMargin="30"
		 rightMargin="30"
		 topMargin="20"
		 bottomMargin="20"
		 whenNoDataType="NoPages"
		 isTitleNewPage="false"
		 isSummaryNewPage="false">
	<property name="ireport.scriptlethandling" value="0" />
	<property name="ireport.encoding" value="UTF-8" />
	<import value="java.util.*" />
	<import value="net.sf.jasperreports.engine.*" />
	<import value="net.sf.jasperreports.engine.data.*" />
	<import value="it.businesslogic.ireport.IReportScriptlet" />

		<group  name="Group1" >
			<groupExpression><![CDATA[null]]></groupExpression>
			<groupHeader>
			<band height="32"  isSplitAllowed="true" >
				<rectangle radius="0" >
					<reportElement
						mode="Opaque"
						x="0"
						y="28"
						width="535"
						height="2"
						forecolor="#000099"
						backcolor="#000099"
						key="rectangle"/>
					<graphicElement stretchType="NoStretch" pen="None"/>
				</rectangle>
				<staticText>
					<reportElement
						x="3"
						y="2"
						width="96"
						height="23"
						forecolor="#000066"
						backcolor="#FFFFFF"
						key="staticText"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<text><![CDATA[G1Label]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="102"
						y="2"
						width="146"
						height="23"
						forecolor="#000066"
						backcolor="#FFFFFF"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[G1Field]]></textFieldExpression>
				</textField>
			</band>
			</groupHeader>
			<groupFooter>
			<band height="10"  isSplitAllowed="true" >
				<line direction="BottomUp">
					<reportElement
						mode="Opaque"
						x="1"
						y="4"
						width="534"
						height="0"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="line"/>
					<graphicElement stretchType="NoStretch" pen="Thin"/>
				</line>
			</band>
			</groupFooter>
		</group>
		<group  name="Group2" >
			<groupExpression><![CDATA[null]]></groupExpression>
			<groupHeader>
			<band height="25"  isSplitAllowed="true" >
				<rectangle radius="0" >
					<reportElement
						mode="Opaque"
						x="0"
						y="0"
						width="535"
						height="25"
						forecolor="#FFFF33"
						backcolor="#FFFF33"
						key="rectangle"/>
					<graphicElement stretchType="NoStretch" pen="None"/>
				</rectangle>
				<staticText>
					<reportElement
						x="25"
						y="0"
						width="96"
						height="23"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="staticText"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<text><![CDATA[G2Label]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="124"
						y="0"
						width="98"
						height="23"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[G2Field]]></textFieldExpression>
				</textField>
			</band>
			</groupHeader>
			<groupFooter>
			<band height="10"  isSplitAllowed="true" >
				<line direction="BottomUp">
					<reportElement
						mode="Opaque"
						x="1"
						y="4"
						width="534"
						height="0"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="line"/>
					<graphicElement stretchType="NoStretch" pen="Thin"/>
				</line>
			</band>
			</groupFooter>
		</group>
		<group  name="Group3" >
			<groupExpression><![CDATA[null]]></groupExpression>
			<groupHeader>
			<band height="25"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="50"
						y="1"
						width="96"
						height="23"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="staticText"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<text><![CDATA[G3Label]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="149"
						y="1"
						width="98"
						height="23"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[G3Field]]></textFieldExpression>
				</textField>
			</band>
			</groupHeader>
			<groupFooter>
			<band height="10"  isSplitAllowed="true" >
				<line direction="BottomUp">
					<reportElement
						mode="Opaque"
						x="1"
						y="4"
						width="534"
						height="0"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="line"/>
					<graphicElement stretchType="NoStretch" pen="Thin"/>
				</line>
			</band>
			</groupFooter>
		</group>
		<group  name="Group4" >
			<groupExpression><![CDATA[null]]></groupExpression>
			<groupHeader>
			<band height="25"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="75"
						y="0"
						width="96"
						height="23"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="staticText"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<text><![CDATA[G4Label]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="174"
						y="0"
						width="98"
						height="23"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[G4Field]]></textFieldExpression>
				</textField>
			</band>
			</groupHeader>
			<groupFooter>
			<band height="10"  isSplitAllowed="true" >
				<line direction="BottomUp">
					<reportElement
						mode="Opaque"
						x="1"
						y="4"
						width="534"
						height="0"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="line"/>
					<graphicElement stretchType="NoStretch" pen="Thin"/>
				</line>
			</band>
			</groupFooter>
		</group>
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="50"  isSplitAllowed="true" >
				<rectangle radius="0" >
					<reportElement
						mode="Opaque"
						x="0"
						y="2"
						width="535"
						height="48"
						forecolor="#00CCCC"
						backcolor="#000099"
						key="rectangle-1"/>
					<graphicElement stretchType="NoStretch" pen="Thin"/>
				</rectangle>
				<staticText>
					<reportElement
						x="5"
						y="5"
						width="468"
						height="40"
						forecolor="#FFFFFF"
						backcolor="#FFFFFF"
						key="staticText"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Justified" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<text><![CDATA[Test template]]></text>
				</staticText>
			</band>
		</title>
		<pageHeader>
			<band height="6"  isSplitAllowed="true" >
			</band>
		</pageHeader>
		<columnHeader>
			<band height="0"  isSplitAllowed="true" >
				<line direction="BottomUp">
					<reportElement
						mode="Opaque"
						x="0"
						y="0"
						width="535"
						height="0"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="line"/>
					<graphicElement stretchType="NoStretch" pen="Thin"/>
				</line>
			</band>
		</columnHeader>
		<detail>
			<band height="20"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="0"
						y="2"
						width="127"
						height="17"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="staticText"
						positionType="Float"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<text><![CDATA[DetailLabel]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="127"
						y="2"
						width="398"
						height="17"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[DetailField]]></textFieldExpression>
				</textField>
			</band>
		</detail>
		<columnFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnFooter>
		<pageFooter>
			<band height="27"  isSplitAllowed="true" >
				<rectangle radius="0" >
					<reportElement
						mode="Opaque"
						x="0"
						y="5"
						width="535"
						height="20"
						forecolor="#000099"
						backcolor="#000099"
						key="rectangle-2"/>
					<graphicElement stretchType="NoStretch" pen="Thin"/>
				</rectangle>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						mode="Transparent"
						x="325"
						y="4"
						width="174"
						height="19"
						forecolor="#FFFFFF"
						backcolor="#FFFFFF"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						mode="Transparent"
						x="499"
						y="4"
						width="36"
						height="19"
						forecolor="#FFFFFF"
						backcolor="#FFFFFF"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
				</textField>
				<line direction="TopDown">
					<reportElement
						mode="Opaque"
						x="0"
						y="1"
						width="535"
						height="0"
						forecolor="#000000"
						backcolor="#FFFFFF"
						key="line"/>
					<graphicElement stretchType="NoStretch" pen="2Point"/>
				</line>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="1"
						y="6"
						width="209"
						height="19"
						forecolor="#FFFFFF"
						backcolor="#FFFFFF"
						key="textField"/>
					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
					<textElement textAlignment="Left" verticalAlignment="Top" rotation="None" lineSpacing="Single">

					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
				</textField>
			</band>
		</pageFooter>

			<band height="0"  isSplitAllowed="true" >
			</band>

</jasperReport>


text:
namespace wgt
{
char NGT_MAYA_COMMAND_SHOW[] = "NGTShow";
char NGT_MAYA_COMMAND_HIDE[] = "NGTHide";
char NGT_MAYA_COMMAND_START[] = "NGTStart";
char NGT_MAYA_COMMAND_STOP[] = "NGTStop";
const char * NGT_MAYA_PLUGIN_LIST_FILE = "\\plugins\\plugins_maya.txt";

#ifdef _DEBUG
const char * NGT_MAYA_PLUGIN_NAME = "maya_plugin_d.mll";
#else
	const char * NGT_MAYA_PLUGIN_NAME = "maya_plugin.mll";
#endif

static HMODULE hApp = ::GetModuleHandleA( NGT_MAYA_PLUGIN_NAME );

static char ngtHome[MAX_PATH];
static wchar_t exePath[MAX_PATH];

const char NGT_HOME[] = "NGT_HOME";
const char NGT_PATH[] = "PATH";

static NGTApplicationProxy * ngtApp = nullptr;
static GenericPluginManager * pluginManager = nullptr;

bool getNGTPlugins(std::vector< std::wstring >& plugins, const wchar_t* filepath)
{
	return ConfigPluginLoader::getPlugins(plugins, std::wstring( filepath ));
}

bool loadNGT()
{
	MString filepath = ngtHome;
	filepath += NGT_MAYA_PLUGIN_LIST_FILE;

	std::vector< std::wstring > plugins;
	if (!getNGTPlugins(plugins, filepath.asWChar()) || plugins.empty())
	{
		return MStatus::kFailure; // failed to find any plugins!
	}

	auto& contextManager = pluginManager->getContextManager();
	contextManager.setExecutablePath( ngtHome );

	auto globalContext = contextManager.getGlobalContext();
	globalContext->registerInterface(new MemoryPluginContextCreator);

	pluginManager->loadPlugins(plugins);

	auto uiApp = globalContext->queryInterface< IUIApplication >();
	if (!uiApp)
	{
		return false;
	}

	ngtApp = new NGTApplicationProxy( uiApp );
	ngtApp->start();

	return true;
}

struct NGTShowCommand : public MTemplateAction< NGTShowCommand, NGT_MAYA_COMMAND_SHOW, MTemplateCommand_nullSyntax >
{
	MStatus doIt(const MArgList& args) override;
};

MStatus NGTShowCommand::doIt(const MArgList& args)
{
	if (!ngtApp || !ngtApp->started())
	{
		return MStatus::kFailure;
	}

	if (!ngtApp->visible())
	{
		ngtApp->show();
	}

	return MStatus::kSuccess;
}

struct NGTHideCommand : public MTemplateAction< NGTShowCommand, NGT_MAYA_COMMAND_HIDE, MTemplateCommand_nullSyntax >
{
	MStatus doIt(const MArgList& args) override;
};

MStatus NGTHideCommand::doIt(const MArgList& args)
{
	if (!ngtApp || !ngtApp->started())
	{
		return MStatus::kFailure;
	}

	ngtApp->hide();
	return MStatus::kSuccess;
}

struct NGTStartCommand : public MTemplateAction< NGTShowCommand, NGT_MAYA_COMMAND_HIDE, MTemplateCommand_nullSyntax >
{
	MStatus doIt(const MArgList& args) override;
};

MStatus NGTStartCommand::doIt(const MArgList& args)
{
	if (!ngtApp)
	{
		return MStatus::kFailure;
	}

	if (!ngtApp->started())
	{
		ngtApp->start();
	}
	return MStatus::kSuccess;
}

struct NGTStopCommand : public MTemplateAction< NGTShowCommand, NGT_MAYA_COMMAND_STOP, MTemplateCommand_nullSyntax >
{
	MStatus doIt(const MArgList& args) override;
};

MStatus NGTStopCommand::doIt(const MArgList& args)
{
	if (!ngtApp || !ngtApp->started())
	{
		return MStatus::kFailure;
	}

	ngtApp->stop();
	return MStatus::kSuccess;
}

MStatus initializeMayaPlugin(MObject obj)
{
	MStatus status;

    if (!Environment::getValue<MAX_PATH>( NGT_HOME, ngtHome ))
    {
#ifdef _WIN32
        GetModuleFileNameA( hApp, ngtHome, MAX_PATH );
        PathRemoveFileSpecA( ngtHome );
        Environment::setValue( NGT_HOME, ngtHome );
#endif // _WIN32

#ifdef __APPLE__
        Dl_info info;
        if (!dladdr( reinterpret_cast<void*>(setContext), &info ))
        {
            NGT_ERROR_MSG( "Generic plugin manager: failed to get current module file name%s", "\n" );
        }
        strcpy(ngtHome, info.dli_fname);
        const char* dir = dirname(ngtHome);
        Environment::setValue( NGT_HOME, dir);

        std::string dlybs = dir;
        dlybs += "/../PlugIns";
        Environment::setValue( "LD_LIBRARY_PATH", dlybs.c_str() );
#endif // __APPLE__
    }

#ifdef __APPLE__
    Environment::setValue( "QT_QPA_PLATFORM_PLUGIN_PATH", (std::string( ngtHome ) + "/../PlugIns/platforms").c_str() );
#else
    Environment::setValue( "QT_QPA_PLATFORM_PLUGIN_PATH", (std::string( ngtHome ) + "/platforms").c_str() );
#endif

#ifdef _WIN32
    size_t convertedChars = 0;
    mbstowcs_s( &convertedChars, exePath, MAX_PATH, ngtHome, _TRUNCATE );
    assert( convertedChars );
#endif // _WIN32

#ifdef __APPLE__
    std::wstring_convert< std::codecvt_utf8<wchar_t> > conv;
    wcscpy(exePath, conv.from_bytes( ngtHome ).c_str());
#endif // __APPLE__

    char path[2048];
    if(Environment::getValue<2048>( NGT_PATH, path ))
    {
        std::string newPath( "\"" );
        newPath += ngtHome;
        newPath += "\";";
        newPath += path;
        Environment::setValue( NGT_PATH, newPath.c_str() );
    }

#ifdef _WIN32
    SetDllDirectoryA( ngtHome );
#endif // _WIN32

	pluginManager = new GenericPluginManager();

	NGTShowCommand::registerCommand( obj );
	NGTHideCommand::registerCommand( obj );
	NGTStartCommand::registerCommand( obj );
	NGTStopCommand::registerCommand( obj );

	return loadNGT() ? MStatus::kSuccess : MStatus::kFailure;
}

MStatus uninitializeMayaPlugin(MObject obj)
{
	delete ngtApp;
	ngtApp = nullptr;
	delete pluginManager;
	pluginManager = nullptr;
	// TODO: Maya crashes if return MStatus::kSuccess here
	return MStatus::kFailure;
}

}

PLUGIN_EXPORT MStatus initializePlugin(MObject obj)
//
//	Description:
//		this method is called when the plug-in is loaded into Maya.  It
//		registers all of the services that this plug-in provides with
//		Maya.
//
//	Arguments:
//		obj - a handle to the plug-in object (use MFnPlugin to access it)
//
{
	return wgt::initializeMayaPlugin(obj);
}

PLUGIN_EXPORT MStatus uninitializePlugin(MObject obj)
//
//	Description:
//		this method is called when the plug-in is unloaded from Maya. It
//		deregisters all of the services that it was providing.
//
//	Arguments:
//		obj - a handle to the plug-in object (use MFnPlugin to access it)
//
{
	return wgt::uninitializeMayaPlugin(obj);
} // end namespace wgt

#pragma warning( pop )


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/title">
    <ListView
        android:id="@+id/lv_publish"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </ListView>

</LinearLayout>


text:
<?php

namespace App\Models;

use App\Events\SongLikeToggled;
use App\Traits\CanFilterByUser;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * @property bool  liked
 * @property int   play_count
 * @property Song  song
 * @property User  user
 * @property int id
 */
class Interaction extends Model
{
    use CanFilterByUser;

    protected $casts = [
        'liked' => 'boolean',
        'play_count' => 'integer',
    ];

    protected $guarded = ['id'];

    protected $hidden = ['id', 'user_id', 'created_at', 'updated_at'];

    /**
     * An interaction belongs to a user.
     *
     * @return BelongsTo
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }

    /**
     * An interaction is associated with a song.
     *
     * @return BelongsTo
     */
    public function song()
    {
        return $this->belongsTo(Song::class);
    }

    /**
     * Increase the number of times a song is played by a user.
     *
     * @param string $songId
     * @param User   $user
     *
     * @return Interaction
     */
    public static function increasePlayCount($songId, User $user)
    {
        return tap(self::firstOrCreate([
            'song_id' => $songId,
            'user_id' => $user->id,
        ]), function (Interaction $interaction) {
            if (!$interaction->exists) {
                $interaction->liked = false;
            }

            ++$interaction->play_count;
            $interaction->save();
        });
    }

    /**
     * Like or unlike a song on behalf of a user.
     *
     * @param string $songId
     * @param User   $user
     *
     * @return Interaction
     */
    public static function toggleLike($songId, User $user)
    {
        return tap(self::firstOrCreate([
            'song_id' => $songId,
            'user_id' => $user->id,
        ]), function (Interaction $interaction) {
            $interaction->liked = !$interaction->liked;
            $interaction->save();

            event(new SongLikeToggled($interaction));
        });
    }

    /**
     * Like several songs at once.
     *
     * @param array $songIds
     * @param User  $user
     *
     * @return array
     */
    public static function batchLike(array $songIds, User $user)
    {
        return collect($songIds)->map(function ($songId) use ($user) {
            return tap(self::firstOrCreate([
                'song_id' => $songId,
                'user_id' => $user->id,
            ]), function (Interaction $interaction) {
                if (!$interaction->exists) {
                    $interaction->play_count = 0;
                }

                $interaction->liked = true;
                $interaction->save();

                event(new SongLikeToggled($interaction));
            });
        })->all();
    }

    /**
     * Unlike several songs at once.
     *
     * @param array $songIds
     * @param User  $user
     *
     * @return int
     */
    public static function batchUnlike(array $songIds, User $user)
    {
        self::whereIn('song_id', $songIds)->whereUserId($user->id)->get()->each(function (Interaction $interaction) {
            $interaction->liked = false;
            $interaction->save();

            event(new SongLikeToggled($interaction));
        });
    }
}


text:
START TRANSACTION;
  UPDATE cfg_schema_version SET version_value='44' WHERE version_key='schema_patch';
COMMIT;


text:
package org.wso2.sample.warehouselocator;

public class Warehouse {
	private String Name;
	private String Address;
	private String postCode;
	private String city;
	private int capacityLevel;

	public String getName() {
		return Name;
	}
	public void setName(String name) {
		Name = name;
	}

	public String getAddress() {
		return Address;
	}
	public void setAddress(String address) {
		Address = address;
	}

	public String getPostCode() {
		return postCode;
	}
	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}

	public int getCapacityLevel() {
		return capacityLevel;
	}
	public void setCapacityLevel(int capacityLevel) {
		this.capacityLevel = capacityLevel;
	}
}


text:
namespace nj
{

   class Result
   {
      protected:

         std::shared_ptr<nj::Exception> _ex;
         std::vector<std::shared_ptr<nj::Value>> _results;
         int64_t expr_id;

      public:

         Result() { expr_id = -1; }
         Result(std::shared_ptr<nj::Exception> &ex,int64_t exprId) { _ex = ex; expr_id = exprId; }
         Result(const std::vector<std::shared_ptr<nj::Value>> &results,int64_t exprId) { _results = results; expr_id = exprId; }
         const std::vector<std::shared_ptr<nj::Value>> &results() const { return _results; }
         std::string exceptionText() const { return _ex.get()?_ex->what():""; }
         std::vector<std::string> exceptionStack() const { return _ex.get()?_ex->stack():std::vector<std::string>(); }
         int exceptionId() const { return _ex.get()?_ex->id():Exception::no_exception; }
         int64_t exprId() const { return expr_id; }
   };
};

#endif


text:
import csv
import inspect
import os

from telemetry.page import page as page_module
from telemetry.user_story import user_story_set
from telemetry.util import cloud_storage

PUBLIC_BUCKET = cloud_storage.PUBLIC_BUCKET
PARTNER_BUCKET = cloud_storage.PARTNER_BUCKET
INTERNAL_BUCKET = cloud_storage.INTERNAL_BUCKET

class PageSetError(Exception):
  pass

class PageSet(user_story_set.UserStorySet):
  def __init__(self, file_path=None, archive_data_file='', user_agent_type=None,
               serving_dirs=None, bucket=None):
    # The default value of file_path is location of the file that define this
    # page set instance's class.
    # TODO(aiolos): When migrating page_sets over to user_story_sets, make
    # sure that we are passing a valid directory path in to base_dir, and not
    # a file path like we curerntly do in some cases for file_path.
    dir_name = file_path
    if file_path and os.path.isfile(file_path):
      dir_name = os.path.dirname(file_path)

    super(PageSet, self).__init__(
        archive_data_file=archive_data_file, cloud_storage_bucket=bucket,
        base_dir=dir_name, serving_dirs=serving_dirs)

    # These attributes can be set dynamically by the page set.
    self.user_agent_type = user_agent_type

  @property
  def pages(self):
    return self.user_stories

  def AddUserStory(self, user_story):
    assert isinstance(user_story, page_module.Page)
    assert user_story.page_set is self
    super(PageSet, self).AddUserStory(user_story)


text:
<?php
# MantisBT - a php based bugtracking system

# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Returns whether wiki functionality is enabled
 * @return bool indicating whether wiki is enabled
 * @access public
 */
function wiki_enabled() {
	return( config_get_global( 'wiki_enable' ) == ON );
}

/**
 *
 * @return null
 * @access public
 */
function wiki_init() {
	if( wiki_enabled() ) {

		# handle legacy style wiki integration
		require_once( config_get_global( 'class_path' ) . 'MantisCoreWikiPlugin.class.php' );
		switch( config_get_global( 'wiki_engine' ) ) {
			case 'dokuwiki':
				plugin_child( 'MantisCoreDokuwiki' );
				break;
			case 'mediawiki':
				plugin_child( 'MantisCoreMediaWiki' );
				break;
			case 'twiki':
				plugin_child( 'MantisCoreTwiki' );
				break;
			case 'WikkaWiki':
				plugin_child( 'MantisCoreWikkaWiki' );
				break;
			case 'xwiki':
				plugin_child( 'MantisCoreXwiki' );
				break;
		}

		if( is_null( event_signal( 'EVENT_WIKI_INIT' ) ) ) {
			config_set_global( 'wiki_enable', OFF );
		}
	}
}

/**
 *
 * @param int $p_bug_id Bug ID
 * @return string url
 * @access public
 */
function wiki_link_bug( $p_bug_id ) {
	return event_signal( 'EVENT_WIKI_LINK_BUG', $p_bug_id );
}

/**
 *
 * @param int $p_project_id
 * @return string url
 * @access public
 */
function wiki_link_project( $p_project_id ) {
	return event_signal( 'EVENT_WIKI_LINK_PROJECT', $p_project_id );
}


text:
<!DOCTYPE html>

    <title>Travis Steel | Phi Leaf Generator</title>

      <canvas id='leaf-canvas' width='800' height='800'>
        Canvas not supported.
      </canvas>

        <fieldset>
          <legend>Arrangement</legend>
          Number of leaves:
          <input id='leaves' name='leaves' type="number" step="1" min='1'>

          Angle:
          <input id='angle' name='angle' type="number"/>
          <input id='phi' type="button" style='width: 60px;' value='φ - phi'/>

          Center radius:
          <input id='center_radius' name='center_radius' type="number"/>

          Growth radius:
          <input id='growth_radius' name='growth_radius' type="number"/>
        </fieldset>
        <fieldset>
          <legend>Leaf Shape</legend>
          Leaf length:
          <input id='leaf_length' name='leaf_length' type="number" step="1" min='1'/>

          Leaf width:
          <input id='leaf_width' name='leaf_width' type="number" step="1" min='1'/>

          Leaf bulb ratio:
          <input id='leaf_bulb_ratio' name='leaf_bulb_ratio' type="number" step="1" min='1'/>
        </fieldset>
        <fieldset>
          <legend>Lines</legend>
          Outline width:
          <input id='outline_width' name='outline_width' type="number" min='0'/>

          Crease line width:
          <input id='crease_line_width' name='crease_line_width' type="number" min='0'/>

          Crease length (%):
          <input id='crease_length_percent' name='crease_length_percent' type="number" min='0' max='1' step='0.1'/>

          Crease curvature:
          <input id='crease_curvature_amount' name='crease_curvature_amount' type="number"/>
        </fieldset>
        <fieldset>
          <legend>Colors</legend>
          Outline color:
          <input id='outline_color' name='outline_color' type='text' class='colorpicker' maxlength='7' />

          Outer leaf gradient:
          <input id='outer_leaf_grad' name='outer_leaf_grad' type='text' class='colorpicker' maxlength='7' />

          Inner leaf gradient:
          <input id='inner_leaf_grad' name='inner_leaf_grad' type='text' class='colorpicker' maxlength='7' />

          Shadow color:
          <input id='shadow_color' name='shadow_color' type='text' class='colorpicker' maxlength='7' />
        </fieldset>
        <fieldset>
          <legend>Shadows</legend>
          Shadow blur:
          <input id='shadow_blur' name='shadow_blur' type="number" min='0'/>

          Shadow offset X:
          <input id='shadow_offset_x' name='shadow_offset_x' type="number"/>

          Shadow offset Y:
          <input id='shadow_offset_y' name='shadow_offset_y' type="number"/>

          Shadow opacity:
          <input id='shadow_opacity' name='shadow_opacity' type="number" min='0' max='1' step='0.1'/>
        </fieldset>
        <input id='save' type=button value='Save image' style='margin-left: 140px;' />

        Inspired by Vi Hart's  doodling videos.

        © 2012 Travis Steel


text:
package org.eclipse.microprofile.metrics.tck;

import javax.inject.Inject;

import org.eclipse.microprofile.metrics.Counter;
import org.eclipse.microprofile.metrics.Histogram;
import org.eclipse.microprofile.metrics.Metadata;
import org.eclipse.microprofile.metrics.Meter;
import org.eclipse.microprofile.metrics.MetricID;
import org.eclipse.microprofile.metrics.MetricRegistry;
import org.eclipse.microprofile.metrics.MetricType;
import org.eclipse.microprofile.metrics.Tag;
import org.eclipse.microprofile.metrics.Timer;
import org.eclipse.microprofile.metrics.annotation.Metric;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.arquillian.junit.InSequence;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

@RunWith(Arquillian.class)
public class MetricRegistryTest {

    @Inject
    @Metric(name = "nameTest", absolute = true)
    private Counter nameTest;

    @Inject
    private Counter countTemp;

    @Inject
    private Histogram histoTemp;

    @Inject
    private Timer timerTemp;

    @Inject
    private Meter meterTemp;

    @Inject
    private MetricRegistry metrics;

    @Deployment
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    }

    @Test
    @InSequence(1)
    public void nameTest() {
        Assert.assertNotNull(metrics);
        Assert.assertTrue(metrics.getNames().contains("nameTest"));
    }

    @Test
    @InSequence(2)
    public void registerTest() {
        metrics.register("regCountTemp", countTemp);
        Assert.assertTrue(metrics.getCounters().containsKey(new MetricID("regCountTemp")));

        metrics.register("regHistoTemp", histoTemp);
        Assert.assertTrue(metrics.getHistograms().containsKey(new MetricID("regHistoTemp")));

        metrics.register("regTimerTemp", timerTemp);
        Assert.assertTrue(metrics.getTimers().containsKey(new MetricID("regTimerTemp")));

        metrics.register("regMeterTemp", meterTemp);
        Assert.assertTrue(metrics.getMeters().containsKey(new MetricID("regMeterTemp")));
    }

    @Test
    @InSequence(3)
    public void removeTest() {
        metrics.remove("nameTest");
        Assert.assertFalse(metrics.getNames().contains("nameTest"));
    }

    @Test
    @InSequence(4)
    public void useExistingMetaDataTest() {
        String displayName = "displayCounterFoo";
        String metricName = "counterFoo";

        //first to register a "complex" metadata
        metrics.counter(Metadata.builder().withName(metricName).withDisplayName(displayName).withType(MetricType.COUNTER).build());

        Tag purpleTag = new Tag("colour","purple");
        //creates with a simple/template metadata or uses an existing one.
        metrics.counter(metricName, purpleTag);

        //check both counters have been registered
        Assert.assertTrue(metrics.getCounters().containsKey(new MetricID(metricName)));
        Assert.assertTrue(metrics.getCounters().containsKey(new MetricID(metricName, purpleTag)));

        //check that the "original" metadata wasn't replaced by the empty default metadata
        Assert.assertEquals(metrics.getMetadata().get(metricName).getDisplayName(), displayName);
    }

}


text:
<?php

namespace phpseclib3\Crypt\Common;

/**
 * Base Class for all stream cipher classes
 *
 * @package StreamCipher
 * @author  Jim Wigginton <terrafrost@php.net>
 */
abstract class StreamCipher extends SymmetricKey
{
}


text:
package org.mym.datamocker.rule.annotation;

import org.mym.datamocker.rule.AffectType;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Indicate that mocked value should always be more than the param value.
 * Created by Muyangmin on Apr 06, 2017.
 */
@Retention(RetentionPolicy.RUNTIME)
@AffectType(types = {Integer.class, Double.class, int.class, double.class})
public @interface MoreThan {
    double value();
}


text:
package com.fasterxml.jackson.databind.type;

import java.lang.reflect.*;
import java.util.*;

import com.fasterxml.jackson.databind.JavaType;

/**
 * Helper class used for resolving type parameters for given class
 */
public class TypeBindings
{
    private final static JavaType[] NO_TYPES = new JavaType[0];

    /**
     * Marker to use for (temporarily) unbound references.
     */
    public final static JavaType UNBOUND = new SimpleType(Object.class);

    /**
     * Factory to use for constructing resolved related types.
     */
    protected final TypeFactory _typeFactory;

    /**
     * Context type used for resolving all types, if specified. May be null,
     * in which case {@link #_contextClass} is used instead.
     */
    protected final JavaType _contextType;

    /**
     * Specific class to use for resolving all types, for methods and fields
     * class and its superclasses and -interfaces contain.
     */
    protected final Class<?> _contextClass;

    /**
     * Lazily-instantiated bindings of resolved type parameters
     */
    protected Map<String,JavaType> _bindings;

    /**
     * Also: we may temporarily want to mark certain named types
     * as resolved (but without exact type); if so, we'll just store
     * names here.
     */
    protected HashSet<String> _placeholders;

    /**
     * Sometimes it is necessary to allow hierarchic resolution of types: specifically
     * in cases where there are local bindings (for methods, constructors). If so,
     * we'll just use simple delegation model.
     */
    private final TypeBindings _parentBindings;

    /*
    /**********************************************************
    /* Construction
    /**********************************************************
     */

    public TypeBindings(TypeFactory typeFactory, Class<?> cc)
    {
        this(typeFactory, null, cc, null);
    }

    public TypeBindings(TypeFactory typeFactory, JavaType type)
    {
        this(typeFactory, null, type.getRawClass(), type);
    }

    /**
     * Constructor used to create "child" instances; mostly to
     * allow delegation from explicitly defined local overrides
     * (local type variables for methods, constructors) to
     * contextual (class-defined) ones.
     */
    public TypeBindings childInstance() {
        return new TypeBindings(_typeFactory, this, _contextClass, _contextType);
    }

    private TypeBindings(TypeFactory tf, TypeBindings parent,
            Class<?> cc, JavaType type)
    {
        _typeFactory = tf;
        _parentBindings = parent;
        _contextClass = cc;
        _contextType = type;
    }

    /*
    /**********************************************************
    /* Pass-through type resolution methods
    /**********************************************************
     */

    public JavaType resolveType(Class<?> cls) {
        return _typeFactory._constructType(cls, this);
    }

    public JavaType resolveType(Type type) {
        return _typeFactory._constructType(type, this);
    }

    /*
    /**********************************************************
    /* Accesors
    /**********************************************************
     */

    public int getBindingCount() {
        if (_bindings == null) {
            _resolve();
        }
        return _bindings.size();
    }

    public JavaType findType(String name)
    {
        if (_bindings == null) {
            _resolve();
        }
        JavaType t = _bindings.get(name);
        if (t != null) {
            return t;
        }
        if (_placeholders != null && _placeholders.contains(name)) {
            return UNBOUND;
        }
        if (_parentBindings != null) {
            return _parentBindings.findType(name);
        }
        // nothing found, so...
        // Should we throw an exception or just return null?

        /* [JACKSON-499] 18-Feb-2011, tatu: There are some tricky type bindings within
         *   java.util, such as HashMap$KeySet; so let's punt the problem
         *   (honestly not sure what to do -- they are unbound for good, I think)
         */
        if (_contextClass != null) {
            Class<?> enclosing = _contextClass.getEnclosingClass();
            if (enclosing != null) {
                // [JACKSON-572]: Actually, let's skip this for all non-static inner classes
                //   (which will also cover 'java.util' type cases...
                if (!Modifier.isStatic(_contextClass.getModifiers())) {
                    return UNBOUND;
                }

                // ... so this piece of code should not be needed any more
                /*
                Package pkg = enclosing.getPackage();
                if (pkg != null) {
                    // as per [JACKSON-533], also include "java.util.concurrent":
                    if (pkg.getName().startsWith("java.util")) {
                        return UNBOUND;
                    }
                }
                */
            }
        }

        String className;
        if (_contextClass != null) {
            className = _contextClass.getName();
        } else if (_contextType != null) {
            className = _contextType.toString();
        } else {
            className = "UNKNOWN";
        }
        throw new IllegalArgumentException("Type variable '"+name
                +"' can not be resolved (with context of class "+className+")");
        //t = UNBOUND;
    }

    public void addBinding(String name, JavaType type)
    {
        // note: emptyMap() is unmodifiable, hence second check is needed:
        if (_bindings == null || _bindings.size() == 0) {
            _bindings = new LinkedHashMap<String,JavaType>();
        }
        _bindings.put(name, type);
    }

    public JavaType[] typesAsArray()
    {
        if (_bindings == null) {
            _resolve();
        }
        if (_bindings.size() == 0) {
            return NO_TYPES;
        }
        return _bindings.values().toArray(new JavaType[_bindings.size()]);
    }

    /*
    /**********************************************************
    /* Internal methods
    /**********************************************************
     */

    protected void _resolve()
    {
        _resolveBindings(_contextClass);

        // finally: may have root level type info too
        if (_contextType != null) {
            int count = _contextType.containedTypeCount();
            if (count > 0) {
                for (int i = 0; i < count; ++i) {
                    String name = _contextType.containedTypeName(i);
                    JavaType type = _contextType.containedType(i);
                    addBinding(name, type);
                }
            }
        }

        // nothing bound? mark with empty map to prevent further calls
        if (_bindings == null) {
            _bindings = Collections.emptyMap();
        }
    }

    public void _addPlaceholder(String name) {
        if (_placeholders == null) {
            _placeholders = new HashSet<String>();
        }
        _placeholders.add(name);
    }

    protected void _resolveBindings(Type t)
    {
        if (t == null) return;

        Class<?> raw;
        if (t instanceof ParameterizedType) {
            ParameterizedType pt = (ParameterizedType) t;
            Type[] args = pt.getActualTypeArguments();
            if (args  != null && args.length > 0) {
                Class<?> rawType = (Class<?>) pt.getRawType();
                TypeVariable<?>[] vars = rawType.getTypeParameters();
                if (vars.length != args.length) {
                    throw new IllegalArgumentException("Strange parametrized type (in class "+rawType.getName()+"): number of type arguments != number of type parameters ("+args.length+" vs "+vars.length+")");
                }
                for (int i = 0, len = args.length; i < len; ++i) {
                    TypeVariable<?> var = vars[i];
                    String name = var.getName();
                    if (_bindings == null) {
                        _bindings = new LinkedHashMap<String,JavaType>();
                    } else {
                        /* 24-Mar-2010, tatu: Better ensure that we do not overwrite something
                         *  collected earlier (since we descend towards super-classes):
                         */
                        if (_bindings.containsKey(name)) continue;
                    }
                    // first: add a placeholder to prevent infinite loops
                    _addPlaceholder(name);
                    // then resolve type
                    _bindings.put(name, _typeFactory._constructType(args[i], this));
                }
            }
            raw = (Class<?>)pt.getRawType();
        } else if (t instanceof Class<?>) {
            raw = (Class<?>) t;
            /* [JACKSON-677]: If this is an inner class then the generics are defined on the
             * enclosing class so we have to check there as well.  We don't
             * need to call getEnclosingClass since anonymous classes declare
             * generics
             */
            _resolveBindings(raw.getDeclaringClass());
            /* 24-Mar-2010, tatu: Can not have true generics definitions, but can
             *   have lower bounds ("<T extends BeanBase>") in declaration itself
             */
            TypeVariable<?>[] vars = raw.getTypeParameters();
            if (vars != null && vars.length > 0) {
                JavaType[] typeParams = null;

                if (_contextType != null && raw.isAssignableFrom(_contextType.getRawClass())) {
                    typeParams = _typeFactory.findTypeParameters(_contextType, raw);
                }

                for (int i = 0; i < vars.length; i++) {
                    TypeVariable<?> var = vars[i];

                    String name = var.getName();
                    Type varType = var.getBounds()[0];
                    if (varType != null) {
                        if (_bindings == null) {
                            _bindings = new LinkedHashMap<String,JavaType>();
                        } else { // and no overwriting...
                            if (_bindings.containsKey(name)) continue;
                        }
                        _addPlaceholder(name); // to prevent infinite loops

                        if (typeParams != null) {
                            _bindings.put(name, typeParams[i]);
                        } else {
                            _bindings.put(name, _typeFactory._constructType(varType, this));
                        }
                    }
                }
            }
        } else { // probably can't be any of these... so let's skip for now
            //if (type instanceof GenericArrayType) {
            //if (type instanceof TypeVariable<?>) {
            // if (type instanceof WildcardType) {
            return;
        }
        // but even if it's not a parameterized type, its super types may be:
        _resolveBindings(raw.getGenericSuperclass());
        for (Type intType : raw.getGenericInterfaces()) {
            _resolveBindings(intType);
        }
    }

    @Override
    public String toString()
    {
        if (_bindings == null) {
            _resolve();
        }
        StringBuilder sb = new StringBuilder("[TypeBindings for ");
        if (_contextType != null) {
            sb.append(_contextType.toString());
        } else {
            sb.append(_contextClass.getName());
        }
        sb.append(": ").append(_bindings).append("]");
        return sb.toString();
    }
}


text:
<?php include("head.php"); ?>

		<?php include("header.php"); ?>

FREE delivery with order above £80

You are here: Home >  About us

			 <?php include("sidebar.php") ?>

Pepe's picks

Regarded as producing some of the best wines in the world, let our man in the vines, Pepe
			guide you through the best wines the Spanish DO have to offer.

			our specials this week

Casa Muga Cava

				price £15

The best wine in spain. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

				add to basket

Casa Muga Cava

				price £34

The best wine in spain. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

				add to basket

Casa Muga Cava

				price £12

The best wine in spain. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

				add to basket

Casa Muga Cava

				price £8

The best wine in spain. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

				add to basket

Casa Muga Cava

				price £11

The best wine in spain. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

				add to basket

view item

Casa Muga Cava

				price £25

The best wine in spain. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

				add to basket

Casa Muga Cava

				price £8

The best wine in spain. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

				add to basket

Casa Muga Cava

				price £32

The best wine in spain. Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.Produced in sunny Spain. Our wine expert exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

				add to basket

	<?php include("footer.php"); ?>