text:
module.exports = function($scope, $http, $q, $log, imageService){
	$scope.photoRows = []
	$scope.times = 0
	$scope.isLoading = false

	$scope.loadImages = function(filter) {

		$scope.isLoading = true

		filter = (typeof filter == "string") ? filter : 'nature'

		// console.log('we gonna load images of:', filter)

		var img = new Image()
		var promise = imageService.getImages(filter)

		promise.then(
			function(res) {
				if(res.data.images.length > 0 ) {
					this.rowIdx = 0
					res.data.images.forEach(function(image, idx){
						if(idx % 3 === 0) {
							if(idx>0) this.rowIdx++
							$scope.photoRows[this.rowIdx] = []
							$scope.photoRows[this.rowIdx].images = []
						}

						// console.log('rowIdx ', this.rowIdx, 'photoRows ', $scope.photoRows[rowIdx])
						$scope.photoRows[this.rowIdx].images.push(image)
					})
					// console.log('now its gone', $scope.photoRows)

					$scope.isLoading = false
				} else {
					// !MISSING: implementar mensagem de erro na view para o usuário!

					console.log("Não foram encontradas imagens relacionadas ao termo pesquisado")
				}
			},
			function(err) {
				// !MISSING: implementar mensagem de erro na view para o usuário!

				$log.error('Falha ao carregar imagens: ', err)
			},
			function(progress) {
				$log.error('Estamos tentando: ', progress)
			}
		)

	}

	// $scope.assignImages = function(images) {
	// 	$scope.images.push(images)
	// }

	// $scope.promise = $scope.loadImages()

	// $scope.promise.then(
	// 	function(answer) {
	// 		console.log("Loaded! ", answer);
	// 	},
	// 	function(error) {
	// 		console.log("Something went wrong :/ ", error);
	// 	},
	// 	function(update) {
	// 		console.log("A new update: ", update);
	// 	})

}


text:
layout: page_v2
title: Setup Line items For Google Ad Manager
head_title: Step by step guide to Google Ad Manager Setup
description: Setting up GAM for Prebid.js
#note the sidebar type needs to reflect the section this file is displayed in. See _data/sidenav.yml for the side nav categories.
sidebarType: 2
---

{% include /adops/adops-gam-setup.html %}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class xmlns="http://xml.phpdox.net/src" full="Yaf_Request_Simple" namespace="" name="Yaf_Request_Simple">
  <extends name="Yaf_Request_Abstract" full="Yaf_Request_Abstract"/>
  <constant name="SCHEME_HTTP" value="http">
    <docblock>
      <var type="string"/>
    </docblock>
  </constant>
  <constant name="SCHEME_HTTPS" value="https">
    <docblock>
      <var type="string"/>
    </docblock>
  </constant>
  <method name="__clone" abstract="false" static="false" final="false">
    <docblock>
      <description compact="The __clone purpose"/>
      <return type="void"/>
    </docblock>
  </method>
  <constructor name="__construct" abstract="false" static="false" final="false">
    <docblock>
      <description compact="The __construct purpose"/>
      <return type="void"/>
    </docblock>
  </constructor>
  <method name="get" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="The get purpose"/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getCookie" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="The getCookie purpose"/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getFiles" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="The getFiles purpose"/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getPost" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="The getPost purpose"/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getQuery" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="The getQuery purpose"/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getRequest" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="The getRequest purpose"/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isXmlHttpRequest" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact="The isXmlHttpRequest purpose"/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getActionName" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getBaseUri" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getControllerName" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getEnv" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="name" optional="false" byreference="false" type="string"/>
    <parameter name="default" optional="true" byreference="false" type="string"/>
  </method>
  <method name="getException" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getLanguage" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getMethod" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getModuleName" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getParam" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="name" optional="false" byreference="false" type="string"/>
    <parameter name="default" optional="true" byreference="false" type="string"/>
  </method>
  <method name="getParams" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getRequestUri" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="getServer" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="name" optional="false" byreference="false" type="string"/>
    <parameter name="default" optional="true" byreference="false" type="string"/>
  </method>
  <method name="isCli" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isDispatched" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isGet" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isHead" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isOptions" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isPost" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isPut" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isRouted" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="isXmlHttpRequest" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="setActionName" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="action" optional="false" byreference="false" type="string"/>
  </method>
  <method name="setBaseUri" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="bool"/>
    </docblock>
    <parameter name="uir" optional="false" byreference="false" type="string"/>
  </method>
  <method name="setControllerName" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="controller" optional="false" byreference="false" type="string"/>
  </method>
  <method name="setDispatched" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
  </method>
  <method name="setModuleName" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="module" optional="false" byreference="false" type="string"/>
  </method>
  <method name="setParam" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="name" optional="false" byreference="false" type="string"/>
    <parameter name="value" optional="true" byreference="false" type="string"/>
  </method>
  <method name="setRequestUri" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="uir" optional="false" byreference="false" type="string"/>
  </method>
  <method name="setRouted" abstract="false" static="false" visibility="public" final="false">
    <docblock>
      <description compact=""/>
      <return type="void"/>
    </docblock>
    <parameter name="flag" optional="true" byreference="false" type="string"/>
  </method>
</class>


text:
from random import choice
from time import sleep
from datetime import datetime, date
from twilio import TwilioRestException
from twilio.rest import TwilioRestClient
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy import or_, cast, Date
from config import *
from database import db_session
from database.models import Reminder

try:
    client = TwilioRestClient(TWILIO_ACCOUNT, TWILIO_SECRET)
except TwilioRestException:
    exit(0)

hour = datetime.now().hour
today = date.today()

try:
    reminders = db_session.query(Reminder).filter(Reminder.time == hour, or_(Reminder.last_called == None, cast(Reminder.last_called, Date) != today)).all()
except NoResultFound:
    exit(0)

for reminder in reminders:
    try:
        client.calls.create(to = reminder.phone_number,
                            from_ = choice(TWILIO_NUMBERS),
                            url = "https://beta.xn--berwachungspaket-izb.at/act/gather-reminder-call/",
                            if_machine = "Hangup")
        reminder.last_called = datetime.now()
        reminder.times_called = reminder.times_called + 1
    except TwilioRestException:
        pass

    sleep(2)

db_session.commit()
db_session.remove()


text:
import React from 'react';
import ReactDOM from 'react-dom';

import JqxDataTable from '../../../jqwidgets-react/react_jqxdatatable.js';

class App extends React.Component {
    render() {
        let data = generatedata(200);

        let source =
            {
                localData: data,
                dataType: 'array',
                datafields:
                [
                    { name: 'firstname', type: 'string' },
                    { name: 'lastname', type: 'string' },
                    { name: 'productname', type: 'string' },
                    { name: 'quantity', type: 'number' },
                    { name: 'price', type: 'number' }
                ],
                updateRow: function (rowid, rowdata, commit) {
                    // synchronize with the server - send update command
                    commit(true);
                }
            };

        let dataAdapter = new $.jqx.dataAdapter(source);

        let columns =
            [
                { text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90 },
                { text: 'Last Name', datafield: 'lastname', columntype: 'textbox', width: 90 },
                { text: 'Product', datafield: 'productname', width: 170 },
                { text: 'Quantity', datafield: 'quantity', width: 100, align: 'right', cellsAlign: 'right', cellsFormat: 'n2' },
                {
                    text: 'Price', datafield: 'price', cellsAlign: 'right', align: 'right', cellsFormat: 'c2',
                    aggregates:
                    [{
                        'Total':
                        (aggregatedValue, currentValue, column, record) => {
                            let total = currentValue * parseInt(record['quantity']);
                            return aggregatedValue + total;
                        }
                    }],
                    aggregatesRenderer: (aggregates, column, element) => {
                        let renderString = '
';
                        renderString += 'Total: ' + aggregates.Total + '
';
                        return renderString;
                    }
                }
            ];

        return (
            <JqxDataTable
                width={850} source={dataAdapter} altRows={true}
                pageable={true} showAggregates={true} columns={columns}
                pagerButtonsCount={10} aggregatesHeight={25}
            />
        )
    }
}

ReactDOM.render(<App />, document.getElementById('app'));


text:
require 'active_support/concern'

module ScopedAttrAccessible
  autoload :Sanitizer,        'scoped_attr_accessible/sanitizer'
  autoload :ActiveModelMixin, 'scoped_attr_accessible/active_model_mixin'

  # Mixes the am mixin into ActiveModel's mass assignment helpers.
  def self.mixin!
    require 'active_model/mass_assignment_security'
    ActiveModel::MassAssignmentSecurity.module_eval do
      extend ScopedAttrAccessible::ActiveModelMixin::IncludedHook
    end
  end

  GLOBAL_SCOPE_KEY = :_scoped_attr_accessible_sanitizer_scope

  def self.current_sanitizer_scope
    Thread.current[GLOBAL_SCOPE_KEY]
  end

  def self.current_sanitizer_scope=(value)
    Thread.current[GLOBAL_SCOPE_KEY] = value
  end

  def self.with_sanitizer_scope(scope)
    old_sanitizer_scope = self.current_sanitizer_scope
    self.current_sanitizer_scope = scope
    yield if block_given?
  ensure
    self.current_sanitizer_scope = old_sanitizer_scope
  end

  if defined?(Rails::Railtie)
    class Railtie < Rails::Railtie
      initializer "scoped_attr_accessible.setup" do
        ScopedAttrAccessible.mixin!
      end
    end
  end

end


text:
@interface VisualEffectViewController : UIViewController

@end


text:
<?php

require_once(dirname(__FILE__) . '/../parse_dataload.php');

class ParseTest extends PHPUnit_Framework_Testcase {
  public function testParseDataload() {
    $expected = json_decode(
        file_get_contents(dirname(__FILE__) . '/dataload.json'), true);
    $actual = ParseDataload::Parse(
        file_get_contents(dirname(__FILE__) . '/dataload.html'));
    $this->assertEquals($expected, $actual);
  }
}


