text:
namespace dp2Circulation
{
    partial class OpacVirtualDatabaseDialog
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OpacVirtualDatabaseDialog));
            this.textBox_memberDatabases = new System.Windows.Forms.TextBox();
            this.tabControl_main = new System.Windows.Forms.TabControl();
            this.tabPage_virtualDatabaseName = new System.Windows.Forms.TabPage();
            this.button_virtualDatabaseName_newBlankLine = new System.Windows.Forms.Button();
            this.label5 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.captionEditControl_virtualDatabaseName = new DigitalPlatform.CommonControl.CaptionEditControl();
            this.tabPage_memberDatabases = new System.Windows.Forms.TabPage();
            this.button_insertMemberDatabaseName = new System.Windows.Forms.Button();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.tabPage_froms = new System.Windows.Forms.TabPage();
            this.button_from_import = new System.Windows.Forms.Button();
            this.label6 = new System.Windows.Forms.Label();
            this.button_froms_newBlankLine = new System.Windows.Forms.Button();
            this.label3 = new System.Windows.Forms.Label();
            this.fromEditControl1 = new DigitalPlatform.CommonControl.FromEditControl();
            this.button_OK = new System.Windows.Forms.Button();
            this.button_Cancel = new System.Windows.Forms.Button();
            this.tabControl_main.SuspendLayout();
            this.tabPage_virtualDatabaseName.SuspendLayout();
            this.tabPage_memberDatabases.SuspendLayout();
            this.tabPage_froms.SuspendLayout();
            this.SuspendLayout();
            //
            // textBox_memberDatabases
            //
            this.textBox_memberDatabases.AcceptsReturn = true;
            this.textBox_memberDatabases.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.textBox_memberDatabases.Location = new System.Drawing.Point(4, 28);
            this.textBox_memberDatabases.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.textBox_memberDatabases.MaxLength = 0;
            this.textBox_memberDatabases.Multiline = true;
            this.textBox_memberDatabases.Name = "textBox_memberDatabases";
            this.textBox_memberDatabases.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            this.textBox_memberDatabases.Size = new System.Drawing.Size(237, 147);
            this.textBox_memberDatabases.TabIndex = 3;
            //
            // tabControl_main
            //
            this.tabControl_main.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.tabControl_main.Controls.Add(this.tabPage_virtualDatabaseName);
            this.tabControl_main.Controls.Add(this.tabPage_memberDatabases);
            this.tabControl_main.Controls.Add(this.tabPage_froms);
            this.tabControl_main.Location = new System.Drawing.Point(9, 10);
            this.tabControl_main.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.tabControl_main.Name = "tabControl_main";
            this.tabControl_main.SelectedIndex = 0;
            this.tabControl_main.Size = new System.Drawing.Size(380, 241);
            this.tabControl_main.TabIndex = 4;
            //
            // tabPage_virtualDatabaseName
            //
            this.tabPage_virtualDatabaseName.Controls.Add(this.button_virtualDatabaseName_newBlankLine);
            this.tabPage_virtualDatabaseName.Controls.Add(this.label5);
            this.tabPage_virtualDatabaseName.Controls.Add(this.label4);
            this.tabPage_virtualDatabaseName.Controls.Add(this.captionEditControl_virtualDatabaseName);
            this.tabPage_virtualDatabaseName.Location = new System.Drawing.Point(4, 22);
            this.tabPage_virtualDatabaseName.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.tabPage_virtualDatabaseName.Name = "tabPage_virtualDatabaseName";
            this.tabPage_virtualDatabaseName.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.tabPage_virtualDatabaseName.Size = new System.Drawing.Size(372, 215);
            this.tabPage_virtualDatabaseName.TabIndex = 0;
            this.tabPage_virtualDatabaseName.Text = "ÐéÄâ¿âÃû";
            this.tabPage_virtualDatabaseName.UseVisualStyleBackColor = true;
            //
            // button_virtualDatabaseName_newBlankLine
            //
            this.button_virtualDatabaseName_newBlankLine.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.button_virtualDatabaseName_newBlankLine.Location = new System.Drawing.Point(2, 152);
            this.button_virtualDatabaseName_newBlankLine.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.button_virtualDatabaseName_newBlankLine.Name = "button_virtualDatabaseName_newBlankLine";
            this.button_virtualDatabaseName_newBlankLine.Size = new System.Drawing.Size(110, 22);
            this.button_virtualDatabaseName_newBlankLine.TabIndex = 4;
            this.button_virtualDatabaseName_newBlankLine.Text = "ÐÂÔö¿Õ°×ÐÐ(&N)";
            this.button_virtualDatabaseName_newBlankLine.UseVisualStyleBackColor = true;
            this.button_virtualDatabaseName_newBlankLine.Click += new System.EventHandler(this.button_virtualDatabaseName_newLine_Click);
            //
            // label5
            //
            this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.label5.BackColor = System.Drawing.SystemColors.Info;
            this.label5.Location = new System.Drawing.Point(2, 183);
            this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label5.Name = "label5";
            this.label5.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.label5.Size = new System.Drawing.Size(323, 33);
            this.label5.TabIndex = 3;
            this.label5.Text = "×¢£ºÐèÒª¸øÐéÄâ¿âÈ¡Ãû×Ö¡£ÖÁÉÙÒªÓÐÒ»¸öÖÐÎÄ(ÓïÑÔ´úÂëΪzh)µÄÃû×Ö¡£";
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(0, 10);
            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(77, 12);
            this.label4.TabIndex = 2;
            this.label4.Text = "ÐéÄâ¿âÃû(&V):";
            //
            // captionEditControl_virtualDatabaseName
            //
            this.captionEditControl_virtualDatabaseName.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.captionEditControl_virtualDatabaseName.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
            this.captionEditControl_virtualDatabaseName.Changed = false;
            this.captionEditControl_virtualDatabaseName.Location = new System.Drawing.Point(2, 24);
            this.captionEditControl_virtualDatabaseName.Margin = new System.Windows.Forms.Padding(2);
            this.captionEditControl_virtualDatabaseName.Name = "captionEditControl_virtualDatabaseName";
            this.captionEditControl_virtualDatabaseName.Size = new System.Drawing.Size(325, 123);
            this.captionEditControl_virtualDatabaseName.TabIndex = 1;
            //
            // tabPage_memberDatabases
            //
            this.tabPage_memberDatabases.Controls.Add(this.button_insertMemberDatabaseName);
            this.tabPage_memberDatabases.Controls.Add(this.label2);
            this.tabPage_memberDatabases.Controls.Add(this.label1);
            this.tabPage_memberDatabases.Controls.Add(this.textBox_memberDatabases);
            this.tabPage_memberDatabases.Location = new System.Drawing.Point(4, 22);
            this.tabPage_memberDatabases.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.tabPage_memberDatabases.Name = "tabPage_memberDatabases";
            this.tabPage_memberDatabases.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.tabPage_memberDatabases.Size = new System.Drawing.Size(372, 215);
            this.tabPage_memberDatabases.TabIndex = 1;
            this.tabPage_memberDatabases.Text = "³ÉÔ±¿â";
            this.tabPage_memberDatabases.UseVisualStyleBackColor = true;
            //
            // button_insertMemberDatabaseName
            //
            this.button_insertMemberDatabaseName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button_insertMemberDatabaseName.Location = new System.Drawing.Point(245, 26);
            this.button_insertMemberDatabaseName.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.button_insertMemberDatabaseName.Name = "button_insertMemberDatabaseName";
            this.button_insertMemberDatabaseName.Size = new System.Drawing.Size(123, 22);
            this.button_insertMemberDatabaseName.TabIndex = 6;
            this.button_insertMemberDatabaseName.Text = "²åÈëÊý¾Ý¿âÃû(&I)...";
            this.button_insertMemberDatabaseName.UseVisualStyleBackColor = true;
            this.button_insertMemberDatabaseName.Click += new System.EventHandler(this.button_insertMemberDatabaseName_Click);
            //
            // label2
            //
            this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.label2.BackColor = System.Drawing.SystemColors.Info;
            this.label2.Location = new System.Drawing.Point(3, 177);
            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label2.Name = "label2";
            this.label2.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.label2.Size = new System.Drawing.Size(365, 39);
            this.label2.TabIndex = 5;
            this.label2.Text = "×¢: ÿÐÐÒ»¸öÊý¾Ý¿âÃû£¬ÓïÑÔÓÃÖÐÎÄ£»Ö»ÄÜʹÓÃÒѾ³öÏÖÔÚ¡°OPAC¡±ÊôÐÔÒ³µÄÆÕͨ¿âÃû";
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(2, 14);
            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(101, 12);
            this.label1.TabIndex = 4;
            this.label1.Text = "³ÉÔ±¿âÃûÁбí(&L):";
            //
            // tabPage_froms
            //
            this.tabPage_froms.Controls.Add(this.button_from_import);
            this.tabPage_froms.Controls.Add(this.label6);
            this.tabPage_froms.Controls.Add(this.button_froms_newBlankLine);
            this.tabPage_froms.Controls.Add(this.label3);
            this.tabPage_froms.Controls.Add(this.fromEditControl1);
            this.tabPage_froms.Location = new System.Drawing.Point(4, 22);
            this.tabPage_froms.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.tabPage_froms.Name = "tabPage_froms";
            this.tabPage_froms.Size = new System.Drawing.Size(372, 215);
            this.tabPage_froms.TabIndex = 2;
            this.tabPage_froms.Text = "¼ìË÷;¾¶";
            this.tabPage_froms.UseVisualStyleBackColor = true;
            //
            // button_from_import
            //
            this.button_from_import.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.button_from_import.Location = new System.Drawing.Point(285, 152);
            this.button_from_import.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.button_from_import.Name = "button_from_import";
            this.button_from_import.Size = new System.Drawing.Size(86, 22);
            this.button_from_import.TabIndex = 7;
            this.button_from_import.Text = "µ¼Èë(&I)...";
            this.button_from_import.UseVisualStyleBackColor = true;
            this.button_from_import.Click += new System.EventHandler(this.button_from_import_Click);
            //
            // label6
            //
            this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.label6.BackColor = System.Drawing.SystemColors.Info;
            this.label6.Location = new System.Drawing.Point(2, 186);
            this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label6.Name = "label6";
            this.label6.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.label6.Size = new System.Drawing.Size(367, 33);
            this.label6.TabIndex = 6;
            this.label6.Text = "×¢£º¼ìË÷;¾¶ÊÇ´Ó³ÉÔ±¿âµÄ¼ìË÷;¾¶¼¯ºÏÖÐÌôÑ¡³öÀ´µÄ£¬Ï£Íû³öÏÖÔÚOPAC¼ìË÷½çÃæÉϵÄÄDz¿·Ö¡£";
            //
            // button_froms_newBlankLine
            //
            this.button_froms_newBlankLine.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.button_froms_newBlankLine.Location = new System.Drawing.Point(2, 152);
            this.button_froms_newBlankLine.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.button_froms_newBlankLine.Name = "button_froms_newBlankLine";
            this.button_froms_newBlankLine.Size = new System.Drawing.Size(110, 22);
            this.button_froms_newBlankLine.TabIndex = 5;
            this.button_froms_newBlankLine.Text = "ÐÂÔö¿Õ°×ÐÐ(&N)";
            this.button_froms_newBlankLine.UseVisualStyleBackColor = true;
            this.button_froms_newBlankLine.Click += new System.EventHandler(this.button_froms_newBlankLine_Click);
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(2, 17);
            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(101, 12);
            this.label3.TabIndex = 1;
            this.label3.Text = "¼ìË÷;¾¶¶¨Òå(&D):";
            //
            // fromEditControl1
            //
            this.fromEditControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.fromEditControl1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.Single;
            this.fromEditControl1.Changed = false;
            this.fromEditControl1.Location = new System.Drawing.Point(2, 31);
            this.fromEditControl1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.fromEditControl1.Name = "fromEditControl1";
            this.fromEditControl1.Size = new System.Drawing.Size(369, 116);
            this.fromEditControl1.TabIndex = 0;
            //
            // button_OK
            //
            this.button_OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.button_OK.Location = new System.Drawing.Point(272, 257);
            this.button_OK.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.button_OK.Name = "button_OK";
            this.button_OK.Size = new System.Drawing.Size(56, 22);
            this.button_OK.TabIndex = 5;
            this.button_OK.Text = "È·¶¨";
            this.button_OK.UseVisualStyleBackColor = true;
            this.button_OK.Click += new System.EventHandler(this.button_OK_Click);
            //
            // button_Cancel
            //
            this.button_Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.button_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.button_Cancel.Location = new System.Drawing.Point(332, 257);
            this.button_Cancel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.button_Cancel.Name = "button_Cancel";
            this.button_Cancel.Size = new System.Drawing.Size(56, 22);
            this.button_Cancel.TabIndex = 6;
            this.button_Cancel.Text = "È¡Ïû";
            this.button_Cancel.UseVisualStyleBackColor = true;
            this.button_Cancel.Click += new System.EventHandler(this.button_Cancel_Click);
            //
            // OpacVirtualDatabaseDialog
            //
            this.AcceptButton = this.button_OK;
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.CancelButton = this.button_Cancel;
            this.ClientSize = new System.Drawing.Size(398, 289);
            this.Controls.Add(this.button_Cancel);
            this.Controls.Add(this.button_OK);
            this.Controls.Add(this.tabControl_main);
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
            this.Name = "OpacVirtualDatabaseDialog";
            this.ShowInTaskbar = false;
            this.Text = "OpacVirtualDatabaseDialog";
            this.Load += new System.EventHandler(this.OpacVirtualDatabaseDialog_Load);
            this.tabControl_main.ResumeLayout(false);
            this.tabPage_virtualDatabaseName.ResumeLayout(false);
            this.tabPage_virtualDatabaseName.PerformLayout();
            this.tabPage_memberDatabases.ResumeLayout(false);
            this.tabPage_memberDatabases.PerformLayout();
            this.tabPage_froms.ResumeLayout(false);
            this.tabPage_froms.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private DigitalPlatform.CommonControl.CaptionEditControl captionEditControl_virtualDatabaseName;
        private System.Windows.Forms.TextBox textBox_memberDatabases;
        private System.Windows.Forms.TabControl tabControl_main;
        private System.Windows.Forms.TabPage tabPage_virtualDatabaseName;
        private System.Windows.Forms.TabPage tabPage_memberDatabases;
        private System.Windows.Forms.TabPage tabPage_froms;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private DigitalPlatform.CommonControl.FromEditControl fromEditControl1;
        private System.Windows.Forms.Button button_OK;
        private System.Windows.Forms.Button button_Cancel;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Button button_insertMemberDatabaseName;
        private System.Windows.Forms.Button button_virtualDatabaseName_newBlankLine;
        private System.Windows.Forms.Button button_froms_newBlankLine;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Button button_from_import;
    }
}


