text:
[AMP](https://amp.dev) is a web component framework for easily creating user-first websites, stories, ads, emails and more. This project is a prototype that maps React components in web components space. It uses a few technologies such as Preact, Shadow DOM, and Custom Elements API.

## Running locally

After cloning the repository, you can run the prototype with the following:

```bash
npm install
npm run start
```

This script will start up a local [webserver](http://localhost:8080).

## Code of conduct

The AMP Project strives for a positive and growing project community that provides a safe environment for everyone.  All members, committers and volunteers in the community are required to act according to the [code of conduct](CODE_OF_CONDUCT.md).

## License

amp-react-prototype is licensed under the [Apache License, Version 2.0](LICENSE).


text:
package de.dominikschadow.javasecurity.tink.aead;

import com.google.crypto.tink.KeysetHandle;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.nio.charset.StandardCharsets;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

@Disabled("These test require AWS KMS configuration")
class AesGcmWithAwsKmsSavedKeyTest {
    private static final byte[] INITIAL_TEXT = "Some dummy text to work with".getBytes(StandardCharsets.UTF_8);
    private static final byte[] ASSOCIATED_DATA = "Some additional data".getBytes(StandardCharsets.UTF_8);
    private static final String KEYSET_FILENAME = "src/test/resources/keysets/aead-aes-gcm-kms.json";
    private final File keysetFile = new File(KEYSET_FILENAME);
    private KeysetHandle secretKey;

    private AesGcmWithAwsKmsSavedKey aes;

    @BeforeEach
    protected void setup() throws Exception {
        aes = new AesGcmWithAwsKmsSavedKey();

        aes.generateAndStoreKey(keysetFile);
        secretKey = aes.loadKey(keysetFile);
    }

    @Test
    void encryptionAndDecryptionWithValidInputsIsSuccessful() throws Exception {
        byte[] cipherText = aes.encrypt(secretKey, INITIAL_TEXT, ASSOCIATED_DATA);
        byte[] plainText = aes.decrypt(secretKey, cipherText, ASSOCIATED_DATA);

        Assertions.assertAll(
                () -> assertNotEquals(new String(INITIAL_TEXT, StandardCharsets.UTF_8), new String(cipherText, StandardCharsets.UTF_8)),
                () -> assertEquals(new String(INITIAL_TEXT, StandardCharsets.UTF_8), new String(plainText, StandardCharsets.UTF_8))
        );
    }
}

redpajama_set_name: RedPajamaGithub


text:
/**
 * << detailed description >>
 *
 * @file Exception.h
 * @brief << brief description >>
 * @author clonker
 * @date 05.09.17
 * @copyright BSD-3
 */

#pragma once

#include <utility>
#include <sstream>
#include <exception>
#include <H5Epublic.h>
#include "common.h"

namespace h5rd {

class Exception : public std::runtime_error {
public:
    explicit Exception(const std::string &msg) : std::runtime_error(h5stack(msg)) {}

    static std::string h5stack(const std::string &msg) {
        handle_id stackId = H5Eget_current_stack();
        if (stackId >= 0) {

            H5E_walk2_t walker = [](unsigned int n, const H5E_error2_t *desc, void *clientData) -> herr_t {

                auto *ss = static_cast<std::stringstream *>(clientData);

                char *major_err = H5Eget_major(desc->maj_num);
                char *minor_err = H5Eget_minor(desc->min_num);

                std::string err_string("(");
                err_string += major_err;
                err_string += ") ";
                err_string += minor_err;

                free(major_err);
                free(minor_err);

                *ss << err_string << std::endl;
                return 0;
            };

            std::stringstream ss;
            H5Ewalk2(stackId, H5E_WALK_UPWARD, walker, &ss);
            return msg + ": " + ss.str();
        }
        return msg + ": Unknown hdf5 error!";
    }
};
}


text:
namespace Twin
{
	partial class ColorWordEditDialog
	{
		/// <summary>
		/// 必要なデザイナ変数です。
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// 使用中のリソースをすべてクリーンアップします。
		/// </summary>
		/// <param name="disposing">マネージ リソースが破棄される場合 true、破棄されない場合は false です。</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Windows フォーム デザイナで生成されたコード

		/// <summary>
		/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
		/// コード エディタで変更しないでください。
		/// </summary>
		private void InitializeComponent()
		{
			this.listView1 = new System.Windows.Forms.ListView();
			this.columnHeaderWord = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderIsRegex = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderForeColor = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderBackColor = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderIsBold = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderIsItalic = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderPlaySound = new System.Windows.Forms.ColumnHeader();
			this.columnHeaderIsPopup = new System.Windows.Forms.ColumnHeader();
			this.menuStrip1 = new System.Windows.Forms.MenuStrip();
			this.menuItemFile = new System.Windows.Forms.ToolStripMenuItem();
			this.menuItemFileExit = new System.Windows.Forms.ToolStripMenuItem();
			this.menuItemEdit = new System.Windows.Forms.ToolStripMenuItem();
			this.menuItemEditNew = new System.Windows.Forms.ToolStripMenuItem();
			this.menuItemEditSelection = new System.Windows.Forms.ToolStripMenuItem();
			this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
			this.menuItemEditDel = new System.Windows.Forms.ToolStripMenuItem();
			this.menuStrip1.SuspendLayout();
			this.SuspendLayout();
			//
			// listView1
			//
			this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.columnHeaderWord,
            this.columnHeaderIsRegex,
            this.columnHeaderForeColor,
            this.columnHeaderBackColor,
            this.columnHeaderIsBold,
            this.columnHeaderIsItalic,
            this.columnHeaderPlaySound,
            this.columnHeaderIsPopup});
			this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
			this.listView1.FullRowSelect = true;
			this.listView1.Location = new System.Drawing.Point(0, 24);
			this.listView1.Name = "listView1";
			this.listView1.Size = new System.Drawing.Size(703, 309);
			this.listView1.TabIndex = 0;
			this.listView1.UseCompatibleStateImageBehavior = false;
			this.listView1.View = System.Windows.Forms.View.Details;
			this.listView1.DoubleClick += new System.EventHandler(this.listView1_DoubleClick);
			this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
			this.listView1.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listView1_ColumnClick);
			//
			// columnHeaderWord
			//
			this.columnHeaderWord.Text = "単語";
			this.columnHeaderWord.Width = 136;
			//
			// columnHeaderIsRegex
			//
			this.columnHeaderIsRegex.Text = "正規表現";
			//
			// columnHeaderForeColor
			//
			this.columnHeaderForeColor.Text = "文字色";
			//
			// columnHeaderBackColor
			//
			this.columnHeaderBackColor.Text = "背景色";
			//
			// columnHeaderIsBold
			//
			this.columnHeaderIsBold.Text = "太字";
			this.columnHeaderIsBold.Width = 43;
			//
			// columnHeaderIsItalic
			//
			this.columnHeaderIsItalic.Text = "斜体";
			this.columnHeaderIsItalic.Width = 44;
			//
			// columnHeaderPlaySound
			//
			this.columnHeaderPlaySound.DisplayIndex = 7;
			this.columnHeaderPlaySound.Text = "サウンド";
			this.columnHeaderPlaySound.Width = 206;
			//
			// columnHeaderIsPopup
			//
			this.columnHeaderIsPopup.DisplayIndex = 6;
			this.columnHeaderIsPopup.Text = "ポップアップ";
			this.columnHeaderIsPopup.Width = 83;
			//
			// menuStrip1
			//
			this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.menuItemFile,
            this.menuItemEdit});
			this.menuStrip1.Location = new System.Drawing.Point(0, 0);
			this.menuStrip1.Name = "menuStrip1";
			this.menuStrip1.Size = new System.Drawing.Size(703, 24);
			this.menuStrip1.TabIndex = 1;
			this.menuStrip1.Text = "menuStrip1";
			//
			// menuItemFile
			//
			this.menuItemFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.menuItemFileExit});
			this.menuItemFile.Name = "menuItemFile";
			this.menuItemFile.Size = new System.Drawing.Size(66, 20);
			this.menuItemFile.Text = "ファイル(&F)";
			//
			// menuItemFileExit
			//
			this.menuItemFileExit.Name = "menuItemFileExit";
			this.menuItemFileExit.Size = new System.Drawing.Size(114, 22);
			this.menuItemFileExit.Text = "終了(&X)";
			this.menuItemFileExit.Click += new System.EventHandler(this.menuItemFileExit_Click);
			//
			// menuItemEdit
			//
			this.menuItemEdit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.menuItemEditNew,
            this.menuItemEditSelection,
            this.toolStripMenuItem1,
            this.menuItemEditDel});
			this.menuItemEdit.Name = "menuItemEdit";
			this.menuItemEdit.Size = new System.Drawing.Size(56, 20);
			this.menuItemEdit.Text = "編集(&E)";
			this.menuItemEdit.DropDownOpening += new System.EventHandler(this.menuItemEdit_DropDownOpening);
			//
			// menuItemEditNew
			//
			this.menuItemEditNew.Name = "menuItemEditNew";
			this.menuItemEditNew.Size = new System.Drawing.Size(177, 22);
			this.menuItemEditNew.Text = "新規登録(&A)...";
			this.menuItemEditNew.Click += new System.EventHandler(this.menuItemEditNew_Click);
			//
			// menuItemEditSelection
			//
			this.menuItemEditSelection.Name = "menuItemEditSelection";
			this.menuItemEditSelection.Size = new System.Drawing.Size(177, 22);
			this.menuItemEditSelection.Text = "選択項目を編集(&E)...";
			this.menuItemEditSelection.Click += new System.EventHandler(this.menuItemEditSelection_Click);
			//
			// toolStripMenuItem1
			//
			this.toolStripMenuItem1.Name = "toolStripMenuItem1";
			this.toolStripMenuItem1.Size = new System.Drawing.Size(174, 6);
			//
			// menuItemEditDel
			//
			this.menuItemEditDel.Name = "menuItemEditDel";
			this.menuItemEditDel.Size = new System.Drawing.Size(177, 22);
			this.menuItemEditDel.Text = "選択項目を削除(&D)";
			this.menuItemEditDel.Click += new System.EventHandler(this.menuItemEditDel_Click);
			//
			// ColorWordEditDialog
			//
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(703, 333);
			this.Controls.Add(this.listView1);
			this.Controls.Add(this.menuStrip1);
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.MainMenuStrip = this.menuStrip1;
			this.MaximizeBox = false;
			this.MinimizeBox = false;
			this.Name = "ColorWordEditDialog";
			this.Text = "単語の強調表示リスト";
			this.menuStrip1.ResumeLayout(false);
			this.menuStrip1.PerformLayout();
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private System.Windows.Forms.ListView listView1;
		private System.Windows.Forms.ColumnHeader columnHeaderWord;
		private System.Windows.Forms.ColumnHeader columnHeaderIsRegex;
		private System.Windows.Forms.ColumnHeader columnHeaderForeColor;
		private System.Windows.Forms.ColumnHeader columnHeaderBackColor;
		private System.Windows.Forms.ColumnHeader columnHeaderIsBold;
		private System.Windows.Forms.ColumnHeader columnHeaderIsItalic;
		private System.Windows.Forms.ColumnHeader columnHeaderPlaySound;
		private System.Windows.Forms.ColumnHeader columnHeaderIsPopup;
		private System.Windows.Forms.MenuStrip menuStrip1;
		private System.Windows.Forms.ToolStripMenuItem menuItemFile;
		private System.Windows.Forms.ToolStripMenuItem menuItemFileExit;
		private System.Windows.Forms.ToolStripMenuItem menuItemEdit;
		private System.Windows.Forms.ToolStripMenuItem menuItemEditNew;
		private System.Windows.Forms.ToolStripMenuItem menuItemEditSelection;
		private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
		private System.Windows.Forms.ToolStripMenuItem menuItemEditDel;
	}
}