text:
package edu.usfca.xj.appkit.document;

import edu.usfca.xj.appkit.app.XJApplication;
import edu.usfca.xj.appkit.frame.XJWindow;
import edu.usfca.xj.appkit.utils.XJAlert;
import edu.usfca.xj.appkit.utils.XJFileChooser;
import edu.usfca.xj.appkit.utils.XJLocalizable;
import edu.usfca.xj.foundation.XJObject;
import edu.usfca.xj.foundation.XJUtils;

import java.awt.*;
import java.io.*;

public class XJDocument extends XJObject {

    private XJData documentData = null;
    private XJWindow documentWindow = null;
    private String documentTitle = XJLocalizable.getXJString("DocUntitled");
    private String documentPath = null;

    private String documentFileExt = null;
    private String documentFileExtDescription = null;

    private boolean dirty = false;
    private boolean firstDocument = false;

    private static int absoluteCounter = 0;

    public XJDocument() {
        XJApplication.shared().addDocument(this);
        this.firstDocument = absoluteCounter == 0;
        absoluteCounter++;
    }

    // *** Public methods

    public boolean isFirstDocument() {
        return firstDocument;
    }

    public boolean isDirty() {
        return dirty;
    }

    public void changeDone() {
        if(dirty)
            return;

        dirty = true;
        if(documentWindow != null)
            documentWindow.setDirty();
    }

    public void changeReset() {
        dirty = false;
        if(documentWindow != null)
            documentWindow.resetDirty();
    }

    public void setTitle(String title) {
        documentTitle = title;
        if(documentWindow != null)
            documentWindow.setTitle(documentTitle);
    }

    public void setWindow(XJWindow window) {
        documentWindow = window;
        if(documentWindow != null) {
            documentWindow.setDocument(this);
            documentWindow.setTitle(documentTitle);
        }
    }

    public XJWindow getWindow() {
        return documentWindow;
    }

    public Component getJavaComponent() {
        return getWindow() == null ? null : getWindow().getJavaContainer();
    }

    public void showWindow() {
        if(documentWindow != null)
            documentWindow.show();
    }

    public void setDocumentData(XJData data) {
        this.documentData = data;
        if(documentData != null) {
            documentData.addObserver(this);
        }
    }

    public XJData getDocumentData() {
        return documentData;
    }

    public String getDocumentPath() {
        return documentPath;
    }

    public String getDocumentName() {
        return XJUtils.getLastPathComponent(documentPath);
    }

    public void setDocumentFileType(String ext, String description) {
        documentFileExt = ext;
        documentFileExtDescription = description;
    }

    public void observeValueForKey(Object sender, String key, Object object) {
        changeDone();
    }

    // *** Methods

    private boolean performLoad_() {
        if(!dirty)
            return XJApplication.YES;

        int r = XJAlert.displayAlertYESNOCANCEL(documentWindow.getJavaContainer(),
                                                XJLocalizable.getXJString("DocLoad"),
                                                XJLocalizable.getStringFormat("DocSaveChanges",
                                                documentTitle));
        switch(r) {
            case XJAlert.YES:
                return performSave(false);

            case XJAlert.NO:
                return XJApplication.YES;

            case XJAlert.CANCEL:
                return XJApplication.NO;
        }

        return XJApplication.YES;
    }

    public boolean performLoad(String file) {
        documentPath = file;
        try {
            readDocument(documentPath);
        } catch(Exception e) {
            XJAlert.display(documentWindow.getJavaContainer(), XJLocalizable.getXJString("DocError"), XJLocalizable.getXJString("DocLoadError")+" "+e.toString());
            return XJApplication.NO;
        }

        setTitle(documentPath);
        changeReset();

        return XJApplication.YES;
    }

    public boolean performLoad() {
        if(!performLoad_())
            return XJApplication.NO;

        if(!XJFileChooser.shared().displayOpenDialog(getJavaComponent(), documentFileExt, documentFileExtDescription, false))
            return XJApplication.NO;

        String path = XJFileChooser.shared().getSelectedFilePath();
        XJDocument document = XJApplication.shared().getDocumentForPath(path);
        if(document != null && document != this) {
            XJAlert.display(documentWindow.getJavaContainer(), XJLocalizable.getXJString("DocError"), XJLocalizable.getXJString("DocLoadExists"));
            return XJApplication.NO;
        } else {
            XJApplication.shared().addRecentFile(path);
            return performLoad(XJFileChooser.shared().getSelectedFilePath());
        }
    }

    public boolean reload() {
        try {
            readDocument(documentPath);
        } catch(Exception e) {
            XJAlert.display(documentWindow.getJavaContainer(), XJLocalizable.getXJString("DocError"), XJLocalizable.getXJString("DocLoadError")+" "+e.toString());
            return XJApplication.NO;
        }
        return XJApplication.YES;
    }

    public boolean performSave(boolean saveAs) {
        if(documentPath == null || saveAs) {
            if(!XJFileChooser.shared().displaySaveDialog(getJavaComponent(), documentFileExt, documentFileExtDescription, true))
                return XJApplication.NO;

            documentPath = XJFileChooser.shared().getSelectedFilePath();
            XJApplication.shared().addRecentFile(documentPath);
        }

        try {
            writeDocument(documentPath);
        } catch(Exception e) {
            e.printStackTrace();
            XJAlert.display(documentWindow.getJavaContainer(), XJLocalizable.getXJString("DocError"), XJLocalizable.getXJString("DocSaveError")+" "+e.toString());
            return XJApplication.NO;
        }

        setTitle(documentPath);
        changeReset();
        return XJApplication.YES;
    }

    private boolean performClose_() {
        if(!dirty || !XJApplication.shared().supportsPersistence())
            return XJApplication.YES;

        Container parent = null;
        if(documentWindow != null) {
            parent = documentWindow.getJavaContainer();
            documentWindow.bringToFront();
        }

        int r = XJAlert.displayAlertYESNOCANCEL(parent, XJLocalizable.getXJString("DocCloseTitle"), XJLocalizable.getStringFormat("DocCloseMessage", documentTitle));
        switch(r) {
            case XJAlert.YES:
                return performSave(false);

            case XJAlert.NO:
                return XJApplication.YES;

            case XJAlert.CANCEL:
                return XJApplication.NO;
        }

        return XJApplication.YES;
    }

    public boolean performClose(boolean force) {
        boolean r = force?XJApplication.YES:performClose_();
        if(r == XJApplication.YES) {
            XJApplication.shared().removeDocument(this);
            if(documentWindow != null)
                documentWindow.close();
        }
        return r;
    }

    public boolean performClose() {
        return performClose(false);
    }

    private void writeDocument(String file) throws IOException {
        documentWillWriteData();
        documentData.setFile(file);
        switch(documentData.dataType()) {
            case XJData.DATA_INPUTSTREAM: {
                OutputStream os = new FileOutputStream(file);
                documentData.writeData(os);
                os.close();
                break;
            }

            case XJData.DATA_OBJECTINPUTSTREAM: {
                OutputStream os = new FileOutputStream(file);
                documentData.writeData(new ObjectOutputStream(os));
                os.close();
                break;
            }

            case XJData.DATA_PLAINTEXT:
                documentData.writeData();
                break;

            case XJData.DATA_XML:
                documentData.writeData();
                break;
        }
        if(documentWindow != null)
            documentWindow.synchronizeLastModifiedDate();
    }

    private void readDocument(String file) throws IOException, ClassNotFoundException {
        documentWillReadData();
        documentData.setFile(file);
        switch(documentData.dataType()) {
            case XJData.DATA_INPUTSTREAM: {
                InputStream is = new FileInputStream(file);
                documentData.readData(is);
                is.close();
                break;
            }

            case XJData.DATA_OBJECTINPUTSTREAM: {
                InputStream is = new FileInputStream(file);
                documentData.readData(new ObjectInputStream(is));
                is.close();
                break;
            }

            case XJData.DATA_PLAINTEXT:
                documentData.readData();
                break;

            case XJData.DATA_XML:
                documentData.readData();
                break;
        }
        documentDidReadData();
    }

    // Subclasses only

    public void documentWillWriteData() {

    }

    public void documentWillReadData() {

    }

    public void documentDidReadData() {

    }

}


text:
import { moduleFor, test } from 'ember-qunit';

moduleFor('route:datasets/name/subpage', 'Unit | Route | datasets/name/subpage', {
  // Specify the other units that are required for this test.
  // needs: ['controller:foo']
});

test('it exists', function(assert) {
  let route = this.subject();
  assert.ok(route);
});


text:
<?php

namespace Bootstrap\View\Helper;

use Cake\View\Helper;

class BootstrapModalHelper extends Helper {

    use BootstrapTrait ;

    public $helpers = ['Html'];

    public $current = NULL ;

    /**
     *
     * Create a Twitter Bootstrap like modal.
     *
     * @param array|string $title If array, works as $options, otherwize used as the modal title.
     * @param array $options Options for the main div of the modal.
     *
     * Extra options (useless if $title not specified) :
     *     - close: Add close buttons to header (default true)
     *     - no-body: Do not open the body after the create (default false)
    **/
    public function create($title = null, $options = array()) {

        if (is_array($title)) {
            $options = $title ;
        }
        $close = $this->_extractOption('close', $options, true);
        unset ($options['close']) ;
        $nobody = $this->_extractOption('no-body', $options, false);
        unset ($options['no-body']) ;
        $options['tabindex'] = $this->_extractOption('tabindex', $options, -1);
        $options['role'] = $this->_extractOption('role', $options, 'dialog');
        $options['aria-hidden'] = $this->_extractOption('aria-hidden', $options, 'true');
        if (isset($options['id'])) {
            $this->currentId = $options['id'] ;
            $options['aria-labelledby'] = $this->currentId.'Label' ;
        }
        $options['size'] = $this->_extractOption('size', $options, '');
	    switch($options['size']) {
		    case 'lg':
		    case 'large':
		    case 'modal-lg':
			    $size = 'modal-lg';
			    break;
		    case 'sm':
		    case 'small':
		    case 'modal-sm':
			    $size = 'modal-sm';
			    break;
		    default:
			    $size = '';
			    break;
	    }
	    unset($options['size']);

	    $res = $this->Html->div('modal fade '.$this->_extractOption('class', $options, ''), NULL, $options).$this->Html->div('modal-dialog '.$size).$this->Html->div('modal-content');
        if (is_string($title) && $title) {
            $res .= $this->_createHeader($title, array('close' => $close)) ;
            if (!$nobody) {
                $res .= $this->_startPart('body');
            }
        }
        return $res ;
	}