text:
import test from 'tape'
import nlp from '../_lib.js'
const here = '[three/verb-toNegative] '

test('inline verb negate:', function (t) {
  let arr = [

    [`he is nice`, 'he is not nice'],
    [`she was nice`, 'she was not nice'],

    [`she has walked`, 'she has not walked'],
    [`she had walked`, 'she had not walked'],
    [`we have had problems`, 'we have not had problems'],
    [`we would walk`, 'we would not walk'],
    [`we would have walked`, 'we would not have walked'],

    //conjugations
    [`she walked`, 'she did not walk'],
    [`it all came apart`, 'it did not all come apart'],

    //phrasals
    [`he would come forward`, 'he would not come forward'],
    // [`we come together`, 'do not come together'],
    [`i didn't want to`, "i didn't want to"],

    //===singular
    // pastTense -
    ['john played', 'john did not play'],
    // presentTense -
    ['john plays', 'john does not play'],
    // futureTense -
    ['john will play', 'john will not play'],

    ///===plural
    // pastTense -
    ['we played', 'we did not play'],
    // presentTense -
    ['we play', 'we do not play'],
    // futureTense -
    ['we will play', 'we will not play'],

    ['is', 'is not'],
    ['will', 'will not'],
    ['will be', 'will not be'],
    ['was', 'was not'],

    ['walks', 'does not walk'],
    ['walked', 'did not walk'],
    // ['walking', 'not walking'],
    // ['walk', 'do not walk'],
    ['will walk', 'will not walk'],
    ['will have walked', 'will not have walked'],
    //auxiliary/adjective
    ['he was lifted', 'he was not lifted'],
    ['he was lifting', 'he was not lifting'],
    ['he was tall', 'he was not tall'],
    ['he was armed', 'he was not armed'],
    [`he was frightened`, 'he was not frightened'],
    [`he was frightened of`, 'he was not frightened of'],
    // [`he was frightened-of`, 'he was not frightened-of'],

    //already negative
    ['he did not die', 'he did not die'],
    ['that is not it', 'that is not it'],
    ['we will not have this', 'we will not have this'],
    ['we would not particularly go', 'we would not particularly go'],

    // ['corrupted', 'did not corrupt'],
    ['jumped', 'did not jump'],
    ['stunk up', 'did not stink up'],

    [`would study`, `would not study`],
    [`could study`, `could not study`],
    [`should study`, `should not study`],

    [`please walk`, `please do not walk`],
    [`he walks`, `he does not walk`],
    [`we walk`, `we do not walk`],
    [`i walk`, `i do not walk`],
    [`spencer walks`, `spencer does not walk`],
    [`he walked`, `he did not walk`],
    [`he will walk`, `he will not walk`],
    [`he is walking`, `he is not walking`],
    [`he was walking`, `he was not walking`],
    [`he will be walking`, `he will not be walking`],
    [`he has walked`, `he has not walked`],
    [`he had walked`, `he had not walked`],
    [`he will have walked`, `he will not have walked`],
    [`he has been walking`, `he has not been walking`],
    [`he had been walking`, `he had not been walking`],
    [`he will have been walking`, `he will not have been walking`],
    [`he got walked`, `he did not get walked`],//**
    [`we were walked`, `we were not walked`],
    [`he had been walked`, `he had not been walked`],
    [`i have been walked`, `i have not been walked`],
    [`he was being walked`, `he was not being walked`],
    [`he is walked`, `he is not walked`],
    [`he has been walked`, `he has not been walked`],
    [`we are walked`, `we are not walked`],
    [`he will have been walked`, `he will not have been walked`],
    [`we will be walked`, `we will not be walked`],
    [`he would be walked`, `he would not be walked`],
    [`he would have been walked`, `he would not have been walked`],
    [`he is going to walk`, `he is not going to walk`],
    [`he did walk`, `he did not walk`],
    [`he used to walk`, `he did not used to walk`],
    [`we do walk`, `we do not walk`],
    [`he does walk`, `he does not walk`],
    [`he could have walked`, `he could not have walked`],
    [`he wants to walk`, `he does not want to walk`],
    [`he can walk`, `he can not walk`],

    // already-negative
    [`he can not walk`, `he can not walk`],
    [`he could not have really walked`, `he could not have really walked`],
    ['there is not hope', 'there is not hope'],
    ['there is no hope', 'there is no hope'],
  ]
  arr.forEach(function (a) {
    let doc = nlp(a[0])
    doc.verbs().toNegative()
    let str = doc.text('normal')
    t.equal(str, a[1], here + a[1] + ' --- ' + str)
  })
  t.end()
})