text:
<?php

if (!defined('UPDRAFTPLUS_DIR')) die('No direct access allowed');

if (!class_exists('Updraft_Notices')) require_once(UPDRAFTPLUS_DIR.'/includes/updraft-notices.php');

class UpdraftPlus_Notices extends Updraft_Notices {

	protected static $_instance = null;

	private $initialized = false;

	protected $notices_content = array();

	protected $self_affiliate_id = 212;

	public static function instance() {
		if (empty(self::$_instance)) {
			self::$_instance = new self();
		}
		return self::$_instance;
	}

	protected function populate_notices_content() {

		$parent_notice_content = parent::populate_notices_content();

		$child_notice_content = array(
			1 => array(
				'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
				'title' => __('support', 'updraftplus'),
				'text' => __('Enjoy professional, fast, and friendly help whenever you need it.', 'updraftplus'),
				'image' => 'notices/support.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			2 => array(
				'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
				'title' => __('UpdraftVault storage', 'updraftplus'),
				'text' => __('The ultimately secure and convenient place to store your backups.', 'updraftplus'),
				'image' => 'notices/updraft_logo.png',
				'button_link' => 'https://updraftplus.com/landing/vault',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			3 => array(
				'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
				'title' => __('enhanced remote storage options', 'updraftplus'),
				'text' => __('Enhanced storage options for Dropbox, Google Drive and S3. Plus many more options.', 'updraftplus'),
				'image' => 'notices/multiplestorage_destinations.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			4 => array(
				'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
				'title' => __('advanced options', 'updraftplus'),
				'text' => __('Secure multisite installation, advanced reporting and much more.', 'updraftplus'),
				'image' => 'notices/reporting.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			5 => array(
				'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
				'title' => __('secure your backups', 'updraftplus'),
				'text' => __('Add SFTP to send your data securely, lock settings and encrypt your database backups for extra security.', 'updraftplus'),
				'image' => 'notices/locksettings.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			6 => array(
				'prefix' => __('UpdraftPlus Premium:', 'updraftplus'),
				'title' => __('easily migrate or clone your site in minutes', 'updraftplus'),
				'text' => __('Copy your site to another domain directly. Includes find-and-replace tool for database references.', 'updraftplus'),
				'image' => 'notices/migrator.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->anywhere,
			),
			7 => array(
				'prefix' => '',
				'title' => __('Introducing UpdraftCentral', 'updraftplus'),
				'text' => __('UpdraftCentral is a highly efficient way to manage, update and backup multiple websites from one place.', 'updraftplus'),
				'image' => 'notices/updraft_logo.png',
				'button_link' => 'https://updraftcentral.com',
				'button_meta' => 'updraftcentral',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			8 => array(
				'prefix' => '',
				'title' => __('Like UpdraftPlus and can spare one minute?', 'updraftplus'),
				'text' => __('Please help UpdraftPlus by giving a positive review at wordpress.org.', 'updraftplus'),
				'image' => 'notices/updraft_logo.png',
				'button_link' => 'https://wordpress.org/support/plugin/updraftplus/reviews/?rate=5#new-post',
				'button_meta' => 'review',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->anywhere,
			),
			9 => array(
				'prefix' => '',
				'title' => __('Do you use UpdraftPlus on multiple sites?', 'updraftplus'),
				'text' => __('Control all your WordPress installations from one place using UpdraftCentral remote site management!', 'updraftplus'),
				'image' => 'notices/updraft_logo.png',
				'button_link' => 'https://updraftcentral.com',
				'button_meta' => 'updraftcentral',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->anywhere,
			),
			'translation_needed' => array(
				'prefix' => '',
				'title' => 'Can you translate? Want to improve UpdraftPlus for speakers of your language?',
				'text' => $this->url_start(true,'updraftplus.com/translate/')."Please go here for instructions - it is easy.".$this->url_end(true,'updraftplus.com/translate/'),
				'text_plain' => $this->url_start(false,'updraftplus.com/translate/')."Please go here for instructions - it is easy.".$this->url_end(false,'updraftplus.com/translate/'),
				'image' => 'notices/updraft_logo.png',
				'button_link' => false,
				'dismiss_time' => false,
				'supported_positions' => $this->anywhere,
				'validity_function' => 'translation_needed',
			),
			'social_media' => array(
				'prefix' => '',
				'title' => __('UpdraftPlus is on social media - check us out!', 'updraftplus'),
				'text' => $this->url_start(true,'twitter.com/updraftplus', true).__('Twitter', 'updraftplus').$this->url_end(true,'twitter.com/updraftplus', true).' - '.$this->url_start(true,'facebook.com/updraftplus', true).__('Facebook', 'updraftplus').$this->url_end(true,'facebook.com/updraftplus', true).' - '.$this->url_start(true,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).__('Google+', 'updraftplus').$this->url_end(true,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).' - '.$this->url_start(true,'www.linkedin.com/company/updraftplus', true).__('LinkedIn', 'updraftplus').$this->url_end(true,'www.linkedin.com/company/updraftplus', true),
				'text_plain' => $this->url_start(false,'twitter.com/updraftplus', true).__('Twitter', 'updraftplus').$this->url_end(false,'twitter.com/updraftplus', true).' - '.$this->url_start(false,'facebook.com/updraftplus', true).__('Facebook', 'updraftplus').$this->url_end(false,'facebook.com/updraftplus', true).' - '.$this->url_start(false,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).__('Google+', 'updraftplus').$this->url_end(false,'plus.google.com/u/0/b/112313994681166369508/112313994681166369508/about', true).' - '.$this->url_start(false,'www.linkedin.com/company/updraftplus', true).__('LinkedIn', 'updraftplus').$this->url_end(false,'www.linkedin.com/company/updraftplus', true),
				'image' => 'notices/updraft_logo.png',
				'dismiss_time' => false,
				'supported_positions' => $this->anywhere,
			),
			'newsletter' => array(
				'prefix' => '',
				'title' => __('UpdraftPlus Newsletter', 'updraftplus'),
				'text' => __("Follow this link to sign up for the UpdraftPlus newsletter.", 'updraftplus'),
				'image' => 'notices/updraft_logo.png',
				'button_link' => 'https://updraftplus.com/newsletter-signup',
				'button_meta' => 'signup',
				'supported_positions' => $this->anywhere,
				'dismiss_time' => false
			),
			'subscribe_blog' => array(
				'prefix' => '',
				'title' => __('UpdraftPlus Blog - get up-to-date news and offers', 'updraftplus'),
				'text' => $this->url_start(true,'updraftplus.com/news/').__("Blog link",'updraftplus').$this->url_end(true,'updraftplus.com/news/').' - '.$this->url_start(true,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').$this->url_end(true,'feeds.feedburner.com/UpdraftPlus'),
				'text_plain' => $this->url_start(false,'updraftplus.com/news/').__("Blog link",'updraftplus').$this->url_end(false,'updraftplus.com/news/').' - '.$this->url_start(false,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').$this->url_end(false,'feeds.feedburner.com/UpdraftPlus'),
				'image' => 'notices/updraft_logo.png',
				'button_link' => false,
				'supported_positions' => $this->anywhere,
				'dismiss_time' => false
			),
			'check_out_updraftplus_com' => array(
				'prefix' => '',
				'title' => __('UpdraftPlus Blog - get up-to-date news and offers', 'updraftplus'),
				'text' => $this->url_start(true,'updraftplus.com/news/').__("Blog link",'updraftplus').$this->url_end(true,'updraftplus.com/news/').' - '.$this->url_start(true,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').$this->url_end(true,'feeds.feedburner.com/UpdraftPlus'),
				'text_plain' => $this->url_start(false,'updraftplus.com/news/').__("Blog link",'updraftplus').$this->url_end(false,'updraftplus.com/news/').' - '.$this->url_start(false,'feeds.feedburner.com/UpdraftPlus').__("RSS link",'updraftplus').$this->url_end(false,'feeds.feedburner.com/UpdraftPlus'),
				'image' => 'notices/updraft_logo.png',
				'button_link' => false,
				'supported_positions' => $this->dashboard_bottom_or_report,
				'dismiss_time' => false
			),
			'autobackup' => array(
				'prefix' => '',
				'title' => __('Be safe with an automatic backup', 'updraftplus'),
				'text' => __('UpdraftPlus Premium can automatically backup your plugins/themes/database before you update, without you needing to remember.', 'updraftplus'),
				'image' => 'automaticbackup.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismissautobackup',
				'supported_positions' => $this->autobackup_bottom_or_report,
			),
			'wp-optimize' => array(
				'prefix' => '',
				'title' => 'WP-Optimize',
				'text' => __("After you've backed up your database, we recommend you install our WP-Optimize plugin to streamline it for better website performance.", "updraftplus"),
				'image' => 'notices/wp_optimize_logo.png',
				'button_link' => 'https://wordpress.org/plugins/wp-optimize/',
				'button_meta' => 'wp-optimize',
				'dismiss_time' => 'dismiss_notice',
				'supported_positions' => $this->anywhere,
				'validity_function' => 'wp_optimize_installed',
			),

			//The sale adverts content starts here
			'blackfriday' => array(
				'prefix' => '',
				'title' => __('Black Friday - 20% off UpdraftPlus Premium until November 30th', 'updraftplus'),
				'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
				'image' => 'notices/black_friday.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_season',
				'discount_code' => 'blackfridaysale2016',
				'valid_from' => '2016-11-23 00:00:00',
				'valid_to' => '2016-11-30 23:59:59',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			'christmas' => array(
				'prefix' => '',
				'title' => __('Christmas sale - 20% off UpdraftPlus Premium until December 25th', 'updraftplus'),
				'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
				'image' => 'notices/christmas.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_season',
				'discount_code' => 'christmassale2016',
				'valid_from' => '2016-12-01 00:00:00',
				'valid_to' => '2016-12-25 23:59:59',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			'newyear' => array(
				'prefix' => '',
				'title' => __('Happy New Year - 20% off UpdraftPlus Premium until January 1st', 'updraftplus'),
				'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
				'image' => 'notices/new_year.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_season',
				'discount_code' => 'newyearsale2017',
				'valid_from' => '2016-12-26 00:00:00',
				'valid_to' => '2017-01-01 23:59:59',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			'spring' => array(
				'prefix' => '',
				'title' => __('Spring sale - 20% off UpdraftPlus Premium until April 31st', 'updraftplus'),
				'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
				'image' => 'notices/spring.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_season',
				'discount_code' => 'springsale2017',
				'valid_from' => '2017-04-01 00:00:00',
				'valid_to' => '2017-04-30 23:59:59',
				'supported_positions' => $this->dashboard_top_or_report,
			),
			'summer' => array(
				'prefix' => '',
				'title' => __('Summer sale - 20% off UpdraftPlus Premium until July 31st', 'updraftplus'),
				'text' => __('To benefit, use this discount code:', 'updraftplus').' ',
				'image' => 'notices/summer.png',
				'button_link' => 'https://updraftplus.com/landing/updraftplus-premium',
				'button_meta' => 'updraftplus',
				'dismiss_time' => 'dismiss_season',
				'discount_code' => 'summersale2017',
				'valid_from' => '2017-07-01 00:00:00',
				'valid_to' => '2017-07-31 23:59:59',
				'supported_positions' => $this->dashboard_top_or_report,
			),
		);

		return array_merge($parent_notice_content, $child_notice_content);
	}

	// Call this method to setup the notices
	public function notices_init() {
		if ($this->initialized) return;
		$this->initialized = true;
		//parent::notices_init();
		$this->notices_content = (defined('UPDRAFTPLUS_NOADS_B') && UPDRAFTPLUS_NOADS_B) ? array() : $this->populate_notices_content();
		global $updraftplus;
		$our_version = @constant('SCRIPT_DEBUG') ? $updraftplus->version.'.'.time() : $updraftplus->version;
		wp_enqueue_style('updraftplus-notices-css',  UPDRAFTPLUS_URL.'/css/updraftplus-notices.css', array(), $our_version);
	}

	protected function translation_needed($plugin_base_dir = null, $product_name = null) {
		return parent::translation_needed(UPDRAFTPLUS_DIR, 'updraftplus');
	}

	protected function wp_optimize_installed($plugin_base_dir = null, $product_name = null) {
		$wp_optimize_file = false;
		if (!function_exists('get_plugins')) require_once(ABSPATH.'wp-admin/includes/plugin.php');
		$plugins = get_plugins();

		foreach ($plugins as $key => $value) {
			if ($value['TextDomain'] == 'wp-optimize') {
				return false;
			}
		}
		return true;
	}

	protected function url_start($html_allowed = false, $url, $https = false, $website_home = 'updraftplus.com') {
		return parent::url_start($html_allowed, $url, $https, $website_home);
	}

	protected function skip_seasonal_notices($notice_data) {
		global $updraftplus;

		$time_now = defined('UPDRAFTPLUS_NOTICES_FORCE_TIME') ? UPDRAFTPLUS_NOTICES_FORCE_TIME : time();
		// Do not show seasonal notices to people with an updraftplus.com version and no-addons yet
		if (!file_exists(UPDRAFTPLUS_DIR.'/udaddons') || $updraftplus->have_addons) {
			$valid_from = strtotime($notice_data['valid_from']);
			$valid_to = strtotime($notice_data['valid_to']);
			$dismiss = $this->check_notice_dismissed($notice_data['dismiss_time']);
			if (($time_now >= $valid_from && $time_now <= $valid_to) && !$dismiss) {
				//return true so that we return this notice to be displayed
				return true;
			}
		}

		return false;
	}

	protected function check_notice_dismissed($dismiss_time){

		$time_now = defined('UPDRAFTPLUS_NOTICES_FORCE_TIME') ? UPDRAFTPLUS_NOTICES_FORCE_TIME : time();

		$notice_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_general_notices_until', 0));
		$seasonal_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('dismissed_season_notices_until', 0));
		$autobackup_dismiss = ($time_now < UpdraftPlus_Options::get_updraft_option('updraftplus_dismissedautobackup', 0));

		$dismiss = false;

		if ('dismiss_notice' == $dismiss_time) $dismiss = $notice_dismiss;
		if ('dismiss_season' == $dismiss_time) $dismiss = $seasonal_dismiss;
		if ('dismissautobackup' == $dismiss_time) $dismiss = $autobackup_dismiss;

		return $dismiss;
	}

	protected function render_specified_notice($advert_information, $return_instead_of_echo = false, $position = 'top') {

		if ('bottom' == $position) {
			$template_file = 'bottom-notice.php';
		} elseif ('report' == $position) {
			$template_file = 'report.php';
		} elseif ('report-plain' == $position) {
			$template_file = 'report-plain.php';
		} else {
			$template_file = 'horizontal-notice.php';
		}

		/*
			Check to see if the updraftplus_com_link filter is being used, if it's not then add our tracking to the link.
		*/

		if(!has_filter('updraftplus_com_link') && isset($advert_information['button_link']) && false !== strpos($advert_information['button_link'], '//updraftplus.com')) {
			$advert_information['button_link'] = trailingslashit($advert_information['button_link']).'?afref='.$this->self_affiliate_id;
		}

		require_once(UPDRAFTPLUS_DIR.'/admin.php');
		global $updraftplus_admin;
		return $updraftplus_admin->include_template('wp-admin/notices/'.$template_file, $return_instead_of_echo, $advert_information);
	}
}

$GLOBALS['updraftplus_notices'] = UpdraftPlus_Notices::instance();


text:
set -ex

#Variables
PACKAGE_NAME=psycopg2cffi
PACKAGE_URL=https://github.com/chtd/psycopg2cffi.git
PACKAGE_VERSION=2.9.0

echo "Usage: $0 [-v <PACKAGE_VERSION>]"
echo "PACKAGE_VERSION is an optional paramater whose default value is 2_9_0 for 2.9.0"

PACKAGE_VERSION="${1:-$PACKAGE_VERSION}"

#Install required packages
apt-get update -y
apt-get install -y wget sudo python3-dev libpq-dev git build-essential python3-setuptools lsb-release libffi-dev python3-pip

#Clone and checkout the package
cd /opt
git clone $PACKAGE_URL
cd $PACKAGE_NAME
git checkout $PACKAGE_VERSION

#Build and install package
python3 setup.py install

#Install postgres and run tests
sudo apt-get install ca-certificates -y
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
TZ=Europe/Minsk
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
sudo apt-get update -y
sudo apt-get install postgresql postgresql-contrib -y
pip3 install pytest
service postgresql start
chmod -R ugo+rwx /opt/psycopg2cffi
sudo -u postgres -i bash << EOF
psql -c "CREATE DATABASE psycopg2_test;"
cd /opt/psycopg2cffi/
/usr/local/bin/py.test psycopg2cffi
echo "Installation complete, one faling test (test_types_basic.py::TypesBasicTests::testEmptyArray) is in parity with x86."
EOF


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <pl.droidsonroids.gif.GifTextView
        android:id="@+id/tx_title"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:text="Gif test"
        android:gravity="center|left"
        android:drawableLeft="@drawable/f000"/>
    <ListView
        android:id="@+id/listView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/et_chat_lay"
        android:layout_below="@+id/tx_title"
        style="@style/MListView">
    </ListView>

    <LinearLayout
        android:id="@+id/et_chat_lay"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" >

        <pl.droidsonroids.gif.FaceEditText
            android:id="@+id/et_chat"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.3" />

        <pl.droidsonroids.gif.GifImageButton
            android:id="@+id/btn_sure"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0.7"
            android:src="@drawable/f077"
            android:onClick="onClick" />
    </LinearLayout>

</RelativeLayout>


text:
import Ember from 'ember';

var get = Ember.get;
var computed = Ember.computed;
var isBlank = Ember.isBlank;

var a_slice = Array.prototype.slice;

// isBlank was introduced in Ember 1.5, backport if necessary.
if (!isBlank) {
  isBlank = function(obj) {
    return Ember.isEmpty(obj) || (typeof obj === 'string' && obj.match(/\S/) === null);
  };
}

var isPresent = function(value) {
  return !isBlank(value);
};

/**
  Returns the first argument that is not blank (as in Ember.isBlank)

  Example

  ```javascript
  var obj = Ember.Object.extend({
    nickname: '',
    name: 'Jean-Luc',
    email: 'jean@starship-enterprise.space',
    displayName: firstPresent('nickname', 'name', 'email')
  }).create();

  item.get('displayName'); // 'Jean-Luc'
  ```

  @method firstPresent
  @for macros
  @param *arguments
  @return The first arguments that is not blank.
*/
export default function EmberCPM_firstPresent() {
  var properties = a_slice.call(arguments);
  var computedArgs = a_slice.call(properties);

  computedArgs.push(function() {
    var that = this;
    var property = Ember.A(properties).find(function(key) {
      return isPresent(get(that, key));
    });

    if (property) { return get(that, property); }
  });

  return computed.apply(this, computedArgs);
}


text:
Thomas
======

Ascii-based graphics engine in a Ruby Gem


text:
// @flow
/* eslint-disable jsx-a11y/label-has-for */

import React from 'react';
import type { Node, Element } from 'react';
import classNames from 'classnames';
import withStyles from '../styles/withStyles';
import Typography from '../Typography';

export const styles = (theme: Object) => ({
  root: {
    display: 'inline-flex',
    alignItems: 'center',
    cursor: 'pointer',
    // Remove grey highlight
    WebkitTapHighlightColor: theme.palette.common.transparent,
    marginLeft: -14,
    marginRight: theme.spacing.unit * 2, // used for row presentation of radio/checkbox
  },
  disabled: {
    color: theme.palette.text.disabled,
    cursor: 'default',
  },
  label: {
    userSelect: 'none',
  },
});

type DefaultProps = {
  classes: Object,
};

export type Props = {
  /**
   * If `true`, the component appears selected.
   */
  checked?: boolean | string,
  /**
   * Useful to extend the style applied to components.
   */
  classes?: Object,
  /**
   * @ignore
   */
  className?: string,
  /**
   * A control element. For instance, it can be be a `Radio`, a `Switch` or a `Checkbox`.
   */
  control: Element<*>,
  /**
   * If `true`, the control will be disabled.
   */
  disabled?: boolean,
  /**
   * Use that property to pass a ref callback to the native input component.
   */
  inputRef?: Function,
  /**
   * The text to be used in an enclosing label element.
   */
  label: Node,
  /*
   * @ignore
   */
  name?: string,
  /**
   * Callback fired when the state is changed.
   *
   * @param {object} event The event source of the callback
   * @param {boolean} checked The `checked` value of the switch
   */
  onChange?: Function,
  /**
   * The value of the component.
   */
  value?: string,
};

type AllProps = DefaultProps & Props;

/**
 * Drop in replacement of the `Radio`, `Switch` and `Checkbox` component.
 * Use this component if you want to display an extra label.
 */
function FormControlLabel(props: AllProps) {
  const {
    checked,
    classes,
    className: classNameProp,
    control,
    disabled,
    inputRef,
    label,
    name,
    onChange,
    value,
    ...other
  } = props;

  const className = classNames(
    classes.root,
    {
      [classes.disabled]: disabled,
    },
    classNameProp,
  );

  return (
    <label className={className} {...other}>
      {React.cloneElement(control, {
        disabled: typeof control.props.disabled === 'undefined' ? disabled : control.props.disabled,
        checked: typeof control.props.checked === 'undefined' ? checked : control.props.checked,
        name: control.props.name || name,
        onChange: control.props.onChange || onChange,
        value: control.props.value || value,
        inputRef: control.props.inputRef || inputRef,
      })}
      <Typography className={classes.label}>{label}</Typography>
    </label>
  );
}

FormControlLabel.defaultProps = {
  disabled: false,
};

export default withStyles(styles, { name: 'MuiFormControlLabel' })(FormControlLabel);


text:
class Admin::RegionesController < Admin::AdminController
  before_action :set_admin_region, only: [:show, :edit, :update, :destroy]

  # GET /admin/regiones
  # GET /admin/regiones.json
  def index
    @admin_regiones = Admin::Region.all
  end

  # GET /admin/regiones/1
  # GET /admin/regiones/1.json
  def show
  end

  # GET /admin/regiones/new
  def new
    @admin_region = Admin::Region.new
  end

  # GET /admin/regiones/1/edit
  def edit
  end

  # POST /admin/regiones
  # POST /admin/regiones.json
  def create
    @admin_region = Admin::Region.new(admin_region_params)

    respond_to do |format|
      if @admin_region.save
        format.html { redirect_to @admin_region, notice: 'Region was successfully created.' }
        format.json { render :show, status: :created, location: @admin_region }
      else
        format.html { render :new }
        format.json { render json: @admin_region.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /admin/regiones/1
  # PATCH/PUT /admin/regiones/1.json
  def update
    respond_to do |format|
      if @admin_region.update(admin_region_params)
        format.html { redirect_to @admin_region, notice: 'Region was successfully updated.' }
        format.json { render :show, status: :ok, location: @admin_region }
      else
        format.html { render :edit }
        format.json { render json: @admin_region.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /admin/regiones/1
  # DELETE /admin/regiones/1.json
  def destroy
    @admin_region.destroy
    respond_to do |format|
      format.html { redirect_to admin_regiones_url, notice: 'Region was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  # GET /admin/regiones/autocompleta?q=
  def autocompleta
    regiones = params[:term].present? ? Admin::Region.autocompleta(params[:term]) : []
    render json: regiones.map { |b| { label: "#{b.nombre_region}, #{b.tipo_region.descripcion}", value: b.id } }
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_admin_region
      @admin_region = Admin::Region.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def admin_region_params
      params.require(:admin_region).permit(:nombre_region, :tipo_region_id, :clave_region, :id_region_asc)
    end
end


text:
/**
 * Module for "Focus" filter.
 */
/**
 * ============================================================================
 * IMPORTS
 * ============================================================================
 * @hidden
 */
import { Sprite } from "../../Sprite";
import { Filter, FilterProperties } from "./Filter";
import { AMElement } from "../AMElement";
import { Color } from "../../utils/Color";
import * as $type from "../../utils/Type";
/**
 * ============================================================================
 * REQUISITES
 * ============================================================================
 * @hidden
 */
/**
 * Defines additional properties relative to the "Focus" filter.
 */
export interface FocusFilterProperties extends FilterProperties {
    /**
     * Opacity of the outline. (0-1)
     */
    opacity?: number;
    /**
     * Stroke (outline) color.
     */
    stroke?: Color;
    /**
     * Stroke (outline) thickness in pixels.
     */
    strokeWidth?: number;
    /**
     * Stroke (outline) opacity. (0-1)
     */
    strokeOpacity?: number;
}
/**
 * ============================================================================
 * MAIN CLASS
 * ============================================================================
 * @hidden
 */
/**
 * Creates a "Focus" filter.
 *
 * @see {@link https://www.amcharts.com/docs/v4/concepts/accessibility/} more about accessibility
 * @see {@link https://www.amcharts.com/docs/v4/tutorials/changing-appearance-of-focused-items/} cusomizing focus appearance
 */
export declare class FocusFilter extends Filter {
    /**
     * Defines property types.
     */
    _properties: FocusFilterProperties;
    /**
     * A storage for Filter property/value pairs.
     * @see [@link FocusFilterProperties]
     */
    /**
     * Reference to the `<feFlood>` element.
     *
     * @ignore Exclude from docs
     */
    feFlood: AMElement;
    /**
     * Reference to the `<feMorphology>` element.
     *
     * @ignore Exclude from docs
     */
    feMorphology: AMElement;
    /**
     * Reference to the `<feFlood>` element.
     *
     * @ignore Exclude from docs
     */
    feColorMatrix: AMElement;
    /**
     * Reference to the `<feComposite>` element.
     *
     * @ignore Exclude from docs
     */
    feComposite: AMElement;
    /**
     * Reference to the `<feFlood>` element.
     *
     * @ignore Exclude from docs
     */
    feBlend: AMElement;
    /**
     * Constructor
     */
    constructor();
    /**
     * Stroke (outline) color.
     *
     * @param value  Color
     */
    /**
    * @return Color
    */
    stroke: $type.Optional<Color>;
    /**
     * Stroke (outline) thickness in pixels.
     *
     * @param value  Outline thickness (px)
     */
    /**
    * @return Outline thickness (px)
    */
    strokeWidth: $type.Optional<number>;
    /**
     * Opacity of the outline. (0-1)
     *
     * @param value  Outline opacity (0-1)
     */
    /**
    * @return Outline opacity (0-1)
    */
    opacity: $type.Optional<number>;
    /**
     * Sets filter's target element.
     *
     * In addition it also disables built-in focus outline on element this
     * filter is applied to.
     *
     * @ignore Exclude from docs
     * @param value  Element filter is being attached to
     */
    protected setSprite(value: Sprite): void;
}


text:
shared_examples_for "model with has many through belongs to relationship" do |
  model_name,
  through_model_factory,
  related_model_factory,
  has_many_relationship,
  belongs_to_relationship,
  through_relationship|

  context "when creating various #{through_relationship}" do

    let!(:model_object) { create model_name, has_many_relationship => [ through_object_1, through_object_2 ]  }
    let!(:through_object_1)  { create through_model_factory, belongs_to_relationship => related_object_1 }
    let!(:related_object_1)  { create related_model_factory }
    let!(:through_object_2)  { create through_model_factory, belongs_to_relationship => related_object_2 }
    let!(:related_object_2)  { create related_model_factory }

    subject { model_object }

    it("should relate to all of its #{through_relationship}") { expect(subject.send(through_relationship.to_sym)).to match_array [related_object_1, related_object_2] }

  end

end


text:
@interface CRDIBlockBuilder ()

@property (nonatomic, copy) CRDIContainerBindBlock bindBlock;

@end

@implementation CRDIBlockBuilder

- (id)initWithBlock:(CRDIContainerBindBlock)aBindBlock
{
    NSParameterAssert(aBindBlock);

    self = [super init];

    if (self) {
        self.bindBlock = aBindBlock;
    }

    return self;
}

- (id)build
{
    return self.bindBlock();
}

@end


text:
import { InjectionToken, ModuleWithProviders } from '@angular/core';
import { SentryErrorHandler } from './error.handler';
export interface SentryConfig {
  dsn: string;
}
export declare const SentryService: InjectionToken<SentryConfig>;
export declare class SentryModule {
  static forRoot(config: SentryConfig): ModuleWithProviders;
}
export declare function provideSentryServiceOptions(config: SentryConfig): SentryErrorHandler;


text:
<?php

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

namespace Twilio\Rest\IpMessaging\V2\Service\Channel;

use Twilio\Options;
use Twilio\Values;

abstract class MessageOptions {
    /**
     * @param string $from The from
     * @param string $attributes The attributes
     * @param \DateTime $dateCreated The date_created
     * @param \DateTime $dateUpdated The date_updated
     * @param string $lastUpdatedBy The last_updated_by
     * @param string $body The body
     * @param string $mediaSid The media_sid
     * @return CreateMessageOptions Options builder
     */
    public static function create($from = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $body = Values::NONE, $mediaSid = Values::NONE) {
        return new CreateMessageOptions($from, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $body, $mediaSid);
    }

    /**
     * @param string $order The order
     * @return ReadMessageOptions Options builder
     */
    public static function read($order = Values::NONE) {
        return new ReadMessageOptions($order);
    }

    /**
     * @param string $body The body
     * @param string $attributes The attributes
     * @param \DateTime $dateCreated The date_created
     * @param \DateTime $dateUpdated The date_updated
     * @param string $lastUpdatedBy The last_updated_by
     * @return UpdateMessageOptions Options builder
     */
    public static function update($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE) {
        return new UpdateMessageOptions($body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy);
    }
}

class CreateMessageOptions extends Options {
    /**
     * @param string $from The from
     * @param string $attributes The attributes
     * @param \DateTime $dateCreated The date_created
     * @param \DateTime $dateUpdated The date_updated
     * @param string $lastUpdatedBy The last_updated_by
     * @param string $body The body
     * @param string $mediaSid The media_sid
     */
    public function __construct($from = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $body = Values::NONE, $mediaSid = Values::NONE) {
        $this->options['from'] = $from;
        $this->options['attributes'] = $attributes;
        $this->options['dateCreated'] = $dateCreated;
        $this->options['dateUpdated'] = $dateUpdated;
        $this->options['lastUpdatedBy'] = $lastUpdatedBy;
        $this->options['body'] = $body;
        $this->options['mediaSid'] = $mediaSid;
    }

    /**
     * The from
     *
     * @param string $from The from
     * @return $this Fluent Builder
     */
    public function setFrom($from) {
        $this->options['from'] = $from;
        return $this;
    }

    /**
     * The attributes
     *
     * @param string $attributes The attributes
     * @return $this Fluent Builder
     */
    public function setAttributes($attributes) {
        $this->options['attributes'] = $attributes;
        return $this;
    }

    /**
     * The date_created
     *
     * @param \DateTime $dateCreated The date_created
     * @return $this Fluent Builder
     */
    public function setDateCreated($dateCreated) {
        $this->options['dateCreated'] = $dateCreated;
        return $this;
    }

    /**
     * The date_updated
     *
     * @param \DateTime $dateUpdated The date_updated
     * @return $this Fluent Builder
     */
    public function setDateUpdated($dateUpdated) {
        $this->options['dateUpdated'] = $dateUpdated;
        return $this;
    }

    /**
     * The last_updated_by
     *
     * @param string $lastUpdatedBy The last_updated_by
     * @return $this Fluent Builder
     */
    public function setLastUpdatedBy($lastUpdatedBy) {
        $this->options['lastUpdatedBy'] = $lastUpdatedBy;
        return $this;
    }

    /**
     * The body
     *
     * @param string $body The body
     * @return $this Fluent Builder
     */
    public function setBody($body) {
        $this->options['body'] = $body;
        return $this;
    }

    /**
     * The media_sid
     *
     * @param string $mediaSid The media_sid
     * @return $this Fluent Builder
     */
    public function setMediaSid($mediaSid) {
        $this->options['mediaSid'] = $mediaSid;
        return $this;
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString() {
        $options = array();
        foreach ($this->options as $key => $value) {
            if ($value != Values::NONE) {
                $options[] = "$key=$value";
            }
        }
        return '[Twilio.IpMessaging.V2.CreateMessageOptions ' . implode(' ', $options) . ']';
    }
}

class ReadMessageOptions extends Options {
    /**
     * @param string $order The order
     */
    public function __construct($order = Values::NONE) {
        $this->options['order'] = $order;
    }

    /**
     * The order
     *
     * @param string $order The order
     * @return $this Fluent Builder
     */
    public function setOrder($order) {
        $this->options['order'] = $order;
        return $this;
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString() {
        $options = array();
        foreach ($this->options as $key => $value) {
            if ($value != Values::NONE) {
                $options[] = "$key=$value";
            }
        }
        return '[Twilio.IpMessaging.V2.ReadMessageOptions ' . implode(' ', $options) . ']';
    }
}

class UpdateMessageOptions extends Options {
    /**
     * @param string $body The body
     * @param string $attributes The attributes
     * @param \DateTime $dateCreated The date_created
     * @param \DateTime $dateUpdated The date_updated
     * @param string $lastUpdatedBy The last_updated_by
     */
    public function __construct($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE) {
        $this->options['body'] = $body;
        $this->options['attributes'] = $attributes;
        $this->options['dateCreated'] = $dateCreated;
        $this->options['dateUpdated'] = $dateUpdated;
        $this->options['lastUpdatedBy'] = $lastUpdatedBy;
    }

    /**
     * The body
     *
     * @param string $body The body
     * @return $this Fluent Builder
     */
    public function setBody($body) {
        $this->options['body'] = $body;
        return $this;
    }

    /**
     * The attributes
     *
     * @param string $attributes The attributes
     * @return $this Fluent Builder
     */
    public function setAttributes($attributes) {
        $this->options['attributes'] = $attributes;
        return $this;
    }

    /**
     * The date_created
     *
     * @param \DateTime $dateCreated The date_created
     * @return $this Fluent Builder
     */
    public function setDateCreated($dateCreated) {
        $this->options['dateCreated'] = $dateCreated;
        return $this;
    }

    /**
     * The date_updated
     *
     * @param \DateTime $dateUpdated The date_updated
     * @return $this Fluent Builder
     */
    public function setDateUpdated($dateUpdated) {
        $this->options['dateUpdated'] = $dateUpdated;
        return $this;
    }

    /**
     * The last_updated_by
     *
     * @param string $lastUpdatedBy The last_updated_by
     * @return $this Fluent Builder
     */
    public function setLastUpdatedBy($lastUpdatedBy) {
        $this->options['lastUpdatedBy'] = $lastUpdatedBy;
        return $this;
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString() {
        $options = array();
        foreach ($this->options as $key => $value) {
            if ($value != Values::NONE) {
                $options[] = "$key=$value";
            }
        }
        return '[Twilio.IpMessaging.V2.UpdateMessageOptions ' . implode(' ', $options) . ']';
    }
}


text:
define([
    "qasht/package/Unit",
    "blocks/Cache"
], function (TestPackage, Cache) {
    return new TestPackage({
        module: "blocks/Cache",
        tests: [
            {
                name: "get: calls getter method if key not found",
                load: function(id){
                    this.__requestedId =id;
                },
                exec: function (test) {
                    test.cache.get("anId");

                    test.assertEqual("anId", test.__requestedId);

                    test.complete();
                }
            },
            {
                name: "get: returns value from getter",
                load: function(){
                    return "expected";
                },
                exec: function (test) {
                    var actual = test.cache.get("anId");

                    test.assertEqual("expected", actual);

                    test.complete();
                }
            },
            {
                name: "get: only called once; value returned every time",
                load: function(){
                    this.__called++;
                    return "expected";
                },
                exec: function (test) {
                    test.__called = 0;
                    var actual = test.cache.get("anId");
                    test.assertEqual(1, test.__called);
                    test.assertEqual("expected", actual);

                    actual = test.cache.get("anId");
                    test.assertEqual(1, test.__called);
                    test.assertEqual("expected", actual);

                    test.complete();
                }
            },
            {
                name: "get: Supports Object Ids",
                load: function(id){
                    this.__called++;
                    return id.object.nested;
                },
                exec: function (test) {
                    test.__called = 0;
                    var actual = test.cache.get({
                        "one": "somewhere",
                        "object": { "nested": "value1" },
                        "value": "property"
                    });
                    test.assertEqual(1, test.__called);
                    test.assertEqual("value1", actual);

                    actual = test.cache.get({
                        "two": "somewhere",
                        "object": { "nested": "value2" },
                        "value": "property"
                    });
                    test.assertEqual(2, test.__called);
                    test.assertEqual("value2", actual);

                    actual = test.cache.get({
                        "one": "somewhere",
                        "value": "property",
                        "object": { "nested": "value1" }
                    });
                    test.assertEqual(2, test.__called);
                    test.assertEqual("value1", actual);

                    actual = test.cache.get({
                        "two": "somewhere",
                        "value": "property",
                        "object": { "nested": "value2" }
                    });
                    test.assertEqual(2, test.__called);
                    test.assertEqual("value2", actual);

                    test.complete();
                }
            },
            {
                name: "get: different key will cause getter to be called",
                load: function(value){
                    this.__called = this.__called || [];
                    this.__called.push(value);
                    return value;
                },
                exec: function (test) {
                    test.cache.get("id1");
                    test.cache.get("id2");

                    test.assertEqual(2, test.__called.length);

                    test.assertEqual("id1", test.__called[0]);
                    test.assertEqual("id2", test.__called[1]);

                    test.complete();
                }
            },
            {
                name: "get: null return will prevent caching",
                load: function(){
                    this.__called++;
                    return null;
                },
                exec: function (test) {
                    test.__called = 0;

                    var actual = test.cache.get("anId");
                    test.assertEqual(1, test.__called);
                    test.assertNull(actual);

                    actual = test.cache.get("anId");
                    test.assertEqual(2, test.__called);
                    test.assertNull(actual);

                    test.cache.get("anId");
                    test.assertEqual(3, test.__called);

                    test.complete();
                }
            },
            {
                name: "remove: will clear a value from the cache",
                load: function(){
                    return this.__called++;
                },
                exec: function(test){
                    test.__called = 0;
                    var key = "The Key";

                    test.assertEqual(0, test.cache.get(key));
                    test.assertEqual(0, test.cache.get(key));

                    test.cache.remove(key);

                    test.assertEqual(1, test.cache.get(key));

                    test.complete();
                }
            }
        ],
        setUp: function (test) {
            test.cache = new Cache({
                load: test.load.bind(test)
            })
        }
    });
});


text:
package org.apache.hadoop.hbase.util;

import java.io.IOException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.regionserver.Store;

/**
 * Helper class for all utilities related to archival/retrieval of HFiles
 */
public class HFileArchiveUtil {

  private HFileArchiveUtil() {
    // non-external instantiation - util class
  }

  /**
   * Get the directory to archive a store directory
   * @param conf {@link Configuration} to read for the archive directory name
   * @param tableName table name under which the store currently lives
   * @param regionName region encoded name under which the store currently lives
   * @param family name of the family in the store
   * @return {@link Path} to the directory to archive the given store or
   *         <tt>null</tt> if it should not be archived
   */
  public static Path getStoreArchivePath(final Configuration conf, final String tableName,
      final String regionName, final String familyName) throws IOException {
    Path tableArchiveDir = getTableArchivePath(conf, tableName);
    return Store.getStoreHomedir(tableArchiveDir, regionName, familyName);
  }

  /**
   * Get the directory to archive a store directory
   * @param conf {@link Configuration} to read for the archive directory name
   * @param region parent region information under which the store currently
   *          lives
   * @param family name of the family in the store
   * @return {@link Path} to the directory to archive the given store or
   *         <tt>null</tt> if it should not be archived
   */
  public static Path getStoreArchivePath(Configuration conf, HRegion region, byte [] family){
    return getStoreArchivePath(conf, region.getRegionInfo(), region.getTableDir(), family);
  }

  /**
   * Get the directory to archive a store directory
   * @param conf {@link Configuration} to read for the archive directory name. Can be null.
   * @param region parent region information under which the store currently lives
   * @param tabledir directory for the table under which the store currently lives
   * @param family name of the family in the store
   * @return {@link Path} to the directory to archive the given store or <tt>null</tt> if it should
   *         not be archived
   */
  public static Path getStoreArchivePath(Configuration conf, HRegionInfo region, Path tabledir,
      byte[] family) {
    Path tableArchiveDir = getTableArchivePath(tabledir);
    return Store.getStoreHomedir(tableArchiveDir,
      HRegionInfo.encodeRegionName(region.getRegionName()), family);
  }

  /**
   * Get the archive directory for a given region under the specified table
   * @param conf {@link Configuration} to read the archive directory from. Can be null
   * @param tabledir the original table directory. Cannot be null.
   * @param regiondir the path to the region directory. Cannot be null.
   * @return {@link Path} to the directory to archive the given region, or <tt>null</tt> if it
   *         should not be archived
   */
  public static Path getRegionArchiveDir(Configuration conf, Path tabledir, Path regiondir) {
    // get the archive directory for a table
    Path archiveDir = getTableArchivePath(tabledir);

    // then add on the region path under the archive
    String encodedRegionName = regiondir.getName();
    return HRegion.getRegionDir(archiveDir, encodedRegionName);
  }

  /**
   * Get the archive directory for a given region under the specified table
   * @param rootdir {@link Path} to the root directory where hbase files are stored (for building
   *          the archive path)
   * @param tabledir the original table directory. Cannot be null.
   * @param regiondir the path to the region directory. Cannot be null.
   * @return {@link Path} to the directory to archive the given region, or <tt>null</tt> if it
   *         should not be archived
   */
  public static Path getRegionArchiveDir(Path rootdir, Path tabledir, Path regiondir) {
    // get the archive directory for a table
    Path archiveDir = getTableArchivePath(rootdir, tabledir.getName());

    // then add on the region path under the archive
    String encodedRegionName = regiondir.getName();
    return HRegion.getRegionDir(archiveDir, encodedRegionName);
  }

  /**
   * Get the path to the table archive directory based on the configured archive directory.
   *

   * Get the path to the table's archive directory.
   *

   * Generally of the form: /hbase/.archive/[tablename]
   * @param tabledir directory of the table to be archived. Cannot be null.
   * @return {@link Path} to the archive directory for the table
   */
  public static Path getTableArchivePath(Path tabledir) {
    Path root = tabledir.getParent();
    return getTableArchivePath(root, tabledir.getName());
  }

  /**
   * Get the path to the table archive directory based on the configured archive directory.
   *

   * Get the path to the table's archive directory.
   *

   * Generally of the form: /hbase/.archive/[tablename]
   * @param rootdir {@link Path} to the root directory where hbase files are stored (for building
   *          the archive path)
   * @param tableName Name of the table to be archived. Cannot be null.
   * @return {@link Path} to the archive directory for the table
   */
  public static Path getTableArchivePath(final Path rootdir, final String tableName) {
    return new Path(getArchivePath(rootdir), tableName);
  }

  /**
   * Get the path to the table archive directory based on the configured archive directory.
   *

   * Assumed that the table should already be archived.
   * @param conf {@link Configuration} to read the archive directory property. Can be null
   * @param tableName Name of the table to be archived. Cannot be null.
   * @return {@link Path} to the archive directory for the table
   */
  public static Path getTableArchivePath(final Configuration conf, final String tableName)
      throws IOException {
    return new Path(getArchivePath(conf), tableName);
  }

  /**
   * Get the full path to the archive directory on the configured {@link FileSystem}
   * @param conf to look for archive directory name and root directory. Cannot be null. Notes for
   *          testing: requires a FileSystem root directory to be specified.
   * @return the full {@link Path} to the archive directory, as defined by the configuration
   * @throws IOException if an unexpected error occurs
   */
  public static Path getArchivePath(Configuration conf) throws IOException {
    return getArchivePath(FSUtils.getRootDir(conf));
  }

  /**
   * Get the full path to the archive directory on the configured {@link FileSystem}
   * @param rootdir {@link Path} to the root directory where hbase files are stored (for building
   *          the archive path)
   * @return the full {@link Path} to the archive directory, as defined by the configuration
   */
  private static Path getArchivePath(final Path rootdir) {
    return new Path(rootdir, HConstants.HFILE_ARCHIVE_DIRECTORY);
  }
}