    /**
     *
     * End a modal. If $buttons is not null, the ModalHelper::footer functions is called with $buttons and $options arguments.
     *
     * @param array|null $buttons
     * @param array $options
     *
    **/
    public function end ($buttons = NULL, $options = array()) {
        $res = '' ;
        if ($this->current != NULL) {
            $this->current = NULL ;
            $res .= $this->_endPart();
        }
        if ($buttons !== NULL) {
            $res .= $this->footer($buttons, $options) ;
        }
        $res .= '

' ;
		return $res ;
    }

    protected function _cleanCurrent () {
        if ($this->current) {
            $this->current = NULL ;
            return $this->_endPart();
        }
        return '' ;
    }

    protected function _createHeader ($title, $options = array()) {
        $close = $this->_extractOption('close', $options, true);
        unset($options['close']) ;
        if ($close) {
            $button = '<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' ;
        }
        else {
            $button = '' ;
        }
        return $this->_cleanCurrent().$this->Html->div('modal-header '.$this->_extractOption('class', $options, ''),
            $button.$this->Html->tag('h4', $title, array('class' => 'modal-title', 'id' => $this->currentId ? $this->currentId.'Label' : false)),
            $options
        ) ;
    }

    protected function _createBody ($text, $options = array()) {
        return $this->_cleanCurrent().$this->Html->div('modal-body '.$this->_extractOption('class', $options, ''), $text, $options) ;
    }

    protected function _createFooter ($buttons = NULL, $options = array()) {
        if ($buttons == NULL) {
            $close = $this->_extractOption('close', $options, true);
            unset($options['close']) ;
            if ($close) {
                $buttons = '<button type="button" class="btn btn-default" data-dismiss="modal">'.__('Close').'</button>' ;
            }
            else {
                $buttons = '' ;
            }
        }
        return $this->_cleanCurrent().$this->Html->div('modal-footer '.$this->_extractOption('class', $options, ''), $buttons, $options) ;
    }

    protected function _startPart ($part, $options = array()) {
        $res = '' ;
        if ($this->current != NULL) {
            $res = $this->_endPart () ;
        }
        $this->current = $part ;
        return $res.$this->Html->div('modal-'.$part.' '.$this->_extractOption('class', $options, ''), NULL, $options) ;
    }

    protected function _endPart () {
        return '
' ;
    }

    /**
     *
     * Create / Start the header. If $info is specified as a string, create and return the whole header, otherwize only open the header.
     *
     * @param array|string $info If string, use as the modal title, otherwize works as $options.
     * @param array $options Options for the header div.
     *
     * Special option (if $info is string):
     *     - close: Add the 'close' button in the header (default true).
     *
    **/
    public function header ($info = NULL, $options = array()) {
        if (is_string($info)) {
            return $this->_createHeader($info, $options) ;
        }
        return $this->_startPart('header', is_array($info) ? $info : $options) ;
    }

    /**
     *
     * Create / Start the body. If $info is not null, it is used as the body content, otherwize start the body div.
     *
     * @param array|string $info If string, use as the body content, otherwize works as $options.
     * @param array $options Options for the footer div.
     *
     *
    **/
    public function body ($info = NULL, $options = array()) {
        if (is_string($info)) {
            if ($this->current != NULL) {
                $this->_endPart() ;
            }
            return $this->_createBody($info, $options) ;
        }
        return $this->_startPart('body', is_array($info) ? $info : $options) ;
    }

    protected function _isAssociativeArray ($array) {
        return array_keys($array) !== range(0, count($array) - 1);
    }

    /**
     *
     * Create / Start the footer. If $buttons is specified as an associative arrays or as null, start the footer, otherwize create the footer with the specified buttons.
     *
     * @param array|string $buttons If string, use as the footer content, if list, concatenate values in the list as content (use for buttons purpose), otherwize works as $options.
     * @param array $options Options for the footer div.
     *
     * Special option (if $buttons is NOT NULL but empty):
     *     - close: Add the 'close' button to the footer (default true).
     *
    **/
    public function footer ($buttons = [], $options = []) {
        if ($buttons === NULL || (!empty($buttons) && $this->_isAssociativeArray($buttons))) {
            return $this->_startPart('footer', $buttons === NULL ? $options : $buttons) ;
        }
        if (empty($buttons)) {
            return $this->_createFooter(NULL, $options) ;
        }
        return $this->_createFooter(is_string($buttons) ? $buttons : implode('', $buttons), $options) ;
    }

}

?>


text:
/*
 * pbkdDigest.cpp - SHA1/MD5 digest object for HMAC and PBE routines
 */

#include "pbkdDigest.h"
#include <Security/cssmerr.h>
#include <string.h>

/* the casts are necessary to cover the polymorphous context types */
DigestOps Md2Ops = {
	(DigestInitFcn)CC_MD2_Init,
	(DigestUpdateFcn)CC_MD2_Update,
	(DigestFinalFcn)CC_MD2_Final
};
DigestOps Md5Ops = {
	(DigestInitFcn)CC_MD5_Init,
	(DigestUpdateFcn)CC_MD5_Update,
	(DigestFinalFcn)CC_MD5_Final
};
DigestOps Sha1Ops = {
	(DigestInitFcn)CC_SHA1_Init,
	(DigestUpdateFcn)CC_SHA1_Update,
	(DigestFinalFcn)CC_SHA1_Final
};

/* Ops on a DigestCtx - all return zero on error, like the underlying digests do */
int DigestCtxInit(
	DigestCtx 	*ctx,
	CSSM_ALGORITHMS hashAlg)
{
	switch(hashAlg) {
		case CSSM_ALGID_SHA1:
			ctx->ops = &Sha1Ops;
			break;
		case CSSM_ALGID_MD5:
			ctx->ops = &Md5Ops;
			break;
		case CSSM_ALGID_MD2:
			ctx->ops = &Md2Ops;
			break;
		default:
			return 0;
	}
	ctx->hashAlg = hashAlg;
	return ctx->ops->init(&ctx->dig);
}

void DigestCtxFree(
	DigestCtx 	*ctx)
{
	memset(ctx, 0, sizeof(DigestCtx));
}

int DigestCtxUpdate(
	DigestCtx 	*ctx,
	const void *textPtr,
	uint32 textLen)
{
	return ctx->ops->update(&ctx->dig, textPtr, textLen);
}

int DigestCtxFinal(
	DigestCtx 	*ctx,
	void 		*digest)
{
	return ctx->ops->final(digest, &ctx->dig);
}


text:
#import "tuneup/tuneup.js"
#import "tuneup/assertions.js"
#import "LSUIATesthelpers.js"

/*
	The current set of test cases work for the iPhone version of the app.
	All tests have the same basic structure:
		- Confirm the current state (view) from where test is to be executed
		- Perform test
		- Confirm the test results by checking the new state (view) post test after test is executed
		- Capture screenshot
		In some cases, steps 2 and 3 may be merged into a single function if it makes logical sense
*/

// -- Generic alert handler
UIATarget.onAlert = function onAlert(alert){
	UIALogger.logMessage("alert handler invoked"+ alert.logElementTree());

	var alertTitle= alert.name();
	var alertMessage = alert.staticTexts()[1].name();

	// For every alert message that we want to handle, return true
	if ( alertTitle == "Login Error")
	{
		UIALogger.logMessage("custom handler invoked");
		return true;
	}
	// Pass the rest to default handler
	return false;

}

// -- Test to verify if login fails with an invalid set of credentials
test("TestUnsuccessfulLogin",function(target,app){

	// Set fake credentials
	lsUITester.setLogin("wronguser");
	lsUITester.setPassword("wongpassword");

	// verify we are on  login screen
 	verifyLoginScreenLoaded(target,app);

	// Perform login operation
	accountLogin (target,app);

	// verify results of the test
	// -- Wait for 5 seconds for alert to be displayed with textbox
 	UIATarget.localTarget().pushTimeout(5);

	// -- COnfirm that an error alert is displayed and login is not permitted
	var alertTitle= app.alert().name();
    var alertMessage = app.alert().staticTexts()[1].name();
    var okButton = app.alert().buttons()["OK"];

    // -- dismiss alert
    assertEquals(alertTitle,"Login Error");
    okButton.tap();
    UIATarget.localTarget().popTimeout();

	//capture a screenshot with a specified name
	UIATarget.localTarget().captureScreenWithName("TestUnsuccessfulLogin");

});

// -- Test to verify if login succeeds with a valid set of credentials
test("TestSuccessfulLogin",function(target,app){

	// Set valid credentials
	lsUITester.setLogin("admin");
	lsUITester.setPassword("admin");

	// Perform login operation
	accountLogin (target,app);

	// verify results of the test
	// -- Wait for alert to be displayed with textbox
 	verifyTaskListScreenLoaded (target,app);

	//capture a screenshot with a specified name
	UIATarget.localTarget().captureScreenWithName("TestSuccessfulLogin");

});

// -- Test to verify addition of 'N' new tasks
test("TestAddMultipleTaskFunction",function(target,app){

	for (var i = 0 ; i < 1; i++) {
     // Confirm we are on right screen
     verifyTaskListScreenLoaded(target,app);

	UIALogger.logMessage("Will add task # "+ i);

	//  task to be added
	lsUITester.setTaskDescription("This is my Task Item "+i);

	// Perform addition of task
	addNewTask (target,app);

	}
    //capture a screenshot with a specified name
	UIATarget.localTarget().captureScreenWithName("TestAddMultipleTaskFunction");

});