redpajama_set_name: RedPajamaGithub


text:
module.exports = function(robot){

	var thankYouResponses = [
		"You're welcome!",
		"No problem",
		"Not a problem",
		"It's no bother",
		"No problem at all",
		"It's my pleasure",
		"My pleasure",
		"It's nothing",
		"No, no.  Thank you!",
		"Sure thing"
	];

	var beerResponses = [
		"I think I've had too many",
		"I'm trashed"
	];

	robot.hear(/thank(s| you) bocbot/i, function(res){
		res.random(thankYouResponses);
	});

	robot.hear(/I like pie/i, function(res){
		res.send('I like pie too');
	});

	robot.respond(/open (.*) door/i, function(res){
		var doorType = res.match[1];
		if (doorType.replace('the ') == 'pod bay')
			res.reply("I'm afraid I can't let you do that.");
		else
			res.reply('Opening ' + doorType + ' doors.');
	});

	robot.respond(/you('re| are)(.*) slow/i, function(res){
		setTimeout(function(){
			res.reply('Who you callin\' slow?');
		}, 1000 * 15);
	});

	robot.respond(/(have|drink|consume)(.*) beer/i, function(res){
		var beersHad = robot.brain.get('totalBeersHad') || 0;
		if (beersHad > 4){
			var lastBeerFrom = robot.brain.get('lastBeerFrom');
			var initialResponse = robot.util.random(beerResponses);
			res.reply(initialResponse + ".  " + lastBeerFrom + " got me too drunk.  I need to sleep it off first.");
		}
		else{
			res.reply("Sure thing!  _chugs beer_");
			robot.brain.set('totalBeersHad', beersHad + 1);
			robot.brain.set('lastBeerFrom', res.message.user.name);
		}
	});

	robot.respond(/sleep it off/i, function(res){
		robot.brain.set('totalBeersHad', 0);
		res.reply('zzzzz');
	});
}


text:
import datetime

from contextlib import closing

from .models import FinancialStatement
from . import Session

from sqlalchemy.sql.expression import func

def get_reporting_period(fs_entries):
    date_format = '%Y-%m-%d'
    start_date = None
    end_date = None
    for entry in fs_entries:
        if entry.fieldName == 'gsd:ReportingPeriodStartDate':
            start_date = entry.fieldValue
        if entry.fieldName == 'gsd:ReportingPeriodEndDate':
            end_date = entry.fieldValue
    start_date = datetime.datetime.strptime(start_date[:10], date_format)
    end_date = datetime.datetime.strptime(end_date[:10], date_format)
    return start_date, end_date

def date_is_in_range(start_date, end_date, query_date):
    if start_date is None and end_date is None:
        return True

    if start_date is None:
        return query_date <= end_date

    if end_date is None:
        return query_date >= start_date

    return query_date >= start_date and query_date <= end_date

def date_is_instant(start_date, end_date):
    return start_date is None and end_date is not None