/*
// -- Test to verify cancellation of addition of a new task
test("TestCancelTaskFunction",function(target,app){

	// Confirm we are on right screen
	verifyAddTaskScreenLoaded(target,app);

	// Attempt addition  of task (which will subsequently be cancelled)
	cancelNewTask (target,app);

	// wait for a few seconds
	UIATarget.localTarget().delay(3);

	// verify results of the add task operation
 	verifyTaskListScreenLoaded (target,app);

	//capture a screenshot with a specified name
	UIATarget.localTarget().captureScreenWithName("TestCancelTaskFunction");

});
 */

// -- Test to verify deletion of  a task
test("TestDeleteTaskFunction",function(target,app){

     // wait for a few seconds
     UIATarget.localTarget().delay(3);

	// Confirm we are on right screen
	verifyTaskListScreenLoaded(target,app);

	lsUITester.removeTaskAtIndex(0);

	// Attempt deletion  of task
	deleteTask (target,app);

	// wait for a few seconds
	UIATarget.localTarget().delay(3);

	// verify results of the delete task operation
 	verifyTaskListScreenLoaded (target,app);

	//capture a screenshot with a specified name
	UIATarget.localTarget().captureScreenWithName("TestDeleteTaskFunction");

});

// -- Test to verify Log Out Operation
test("TestLogoutTaskFunction",function(target,app){

	// Confirm we are on right screen
	verifyTaskListScreenLoaded(target,app);

	// Attempt addition  of task
	accountLogout (target,app);

	// verify results of the verify log out operation
 	verifyLoginScreenLoaded(target,app);

	//capture a screenshot with a specified name
	UIATarget.localTarget().captureScreenWithName("TestLogoutTaskFunction");

});


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <title>My Shopping List with AngularJs</title>
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <link href="css/normalize.css" rel="stylesheet" media="screen">
    <link href="css/foundation.min.css" rel="stylesheet" media="screen">
    <link href="css/app-screen.css" rel="stylesheet" media="screen">
    <link href="css/app-print.css" rel="stylesheet" media="print">

My Shopping List

        <form id="addForm" ng-submit="insert()">

                    You need at least {{ howManyMoreCharactersNeeded() }} characters more
                    Remaining characters: {{ howManyCharactersRemaining() }}
                    {{ howManyCharactersOver() }} characters too many

                    <input
                        type="text"
                        name="item"
                        ng-model="item"
                        ng-trim="false"
                        placeholder="Item">

                    <input
                        type="text"
                        name="qty"
                        ng-model="qty"
                        ng-trim="false"
                        placeholder="Qty/Weight">

                    <select
                        name="type"
                        ng-model="type"
                        >

                        <option
                            ng-repeat="type in types"
                            value="{{ type.id }}">{{ type.name }}</option>

                        </select>

                            <button
                                type="button"
                                class="small button primary"
                                ng-click="print()"
                                > Print List</button>

                            <button
                                type="button"
                                class="small button alert"
                                ng-click="remove()"
                                > Clear Completed</button>

                        <button
                            type="submit"
                            class="small button"
                            ng-disabled="!goodToGo()"
                            > Add</button>

                        <button
                            type="submit"
                            class="small button secondary"
                            ng-click="clear()"
                            > Clear Entry</button>

                                <button
                                    type="submit"
                                    class="small button"
                                    ng-disabled="!goodToGo()"
                                    ></button>

                                <button
                                    type="submit"
                                    class="small button secondary"
                                    ng-click="clear()"
                                    ></button>

                                <button
                                    type="button"
                                    class="small button primary"
                                    ng-click="print()"
                                    ></button>

                                <button
                                    type="button"
                                    class="small button alert"
                                    ng-click="remove()"
                                    ></button>

        </form>

        <form id="items">

                        <input
                            type="checkbox"
                            name="item-{{ item.id }}"
                            id="item-{{ item.id }}"
                            ng-model="item.done"
                            ng-true-value="1"
                            ng-false-value="0"
                            ng-change="update(item)"
                            >
                        {{ item.item }}

                    {{ item.qty }}

                    {{ item.type_name }}

        </form>


text:
<?php
/**
 * Created by PhpStorm.
 *
 * Duc-Anh LE (ducanh.ke@gmail.com)
 *
 * User: ducanh-ki
 * Date: 3/3/17
 * Time: 3:32 PM
 */

namespace CreativeDelta\User\Core\Impl\Table;

use Zend\Db\Adapter\AdapterInterface;
use Zend\Db\TableGateway\TableGateway;

class UserIdentityTable
{
    const TABLE_NAME = "UserIdentity";
    const ID_NAME    = "id";

    const COLUMN_STATE         = "state";
    const COLUMN_IDENTITY      = "identity";
    const COLUMN_PRIMARY_TABLE = "primaryTable";
    const COLUMN_PRIMARY_ID    = "primaryId";

    protected $tableGateway;
    protected $dbAdapter;

    function __construct(AdapterInterface $dbAdapter)
    {
        $this->dbAdapter    = $dbAdapter;
        $this->tableGateway = new TableGateway(self::TABLE_NAME, $dbAdapter);
    }

    /**
     * @param $id
     * @return array|\ArrayObject|null
     */
    public function get($id)
    {
        return $this->tableGateway->select([self::ID_NAME => $id])->current();
    }

    /**
     * @param $identity
     * @return array|\ArrayObject|null
     */
    public function getByIdentity($identity)
    {
        $result = $this->tableGateway->select([self::COLUMN_IDENTITY => $identity])->current();
        return $result;
    }

    /**
     * @param $identity
     * @return bool
     */
    public function hasIdentity($identity)
    {
        return $this->tableGateway->select([self::COLUMN_IDENTITY => $identity])->count() > 0;
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Imaging;

namespace Catrobat.Models
{
    class CatrobatProgram
    {
        public string Name { get; set; }

        public BitmapImage Thumbnail { get; set; }

    }
}


text:
from __future__ import unicode_literals
import six
import boto
import sure  # noqa
from freezegun import freeze_time
from boto.exception import JSONResponseError
from moto import mock_dynamodb2
from tests.helpers import requires_boto_gte, py3_requires_boto_gte
try:
    from boto.dynamodb2.fields import HashKey
    from boto.dynamodb2.table import Table
    from boto.dynamodb2.table import Item
except ImportError:
    pass

def create_table():
    table = Table.create('messages', schema=[
        HashKey('forum_name')
    ], throughput={
        'read': 10,
        'write': 10,
    })
    return table

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
@freeze_time("2012-01-14")
def test_create_table():
    create_table()
    expected = {
        'Table': {
            'AttributeDefinitions': [
                {'AttributeName': 'forum_name', 'AttributeType': 'S'}
            ],
            'ProvisionedThroughput': {
                'NumberOfDecreasesToday': 0, 'WriteCapacityUnits': 10, 'ReadCapacityUnits': 10
            },
            'TableSizeBytes': 0,
            'TableName': 'messages',
            'TableStatus': 'ACTIVE',
            'KeySchema': [
                {'KeyType': 'HASH', 'AttributeName': 'forum_name'}
            ],
            'ItemCount': 0, 'CreationDateTime': 1326499200.0
        }
    }
    conn = boto.dynamodb2.connect_to_region(
        'us-west-2',
        aws_access_key_id="ak",
        aws_secret_access_key="sk"
    )

    conn.describe_table('messages').should.equal(expected)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_delete_table():
    create_table()
    conn = boto.dynamodb2.layer1.DynamoDBConnection()
    conn.list_tables()["TableNames"].should.have.length_of(1)

    conn.delete_table('messages')
    conn.list_tables()["TableNames"].should.have.length_of(0)

    conn.delete_table.when.called_with('messages').should.throw(JSONResponseError)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_update_table_throughput():
    table = create_table()
    table.throughput["read"].should.equal(10)
    table.throughput["write"].should.equal(10)

    table.update(throughput={
        'read': 5,
        'write': 6,
    })

    table.throughput["read"].should.equal(5)
    table.throughput["write"].should.equal(6)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_item_add_and_describe_and_update():
    table = create_table()

    data = {
        'forum_name': 'LOLCat Forum',
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User A',
    }

    table.put_item(data=data)
    returned_item = table.get_item(forum_name="LOLCat Forum")
    returned_item.should_not.be.none

    dict(returned_item).should.equal({
        'forum_name': 'LOLCat Forum',
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User A',
    })

    returned_item['SentBy'] = 'User B'
    returned_item.save(overwrite=True)

    returned_item = table.get_item(
        forum_name='LOLCat Forum'
    )
    dict(returned_item).should.equal({
        'forum_name': 'LOLCat Forum',
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User B',
    })

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_item_put_without_table():
    conn = boto.dynamodb2.layer1.DynamoDBConnection()

    conn.put_item.when.called_with(
        table_name='undeclared-table',
        item={
            'forum_name': 'LOLCat Forum',
            'Body': 'http://url_to_lolcat.gif',
            'SentBy': 'User A',
        }
    ).should.throw(JSONResponseError)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_get_missing_item():
    table = create_table()

    table.get_item.when.called_with(test_hash=3241526475).should.throw(JSONResponseError)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_get_item_with_undeclared_table():
    conn = boto.dynamodb2.layer1.DynamoDBConnection()

    conn.get_item.when.called_with(
        table_name='undeclared-table',
        key={"forum_name": {"S": "LOLCat Forum"}},
    ).should.throw(JSONResponseError)

@requires_boto_gte("2.30.0")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_delete_item():
    table = create_table()

    item_data = {
        'forum_name': 'LOLCat Forum',
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User A',
        'ReceivedTime': '12/9/2011 11:36:03 PM',
    }
    item = Item(table, item_data)
    item.save()
    table.count().should.equal(1)

    response = item.delete()

    response.should.equal(True)

    table.count().should.equal(0)

    item.delete().should.equal(False)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_delete_item_with_undeclared_table():
    conn = boto.dynamodb2.layer1.DynamoDBConnection()

    conn.delete_item.when.called_with(
        table_name='undeclared-table',
        key={"forum_name": {"S": "LOLCat Forum"}},
    ).should.throw(JSONResponseError)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_query():
    table = create_table()

    item_data = {
        'forum_name': 'the-key',
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User A',
        'ReceivedTime': '12/9/2011 11:36:03 PM',
    }
    item = Item(table, item_data)
    item.save(overwrite=True)
    table.count().should.equal(1)
    table = Table("messages")

    results = table.query(forum_name__eq='the-key')
    sum(1 for _ in results).should.equal(1)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_query_with_undeclared_table():
    conn = boto.dynamodb2.layer1.DynamoDBConnection()

    conn.query.when.called_with(
        table_name='undeclared-table',
        key_conditions={"forum_name": {"ComparisonOperator": "EQ", "AttributeValueList": [{"S": "the-key"}]}}
    ).should.throw(JSONResponseError)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_scan():
    table = create_table()

    item_data = {
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User A',
        'ReceivedTime': '12/9/2011 11:36:03 PM',
    }
    item_data['forum_name'] = 'the-key'

    item = Item(table, item_data)
    item.save()

    item['forum_name'] = 'the-key2'
    item.save(overwrite=True)

    item_data = {
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User B',
        'ReceivedTime': '12/9/2011 11:36:03 PM',
        'Ids': set([1, 2, 3]),
        'PK': 7,
    }
    item_data['forum_name'] = 'the-key3'
    item = Item(table, item_data)
    item.save()

    results = table.scan()
    sum(1 for _ in results).should.equal(3)

    results = table.scan(SentBy__eq='User B')
    sum(1 for _ in results).should.equal(1)

    results = table.scan(Body__beginswith='http')
    sum(1 for _ in results).should.equal(3)

    results = table.scan(Ids__null=False)
    sum(1 for _ in results).should.equal(1)

    results = table.scan(Ids__null=True)
    sum(1 for _ in results).should.equal(2)

    results = table.scan(PK__between=[8, 9])
    sum(1 for _ in results).should.equal(0)

    results = table.scan(PK__between=[5, 8])
    sum(1 for _ in results).should.equal(1)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_scan_with_undeclared_table():
    conn = boto.dynamodb2.layer1.DynamoDBConnection()

    conn.scan.when.called_with(
        table_name='undeclared-table',
        scan_filter={
            "SentBy": {
                "AttributeValueList": [{
                    "S": "User B"}
                ],
                "ComparisonOperator": "EQ"
            }
        },
    ).should.throw(JSONResponseError)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_write_batch():
    table = create_table()

    with table.batch_write() as batch:
        batch.put_item(data={
            'forum_name': 'the-key',
            'subject': '123',
            'Body': 'http://url_to_lolcat.gif',
            'SentBy': 'User A',
            'ReceivedTime': '12/9/2011 11:36:03 PM',
        })
        batch.put_item(data={
            'forum_name': 'the-key2',
            'subject': '789',
            'Body': 'http://url_to_lolcat.gif',
            'SentBy': 'User B',
            'ReceivedTime': '12/9/2011 11:36:03 PM',
        })

    table.count().should.equal(2)
    with table.batch_write() as batch:
        batch.delete_item(
            forum_name='the-key',
            subject='789'
        )

    table.count().should.equal(1)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_batch_read():
    table = create_table()

    item_data = {
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User A',
        'ReceivedTime': '12/9/2011 11:36:03 PM',
    }
    item_data['forum_name'] = 'the-key1'
    item = Item(table, item_data)
    item.save()

    item = Item(table, item_data)
    item_data['forum_name'] = 'the-key2'
    item.save(overwrite=True)

    item_data = {
        'Body': 'http://url_to_lolcat.gif',
        'SentBy': 'User B',
        'ReceivedTime': '12/9/2011 11:36:03 PM',
        'Ids': set([1, 2, 3]),
        'PK': 7,
    }
    item = Item(table, item_data)
    item_data['forum_name'] = 'another-key'
    item.save(overwrite=True)

    results = table.batch_get(
        keys=[
            {'forum_name': 'the-key1'},
            {'forum_name': 'another-key'},
        ]
    )

    # Iterate through so that batch_item gets called
    count = len([x for x in results])
    count.should.equal(2)

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_get_key_fields():
    table = create_table()
    kf = table.get_key_fields()
    kf[0].should.equal('forum_name')

@requires_boto_gte("2.9")
@py3_requires_boto_gte("2.33.0")
@mock_dynamodb2
def test_get_special_item():
    table = Table.create('messages', schema=[
        HashKey('date-joined')
    ], throughput={
        'read': 10,
        'write': 10,
    })

    data = {
        'date-joined': 127549192,
        'SentBy': 'User A',
    }
    table.put_item(data=data)
    returned_item = table.get_item(**{'date-joined': 127549192})
    dict(returned_item).should.equal(data)


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Alipay.AopSdk.AspnetCore;
using Alipay.AopSdk.Core;
using Alipay.AopSdk.Core.Domain;
using Alipay.AopSdk.Core.Request;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Alipay.Demo.PCPayment.Controllers
{
    public class PayController : Controller
    {

	    private readonly AlipayService  _alipayService;

		public PayController(AlipayService alipayService)
		{
			_alipayService = alipayService;
		}
	    #region 发起支付

	    public IActionResult Index()
	    {
		    return View();
	    }

		/// <summary>
		/// 发起支付请求
		/// </summary>
		/// <param name="tradeno">外部订单号,商户网站订单系统中唯一的订单号</param>
		/// <param name="subject">订单名称</param>
		/// <param name="totalAmout">付款金额</param>
		/// <param name="itemBody">商品描述</param>
		/// <returns></returns>
		[HttpPost]
	    public void PayRequest(string tradeno,string subject,string totalAmout,string itemBody)
	    {
		    // 组装业务参数model
		    AlipayTradePagePayModel model = new AlipayTradePagePayModel
		    {
			    Body = itemBody,
			    Subject = subject,
			    TotalAmount = totalAmout,
			    OutTradeNo = tradeno,
			    ProductCode = "FAST_INSTANT_TRADE_PAY"
		    };

		    AlipayTradePagePayRequest request = new AlipayTradePagePayRequest();
		    // 设置同步回调地址
		    request.SetReturnUrl($"http://{Request.Host}/Pay/Callback");
		    // 设置异步通知接收地址
		    request.SetNotifyUrl("");
		    // 将业务model载入到request
		    request.SetBizModel(model);

			var response = _alipayService.SdkExecute(request);
		    Console.WriteLine($"订单支付发起成功,订单号:{tradeno}");
			//跳转支付宝支付
		    Response.Redirect(_alipayService.Options.Gatewayurl + "?" + response.Body);
		}

	    #endregion

		#region 支付异步回调通知

		/// <summary>
		/// 支付异步回调通知 需配置域名 因为是支付宝主动post请求这个action 所以要通过域名访问或者公网ip
		/// </summary>
		public async void Notify()
	    {
		    /* 实际验证过程建议商户添加以下校验。
			1、商户需要验证该通知数据中的out_trade_no是否为商户系统中创建的订单号,
			2、判断total_amount是否确实为该订单的实际金额(即商户订单创建时的金额),
			3、校验通知中的seller_id(或者seller_email) 是否为out_trade_no这笔单据的对应的操作方(有的时候,一个商户可能有多个seller_id/seller_email)
			4、验证app_id是否为该商户本身。
			*/
		    Dictionary<string, string> sArray = GetRequestPost();
		    if (sArray.Count != 0)
		    {
			    bool flag = _alipayService.RSACheckV1(sArray);
			    if (flag)
			    {
				    //交易状态
				    //判断该笔订单是否在商户网站中已经做过处理
				    //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
				    //请务必判断请求时的total_amount与通知时获取的total_fee为一致的
				    //如果有做过处理,不执行商户的业务程序

				    //注意:
				    //退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
				    Console.WriteLine(Request.Form["trade_status"]);

				    await Response.WriteAsync("success");
			    }
			    else
			    {
				    await Response.WriteAsync("fail");
			    }
		    }
	    }

		    #endregion

		#region 支付同步回调

		/// <summary>
		/// 支付同步回调
		/// </summary>
		[HttpGet]
	    public  IActionResult Callback()
	    {
		    /* 实际验证过程建议商户添加以下校验。
			1、商户需要验证该通知数据中的out_trade_no是否为商户系统中创建的订单号,
			2、判断total_amount是否确实为该订单的实际金额(即商户订单创建时的金额),
			3、校验通知中的seller_id(或者seller_email) 是否为out_trade_no这笔单据的对应的操作方(有的时候,一个商户可能有多个seller_id/seller_email)
			4、验证app_id是否为该商户本身。
			*/
		    Dictionary<string, string> sArray = GetRequestGet();
		    if (sArray.Count != 0)
		    {
			    bool flag = _alipayService.RSACheckV1(sArray);
			    if (flag)
			    {
				    Console.WriteLine($"同步验证通过,订单号:{sArray["out_trade_no"]}");
				    ViewData["PayResult"] = "同步验证通过";
			    }
			    else
			    {
				    Console.WriteLine($"同步验证失败,订单号:{sArray["out_trade_no"]}");
				    ViewData["PayResult"] = "同步验证失败";
			    }
		    }
		    return View();
	    }

	    #endregion

	    #region 订单查询

	    [HttpGet]
	    public IActionResult Query()
	    {
		    return View();
	    }

	    [HttpPost]
	    public async Task<JsonResult> Query(string tradeno, string alipayTradeNo)
	    {
		    /*DefaultAopClient client = new DefaultAopClient(Config.Gatewayurl, Config.AppId, Config.PrivateKey, "json", "2.0",
			    Config.SignType, Config.AlipayPublicKey, Config.CharSet, false);*/
		    AlipayTradeQueryModel model = new AlipayTradeQueryModel
		    {
			    OutTradeNo = tradeno,
			    TradeNo = alipayTradeNo
		    };

		    AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
		    request.SetBizModel(model);

		    var response = await _alipayService.ExecuteAsync(request);
		    return Json(response.Body);
	    }

	    #endregion

		#region 解析请求参数

		private Dictionary<string, string> GetRequestGet()
	    {
		    Dictionary<string, string> sArray = new Dictionary<string, string>();

		    ICollection<string> requestItem = Request.Query.Keys;
		    foreach (var item in requestItem)
		    {
			    sArray.Add(item,Request.Query[item]);

		    }
		    return sArray;

	    }

	    private Dictionary<string, string> GetRequestPost()
	    {
		    Dictionary<string, string> sArray = new Dictionary<string, string>();

		    ICollection<string> requestItem = Request.Form.Keys;
		    foreach (var item in requestItem)
		    {
			    sArray.Add(item, Request.Form[item]);

		    }
		    return sArray;

	    }

	    #endregion

	    #region 订单退款

	    [HttpGet]
	    public IActionResult Refund()
	    {
		    return View();
	    }

		/// <summary>
		/// 订单退款
		/// </summary>
		/// <param name="tradeno">商户订单号</param>
		/// <param name="alipayTradeNo">支付宝交易号</param>
		/// <param name="refundAmount">退款金额</param>
		/// <param name="refundReason">退款原因</param>
		/// <param name="refundNo">退款单号</param>
		/// <returns></returns>
		[HttpPost]
	    public async Task<JsonResult> Refund(string tradeno,string alipayTradeNo,string refundAmount,string refundReason,string refundNo)
	    {
		    /*DefaultAopClient client = new DefaultAopClient(Config.Gatewayurl, Config.AppId, Config.PrivateKey, "json", "2.0",
			    Config.SignType, Config.AlipayPublicKey, Config.CharSet, false);*/

		    AlipayTradeRefundModel model = new AlipayTradeRefundModel();
		    model.OutTradeNo = tradeno;
		    model.TradeNo = alipayTradeNo;
		    model.RefundAmount = refundAmount;
		    model.RefundReason = refundReason;
		    model.OutRequestNo = refundNo;

		    AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
		    request.SetBizModel(model);

		    var response = await _alipayService.ExecuteAsync(request);
		    return Json(response.Body);
	    }

		#endregion

		#region 退款查询

		/// <summary>
		/// 退款查询
		/// </summary>
		/// <returns></returns>
		public IActionResult RefundQuery()
	    {
		    return View();
	    }

		/// <summary>
		/// 退款查询
		/// </summary>
		/// <param name="tradeno">商户订单号</param>
		/// <param name="alipayTradeNo">支付宝交易号</param>
		/// <param name="refundNo">退款单号</param>
		/// <returns></returns>
		[HttpPost]
	    public async Task<JsonResult> RefundQuery(string tradeno,string alipayTradeNo,string refundNo)
	    {
		    /*DefaultAopClient client = new DefaultAopClient(Config.Gatewayurl, Config.AppId, Config.PrivateKey, "json", "2.0",
			    Config.SignType, Config.AlipayPublicKey, Config.CharSet, false);*/

		    if (string.IsNullOrEmpty(refundNo))
		    {
			    refundNo = tradeno;
		    }

		    AlipayTradeFastpayRefundQueryModel model = new AlipayTradeFastpayRefundQueryModel();
		    model.OutTradeNo = tradeno;
		    model.TradeNo = alipayTradeNo;
		    model.OutRequestNo = refundNo;

		    AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
		    request.SetBizModel(model);

		    var response = await _alipayService.ExecuteAsync(request);
		    return Json(response.Body);
	    }

	    #endregion

	    #region 订单关闭

	    public IActionResult OrderClose()
	    {
		    return View();
	    }

		/// <summary>
		/// 关闭订单
		/// </summary>
		/// <param name="tradeno">商户订单号</param>
		/// <param name="alipayTradeNo">支付宝交易号</param>
		/// <returns></returns>
	    [HttpPost]
	    public async Task<JsonResult> OrderClose(string tradeno, string alipayTradeNo)
	    {
		    /*DefaultAopClient client = new DefaultAopClient(Config.Gatewayurl, Config.AppId, Config.PrivateKey, "json", "2.0",
			    Config.SignType, Config.AlipayPublicKey, Config.CharSet, false);*/

		    AlipayTradeCloseModel model = new AlipayTradeCloseModel();
		    model.OutTradeNo = tradeno;
		    model.TradeNo = alipayTradeNo;

		    AlipayTradeCloseRequest request = new AlipayTradeCloseRequest();
		    request.SetBizModel(model);

		    var response = await _alipayService.ExecuteAsync(request);
		    return Json(response.Body);
	    }

	    #endregion
	}
}


text:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Web;
using System.Xml.Linq;
using Thinktecture.IdentityModel.Extensions;

namespace Thinktecture.IdentityModel.Clients.AccessControlService
{
    [DataContract]
    public class JSNotifyRequestSecurityTokenResponse
    {
        [DataMember(Name = "appliesTo", Order = 1)]
        public string AppliesTo { get; set; }

        [DataMember(Name = "context", Order = 2)]
        public string Context { get; set; }

        [DataMember(Name = "created", Order = 3)]
        public string Created { get; set; }

        [DataMember(Name = "expires", Order = 4)]
        public string Expires { get; set; }

        [DataMember(Name = "securityToken", Order = 5)]
        public string SecurityTokenString { get; set; }

        [DataMember(Name = "tokenType", Order = 6)]
        public string TokenType { get; set; }

        public DateTime ValidFrom { get; set; }
        public DateTime ValidTo { get; set; }
        public GenericXmlSecurityToken SecurityToken { get; set; }

        public static JSNotifyRequestSecurityTokenResponse FromJson(string jsonString)
        {
            JSNotifyRequestSecurityTokenResponse rstr;

            var memoryStream = new MemoryStream(Encoding.Unicode.GetBytes(jsonString));
            var serializer = new DataContractJsonSerializer(typeof(JSNotifyRequestSecurityTokenResponse));

            rstr = serializer.ReadObject(memoryStream) as JSNotifyRequestSecurityTokenResponse;
            memoryStream.Close();

            ParseValues(rstr);
            return rstr;
        }

        private static void ParseValues(JSNotifyRequestSecurityTokenResponse rstr)
        {
            rstr.ValidFrom = long.Parse(rstr.Created).ToDateTimeFromEpoch();
            rstr.ValidTo = long.Parse(rstr.Expires).ToDateTimeFromEpoch();
            rstr.SecurityTokenString = HttpUtility.HtmlDecode(rstr.SecurityTokenString);
            var xml = XElement.Parse(rstr.SecurityTokenString);

            string idAttribute = "";

            switch (rstr.TokenType)
            {
                case SecurityTokenTypes.Saml11:
                    idAttribute = "AssertionID";
                    break;
                case SecurityTokenTypes.Saml2:
                    idAttribute = "ID";
                    break;
            }

            if (rstr.TokenType == SecurityTokenTypes.Saml11 || rstr.TokenType == SecurityTokenTypes.Saml2)
            {
                var tokenId = xml.Attribute(idAttribute);
                var xmlElement = xml.ToXmlElement();
                SecurityKeyIdentifierClause clause = null;

                if (tokenId != null)
                {
                    clause = new SamlAssertionKeyIdentifierClause(tokenId.Value);
                }

                rstr.SecurityToken = new GenericXmlSecurityToken(
                    xmlElement,
                    null,
                    rstr.ValidFrom,
                    rstr.ValidTo,
                    clause,
                    clause,
                    new ReadOnlyCollection<IAuthorizationPolicy>(new List<IAuthorizationPolicy>()));
            }
            else if (rstr.TokenType == SecurityTokenTypes.SWT)
            {
                rstr.SecurityTokenString = Encoding.UTF8.GetString(Convert.FromBase64String(xml.Value));
            }
        }

        private class SecurityTokenTypes
        {
            public const string Saml2 = "urn:oasis:names:tc:SAML:2.0:assertion";
            public const string Saml11 = "urn:oasis:names:tc:SAML:1.0:assertion";
            public const string SWT = "http://schemas.xmlsoap.org/ws/2009/11/swt-token-profile-1.0";
        }
    }
}


text:
import { HttpStatus, is } from '@toba/tools';
import { log } from '@toba/logger';
import { blog } from '@trailimage/models';
import { Request, Response } from 'express';
import { RouteParam } from '../routes';
import { Page, Layout, view } from '../views/';

function send(
   req: Request,
   res: Response,
   key: string,
   viewName: string = Page.Post
) {
   view.send(res, key, render => {
      const p = blog.postWithKey(key);
      if (!is.value(p)) {
         view.notFound(req, res);
         return;
      }
      p.ensureLoaded()
         .then(() => {
            render(viewName, {
               post: p,
               title: p.title,
               jsonLD: p.jsonLD(),
               layout: Layout.None,
               description: p.longDescription,
               slug: key
            });
         })
         .catch(err => view.internalError(res, err));
   });
}

/**
 * Display post that's part of a series.
 */
function inSeries(req: Request, res: Response) {
   send(
      req,
      res,
      req.params[RouteParam.SeriesKey] + '/' + req.params[RouteParam.PartKey]
   );
}

/**
 * Render post with matching key.
 */
function withKey(req: Request, res: Response) {
   send(req, res, req.params[RouteParam.PostKey]);
}

/**
 * Render post with matching provider (e.g. Flickr) ID. Redirect to normal URL.
 */
function withID(req: Request, res: Response) {
   const post = blog.postWithID(req.params[RouteParam.PostID]);

   if (is.value(post)) {
      res.redirect(HttpStatus.PermanentRedirect, '/' + post.key);
   } else {
      view.notFound(req, res);
   }
}

/**
 * Render post that contains photo with given ID.
 */
function withPhoto(req: Request, res: Response) {
   const photoID = req.params[RouteParam.PhotoID];

   blog
      .postWithPhoto(photoID)
      .then(post => {
         if (is.value(post)) {
            res.redirect(
               HttpStatus.PermanentRedirect,
               `/${post.key}#${photoID}`
            );
         } else {
            view.notFound(req, res);
         }
      })
      .catch(err => {
         log.error(err, { photoID });
         view.notFound(req, res);
      });
}

/**
 * Show newest post on home page. Provider should have populated posts newest-
 * first.
 */
function latest(req: Request, res: Response) {
   send(req, res, blog.posts[0].key);
}

export const post = { latest, withID, withKey, withPhoto, inSeries };


text:
public class nspace_extend_runme {

  static {
    try {
	System.loadLibrary("nspace_extend");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[]) {
    {
      // constructors and destructors
      nspace_extendPackage.Outer.Inner1.Color color1 = new nspace_extendPackage.Outer.Inner1.Color();
      nspace_extendPackage.Outer.Inner1.Color color = new nspace_extendPackage.Outer.Inner1.Color(color1);
      color1.delete();
      color1 = null;

      // class methods
      color.colorInstanceMethod(20.0);
      nspace_extendPackage.Outer.Inner1.Color.colorStaticMethod(20.0);
      nspace_extendPackage.Outer.Inner1.Color created = nspace_extendPackage.Outer.Inner1.Color.create();
    }
    {
      // constructors and destructors
      nspace_extendPackage.Outer.Inner2.Color color2 = new nspace_extendPackage.Outer.Inner2.Color();
      nspace_extendPackage.Outer.Inner2.Color color = new nspace_extendPackage.Outer.Inner2.Color(color2);
      color2.delete();
      color2 = null;

      // class methods
      color.colorInstanceMethod(20.0);
      nspace_extendPackage.Outer.Inner2.Color.colorStaticMethod(20.0);
      nspace_extendPackage.Outer.Inner2.Color created = nspace_extendPackage.Outer.Inner2.Color.create();

      // Same class different namespaces
      nspace_extendPackage.Outer.Inner1.Color col1 = new nspace_extendPackage.Outer.Inner1.Color();
      nspace_extendPackage.Outer.Inner2.Color col2 = nspace_extendPackage.Outer.Inner2.Color.create();
      col2.colors(col1, col1, col2, col2, col2);
    }
  }
}


text:
The Pump uses a definition file to define how data can be retrieved from VIVO to a spreadsheet, and how data in a spreadsheet can be updated in VIVO.  A single definition file defines both the get action and the update action.

Round tripping is the ability to get data from VIVO to a spreadsheet, edit that spreadsheet and use the same definition to update VIVO.  You can also start from the update -- adding new data to VIVO, and then using the same definition to get the data from VIVO.

In this chapter we will see simple examples first.  You should try these simple examples.  And you should check your work.  See [The Pump Definition File Reference](The-Pump-Definition-File.md) for all definition file features.

## A simple definition file
Definition files are written using JSON syntax. JSON is a popular file format, but can be difficult to write by hand.  You should have a text editor that understands JSON format.  The text editor will help you make sure that the definitions you write are correct JSON syntax.

### Rows and Columns
To write a definition file, you need to think about the spreadsheet you will use to manage your VIVO data.  What do the rows in your spreadsheet represent? Do you have one row per person?  Per publication?  Per academic degree?  VIVO is capable of storing many kinds of data -- actually, VIVO is capable of managing all kinds of data.  VIVO manages whatever its ontologies define.  The rows in your spreadsheet may represent any of the kinds of things that your ontologies define.

Second, you will need to consider what data are stored in the columns of your spreadsheet.  Each column represents an attribute of the entity represented by the row.

Suppose you are managing data about people.  For each person, you have their name, and their academic department.

| name                 | department           |
| -------------------- |----------------------|
| Conlon, Michael      | Statistics           |
| Barnes, Christopher  | Informatics          |

The rows of your spreadsheet represent people.  The first column represents the name of the person.  The second column represents the department[^1] of the person.

## Writing an entity_def
## Writing a simple column_def
### Literals
### Objects and Enumerations
## Writing a two step column_def
## Writing a three step column_def
## Writing a closure_def
## More features of definition files

[^1]: In universities, identifying the department of the person may not be straightforward.  There is the concept of "tenure department," and "appointment department," and "department paying the majority of salary," and "department where the person resides.  Many faculty have appointments in multiple departments.  For the purpose of the example, we will consider department "knowable."


text:
package org.quartzpowered.protocol.packet.play.client;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.quartzpowered.network.protocol.packet.Packet;

@Data
@EqualsAndHashCode(callSuper = true)
public class EntityPacket extends Packet {
    private int entityId;
}


text:
module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    mochaTest: {
      files: ['test\n'
      },
      build: {
        src: 'levenshtein.js',
        dest: 'levenshtein.min.js'
      }
    },

    benchmarkConfig: {
      speed: {
        src: ['benchmark/speed.js']
      }
    },
  });