def filter_reporting_period(fs_entries):
    """
    returns a subset fs_entries where each entry is in the reporting period.

    """
    start_date, end_date = get_reporting_period(fs_entries)
    result = []
    for entry in fs_entries:
        if entry.startDate is None and entry.endDate is None:
            continue
        if date_is_instant(entry.startDate, entry.endDate):
            if date_is_in_range(start_date, end_date, entry.endDate):
                # append to result
                result.append(entry)
            continue

        if (not date_is_in_range(start_date, end_date, entry.startDate) or
                not date_is_in_range(start_date, end_date, entry.endDate)):
            continue
        result.append(entry)

    return result

def arelle_parse_value(d):
    """Decodes an arelle string as a python type (float, int or str)"""
    if not isinstance(d, str):  # already decoded.
        return d
    try:
        return int(d.replace(',', ''))
    except ValueError:
        pass
    try:
        return float(d.replace(",", ""))
    except ValueError:
        pass
    return d

def partition_consolidated(fs_entries):
    fs_tuples_cons = [r for r in fs_entries
                      if r.koncern]
    fs_tuples_solo = [r for r in fs_entries
                      if not r.koncern]

    return fs_tuples_cons, fs_tuples_solo

def get_number_of_rows():
    with closing(Session()) as session:
        total_rows = session.query(FinancialStatement).count()
        return total_rows

def financial_statement_iterator(end_idx=None, length=None, buffer_size=500):
    """Provide an iterator over financial_statements in order of id

    Keyword arguments:
    end_idx -- One past the last financial_statement_id to iterate over.
    length -- The number of financial statements to iterate.
              Note only one of end_idx and length can be provided.
    buffer_size -- the internal buffer size to use for iterating.  The buffer
                   size is measured in number of financial statements.

    """

    if end_idx is not None and length is not None:
        raise ValueError("Cannot accept both end_idx and length.")

    if end_idx is None and length is None:
        try:
            session = Session()
            max_id = session.query(func.max(FinancialStatement.id)).scalar()
            end_idx = max_id + 1
        except (IndexError, ValueError):
            raise LookupError('Could not lookup maximum financial_statement_id'
                              ' in financial_statement table.')
        finally:
            session.close()

    if end_idx is not None:
        assert(isinstance(end_idx, int))

    if length is not None:
        assert(isinstance(length, int))
        end_idx = length

    total_rows = get_number_of_rows()

    with closing(Session()) as session:
        curr = 1
        while curr < end_idx:
            q = session.query(FinancialStatement).filter(
                FinancialStatement.id >= curr,
                FinancialStatement.id < min(curr + buffer_size, end_idx)
            ).enable_eagerloads(True).all()
            for i, fs in enumerate(q):
                entries = filter_reporting_period(fs.financial_statement_entries)
                yield i+curr, total_rows, fs.id, entries
            curr += buffer_size
    return


text:
package com.blazebit.persistence.deltaspike.data.rest.impl;

import com.blazebit.lang.StringUtils;
import com.blazebit.persistence.DefaultKeyset;
import com.blazebit.persistence.DefaultKeysetPage;
import com.blazebit.persistence.KeysetPage;
import com.blazebit.persistence.deltaspike.data.KeysetPageRequest;
import com.blazebit.persistence.deltaspike.data.PageRequest;
import com.blazebit.persistence.deltaspike.data.Pageable;
import com.blazebit.persistence.deltaspike.data.Sort;
import com.blazebit.persistence.deltaspike.data.rest.KeysetPageableConfiguration;
import com.blazebit.persistence.deltaspike.data.rest.PageableConfiguration;
import com.blazebit.reflection.ReflectionUtils;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.Provider;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @author Christian Beikov
 * @since 1.2.0
 */
@Provider
public class KeysetPageableParamConverter implements ParamConverter<Pageable> {

    private static final ConcurrentMap<PropertyCacheKey, Class<? extends Serializable>> PROPERTY_TYPE_CACHE = new ConcurrentHashMap<>();

    private final Class<?> keysetClass;
    private final ObjectMapper mapper;
    private final UriInfo requestUriInfo;
    private final PageableConfiguration pageableConfiguration;
    private final KeysetPageableConfiguration keysetPageableConfiguration;

    public KeysetPageableParamConverter(Class<?> keysetClass, ObjectMapper mapper, UriInfo requestUriInfo, PageableConfiguration pageableConfiguration, KeysetPageableConfiguration keysetPageableConfiguration) {
        this.keysetClass = keysetClass;
        this.mapper = mapper;
        this.requestUriInfo = requestUriInfo;
        this.pageableConfiguration = pageableConfiguration;
        this.keysetPageableConfiguration = keysetPageableConfiguration;
    }

    @Override
    public Pageable fromString(String value) {
        MultivaluedMap<String, String> queryParameters = requestUriInfo.getQueryParameters();

        Pageable defaultOrFallback = pageableConfiguration.getFallbackPageable();

        String offsetString = queryParameters.getFirst(pageableConfiguration.getPrefix() + pageableConfiguration.getOffsetParameterName());
        String pageString = queryParameters.getFirst(pageableConfiguration.getPrefix() + pageableConfiguration.getPageParameterName());
        String pageSizeString = queryParameters.getFirst(pageableConfiguration.getPrefix() + pageableConfiguration.getSizeParameterName());

        boolean pageAndSizeGiven = (!StringUtils.isEmpty(pageString) || !StringUtils.isEmpty(offsetString))  && !StringUtils.isEmpty(pageSizeString);

        if (!pageAndSizeGiven && defaultOrFallback == null) {
            return null;
        }

        int maxPageSize = pageableConfiguration.getMaxPageSize();
        int pageSize = !StringUtils.isEmpty(pageSizeString) ? parseAndApplyBoundaries(pageSizeString, maxPageSize, false)
                : defaultOrFallback.getPageSize();

        // Limit lower bound
        pageSize = pageSize < 1 ? defaultOrFallback.getPageSize() : pageSize;
        // Limit upper bound
        pageSize = pageSize > maxPageSize ? maxPageSize : pageSize;

        int offset;
        if (!StringUtils.isEmpty(offsetString)) {
            offset = parseAndApplyBoundaries(pageString, Integer.MAX_VALUE, false);
        } else if (!StringUtils.isEmpty(pageString)) {
            offset = pageSize * parseAndApplyBoundaries(pageString, Integer.MAX_VALUE, true);
        } else {
            offset = pageSize * defaultOrFallback.getPageNumber();
        }

        Sort sort = resolveSort(queryParameters.get(pageableConfiguration.getSortParameterName()));

        // Default if necessary and default configured
        sort = sort == null && defaultOrFallback != null ? defaultOrFallback.getSort() : sort;

        KeysetPage keysetPage = null;
        Iterator<Sort.Order> iterator;
        if (keysetClass != null) {
            if (sort != null && (iterator = sort.iterator()).hasNext()) {
                String previousOffsetString = queryParameters.getFirst(keysetPageableConfiguration.getPrefix() + keysetPageableConfiguration.getPreviousOffsetParameterName());
                String previousPageString = queryParameters.getFirst(keysetPageableConfiguration.getPrefix() + keysetPageableConfiguration.getPreviousPageParameterName());
                if (!StringUtils.isEmpty(previousOffsetString) || !StringUtils.isEmpty(previousPageString)) {
                    String previousPageSizeString = queryParameters.getFirst(keysetPageableConfiguration.getPrefix() + keysetPageableConfiguration.getPreviousSizeParameterName());
                    int previousPageSize = StringUtils.isEmpty(previousPageSizeString) ? pageSize : parseAndApplyBoundaries(previousPageSizeString, maxPageSize, false);

                    int previousOffset;
                    if (!StringUtils.isEmpty(previousOffsetString)) {
                        previousOffset = parseAndApplyBoundaries(previousOffsetString, Integer.MAX_VALUE, false);
                    } else {
                        int previousPage = parseAndApplyBoundaries(previousPageString, Integer.MAX_VALUE, true);
                        previousOffset = previousPage * previousPageSize;
                    }

                    String lowestString = queryParameters.getFirst(keysetPageableConfiguration.getPrefix() + keysetPageableConfiguration.getLowestParameterName());
                    String highestString = queryParameters.getFirst(keysetPageableConfiguration.getPrefix() + keysetPageableConfiguration.getHighestParameterName());
                    if (!StringUtils.isEmpty(lowestString) && !StringUtils.isEmpty(highestString)) {
                        List<Serializable> lowest = new ArrayList<>();
                        List<Serializable> highest = new ArrayList<>();
                        JsonNode lowestObject;
                        JsonNode highestObject;
                        try {
                            lowestObject = mapper.readTree(lowestString);
                        } catch (IOException ex) {
                            throw new IllegalArgumentException("Invalid lowest object!", ex);
                        }
                        try {
                            highestObject = mapper.readTree(highestString);
                        } catch (IOException ex) {
                            throw new IllegalArgumentException("Invalid highest object!", ex);
                        }

                        while (iterator.hasNext()) {
                            Sort.Order o = iterator.next();
                            JsonNode low = lowestObject;
                            JsonNode high = highestObject;
                            String[] propertyParts = o.getPath().split("\\.");
                            Class<? extends Serializable> propertyType = getPropertyType(keysetClass, o.getPath());

                            for (int i = 0; i < propertyParts.length; i++) {
                                low = low == null ? null : low.get(propertyParts[i]);
                                high = high == null ? null : high.get(propertyParts[i]);
                            }

                            lowest.add(low == null ? null : convert(low, propertyType));
                            highest.add(high == null ? null : convert(high, propertyType));
                        }
                        keysetPage = new DefaultKeysetPage(
                                previousOffset,
                                previousPageSize,
                                new DefaultKeyset(lowest.toArray(new Serializable[lowest.size()])),
                                new DefaultKeyset(highest.toArray(new Serializable[highest.size()]))
                        );
                    }
                }
            }

            return new KeysetPageRequest(keysetPage, sort, offset, pageSize);
        }

        return new PageRequest(sort, offset, pageSize);
    }

    private Serializable convert(JsonNode valueNode, Class<? extends Serializable> propertyType) {
        switch (valueNode.getNodeType()) {
            case NULL:
                return null;
            case BOOLEAN:
                if (propertyType == Boolean.class || propertyType == boolean.class) {
                    return valueNode.asBoolean();
                } else {
                    throw new IllegalArgumentException("Can't convert boolean to type: " + propertyType.getName());
                }
            case NUMBER:
                Number number = valueNode.numberValue();
                if (propertyType == Integer.class || propertyType == int.class) {
                    return number.intValue();
                } else if (propertyType == Long.class || propertyType == long.class) {
                    return number.longValue();
                } else if (propertyType == Double.class || propertyType == double.class) {
                    return number.doubleValue();
                } else if (propertyType == Float.class || propertyType == float.class) {
                    return number.floatValue();
                } else if (propertyType == Byte.class || propertyType == byte.class) {
                    return number.byteValue();
                } else if (propertyType == Short.class || propertyType == short.class) {
                    return number.shortValue();
                } else if (propertyType == BigInteger.class) {
                    return valueNode.bigIntegerValue();
                } else if (propertyType == BigDecimal.class) {
                    return valueNode.decimalValue();
                } else {
                    throw new IllegalArgumentException("Can't convert number to type: " + propertyType.getName());
                }
            case STRING:
                if (propertyType == String.class) {
                    return valueNode.asText();
                } else {
                    throw new IllegalArgumentException("Can't convert string to type: " + propertyType.getName());
                }
            default:
                throw new IllegalArgumentException("Can't convert value of type '" + valueNode.getNodeType() + "' to '" + propertyType.getName() + "'");
        }
    }

    private Sort resolveSort(List<String> sorts) {
        if (sorts == null || sorts.isEmpty()) {
            return null;
        }

        List<Sort.Order> orders = new ArrayList<>(sorts.size());
        for (int i = 0; i < sorts.size(); i++) {
            String[] elements = sorts.get(i).split(",");
            if (!StringUtils.isEmpty(elements[0])) {
                Sort.Direction direction = null;
                Sort.NullHandling nullHandling = Sort.NullHandling.NATIVE;
                if (elements.length > 1) {
                    direction = Sort.Direction.fromStringOrNull(elements[1]);
                }
                if (elements.length > 2) {
                    switch (elements[2].toLowerCase()) {
                        case "native":
                            nullHandling = Sort.NullHandling.NATIVE;
                            break;
                        case "first":
                            nullHandling = Sort.NullHandling.NULLS_FIRST;
                            break;
                        case "last":
                            nullHandling = Sort.NullHandling.NULLS_LAST;
                            break;
                        default:
                            break;
                    }
                }

                orders.add(new Sort.Order(direction, elements[0], nullHandling));
            }
        }
        return new Sort(orders);
    }

    @Override
    public String toString(Pageable value) {
        throw new UnsupportedOperationException();
    }

    private int parseAndApplyBoundaries(String parameter, int upper, boolean shiftIndex) {
        try {
            int parsed = Integer.parseInt(parameter) - (pageableConfiguration.isOneIndexedParameters() && shiftIndex ? 1 : 0);
            return parsed < 0 ? 0 : parsed > upper ? upper : parsed;
        } catch (NumberFormatException e) {
            return 0;
        }
    }

    private Class<? extends Serializable> getPropertyType(Class<?> clazz, String property) {
        PropertyCacheKey cacheKey = new PropertyCacheKey(clazz, property);
        Class<? extends Serializable> propertyType = PROPERTY_TYPE_CACHE.get(cacheKey);
        if (propertyType == null) {
            propertyType = resolvePropertyType(clazz, property);
            PROPERTY_TYPE_CACHE.putIfAbsent(cacheKey, propertyType);
        }
        return propertyType;
    }

    private Class<? extends Serializable> resolvePropertyType(Class<?> baseClazz, String property) {
        Class<?> clazz = baseClazz;
        String[] propertyParts = property.split("\\.");
        for (int i = 0; i < propertyParts.length; i++) {
            Method getter = ReflectionUtils.getGetter(clazz, propertyParts[i]);
            if (getter == null) {
                Field field = ReflectionUtils.getField(clazz, propertyParts[i]);
                if (field == null) {
                    throw new IllegalArgumentException("Couldn't find property '" + propertyParts[i] + "' on type '" + clazz + "' while resolving path '" + property + "' on type '" + baseClazz + "'");
                }
                Class<?>[] typeArguments = ReflectionUtils.getResolvedFieldTypeArguments(clazz, field);
                if (typeArguments.length == 0) {
                    clazz = ReflectionUtils.getResolvedFieldType(clazz, field);
                } else {
                    clazz = typeArguments[typeArguments.length - 1];
                }
            } else {
                Class<?>[] typeArguments = ReflectionUtils.getResolvedMethodReturnTypeArguments(clazz, getter);
                if (typeArguments.length == 0) {
                    clazz = ReflectionUtils.getResolvedMethodReturnType(clazz, getter);
                } else {
                    clazz = typeArguments[typeArguments.length - 1];
                }
            }
        }

        return (Class<? extends Serializable>) clazz;
    }