  require('load-grunt-tasks')(grunt);
  grunt.renameTask('benchmark', 'benchmarkConfig');

  grunt.registerTask('build', ['jshint', 'uglify', 'mochaTest']);

  grunt.registerTask('default', ['build']);

  grunt.registerTask('benchmark', ['npm-install:levenshtein-edit-distance:levenshtein:natural:levenshtein-component:levenshtein-deltas', 'benchmarkConfig']);
};


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <note/>
    <predicate lemma="brutalize">
        <note>Frames file for 'brutalize' based on instances in Webtext 2.5-2.  No VerbNet entry. Comparison to 'terrorize.'</note>
        <roleset framnet="" id="brutalize.01" name="treat in a brutal way" vncls="-">
            <roles>
                <role descr="agent, brutalizer" f="" n="0"/>
                <note/>
                <role descr="entity brutalized, mistreated" f="" n="1"/>
                <role descr="instrument of brutalization" f="" n="2"/>
                <role descr="resulting state of brutalization, predication on arg 1" f="" n="3"/>
            </roles>
            <note>Framed by Claire</note>
            <example name="Passive" src="Passive" type="Passive">
                <inflection aspect="ns" form="ns" person="ns" tense="ns" voice="ns"/>
                <text>Ever since war exists-meaning the dawn of time-, civilians-1 have been brutalized, raped, tortured and murdered *-1.</text>
                <note/>
                <rel f="">brutalized</rel>
                <arg f="" n="1">*-1</arg>
                <arg f="tmp" n="m">Ever since war exists-meaning the dawn of time-</arg>
            </example>
        </roleset>
    </predicate>