    /**
     * @author Christian Beikov
     * @since 1.2.0
     */
    private static class PropertyCacheKey {
        private final Class<?> clazz;
        private final String property;

        public PropertyCacheKey(Class<?> clazz, String property) {
            this.clazz = clazz;
            this.property = property;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) {
                return true;
            }
            if (!(o instanceof PropertyCacheKey)) {
                return false;
            }

            PropertyCacheKey that = (PropertyCacheKey) o;

            if (!clazz.equals(that.clazz)) {
                return false;
            }
            return property.equals(that.property);
        }

        @Override
        public int hashCode() {
            int result = clazz.hashCode();
            result = 31 * result + property.hashCode();
            return result;
        }
    }

}


text:
.class public final Lcom/android/internal/telephony/SMSDispatcher$TextSmsSender;
.super Lcom/android/internal/telephony/SMSDispatcher$SmsSender;
.source "SMSDispatcher.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/telephony/SMSDispatcher;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x14
    name = "TextSmsSender"
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/internal/telephony/SMSDispatcher;

# direct methods
.method public constructor <init>(Lcom/android/internal/telephony/SMSDispatcher;Lcom/android/internal/telephony/SMSDispatcher$SmsTracker;)V
    .locals 0
    .param p2, "tracker"    # Lcom/android/internal/telephony/SMSDispatcher$SmsTracker;

    .prologue
    .line 378
    iput-object p1, p0, Lcom/android/internal/telephony/SMSDispatcher$TextSmsSender;->this$0:Lcom/android/internal/telephony/SMSDispatcher;

    .line 379
    invoke-direct {p0, p1, p2}, Lcom/android/internal/telephony/SMSDispatcher$SmsSender;-><init>(Lcom/android/internal/telephony/SMSDispatcher;Lcom/android/internal/telephony/SMSDispatcher$SmsTracker;)V

    .line 380
    return-void
.end method