</frameset>


text:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("@typescript-eslint/types");
//# sourceMappingURL=estree-to-ts-node-types.js.map


text:
@protocol RHVoiceCommandable <NSObject>

- (NSArray *)availableCommandAsStrings;
- (BOOL)responseToCommandString:(NSString *)commandString;

@end


text:
<?php

namespace Magento\Quote\Model\GuestCart;

use Magento\Quote\Model\QuoteIdMaskFactory;
use Magento\Quote\Api\GuestCartTotalManagementInterface;

/**
 * @inheritDoc
 */
class GuestCartTotalManagement implements GuestCartTotalManagementInterface
{
    /**
     * @var \Magento\Quote\Api\CartTotalManagementInterface
     */
    protected $cartTotalManagement;

    /**
     * @var QuoteIdMaskFactory
     */
    protected $quoteIdMaskFactory;

    /**
     * @param \Magento\Quote\Api\CartTotalManagementInterface $cartTotalManagement
     * @param QuoteIdMaskFactory $quoteIdMaskFactory
     */
    public function __construct(
        \Magento\Quote\Api\CartTotalManagementInterface $cartTotalManagement,
        QuoteIdMaskFactory $quoteIdMaskFactory
    ) {
        $this->cartTotalManagement = $cartTotalManagement;
        $this->quoteIdMaskFactory = $quoteIdMaskFactory;
    }

    /**
     * {@inheritDoc}
     */
    public function collectTotals(
        $cartId,
        \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
        $shippingCarrierCode = null,
        $shippingMethodCode = null,
        \Magento\Quote\Api\Data\TotalsAdditionalDataInterface $additionalData = null
    ) {
        $quoteIdMask = $this->quoteIdMaskFactory->create()->load($cartId, 'masked_id');
        return $this->cartTotalManagement->collectTotals(
            $quoteIdMask->getQuoteId(),
            $paymentMethod,
            $shippingCarrierCode,
            $shippingMethodCode,
            $additionalData
        );
    }
}