# virtual methods
.method protected onServiceReady(Landroid/service/carrier/ICarrierMessagingService;)V
    .locals 8
    .param p1, "carrierMessagingService"    # Landroid/service/carrier/ICarrierMessagingService;

    .prologue
    const/4 v7, 0x1

    const/4 v6, 0x0

    .line 384
    iget-object v3, p0, Lcom/android/internal/telephony/SMSDispatcher$TextSmsSender;->mTracker:Lcom/android/internal/telephony/SMSDispatcher$SmsTracker;

    iget-object v1, v3, Lcom/android/internal/telephony/SMSDispatcher$SmsTracker;->mData:Ljava/util/HashMap;

    .line 385
    .local v1, "map":Ljava/util/HashMap;, "Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/Object;>;"
    const-string v3, "text"

    invoke-virtual {v1, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 387
    .local v2, "text":Ljava/lang/String;
    if-eqz v2, :cond_0

    .line 389
    :try_start_0
    iget-object v3, p0, Lcom/android/internal/telephony/SMSDispatcher$TextSmsSender;->this$0:Lcom/android/internal/telephony/SMSDispatcher;

    invoke-virtual {v3}, Lcom/android/internal/telephony/SMSDispatcher;->getSubId()I

    move-result v3

    iget-object v4, p0, Lcom/android/internal/telephony/SMSDispatcher$TextSmsSender;->mTracker:Lcom/android/internal/telephony/SMSDispatcher$SmsTracker;

    iget-object v4, v4, Lcom/android/internal/telephony/SMSDispatcher$SmsTracker;->mDestAddress:Ljava/lang/String;

    iget-object v5, p0, Lcom/android/internal/telephony/SMSDispatcher$TextSmsSender;->mSenderCallback:Lcom/android/internal/telephony/SMSDispatcher$SmsSenderCallback;

    invoke-interface {p1, v2, v3, v4, v5}, Landroid/service/carrier/ICarrierMessagingService;->sendTextSms(Ljava/lang/String;ILjava/lang/String;Landroid/service/carrier/ICarrierMessagingCallback;)V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 402
    :goto_0
    return-void

    .line 391
    :catch_0
    move-exception v0

    .line 392
    .local v0, "e":Landroid/os/RemoteException;
    const-string v3, "SMSDispatcher"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Exception sending the SMS: "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/telephony/Rlog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 393
    iget-object v3, p0, Lcom/android/internal/telephony/SMSDispatcher$TextSmsSender;->mSenderCallback:Lcom/android/internal/telephony/SMSDispatcher$SmsSenderCallback;

    invoke-virtual {v3, v7, v6}, Lcom/android/internal/telephony/SMSDispatcher$SmsSenderCallback;->onSendSmsComplete(II)V

    goto :goto_0

    .line 398
    .end local v0    # "e":Landroid/os/RemoteException;
    :cond_0
    iget-object v3, p0, Lcom/android/internal/telephony/SMSDispatcher$TextSmsSender;->mSenderCallback:Lcom/android/internal/telephony/SMSDispatcher$SmsSenderCallback;

    invoke-virtual {v3, v7, v6}, Lcom/android/internal/telephony/SMSDispatcher$SmsSenderCallback;->onSendSmsComplete(II)V

    goto :goto_0
.end method


text:
"""
Tests for Google Cloud Life Sciences Hook
"""
from __future__ import annotations

import unittest
from unittest import mock
from unittest.mock import PropertyMock

import pytest

from airflow.exceptions import AirflowException
from airflow.providers.google.cloud.hooks.life_sciences import LifeSciencesHook
from tests.providers.google.cloud.utils.base_gcp_mock import (
    GCP_PROJECT_ID_HOOK_UNIT_TEST,
    mock_base_gcp_hook_default_project_id,
    mock_base_gcp_hook_no_default_project_id,
)

TEST_OPERATION = {
    "name": "operation-name",
    "metadata": {"@type": "anytype"},
    "done": True,
    "response": "response",
}

TEST_WAITING_OPERATION = {"done": False, "response": "response"}
TEST_DONE_OPERATION = {"done": True, "response": "response"}
TEST_ERROR_OPERATION = {"done": True, "response": "response", "error": "error"}
TEST_PROJECT_ID = "life-science-project-id"
TEST_LOCATION = "test-location"

class TestLifeSciencesHookWithPassedProjectId(unittest.TestCase):
    def setUp(self):
        with mock.patch(
            "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.__init__",
            new=mock_base_gcp_hook_default_project_id,
        ):
            self.hook = LifeSciencesHook(gcp_conn_id="test")

    def test_location_path(self):
        path = "projects/life-science-project-id/locations/test-location"
        path2 = self.hook._location_path(project_id=TEST_PROJECT_ID, location=TEST_LOCATION)
        assert path == path2

    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook._authorize")
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.build")
    def test_life_science_client_creation(self, mock_build, mock_authorize):
        result = self.hook.get_conn()
        mock_build.assert_called_once_with(
            "lifesciences", "v2beta", http=mock_authorize.return_value, cache_discovery=False
        )
        assert mock_build.return_value == result
        assert self.hook._conn == result

    @mock.patch(
        "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.project_id",
        new_callable=PropertyMock,
        return_value=GCP_PROJECT_ID_HOOK_UNIT_TEST,
    )
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook.get_conn")
    def test_run_pipeline_immediately_complete(self, get_conn_mock, mock_project_id):
        service_mock = get_conn_mock.return_value
        # fmt: off
        service_mock.projects.return_value \
            .locations.return_value \
            .pipelines.return_value \
            .run.return_value \
            .execute.return_value = TEST_OPERATION

        service_mock.projects.return_value \
            .locations.return_value \
            .operations.return_value \
            .get.return_value \
            .execute.return_value = TEST_DONE_OPERATION

        result = self.hook.run_pipeline(body={},
                                        location=TEST_LOCATION)
        parent = self.hook. \
            _location_path(location=TEST_LOCATION)
        service_mock.projects.return_value.locations.return_value \
            .pipelines.return_value.run \
            .assert_called_once_with(body={},
                                     parent=parent)
        # fmt: on
        assert result == TEST_OPERATION

    @mock.patch(
        "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.project_id",
        new_callable=PropertyMock,
        return_value=GCP_PROJECT_ID_HOOK_UNIT_TEST,
    )
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook.get_conn")
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.time.sleep")
    def test_waiting_operation(self, _, get_conn_mock, mock_project_id):
        service_mock = get_conn_mock.return_value
        # fmt: off
        service_mock.projects.return_value \
            .locations.return_value \
            .pipelines.return_value \
            .run.return_value \
            .execute.return_value = TEST_OPERATION

        execute_mock = mock.Mock(
            **{"side_effect": [TEST_WAITING_OPERATION, TEST_DONE_OPERATION]}
        )
        service_mock.projects.return_value \
            .locations.return_value \
            .operations.return_value \
            .get.return_value \
            .execute = execute_mock

        # fmt: on
        result = self.hook.run_pipeline(body={}, location=TEST_LOCATION, project_id=TEST_PROJECT_ID)
        assert result == TEST_OPERATION

    @mock.patch(
        "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.project_id",
        new_callable=PropertyMock,
        return_value=GCP_PROJECT_ID_HOOK_UNIT_TEST,
    )
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook.get_conn")
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.time.sleep")
    def test_error_operation(self, _, get_conn_mock, mock_project_id):
        service_mock = get_conn_mock.return_value
        # fmt: off
        service_mock.projects.return_value \
            .locations.return_value \
            .pipelines.return_value \
            .run.return_value \
            .execute.return_value = TEST_OPERATION

        execute_mock = mock.Mock(**{"side_effect": [TEST_WAITING_OPERATION, TEST_ERROR_OPERATION]})
        service_mock.projects.return_value \
            .locations.return_value \
            .operations.return_value \
            .get.return_value \
            .execute = execute_mock
        # fmt: on
        with pytest.raises(AirflowException, match="error"):
            self.hook.run_pipeline(body={}, location=TEST_LOCATION, project_id=TEST_PROJECT_ID)

class TestLifeSciencesHookWithDefaultProjectIdFromConnection(unittest.TestCase):
    def setUp(self):
        with mock.patch(
            "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.__init__",
            new=mock_base_gcp_hook_default_project_id,
        ):
            self.hook = LifeSciencesHook(gcp_conn_id="test")

    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook._authorize")
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.build")
    def test_life_science_client_creation(self, mock_build, mock_authorize):
        result = self.hook.get_conn()
        mock_build.assert_called_once_with(
            "lifesciences", "v2beta", http=mock_authorize.return_value, cache_discovery=False
        )
        assert mock_build.return_value == result
        assert self.hook._conn == result

    @mock.patch(
        "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.project_id",
        new_callable=PropertyMock,
        return_value=GCP_PROJECT_ID_HOOK_UNIT_TEST,
    )
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook.get_conn")
    def test_run_pipeline_immediately_complete(self, get_conn_mock, mock_project_id):
        service_mock = get_conn_mock.return_value

        # fmt: off
        service_mock.projects.return_value \
            .locations.return_value \
            .pipelines.return_value \
            .run.return_value \
            .execute.return_value = TEST_OPERATION

        service_mock.projects.return_value \
            .locations.return_value \
            .operations.return_value \
            .get.return_value \
            .execute.return_value = TEST_DONE_OPERATION

        result = self.hook.run_pipeline(body={}, location=TEST_LOCATION, project_id=TEST_PROJECT_ID)
        parent = self.hook._location_path(project_id=TEST_PROJECT_ID, location=TEST_LOCATION)
        service_mock.projects.return_value.locations.return_value \
            .pipelines.return_value.run \
            .assert_called_once_with(body={},
                                     parent=parent)
        # fmt: on
        assert result == TEST_OPERATION

    @mock.patch(
        "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.project_id",
        new_callable=PropertyMock,
        return_value=GCP_PROJECT_ID_HOOK_UNIT_TEST,
    )
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook.get_conn")
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.time.sleep")
    def test_waiting_operation(self, _, get_conn_mock, mock_project_id):
        service_mock = get_conn_mock.return_value

        # fmt: off
        service_mock.projects.return_value \
            .locations.return_value \
            .pipelines.return_value \
            .run.return_value \
            .execute.return_value = TEST_OPERATION

        execute_mock = mock.Mock(**{"side_effect": [TEST_WAITING_OPERATION, TEST_DONE_OPERATION]})
        service_mock.projects.return_value \
            .locations.return_value \
            .operations.return_value \
            .get.return_value \
            .execute = execute_mock
        # fmt: on

        result = self.hook.run_pipeline(body={}, location=TEST_LOCATION)
        assert result == TEST_OPERATION

    @mock.patch(
        "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.project_id",
        new_callable=PropertyMock,
        return_value=GCP_PROJECT_ID_HOOK_UNIT_TEST,
    )
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook.get_conn")
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.time.sleep")
    def test_error_operation(self, _, get_conn_mock, mock_project_id):
        service_mock = get_conn_mock.return_value

        # fmt: off
        service_mock.projects.return_value \
            .locations.return_value \
            .pipelines.return_value \
            .run.return_value \
            .execute.return_value = TEST_OPERATION

        execute_mock = mock.Mock(**{"side_effect": [TEST_WAITING_OPERATION, TEST_ERROR_OPERATION]})
        service_mock.projects.return_value \
            .locations.return_value \
            .operations.return_value \
            .get.return_value \
            .execute = execute_mock
        # fmt: on

        with pytest.raises(AirflowException, match="error"):
            self.hook.run_pipeline(body={}, location=TEST_LOCATION)

class TestLifeSciencesHookWithoutProjectId(unittest.TestCase):
    def setUp(self):
        with mock.patch(
            "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.__init__",
            new=mock_base_gcp_hook_no_default_project_id,
        ):
            self.hook = LifeSciencesHook(gcp_conn_id="test")

    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook._authorize")
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.build")
    def test_life_science_client_creation(self, mock_build, mock_authorize):
        result = self.hook.get_conn()
        mock_build.assert_called_once_with(
            "lifesciences", "v2beta", http=mock_authorize.return_value, cache_discovery=False
        )
        assert mock_build.return_value == result
        assert self.hook._conn == result

    @mock.patch(
        "airflow.providers.google.common.hooks.base_google.GoogleBaseHook.project_id",
        new_callable=PropertyMock,
        return_value=None,
    )
    @mock.patch("airflow.providers.google.cloud.hooks.life_sciences.LifeSciencesHook.get_conn")
    def test_run_pipeline(self, get_conn_mock, mock_project_id):
        with pytest.raises(AirflowException) as ctx:
            self.hook.run_pipeline(body={}, location=TEST_LOCATION)

        assert (
            "The project id must be passed either as keyword project_id parameter or as project_id extra in "
            "Google Cloud connection definition. Both are not set!" == str(ctx.value)
        )


text:
FROM caddy:2.4.6-alpine as build

RUN apk add --no-cache upx ca-certificates \
    && upx --ultra-brute /usr/bin/caddy \
    && caddy version

FROM scratch

COPY --from=build /etc/caddy/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /usr/share/caddy/index.html /usr/share/caddy/index.html
COPY --from=build /usr/bin/caddy /usr/bin/caddy
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/nsswitch.conf /etc/nsswitch.conf

ENV XDG_CONFIG_HOME=/config
ENV XDG_DATA_HOME=/data
ENV HOME=/

VOLUME /config
VOLUME /data

LABEL org.opencontainers.image.version=v2.4.6
LABEL org.opencontainers.image.title="Caddy (productionwentdown build)"
LABEL org.opencontainers.image.description="a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go"
LABEL org.opencontainers.image.url=https://productionwentdown.makerforce.io
LABEL org.opencontainers.image.documentation=https://caddyserver.com/docs
LABEL org.opencontainers.image.vendor="productionwentdown"
LABEL org.opencontainers.image.licenses=Apache-2.0
LABEL org.opencontainers.image.source="https://github.com/productionwentdown/caddy"

EXPOSE 80
EXPOSE 443
EXPOSE 2019

WORKDIR /srv

CMD ["/usr/bin/caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]


text:
#include <linux/kernel.h>
#include <linux/cpuidle.h>
#include <linux/pm_qos_params.h>
#include <linux/moduleparam.h>
#include <linux/jiffies.h>

#include <asm/io.h>
#include <asm/uaccess.h>

#define PROMOTION_COUNT 4
#define DEMOTION_COUNT 1

struct ladder_device_state {
	struct {
		u32 promotion_count;
		u32 demotion_count;
		u32 promotion_time;
		u32 demotion_time;
	} threshold;
	struct {
		int promotion_count;
		int demotion_count;
	} stats;
};

struct ladder_device {
	struct ladder_device_state states[CPUIDLE_STATE_MAX];
	int last_state_idx;
};

static DEFINE_PER_CPU(struct ladder_device, ladder_devices);

/**
 * ladder_do_selection - prepares private data for a state change
 * @ldev: the ladder device
 * @old_idx: the current state index
 * @new_idx: the new target state index
 */
static inline void ladder_do_selection(struct ladder_device *ldev,
				       int old_idx, int new_idx)
{
	ldev->states[old_idx].stats.promotion_count = 0;
	ldev->states[old_idx].stats.demotion_count = 0;
	ldev->last_state_idx = new_idx;
}

/**
 * ladder_select_state - selects the next state to enter
 * @dev: the CPU
 */
static int ladder_select_state(struct cpuidle_device *dev)
{
	struct ladder_device *ldev = &__get_cpu_var(ladder_devices);
	struct ladder_device_state *last_state;
	int last_residency, last_idx = ldev->last_state_idx;
	int latency_req = pm_qos_requirement(PM_QOS_CPU_DMA_LATENCY);

	if (unlikely(!ldev))
		return 0;

	/* Special case when user has set very strict latency requirement */
	if (unlikely(latency_req == 0)) {
		ladder_do_selection(ldev, last_idx, 0);
		return 0;
	}

	last_state = &ldev->states[last_idx];

	if (dev->states[last_idx].flags & CPUIDLE_FLAG_TIME_VALID)
		last_residency = cpuidle_get_last_residency(dev) - dev->states[last_idx].exit_latency;
	else
		last_residency = last_state->threshold.promotion_time + 1;

	/* consider promotion */
	if (last_idx < dev->state_count - 1 &&
	    last_residency > last_state->threshold.promotion_time &&
	    dev->states[last_idx + 1].exit_latency <= latency_req) {
		last_state->stats.promotion_count++;
		last_state->stats.demotion_count = 0;
		if (last_state->stats.promotion_count >= last_state->threshold.promotion_count) {
			ladder_do_selection(ldev, last_idx, last_idx + 1);
			return last_idx + 1;
		}
	}

	/* consider demotion */
	if (last_idx > CPUIDLE_DRIVER_STATE_START &&
	    dev->states[last_idx].exit_latency > latency_req) {
		int i;

		for (i = last_idx - 1; i > CPUIDLE_DRIVER_STATE_START; i--) {
			if (dev->states[i].exit_latency <= latency_req)
				break;
		}
		ladder_do_selection(ldev, last_idx, i);
		return i;
	}

	if (last_idx > CPUIDLE_DRIVER_STATE_START &&
	    last_residency < last_state->threshold.demotion_time) {
		last_state->stats.demotion_count++;
		last_state->stats.promotion_count = 0;
		if (last_state->stats.demotion_count >= last_state->threshold.demotion_count) {
			ladder_do_selection(ldev, last_idx, last_idx - 1);
			return last_idx - 1;
		}
	}

	/* otherwise remain at the current state */
	return last_idx;
}

/**
 * ladder_enable_device - setup for the governor
 * @dev: the CPU
 */
static int ladder_enable_device(struct cpuidle_device *dev)
{
	int i;
	struct ladder_device *ldev = &per_cpu(ladder_devices, dev->cpu);
	struct ladder_device_state *lstate;
	struct cpuidle_state *state;

	ldev->last_state_idx = CPUIDLE_DRIVER_STATE_START;

	for (i = 0; i < dev->state_count; i++) {
		state = &dev->states[i];
		lstate = &ldev->states[i];

		lstate->stats.promotion_count = 0;
		lstate->stats.demotion_count = 0;

		lstate->threshold.promotion_count = PROMOTION_COUNT;
		lstate->threshold.demotion_count = DEMOTION_COUNT;

		if (i < dev->state_count - 1)
			lstate->threshold.promotion_time = state->exit_latency;
		if (i > 0)
			lstate->threshold.demotion_time = state->exit_latency;
	}

	return 0;
}

static struct cpuidle_governor ladder_governor = {
	.name =		"ladder",
	.rating =	10,
	.enable =	ladder_enable_device,
	.select =	ladder_select_state,
	.owner =	THIS_MODULE,
};

/**
 * init_ladder - initializes the governor
 */
static int __init init_ladder(void)
{
	return cpuidle_register_governor(&ladder_governor);
}

/**
 * exit_ladder - exits the governor
 */
static void __exit exit_ladder(void)
{
	cpuidle_unregister_governor(&ladder_governor);
}

MODULE_LICENSE("GPL");
module_init(init_ladder);
module_exit(exit_ladder);


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>DigFont - Reverse Font Search Engine</title>
  <meta name="description" content="DigFont - Reverse Font Search Engine. Made with love by Sanket and Rohit.">
  <meta name="viewport" content="width=device-width">

  <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="/static/css/normalize.css">
  <link rel="stylesheet" href="/static/css/boilerplate_main.css">
  <link rel="stylesheet" href="/static/css/bootstrap-grid.css">
  <link rel="stylesheet" href="/static/css/page.css">

  {% block content %}
  {% endblock %}

  {% block footer %}

  {% endblock %}


text:
// Author: Geoff Yoerger
// Date: Apr 17, 2014
// Assignment: Activity/Program ACT61.cpp
// Purpose: Encode a string

#include "stdio.h"
#include <iostream>
#include "string.h"
using namespace std;

char *encode(char *string) {
	int len = strlen(string);
	char flipAround = string[(int) (len / 2)];
	for(int i = 0; i < len; i++) {
		string[i] = flipAround - (string[i] - flipAround);
		//Make sure its between 32 and 127
		while(string[i] < 32) {
			string[i] += 32;
		}
		while(string[i] >= 127) {
			string[i] -= 32;
		}
	}
	return string;
}

/**
 *
 * @return If the program ended succesfully
 */
int main() {
	char encodeMe[] = "";
	cout << "Please enter a String: ";
	cin >> encodeMe;
	cout << "Your encoded string is \"" << encode(encodeMe) << "\".\n";
	return 0;
}