text:
$template = @'
{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
      "addressPrefix": {"defaultValue": "10.0.0.0/16", "type": "string"},
      "adminUsername": {"type": "string"},
      "adminPassword": {"type": "securestring"},
      "diagnosticsStorageAccountName": {"type": "string"},
      "diagnosticsStorageAccountType": {"defaultValue": "Standard_LRS", "type": "string"},
      "dnsLabelPrefix": {"type": "string"},
      "enableAutomaticUpdates": {"defaultValue": true, "type": "bool"},
      "nicName": {"type": "string"},
      "nsgName": {"type": "string"},
      "offer": {"type": "string"},
      "pipName": {"type": "string"},
      "provisionVMAgent": {"defaultValue": false, "type": "bool"},
      "publisher": {"type": "string"},
      "sku": {"type": "string"},
      "storageAccountName": {"type": "string"},
      "storageAccountType": {"defaultValue": "Standard_LRS", "type": "string"},
      "subnetName": {"defaultValue": "default", "type": "string"},
      "subnetPrefix": {"defaultValue": "10.0.0.0/24", "type": "string"},
      "timeZone": {"defaultValue": "GMT Standard Time", "type": "string"},
      "version": {"type": "string"},
      "vmName": {"type": "string"},
      "vmSize": {"defaultValue": "Standard_A1", "type": "string"},
      "vnetName": {"type": "string"}
    },
    "variables": {
      "subnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vnetName'), parameters('subnetName'))]"
    },
    "resources": [
      {
        "type": "Microsoft.Storage/storageAccounts",
        "name": "[parameters('storageAccountName')]",
        "apiVersion": "2017-06-01",
        "location": "[resourceGroup().location]",
        "sku": {
          "name": "[parameters('storageAccountType')]"
        },
        "kind": "Storage",
        "properties": {}
      },
      {
        "type": "Microsoft.Storage/storageAccounts",
        "name": "[parameters('diagnosticsStorageAccountName')]",
        "apiVersion": "2017-06-01",
        "location": "[resourceGroup().location]",
        "sku": {
          "name": "[parameters('diagnosticsStorageAccountType')]"
        },
        "kind": "Storage",
        "properties": {}
      },
      {
        "apiVersion": "2017-06-01",
        "type": "Microsoft.Network/publicIPAddresses",
        "name": "[parameters('pipName')]",
        "location": "[resourceGroup().location]",
        "properties": {
          "publicIPAllocationMethod": "Dynamic",
          "dnsSettings": {
            "domainNameLabel": "[parameters('dnsLabelPrefix')]"
          }
        }
      },
      {
        "apiVersion": "2017-06-01",
        "type": "Microsoft.Network/virtualNetworks",
        "name": "[parameters('vnetName')]",
        "location": "[resourceGroup().location]",
        "properties": {
          "addressSpace": {
            "addressPrefixes": [
              "[parameters('addressPrefix')]"
            ]
          },
          "subnets": [
            {
              "name": "[parameters('subnetName')]",
              "properties": {
                "addressPrefix": "[parameters('subnetPrefix')]"
              }
            }
          ]
        }
      },
      {
        "apiVersion": "2017-06-01",
        "type": "Microsoft.Network/networkInterfaces",
        "name": "[parameters('nicName')]",
        "location": "[resourceGroup().location]",
        "dependsOn": [
          "[resourceId('Microsoft.Network/publicIPAddresses/', parameters('pipName'))]",
          "[resourceId('Microsoft.Network/virtualNetworks/', parameters('vnetName'))]"
        ],
        "properties": {
          "ipConfigurations": [
            {
              "name": "ipconfig1",
              "properties": {
                "privateIPAllocationMethod": "Dynamic",
                "publicIPAddress": {
                  "id": "[resourceId('Microsoft.Network/publicIPAddresses',parameters('pipName'))]"
                },
                "subnet": {
                  "id": "[variables('subnetRef')]"
                }
              }
            }
          ],
          "networkSecurityGroup": {
            "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('nsgName'))]"
          }
        }
      },
      {
        "name": "[parameters('nsgName')]",
        "type": "Microsoft.Network/networkSecurityGroups",
        "apiVersion": "2016-09-01",
        "location": "[resourceGroup().location]",
        "properties": {
          "securityRules": [
            {
              "name": "default-allow-rdp",
              "properties": {
                "priority": 1000,
                "sourceAddressPrefix": "*",
                "protocol": "TCP",
                "destinationPortRange": "3389",
                "access": "Allow",
                "direction": "Inbound",
                "sourcePortRange": "*",
                "destinationAddressPrefix": "*"
              }
            }
          ]
        }
      },
      {
        "apiVersion": "2017-03-30",
        "type": "Microsoft.Compute/virtualMachines",
        "name": "[parameters('vmName')]",
        "location": "[resourceGroup().location]",
        "dependsOn": [
          "[resourceId('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]",
          "[resourceId('Microsoft.Network/networkInterfaces/', parameters('nicName'))]"
        ],
        "properties": {
          "hardwareProfile": {
              "vmSize": "[parameters('vmSize')]"
          },
          "osProfile": {
            "computerName": "[parameters('vmName')]",
            "adminUsername": "[parameters('adminUsername')]",
            "adminPassword": "[parameters('adminPassword')]",
            "windowsConfiguration": {
              "provisionVMAgent": "[parameters('provisionVMAgent')]",
              "enableAutomaticUpdates": "[parameters('enableAutomaticUpdates')]",
              "timeZone": "[parameters('timeZone')]"
            }
          },
          "storageProfile": {
            "imageReference": {
              "publisher": "[parameters('publisher')]",
              "offer": "[parameters('offer')]",
              "sku": "[parameters('sku')]",
              "version": "[parameters('version')]"
            },
            "osDisk": {
              "createOption": "FromImage"
            },
            "dataDisks": []
          },
          "networkProfile": {
            "networkInterfaces": [
              {
                "id": "[resourceId('Microsoft.Network/networkInterfaces',parameters('nicName'))]"
              }
            ]
          },
          "diagnosticsProfile": {
            "bootDiagnostics": {
              "enabled": true,
              "storageUri": "[reference(resourceId('Microsoft.Storage/storageAccounts/', parameters('diagnosticsStorageAccountName'))).primaryEndpoints.blob]"
            }
          }
        }
      }
    ],
    "outputs": {
      "hostname": {
        "type": "string",
        "value": "[reference(parameters('pipName')).dnsSettings.fqdn]"
      }
    }
  }
'@

$templatefile = ".\provisionVMAgentFalseReproFromTemplate.json"
$template | out-file $templatefile -Force

$location = 'westcentralus'
$vmName = "vm$(get-date -format "MMddhhmmss")"
$resourceGroupName = $vmName
$resourceGroup = New-AzureRmResourceGroup -Name $resourceGroupName -Location $location

$params = [ordered]@{
    publisher = 'MicrosoftWindowsServer'
    offer = 'WindowsServer'
    sku = '2016-Datacenter'
    version = 'latest'
    addressPrefix = "10.0.0.0/16"
    adminUsername = 'craig'
    adminPassword = $password
    dnsLabelPrefix = $vmName.ToLower()
    diagnosticsStorageAccountName = "$($vmName.ToLower())diagsa1"
    enableAutomaticUpdates = $true
    nicName = "$($vmName)-nic"
    nsgName = "$($vmName)-nsg"
    pipName = "$($vmName)-ip"
    provisionVMAgent = $false
    storageAccountName = "$($vmName.ToLower())sa1"
    storageAccountType = 'Standard_LRS'
    subnetName = "$($vmName)-subnet"
    subnetPrefix = "10.0.0.0/24"
    timeZone = "GMT Standard Time"
    vmName = $vmName
    vmSize = 'Standard_A1'
    vnetName = "$($vmName)-vnet"
}

New-AzureRmResourceGroupDeployment -Name $resourceGroupName -ResourceGroupName $resourceGroupName -TemplateParameterObject $params -TemplateFile $templateFile


text:
/*	$NetBSD: ohci_s3c24x0.c,v 1.8 2011/07/01 20:31:39 dyoung Exp $ */

/* derived from ohci_pci.c */

/*
 * Copyright (c) 1998 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Lennart Augustsson (lennart@augustsson.net) at
 * Carlstedt Research & Technology.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ohci_s3c24x0.c,v 1.8 2011/07/01 20:31:39 dyoung Exp $");

#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/queue.h>

#include <sys/bus.h>

#include <arm/s3c2xx0/s3c24x0var.h>

#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdivar.h>
#include <dev/usb/usb_mem.h>

#include <dev/usb/ohcireg.h>
#include <dev/usb/ohcivar.h>

int	ohci_ssio_match(device_t, cfdata_t, void *);
void	ohci_ssio_attach(device_t, device_t, void *);
int	ohci_ssio_detach(device_t, int);

extern	int ohcidebug;

struct ohci_ssio_softc {
	ohci_softc_t		sc;

	void 			*sc_ih;		/* interrupt vectoring */
};

CFATTACH_DECL_NEW(ohci_ssio, sizeof(struct ohci_ssio_softc),
    ohci_ssio_match, ohci_ssio_attach, ohci_ssio_detach, ohci_activate);

int
ohci_ssio_match(device_t parent, cfdata_t match, void *aux)
{
	struct s3c2xx0_attach_args *sa = (struct s3c2xx0_attach_args *)aux;
	/* XXX: check some registers */

	if (sa->sa_dmat == NULL) {
		/* busdma tag is not initialized. */
		return 0;
	}

	return 1;
}

void
ohci_ssio_attach(device_t parent, device_t self, void *aux)
{
	struct ohci_ssio_softc *sc = device_private(self);
	struct s3c2xx0_attach_args *sa = (struct s3c2xx0_attach_args *)aux;

	usbd_status r;

	aprint_normal("\n");
	aprint_naive("\n");

	sc->sc.sc_dev = self;
	sc->sc.sc_bus.hci_private = sc;

	sc->sc.iot = sa->sa_iot;
	/*ohcidebug=15;*/

	/* Map I/O registers */
	if (bus_space_map(sc->sc.iot, sa->sa_addr, 0x5c, 0, &sc->sc.ioh)) {
		aprint_error_dev(self, "can't map mem space\n");
		return;
	}

	/* Disable interrupts, so we don't get any spurious ones. */
	bus_space_write_4(sc->sc.iot, sc->sc.ioh, OHCI_INTERRUPT_DISABLE,
			  OHCI_ALL_INTRS);

	sc->sc.sc_bus.dmatag = sa->sa_dmat;

	/* Enable the device. */
	/* XXX: provide clock to USB block */

	/* establish the interrupt. */
	sc->sc_ih = s3c24x0_intr_establish(sa->sa_intr, IPL_USB, IST_NONE, ohci_intr, sc);
	if (sc->sc_ih == NULL) {
		aprint_error_dev(self, "couldn't establish interrupt\n");
		return;
	}

	strlcpy(sc->sc.sc_vendor, "Samsung", sizeof sc->sc.sc_vendor);

	r = ohci_init(&sc->sc);
	if (r != USBD_NORMAL_COMPLETION) {
		aprint_error_dev(self, "init failed, error=%d\n", r);
		return;
	}

	/* Attach usb device. */
	sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint);
}

int
ohci_ssio_detach(device_t self, int flags)
{
	return (0);
}