text:
package org.midao.jdbc.core.handlers.input.named;

import org.midao.jdbc.core.handlers.input.AbstractInputHandler;
import org.midao.jdbc.core.handlers.model.QueryParameters;
import org.midao.jdbc.core.processor.QueryInputProcessor;

/**
 * Similar to {@link AbstractNamedInputHandler}, but accepts List of Maps/Beans
 */
public abstract class AbstractNamedListInputHandler<T> extends AbstractInputHandler<T> {

    /**
     * Initializes parent part of NamedInputHandler
     *
     * @param processor Query input processor
     */
    protected AbstractNamedListInputHandler(QueryInputProcessor processor) {
        super(processor);
    }

    /**
     * {@inheritDoc}
     */
    abstract public String getQueryString();

    /**
     * {@inheritDoc}
     */
    abstract public QueryParameters getQueryParameters();
}


text:
<?php

defined('_JEXEC') or die('Restricted access');
?><?php

class TemplateController extends acymailingController{

	var $pkey = 'tempid';
	var $table = 'template';
	var $aclCat = 'templates';

	function load(){
		$class = acymailing_get('class.template');
		$tempid = JRequest::getInt('tempid');
		if(empty($tempid)) exit;
		$template = $class->get($tempid);

		header("Content-type: text/css");
		echo $class->buildCSS($template->styles, $template->stylesheet);
		exit;
	}

	function applyareas(){
		if(!$this->isAllowed($this->aclCat, 'manage')) return;

		$class = acymailing_get('class.template');
		$tempid = JRequest::getInt('tempid');
		if(empty($tempid)) exit;
		$template = $class->get($tempid);
		$class->applyAreas($template->body);
		$class->save($template);

		$class->createTemplateFile($tempid);

		acymailing_display(acymailing_translation('ACYEDITOR_ADDAREAS_DONE'));

		if(JRequest::getCmd('tmpl') == 'component'){
			$js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = 'index.php?option=com_acymailing&ctrl=template'; }";
			$doc = JFactory::getDocument();
			$doc->addScriptDeclaration($js);
		}else{
			return $this->listing();
		}
	}

	function remove(){
		if(!$this->isAllowed($this->aclCat, 'delete')) return;
		JRequest::checkToken() or die('Invalid Token');
		$app = JFactory::getApplication();
		$app->isAdmin() or die('Only from the back-end');

		$cids = JRequest::getVar('cid', array(), '', 'array');

		$class = acymailing_get('class.template');
		$num = $class->delete($cids);

		acymailing_enqueueMessage(acymailing_translation_sprintf('SUCC_DELETE_ELEMENTS', $num), 'message');

		return $this->listing();
	}

	function copy(){
		if(!$this->isAllowed($this->aclCat, 'manage')) return;
		JRequest::checkToken() or die('Invalid Token');

		$cids = JRequest::getVar('cid', array(), '', 'array');
		$db = JFactory::getDBO();
		$time = time();

		acymailing_arrayToInteger($cids);

		$query = 'INSERT IGNORE INTO `#__acymailing_template` (`name`, `description`, `body`, `altbody`, `created`, `published`, `premium`, `ordering`, `namekey`, `styles`, `subject`,`stylesheet`,`fromname`,`fromemail`,`replyname`,`replyemail`,`thumb`,`readmore`,`category`)';
		$query .= " SELECT CONCAT('copy_',`name`), `description`, `body`, `altbody`, $time, `published`, 0, `ordering`, CONCAT('$time',`tempid`,`namekey`), `styles`, `subject`,`stylesheet`,`fromname`,`fromemail`,`replyname`,`replyemail`,`thumb`,`readmore`,`category` FROM `#__acymailing_template` WHERE `tempid` IN (".implode(',', $cids).')';
		$db->setQuery($query);
		$db->query();

		$orderClass = acymailing_get('helper.order');
		$orderClass->pkey = 'tempid';
		$orderClass->table = 'template';
		$orderClass->reOrder();

		return $this->listing();
	}

	function store(){
		if(!$this->isAllowed($this->aclCat, 'manage')) return;
		JRequest::checkToken() or die('Invalid Token');

		$app = JFactory::getApplication();
		$app->isAdmin() or die('Only from the back-end');

		$templateClass = acymailing_get('class.template');
		$status = $templateClass->saveForm();
		if($status){
			acymailing_enqueueMessage(acymailing_translation('JOOMEXT_SUCC_SAVED'), 'message');
			$templateClass->proposeApplyAreas(JRequest::getInt('tempid'));
		}else{
			acymailing_enqueueMessage(acymailing_translation('ERROR_SAVING'), 'error');
			if(!empty($templateClass->errors)){
				foreach($templateClass->errors as $oneError){
					acymailing_enqueueMessage($oneError, 'error');
				}
			}
		}
	}

	function theme(){
		if(!$this->isAllowed($this->aclCat, 'view')) return;
		JRequest::setVar('layout', 'theme');
		return parent::display();
	}

	function upload(){
		if(!$this->isAllowed($this->aclCat, 'manage')) return;
		JRequest::setVar('layout', 'upload');
		return parent::display();
	}

	function doupload(){
		if(!$this->isAllowed($this->aclCat, 'manage')) return;
		JRequest::checkToken() or die('Invalid Token');

		$templateClass = acymailing_get('class.template');
		$statusUpload = $templateClass->doupload();

		if($statusUpload){
			if(!$templateClass->proposedAreas){
				$js = "setTimeout('redirect()',2000); function redirect(){window.top.location.href = 'index.php?option=com_acymailing&ctrl=template'; }";
				$doc = JFactory::getDocument();
				$doc->addScriptDeclaration($js);
			}
			return;
		}else{
			return $this->upload();
		}
	}

	function export(){
		if(!$this->isAllowed($this->aclCat, 'manage')) return;
		JRequest::checkToken() or die('Invalid Token');

		$cids = JRequest::getVar('cid', array(), '', 'array');

		acymailing_arrayToInteger($cids);
		$templateClass = acymailing_get('class.template');
		$resExport = $templateClass->export($cids[0]);

		if(!empty($resExport)) acymailing_enqueueMessage(acymailing_translation_sprintf('ACYTEMPLATE_EXPORTED', '', ''), 'success');
		return $this->listing();
	}

	function test(){
		if(!$this->isAllowed($this->aclCat, 'manage')) return;
		$this->store();

		$tempid = acymailing_getCID('tempid');
		$test_selection = JRequest::getVar('test_selection', '', '', 'string');
		if(empty($tempid) OR empty($test_selection)) return;

		$mailer = acymailing_get('helper.mailer');
		$mailer->report = true;
		$config = acymailing_config();
		$subscriberClass = acymailing_get('class.subscriber');
		$userHelper = acymailing_get('helper.user');
		JPluginHelper::importPlugin('acymailing');
		$dispatcher = JDispatcher::getInstance();

		$receivers = array();
		if($test_selection == 'users'){
			$receiverEntry = JRequest::getVar('test_emails', '', '', 'string');
			if(!empty($receiverEntry)){
				if(substr_count($receiverEntry, '@') > 1){
					$receivers = explode(',', trim(preg_replace('# +#', '', $receiverEntry)));
				}else{
					$receivers[] = trim($receiverEntry);
				}
			}
		}else{
			$gid = JRequest::getInt('test_group', '-1');
			if($gid == -1) return false;
			$db = JFactory::getDBO();
			if(!ACYMAILING_J16){
				$db->setQuery('SELECT email FROM '.acymailing_table('users', false).' WHERE gid = '.intval($gid));
			}else $db->setQuery('SELECT u.email FROM '.acymailing_table('users', false).' AS u JOIN '.acymailing_table('user_usergroup_map', false).' AS ugm ON u.id = ugm.user_id WHERE ugm.group_id = '.intval($gid));
			$receivers = acymailing_loadResultArray($db);
		}

		if(empty($receivers)){
			acymailing_enqueueMessage(acymailing_translation('NO_SUBSCRIBER'), 'notice');
			return $this->edit();
		}

		$classTemplate = acymailing_get('class.template');
		$myTemplate = $classTemplate->get($tempid);
		$myTemplate->sendHTML = 1;
		$myTemplate->mailid = 0;
		$myTemplate->template = $myTemplate;
		if(empty($myTemplate->subject)) $myTemplate->subject = $myTemplate->name;
		if(empty($myTemplate->altBody)) $myTemplate->altbody = $mailer->textVersion($myTemplate->body);
		$dispatcher->trigger('acymailing_replacetags', array(&$myTemplate, true));

		$myTemplate->body = acymailing_absoluteURL($myTemplate->body);

		$result = true;
		foreach($receivers as $receiveremail){
			$copy = $myTemplate;
			$mailer->clearAll();
			$mailer->setFrom($copy->fromemail, $copy->fromname);
			if(!empty($copy->replyemail)){
				$replyToName = $config->get('add_names', true) ? $mailer->cleanText($copy->replyname) : '';
				$mailer->AddReplyTo($mailer->cleanText($copy->replyemail), $replyToName);
			}

			$receiver = $subscriberClass->get($receiveremail);
			if(empty($receiver->subid)){
				if($userHelper->validEmail($receiveremail)){
					$newUser = new stdClass();
					$newUser->email = $receiveremail;
					$subscriberClass->sendConf = false;
					$subid = $subscriberClass->save($newUser);
					$receiver = $subscriberClass->get($subid);
				}
				if(empty($receiver->subid)) continue;
			}

			$addedName = $config->get('add_names', true) ? $mailer->cleanText($receiver->name) : '';
			$mailer->AddAddress($mailer->cleanText($receiver->email), $addedName);

			$dispatcher->trigger('acymailing_replaceusertags', array(&$copy, &$receiver, true));
			$mailer->isHTML(true);
			$mailer->Body = $copy->body;
			$mailer->Subject = $copy->subject;
			if($config->get('multiple_part', false)){
				$mailer->AltBody = $copy->altbody;
			}

			$mailer->send();
		}

		return $this->edit();
	}
}

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper'

describe Landable::Liquid do
  specify 'registered tags' do
    Liquid::Template.tags['title_tag'].should eq Landable::Liquid::TitleTag
    Liquid::Template.tags['meta_tags'].should eq Landable::Liquid::MetaTag
    Liquid::Template.tags['head_content'].should eq Landable::Liquid::HeadContent
    Liquid::Template.tags['head'].should eq Landable::Liquid::Head
    Liquid::Template.tags['body'].should eq Landable::Liquid::Body
    Liquid::Template.tags['img_tag'].should eq Landable::Liquid::AssetTag
    Liquid::Template.tags['image_tag'].should eq Landable::Liquid::AssetTag
    Liquid::Template.tags['javascript_include_tag'].should eq Landable::Liquid::AssetTag
    Liquid::Template.tags['stylesheet_link_tag'].should eq Landable::Liquid::AssetTag
    Liquid::Template.tags['asset_url'].should eq Landable::Liquid::AssetAttributeTag
    Liquid::Template.tags['asset_description'].should eq Landable::Liquid::AssetAttributeTag
    Liquid::Template.tags['template'].should eq Landable::Liquid::TemplateTag
  end

  specify 'registered filters' do
    Liquid::Strainer.class_variable_get(:@@known_filters).should include(Landable::Liquid::DefaultFilter)
  end
end


text:
FROM phusion/baseimage:0.9.19
MAINTAINER Carlos Ferreyra <crypticmind@gmail.com>

# The base image's init process
CMD ["/sbin/my_init"]

# osTicket will be available on this port
EXPOSE 8080

# Install required packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y nginx php-fpm php-mysql php-imap php-gd php-xml php-mbstring php-intl php-apcu net-tools git

# Disable dangerous option
RUN sed -i~ 's/.*cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php/7.0/fpm/php.ini

# Catch PHP FPM worker output to help debugging
RUN sed -i~ 's/.*catch_workers_output.*/catch_workers_output = yes/' /etc/php/7.0/fpm/pool.d/www.conf

# Copy configuration file and deploy osTicket
COPY fs /

# Switch to select SETUP mode.
ENV OSTICKET_SETUP no

# Location of externalized configuration files
VOLUME /config

# Cleanup
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*


text:
BY VICTORIA REA

Access to education is a fundamental human right, as enshrined in Article 26 of the Universal Declaration of Human Rights. Throughout the world there is a disparity to access of not only education but also high quality educational resources. Open Education is a viable solution to widening access to quality education for all students worldwide.

 A student, by Petrus van der Velden. Gift of the New Zealand Academy of Fine Arts, 1936. Te Papa (1936-0012-109). No known copyright.

What is Open Education?

Open Education is based on the simple idea that knowledge is powerful and a public good, and that it is in the best interests of society to increase access to education and educational resources in order to produce a well informed and educated citizenry.

Over the last few years, more and more educators and educational institutions have started to open their resources under open licences, so that these resources can be freely (and legally) accessed, shared and adapted. Open Education provides everyone access to learning materials, most of all those non-traditional groups of students that aren't engaged in the formal education system.

Why is it Important in Tertiary Education?

Given the changes in technology over the last decade,most universities and other tertiary education institutions have been relatively slow to recognise the potential of open educational resources. Higher educational institutions have been using the internet and other digital technologies for several years. Yet, until recently, most learning materials were locked up behind passwords in closed systems that were unreachable for outsiders. Open Education aims to break down such barriers and encourage and enable the free sharing of content.

Universities are constantly trying to improve their teaching practices by making their processes more engaging and motivating and Open Education Resources are a good method to address some of the problems that tertiary students currently face.

Here are five broader arguments on why higher education institutions should develop open education resources:

The sharing of knowledge is a good thing, in line with human rights and generally speaking beneficial for society, especially those with little access to formal higher education;

Resources developed by publicly funded institutions should be able to be freely shared and reused by the public;

Sharing and reusing content reduces the costs of development i, thereby increasing efficiency;

Open education resources presents a more positive and accessible view of education and can attract new students;

Open practices can increase the quality and innovation of resources, as less time has to be spent on information that has already been collated by someone else.

The Cost of Education

The cost of education, and especially higher education, is ever increasing. When enrolling in university, you not only already face the $600- $800 dollars to enroll in one paper for one semester; you also face the sometimes exorbitant prices for some textbooks and resources. Students often have to turn to outdated editions of textbooks -- or even opt not to buy them due to their unaffordability.

When you pay $100 for the latest edition of an 'essential' textbook (which the lecturer is the author of), and also use it twice in a semester, it is easy to see why many are calling for open educational resources. Also, due to the increasing spread by which knowledge and information is produced and disseminated throughout the globe, textbooks can become less relevant days after they are printed when new information comes to light. There is a strong need for up to date and accurate information especially in tertiary education.

Open Education Resources are a way to mitigate this problem. The price of educational content doesn't need to be as expensive as it currently is. Through sharing this content online, we can add to the pool of information which students all around the world can have access to with little to no financial hindrance.

Conclusion

Education is an integral part of society and participation in higher education is increasingly in demand throughout the world. Despite the large number of people engaged in education there are still barriers to education such as the cost of resources. The idea of Open Educational Resources has the ability to mitigate some of the barriers facing people trying to enter the tertiary education sector.

Victoria Rea is a law student at Victoria University of Wellington, and is currently working as an intern for Creative Commons Aotearoa New Zealand.


text:
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="Thu, 01 Dec 1994 16:00:00 GMT">


text:
%initialize variables
nM = 10000; %number of mosquitoes at start
L = 100; %size of workspace (m)
nIters = 200; %number of iterations to run mosquito simulation at a time
timeStep = 1; %time per iteration (s)
cumIters = 0; %cumulative iteration counter
numKilled = 0; %number of mosquitoes killed

%initialize mosquito positions randomly
PoseM = [L*rand(nM,2),2*pi*rand(nM,1),ones(nM,1)];

%display scatter plot of positions
figure(1);
set(gcf,'color','w');
%draw mosquitos
hMos = scatter(PoseM(:,1),PoseM(:,2),3*PoseM(:,4),'r','*');
axis equal  %make axis lengths equal
axis(L*[0,1,0,1])
xlabel('X Position (m)');
ylabel('Y Position (m)');
title({['Positions of ', num2str(nM), ' Mosquitoes'];['After ', num2str(cumIters), ' Iterations']})

pause(0.01)

for i=1:100
    %simulate mosquitoes for nIters time steps
    PoseM = MosquitoFlightSimWalled(PoseM,L,nIters);
    cumIters = cumIters + nIters;

    %display scatter plot of positions
    set(hMos,'Xdata', PoseM(:,1),'Ydata',PoseM(:,2))
    title({['Positions of ', num2str(nM), ' Mosquitoes'];['After ', num2str(cumIters), ' Iterations']})
    pause(0.1)

    %update histogram every 10 loop iterations
    if(mod(i, 10) == 0)
        figure(7)
        hist3(PoseM(:,1:2))
    end
end


text:
'use strict';
var batchedUpdates = require('react-dom').unstable_batchedUpdates;

module.exports = function createBatchedUpdatePlugin(options) {
    /**
     * @class BatchedUpdatePlugin
     */
    return {
        name: 'BatchedUpdatePlugin',
        /**
         * Called to plug the FluxContext
         * @method plugContext
         * @returns {Object}
         */
        plugContext: function plugContext() {
            return {
                /**
                 * Provides full access to the router in the action context
                 * @param {Object} actionContext
                 */
                plugActionContext: function plugActionContext(actionContext) {
                    var oldDispatch = actionContext.dispatch;
                    actionContext.dispatch = function () {
                        var args = arguments;
                        batchedUpdates(function () {
                            oldDispatch.apply(actionContext, args);
                        });
                    };
                }
            };
        }
    };
};


text:
namespace Lodtalk
{

ObjectHeader *VMContext::newObject(size_t fixedSlotCount, size_t indexableSize, ObjectFormat format, int classIndex, int identityHash)
{
	// Compute the header size.
	size_t indexableSlotCount = 0;
	auto indexableSlotSize = variableSlotSizeFor(format);
	auto indexableFormatExtraBits = 0;
	bool hasPrimitiveData = false;
	if(indexableSlotSize && indexableSize)
	{
		if(format < OF_INDEXABLE_NATIVE_FIRST)
		{
			indexableSlotCount = indexableSize;
		}
#ifndef OBJECT_MODEL_SPUR_64
		else if(format == OF_INDEXABLE_64)
		{
			indexableSlotCount = indexableSize * 2;
			hasPrimitiveData = true;
		}
#endif
		else
		{
			hasPrimitiveData = true;
			size_t divisor = variableSlotDivisor(format);
			size_t mask = (divisor - 1);

		 	indexableSlotCount = ((indexableSize + divisor - 1) & (~mask)) / divisor;
			indexableFormatExtraBits = int(indexableSize & mask);
			assert(indexableSize <= indexableSlotCount*divisor);
		}
	}

	// Compute more sizes
	auto totalSlotCount = fixedSlotCount + indexableSlotCount;
	auto headerSize = sizeof(ObjectHeader);
    auto bigObject = totalSlotCount >= 255;
	auto bodySize = totalSlotCount * sizeof(void*);
	auto objectSize = headerSize + bodySize;

	// Allocate the object memory
	auto data = allocateObjectMemory(objectSize, bigObject);
	auto header = reinterpret_cast<ObjectHeader*> (data);

	// Generate a hash if requested.
	if(identityHash < 0)
		identityHash = generateIdentityHash(data);

	// Set the object header.
	*header = {0};
	header->slotCount = totalSlotCount < 255 ? totalSlotCount : 255;
	header->identityHash = identityHash;
	header->objectFormat = format + indexableFormatExtraBits;
	header->classIndex = classIndex;
	if(bigObject)
        reinterpret_cast<uint64_t*> (header)[-1] = totalSlotCount;

	// Initialize the slots.
	auto slotStarts = data + headerSize;
	if(!hasPrimitiveData)
	{
		auto slots = reinterpret_cast<Object**> (slotStarts);
		for(size_t i = 0; i < totalSlotCount; ++i)
			slots[i] = &NilObject;
	}
	else
	{
		memset(slotStarts, 0, bodySize);
	}

	// Return the object.
	return header;
}

ObjectHeader *VMContext::basicNativeNewFromClassIndex(size_t classIndex)
{
    auto clazz = getClassFromIndex((int)classIndex);
    assert(isClassOrMetaclass(clazz));
    auto desc = reinterpret_cast<ClassDescription*> (clazz.pointer);
    return reinterpret_cast<ObjectHeader*> (desc->basicNativeNew(this));
}

ObjectHeader *VMContext::basicNativeNewFromFactory(AbstractClassFactory *factory)
{
    LODTALK_UNIMPLEMENTED();
}

// Class testing
bool VMContext::isClassOrMetaclass(Oop oop)
{
	auto classIndex = classIndexOf(oop);
	if(classIndex == SCI_Metaclass)
		return true;

	auto clazz = getClassFromIndex(classIndexOf(oop));
	return classIndexOf(clazz) == SCI_Metaclass;
}

bool VMContext::isMetaclass(Oop oop)
{
	return classIndexOf(oop) == SCI_Metaclass;
}

bool VMContext::isClass(Oop oop)
{
	return isClassOrMetaclass(oop) && !isMetaclass(oop);
}

// Object creation / accessing
Oop VMContext::positiveInt32ObjectFor(uint32_t value)
{
    if(unsignedFitsInSmallInteger(value))
        return Oop::encodeSmallInteger(value);
    LODTALK_UNIMPLEMENTED();
}

Oop VMContext::positiveInt64ObjectFor(uint64_t value)
{
    if(unsignedFitsInSmallInteger(value))
        return Oop::encodeSmallInteger(value);
    LODTALK_UNIMPLEMENTED();
}

Oop VMContext::signedInt32ObjectFor(int32_t value)
{
    if(signedFitsInSmallInteger(value))
        return Oop::encodeSmallInteger(value);
    LODTALK_UNIMPLEMENTED();
}

Oop VMContext::signedInt64ObjectFor(int64_t value)
{
    if(signedFitsInSmallInteger(value))
        return Oop::encodeSmallInteger(value);
    LODTALK_UNIMPLEMENTED();
}

uint32_t VMContext::positiveInt32ValueOf(Oop value)
{
    if(value.isSmallInteger())
        return (uint32_t)value.decodeSmallInteger();
    LODTALK_UNIMPLEMENTED();
}

uint64_t VMContext::positiveInt64ValueOf(Oop value)
{
    if(value.isSmallInteger())
        return value.decodeSmallInteger();
    LODTALK_UNIMPLEMENTED();
}

Oop VMContext::floatObjectFor(double value)
{
    if(floatFitsInSmallFloat(value))
        return Oop::encodeSmallFloat(value);
    LODTALK_UNIMPLEMENTED();
}

double VMContext::floatValueOf(Oop object)
{
    if(object.isSmallFloat())
        return object.decodeSmallFloat();
    LODTALK_UNIMPLEMENTED();
}

Oop VMContext::makeByteString(const std::string &content)
{
	return ByteString::fromNative(this, content).getOop();
}

Oop VMContext::makeByteSymbol(const std::string &content)
{
	return ByteSymbol::fromNative(this, content);
}

Oop VMContext::makeSelector(const std::string &content)
{
	return makeByteSymbol(content);
}

// Get a class from its index
Oop VMContext::getClassFromIndex(int classIndex)
{
    auto clazz = memoryManager->getClassTable()->getClassFromIndex(classIndex);
	return Oop::fromPointer(clazz);
}

Oop VMContext::getClassFromOop(Oop oop)
{
	return getClassFromIndex(classIndexOf(oop));
}

void VMContext::registerClassInTable(Oop clazz)
{
    memoryManager->getClassTable()->registerClass(clazz);
}

size_t VMContext::getFixedSlotCountOfClass(Oop clazzOop)
{
    auto clazz = reinterpret_cast<ClassDescription*> (clazzOop.pointer);
    return clazz->fixedVariableCount.decodeSmallInteger();
}

size_t Oop::getFixedSlotCount(VMContext *context) const
{
    return context->getFixedSlotCountOfClass(context->getClassFromOop(*this));
}

// Global dictionary
void VMContext::createGlobalDictionary()
{
    WithoutGC wgc(this);

    // Create the global dictionary
    globalDictionary = SystemDictionary::create(this);
    registerGCRoot((Oop*)&globalDictionary, 1);

    // Create the smalltalk image object
    auto smalltalk = SmalltalkImage::create(this);
    setGlobalVariable(makeByteSymbol("Smalltalk"), Oop::fromPointer(smalltalk));
    smalltalk->globals = Oop::fromPointer(globalDictionary);
}

Oop VMContext::setGlobalVariable(const char *name, Oop value)
{
	return setGlobalVariable(ByteSymbol::fromNative(this, name), value);
}

Oop VMContext::setGlobalVariable(Oop symbol, Oop value)
{
	// Set the existing value.
	auto globalVar = globalDictionary->getNativeAssociationOrNil(symbol);
	if(classIndexOf(Oop::fromPointer(globalVar)) == SCI_GlobalVariable)
	{
		globalVar->value = value;
		return Oop::fromPointer(globalVar);
	}

	// Create the global variable
	Ref<Association> newGlobalVar(this, GlobalVariable::make(this, symbol, value));
	globalDictionary->putNativeAssociation(this, newGlobalVar.get());
	return newGlobalVar.getOop();
}

Oop VMContext::getGlobalFromName(const char *name)
{
	return getGlobalFromSymbol(makeByteSymbol(name));
}

Oop VMContext::getGlobalFromSymbol(Oop symbol)
{
	return Oop::fromPointer(globalDictionary->getNativeAssociationOrNil(symbol));
}

Oop VMContext::getGlobalValueFromName(const char *name)
{
	return getGlobalValueFromSymbol(ByteSymbol::fromNative(this, name));
}

Oop VMContext::getGlobalValueFromSymbol(Oop symbol)
{
	auto globalVar = globalDictionary->getNativeAssociationOrNil(symbol);
	if(classIndexOf(Oop::fromPointer(globalVar)) != SCI_GlobalVariable)
		return nilOop();
	return globalVar->value;
}

Oop VMContext::getGlobalContext()
{
	return getClassFromIndex(SCI_GlobalContext);
}

// Object reading
std::string VMContext::getClassNameOfObject(Oop object)
{
	auto classIndex = classIndexOf(object);
	auto classOop = getClassFromIndex(classIndex);
	if(classOop.header->classIndex == SCI_Metaclass)
    {
        auto meta = reinterpret_cast<Metaclass*> (classOop.pointer);
        if(!meta->thisClass.isNil())
        {
            auto clazz = reinterpret_cast<Class*> (meta->thisClass.pointer);
    		return clazz->getNameString() + " class";
        }

        return "a Metaclass";
    }

	auto clazz = reinterpret_cast<Class*> (classOop.pointer);
	return clazz->getNameString();
}

std::string VMContext::getByteSymbolData(Oop object)
{
	auto symbol = reinterpret_cast<ByteSymbol*> (object.pointer);
	return symbol->getString();
}

std::string VMContext::getByteStringData(Oop object)
{
	auto string = reinterpret_cast<ByteString*> (object.pointer);
	return string->getString();
}

// Special selectors.
Oop VMContext::getBlockActivationSelector(size_t argumentCount)
{
    auto specialObjects = getSpecialRuntimeObjects();
    if(argumentCount >= specialObjects->blockActivationSelectorCount)
        return Oop();
    return specialObjects->specialObjectTable[specialObjects->blockActivationSelectorFirst + argumentCount];
}

Oop VMContext::getSpecialMessageSelector(SpecialMessageSelector selectorIndex)
{
    auto specialObjects = getSpecialRuntimeObjects();
    return specialObjects->specialObjectTable[specialObjects->specialMessageSelectorFirst + (size_t)selectorIndex];
}

Oop VMContext::getCompilerOptimizedSelector(CompilerOptimizedSelector selectorIndex)
{
    auto specialObjects = getSpecialRuntimeObjects();
    return specialObjects->specialObjectTable[specialObjects->compilerMessageSelectorFirst + (size_t)selectorIndex];
}

CompilerOptimizedSelector VMContext::getCompilerOptimizedSelectorId(Oop selector)
{
    auto specialObjects = getSpecialRuntimeObjects();
    for(int i = 0; i < (int)CompilerOptimizedSelector::CompilerMessageCount; ++i)
    {
        if(specialObjects->specialObjectTable[specialObjects->compilerMessageSelectorFirst + i] == selector)
            return CompilerOptimizedSelector(i);
    }

    return CompilerOptimizedSelector::Invalid;

}

} // End of namespace Lodtalk


text:
def load_json(file_name, root_element):
    import json
    from jsmin import jsmin

    with open(file_name) as f:
        return json.loads(jsmin(f.read()))[root_element]


text:
package com.firstpeople.paintpad.shapes;

import android.graphics.Canvas;
import android.graphics.Paint;

import com.firstpeople.paintpad.interfaces.Shapable;

public class Line extends ShapeAbstract {

	public Line(Shapable paintTool) {
		super(paintTool);
	}

	@Override
	public void draw(Canvas canvas,Paint paint) {
		super.draw(canvas, paint);
		canvas.drawLine(x1, y1, x2, y2, paint);
	}

	@Override
	public String toString() {
		return " line";
	}
}


text:
package log

import "runtime"

var defaultLogger = NewLogger("", 4)

//Log logs normal info with a string
func Log(args ...interface{}) {
	defaultLogger.Log(args...)
}

//Logf logs normal info with a string format
func Logf(format string, args ...interface{}) {
	defaultLogger.Logf(format, args...)
}

//Trace is Log with stack info
func Trace(args ...interface{}) {
	defaultLogger.Trace(args...)
}

//Tracef is Logf with stack info
func Tracef(format string, args ...interface{}) {
	defaultLogger.Tracef(format, args...)
}

//Error logs error info with an error
func Error(err error) {
	defaultLogger.Error(err)
}

//Errorf logs error info with a string format
func Errorf(format string, args ...interface{}) {
	defaultLogger.Errorf(format, args...)
}

//NewErrorf logs error info with a string format and return an error with that message
func NewErrorf(format string, args ...interface{}) error {
	return defaultLogger.NewErrorf(format, args...)
}

//NewError logs error info with a string and return an error with that message
func NewError(args ...interface{}) error {
	return defaultLogger.NewError(args...)
}

func RecoverErrorf(format string, args ...interface{}) {
	defaultLogger.RecoverErrorf(format, args...)
}

func StackTrace(all bool) string {
	// Reserve 10K buffer at first
	buf := make([]byte, 10240)

	for {
		size := runtime.Stack(buf, all)
		// The size of the buffer may be not enough to hold the stacktrace,
		// so double the buffer size
		if size == len(buf) {
			buf = make([]byte, len(buf)<<1)
			continue
		}
		break
	}

	return string(buf)
}


text:
            Walk-in Information
            Active
            Inactive

                Created at {{(walkin.created | date:'short') || 'N/A'}}

                Updated at {{(walkin.updated | date:'short') || 'N/A'}}

Customer information

                        NetID:

{{walkin.user.username}}

                        Name:

{{walkin.user.displayName}}

                        Phone:

{{walkin.user.phone}}

                        Housing:

{{walkin.user.location}}

Device information

                    Device Type:

{{walkin.deviceCategory}}

                    Device info:

{{walkin.deviceType}}

{{walkin.os}}

N/A

                    Other info:

{{walkin.otherDevice}}

                    Problem description:

{{walkin.description}}

                Process information {{walkin.status}}

                    Started by {{walkin.serviceTechnician.displayName}}

                    at {{(walkin.serviceStartTime | date:'short') || 'N/A'}}

                    Resolution type:

                        {{walkin.resolutionType}}

                    Resolution subject:

                        {{walkin.otherResolution}}

                    Resolution:

Resolved at {{(walkin.resolutionTime | date:'short') || 'N/A'}} by {{walkin.resoluteTechnician.displayName}}

                    Work Note:

        ServiceNow Inserted
        <button class="btn btn-default" ng-click="close()">Cancel</button>


text:
package org.apache.hadoop.registry.client.binding;

import org.apache.hadoop.util.Preconditions;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.fs.PathNotFoundException;
import org.apache.hadoop.registry.client.exceptions.InvalidPathnameException;
import org.apache.hadoop.registry.client.impl.zk.RegistryInternalConstants;
import org.apache.zookeeper.common.PathUtils;

import java.net.IDN;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Basic operations on paths: manipulating them and creating and validating
 * path elements.
 */
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class RegistryPathUtils {

  /**
   * Compiled down pattern to validate single entries in the path
   */
  private static final Pattern PATH_ENTRY_VALIDATION_PATTERN =
      Pattern.compile(RegistryInternalConstants.VALID_PATH_ENTRY_PATTERN);

  private static final Pattern USER_NAME =
      Pattern.compile("/users/([a-z][a-z0-9-.]*)");

  /**
   * Validate ZK path with the path itself included in
   * the exception text
   * @param path path to validate
   * @return the path parameter
   * @throws InvalidPathnameException if the pathname is invalid.
   */
  public static String validateZKPath(String path) throws
      InvalidPathnameException {
    try {
      PathUtils.validatePath(path);

    } catch (IllegalArgumentException e) {
      throw new InvalidPathnameException(path,
          "Invalid Path \"" + path + "\" : " + e, e);
    }
    return path;
  }

  /**
   * Validate ZK path as valid for a DNS hostname.
   * @param path path to validate
   * @return the path parameter
   * @throws InvalidPathnameException if the pathname is invalid.
   */
  public static String validateElementsAsDNS(String path) throws
      InvalidPathnameException {
    List<String> splitpath = split(path);
    for (String fragment : splitpath) {
      if (!PATH_ENTRY_VALIDATION_PATTERN.matcher(fragment).matches()) {
        throw new InvalidPathnameException(path,
            "Invalid Path element \"" + fragment + "\"");
      }
    }
    return path;
  }

  /**
   * Create a full path from the registry root and the supplied subdir
   * @param path path of operation
   * @return an absolute path
   * @throws InvalidPathnameException if the path is invalid
   */
  public static String createFullPath(String base, String path) throws
      InvalidPathnameException {
    Preconditions.checkArgument(path != null, "null path");
    Preconditions.checkArgument(base != null, "null path");
    return validateZKPath(join(base, path));
  }

  /**
   * Join two paths, guaranteeing that there will not be exactly
   * one separator between the two, and exactly one at the front
   * of the path. There will be no trailing "/" except for the special
   * case that this is the root path
   * @param base base path
   * @param path second path to add
   * @return a combined path.
   */
  public static String join(String base, String path) {
    Preconditions.checkArgument(path != null, "null path");
    Preconditions.checkArgument(base != null, "null path");
    StringBuilder fullpath = new StringBuilder();

    if (!base.startsWith("/")) {
      fullpath.append('/');
    }
    fullpath.append(base);

    // guarantee a trailing /
    if (!fullpath.toString().endsWith("/")) {
      fullpath.append("/");
    }
    // strip off any at the beginning
    if (path.startsWith("/")) {
      // path starts with /, so append all other characters -if present
      if (path.length() > 1) {
        fullpath.append(path.substring(1));
      }
    } else {
      fullpath.append(path);
    }

    //here there may be a trailing "/"
    String finalpath = fullpath.toString();
    if (finalpath.endsWith("/") && !"/".equals(finalpath)) {
      finalpath = finalpath.substring(0, finalpath.length() - 1);

    }
    return finalpath;
  }

  /**
   * split a path into elements, stripping empty elements
   * @param path the path
   * @return the split path
   */
  public static List<String> split(String path) {
    //
    String[] pathelements = path.split("/");
    List<String> dirs = new ArrayList<String>(pathelements.length);
    for (String pathelement : pathelements) {
      if (!pathelement.isEmpty()) {
        dirs.add(pathelement);
      }
    }
    return dirs;
  }

  /**
   * Get the last entry in a path; for an empty path
   * returns "". The split logic is that of
   * {@link #split(String)}
   * @param path path of operation
   * @return the last path entry or "" if none.
   */
  public static String lastPathEntry(String path) {
    List<String> splits = split(path);
    if (splits.isEmpty()) {
      // empty path. Return ""
      return "";
    } else {
      return splits.get(splits.size() - 1);
    }
  }

  /**
   * Get the parent of a path
   * @param path path to look at
   * @return the parent path
   * @throws PathNotFoundException if the path was at root.
   */
  public static String parentOf(String path) throws PathNotFoundException {
    List<String> elements = split(path);

    int size = elements.size();
    if (size == 0) {
      throw new PathNotFoundException("No parent of " + path);
    }
    if (size == 1) {
      return "/";
    }
    elements.remove(size - 1);
    StringBuilder parent = new StringBuilder(path.length());
    for (String element : elements) {
      parent.append("/");
      parent.append(element);
    }
    return parent.toString();
  }

  /**
   * Perform any formatting for the registry needed to convert
   * non-simple-DNS elements
   * @param element element to encode
   * @return an encoded string
   */
  public static String encodeForRegistry(String element) {
    return IDN.toASCII(element);
  }

  /**
   * Perform whatever transforms are needed to get a YARN ID into
   * a DNS-compatible name
   * @param yarnId ID as string of YARN application, instance or container
   * @return a string suitable for use in registry paths.
   */
  public static String encodeYarnID(String yarnId) {
    return yarnId.replace("container", "ctr").replace("_", "-");
  }

  /**
   * Return the username found in the ZK path.
   *
   * @param recPath the ZK recPath.
   * @return the user name.
   */
  public static String getUsername(String recPath) {
    String user = "anonymous";
    Matcher matcher = USER_NAME.matcher(recPath);
    if (matcher.find()) {
      user = matcher.group(1);
    }
    return user;
  }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Krypt. -Fl. Brandenburg (Leipzig) 7(3): 436 (1938)

#### Original name
Leptosphaeria helvetica Sacc. & Speg.

### Remarks
null


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
                  android:title="@string/display_settings">

    <PreferenceCategory
        android:key="mobile"
        android:title="@string/data_usage_metered_mobile"
        android:persistent="false" />

    <PreferenceCategory
        android:key="wifi"
        android:title="@string/data_usage_metered_wifi"
        android:persistent="false">

        <Preference
            android:key="wifi_disabled"
            android:summary="@string/data_usage_metered_wifi_disabled"
            android:persistent="false"
            android:selectable="false" />

    </PreferenceCategory>

    <Preference
        android:summary="@string/data_usage_metered_body"
        android:persistent="false"
        android:selectable="false" />

</PreferenceScreen>


text:
#ifndef BMD_DECKLINKAPI_v10_4_H
#define BMD_DECKLINKAPI_v10_4_H

#include "DeckLinkAPI.h"

// Type Declarations

/* Enum BMDDeckLinkConfigurationID - DeckLink Configuration ID */

typedef uint32_t BMDDeckLinkConfigurationID_v10_4;
enum _BMDDeckLinkConfigurationID_v10_4 {

    /* Video output flags */

    bmdDeckLinkConfigSingleLinkVideoOutput_v10_4                       = /* 'sglo' */ 0x73676C6F,
};

#endif /* defined(BMD_DECKLINKAPI_v10_4_H) */


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Scheduler: RlScheduler::SleepAction Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Scheduler

Main Page

Related Pages

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

RlScheduler

SleepAction

Public Member Functions |
List of all members

RlScheduler::SleepAction Class Reference

#include <actions.h>

Inheritance diagram for RlScheduler::SleepAction:

  <map id="RlScheduler::SleepAction_map" name="RlScheduler::SleepAction_map">
<area href="classRlScheduler_1_1Action.html" alt="RlScheduler::Action" shape="rect" coords="0,56,155,80"/>
<area href="classMdp_1_1Action.html" alt="Mdp::Action" shape="rect" coords="0,0,155,24"/>
</map>

Public Member Functions

 	SleepAction ()

 	SleepAction (int)

void 	performAction () override

std::string 	getName () override

std::shared_ptr< Scheduler::Process > 	getProcessToRun () override

 	returns the process to run according to the RL algorithm  More...

 Public Member Functions inherited from RlScheduler::Action

 	Action (int processId)

 Public Member Functions inherited from Mdp::Action

virtual 	~Action ()

Additional Inherited Members

 Protected Member Functions inherited from RlScheduler::Action

 	Action ()

 Protected Member Functions inherited from Mdp::Action

template<typename T >

std::shared_ptr< T > 	getModel ()

 Protected Attributes inherited from RlScheduler::Action

int 	id

 Protected Attributes inherited from Mdp::Action

std::shared_ptr< DomainModel > 	domainModel {nullptr}

Detailed Description

Definition at line 49 of file actions.h.

Constructor & Destructor Documentation

          SleepAction::SleepAction
          (
          	)

Definition at line 61 of file actions.cpp.

          RlScheduler::SleepAction::SleepAction
          (
          int
          	)

Member Function Documentation

          std::string SleepAction::getName
          (
          	)

overridevirtual

Reimplemented from RlScheduler::Action.

Definition at line 70 of file actions.cpp.

          std::shared_ptr< Scheduler::Process > SleepAction::getProcessToRun
          (
          	)

overridevirtual

returns the process to run according to the RL algorithm

Returns

returns null if the process is not available in the ready queue, and also not running. In case several jobs of the same task are runnable, and if one of them is currently running, the job currently running is given priority. Otherwise, no guarantee iis made about which of the jobs is selected.

Reimplemented from RlScheduler::Action.

Definition at line 76 of file actions.cpp.

          void SleepAction::performAction
          (
          	)

overridevirtual

Reimplemented from RlScheduler::Action.

Definition at line 66 of file actions.cpp.

The documentation for this class was generated from the following files:

src/rlScheduler/actions.h

src/rlScheduler/actions.cpp

<address class="footer">
Generated on Sun Nov 26 2017 17:01:37 for Scheduler by

 1.8.11
</address>


text:
My Personal Site based on Symblog

Vendors required

composer
doctrine
incenteev
jdorn
kriswallsmith
monolog
psr
sensio
swiftmailer
symfony
twig


text:
<!DOCTYPE html>

<meta charset="utf-8">
<title>shaping: test for Chromium bug 1304876</title>

Test passes if the word "office" is rendered without repeated letters.

Sanitary measures in the

office ought be adequately

maintained.

Sanitary measures in the

office ought be adequately

maintained.


text:
#pragma once

#include "drape/texture.hpp"
#include "drape/color.hpp"
#include "drape/dynamic_texture.hpp"

#include "base/buffer_vector.hpp"

#include <map>
#include <mutex>

namespace dp
{
class ColorKey : public Texture::Key
{
public:
  explicit ColorKey(Color color) : Texture::Key(), m_color(color) {}
  virtual Texture::ResourceType GetType() const { return Texture::ResourceType::Color; }

  Color m_color;
};

class ColorResourceInfo : public Texture::ResourceInfo
{
public:
  explicit ColorResourceInfo(m2::RectF const & texRect) : Texture::ResourceInfo(texRect) { }
  virtual Texture::ResourceType GetType() const { return Texture::ResourceType::Color; }
};

class ColorPalette
{
public:
  explicit ColorPalette(m2::PointU const & canvasSize);

  ref_ptr<Texture::ResourceInfo> ReserveResource(bool predefined, ColorKey const & key, bool & newResource);
  ref_ptr<Texture::ResourceInfo> MapResource(ColorKey const & key, bool & newResource);
  void UploadResources(ref_ptr<dp::GraphicsContext> context, ref_ptr<Texture> texture);

  void SetIsDebug(bool isDebug) { m_isDebug = isDebug; }

private:
  using TPalette = std::map<Color, ColorResourceInfo>;

  struct PendingColor
  {
    m2::RectU m_rect;
    Color m_color;
  };

  TPalette m_palette;
  TPalette m_predefinedPalette;
  buffer_vector<PendingColor, 16> m_nodes;
  buffer_vector<PendingColor, 16> m_pendingNodes;
  m2::PointU m_textureSize;
  m2::PointU m_cursor;
  bool m_isDebug = false;
  std::mutex m_lock;
  std::mutex m_mappingLock;
};

class ColorTexture : public DynamicTexture<ColorPalette, ColorKey, Texture::ResourceType::Color>
{
  using TBase = DynamicTexture<ColorPalette, ColorKey, Texture::ResourceType::Color>;
public:
  ColorTexture(m2::PointU const & size, ref_ptr<HWTextureAllocator> allocator)
    : m_palette(size)
  {
    TBase::DynamicTextureParams params{size, TextureFormat::RGBA8, TextureFilter::Nearest,
                                       false /* m_usePixelBuffer */};
    TBase::Init(allocator, make_ref(&m_palette), params);
  }

  void ReserveColor(dp::Color const & color);

  ~ColorTexture() override { TBase::Reset(); }

  static int GetColorSizeInPixels();

private:
  ColorPalette m_palette;
};
}  // namespace dp


text:
package systemd_test

import (
	"fmt"

	"github.com/cerana/cerana/acomm"
	systemdp "github.com/cerana/cerana/providers/systemd"
)

func (s *systemd) TestEnable() {
	defer func() {
		s.Require().NoError(disableAll("./_test_data"))
	}()

	tests := []struct {
		name    string
		runtime bool
		force   bool
		err     string
	}{
		{"", false, false, "missing arg: name"},
		{"doesnotexist.service", false, false, "No such file or directory"},
		{"systemd-test-loop.service", false, false, ""},
	}

	for _, test := range tests {
		args := &systemdp.EnableArgs{Name: test.name, Runtime: test.runtime, Force: test.force}
		argsS := fmt.Sprintf("%+v", test)
		req, err := acomm.NewRequest(acomm.RequestOptions{
			Task:         "systemd-enable",
			ResponseHook: s.responseHook,
			Args:         args,
		})
		s.Require().NoError(err, argsS)

		res, streamURL, err := s.systemd.Enable(req)
		s.Nil(streamURL, argsS)
		s.Nil(res, argsS)
		if test.err == "" {
			s.NoError(err, argsS)
		} else {
			s.EqualError(err, test.err, argsS)
		}
	}
}


text:
<?php

namespace Bobbyshaw\WatsonVisualRecognition\Message;

use Bobbyshaw\WatsonVisualRecognition\Exceptions\AuthException;
use GuzzleHttp\Exception\ClientException;
use GuzzleHttp\Psr7\Request;

/**
 * Class GetClassifierRequest
 * @package Bobbyshaw\WatsonVisualRecognition\Message
 */
class GetClassifierRequest extends AbstractRequest
{
    const CLASSIFIERS_PATH = 'classifiers/';

    public function getData()
    {
        $data = parent::getData();

        $data['classifier_id'] = $this->getClassifierId();

        return $data;
    }

    /**
     * Send HTTP request to get list of classifiers
     *
     * @param array $data
     * @return ClassifiersResponse
     * @throws AuthException
     */
    public function sendData($data)
    {
        $query = ['version' => $data['version']];

        $request = new Request(
            'GET',
            $this->getApiUrl(static::CLASSIFIERS_PATH) . $data['classifier_id'] . '?' . http_build_query($query),
            ['Authorization' => 'Basic ' . base64_encode($data['username'] . ':' . $data['password'])]
        );

        $this->response = null;

        try {
            $response = $this->httpClient->send($request);
            $this->response = new ClassifierResponse($this, $response->getBody());
        } catch (ClientException $e) {
            if ($e->getCode() == 401) {
                throw new AuthException('Invalid credentials provided');
            }
        }

        return $this->response;
    }
}


text:
package clientv3

import (
	"crypto/tls"
	"errors"
	"fmt"
	"io/ioutil"
	"log"
	"net"
	"net/url"
	"strings"
	"time"

	"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"

	"golang.org/x/net/context"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/credentials"
	"google.golang.org/grpc/metadata"
)

var (
	ErrNoAvailableEndpoints = errors.New("etcdclient: no available endpoints")
)

// Client provides and manages an etcd v3 client session.
type Client struct {
	Cluster
	KV
	Lease
	Watcher
	Auth
	Maintenance

	conn         *grpc.ClientConn
	cfg          Config
	creds        *credentials.TransportCredentials
	balancer     *simpleBalancer
	retryWrapper retryRpcFunc

	ctx    context.Context
	cancel context.CancelFunc

	// Username is a username for authentication
	Username string
	// Password is a password for authentication
	Password string
}

// New creates a new etcdv3 client from a given configuration.
func New(cfg Config) (*Client, error) {
	if len(cfg.Endpoints) == 0 {
		return nil, ErrNoAvailableEndpoints
	}

	return newClient(&cfg)
}

// NewFromURL creates a new etcdv3 client from a URL.
func NewFromURL(url string) (*Client, error) {
	return New(Config{Endpoints: []string{url}})
}

// NewFromConfigFile creates a new etcdv3 client from a configuration file.
func NewFromConfigFile(path string) (*Client, error) {
	cfg, err := configFromFile(path)
	if err != nil {
		return nil, err
	}
	return New(*cfg)
}

// Close shuts down the client's etcd connections.
func (c *Client) Close() error {
	c.cancel()
	return toErr(c.ctx, c.conn.Close())
}

// Ctx is a context for "out of band" messages (e.g., for sending
// "clean up" message when another context is canceled). It is
// canceled on client Close().
func (c *Client) Ctx() context.Context { return c.ctx }

// Endpoints lists the registered endpoints for the client.
func (c *Client) Endpoints() []string { return c.cfg.Endpoints }

type authTokenCredential struct {
	token string
}

func (cred authTokenCredential) RequireTransportSecurity() bool {
	return false
}

func (cred authTokenCredential) GetRequestMetadata(ctx context.Context, s ...string) (map[string]string, error) {
	return map[string]string{
		"token": cred.token,
	}, nil
}

func (c *Client) dialTarget(endpoint string) (proto string, host string, creds *credentials.TransportCredentials) {
	proto = "tcp"
	host = endpoint
	creds = c.creds
	url, uerr := url.Parse(endpoint)
	if uerr != nil || !strings.Contains(endpoint, "://") {
		return
	}
	// strip scheme:// prefix since grpc dials by host
	host = url.Host
	switch url.Scheme {
	case "unix":
		proto = "unix"
	case "http":
		creds = nil
	case "https":
		if creds != nil {
			break
		}
		tlsconfig := &tls.Config{}
		emptyCreds := credentials.NewTLS(tlsconfig)
		creds = &emptyCreds
	default:
		return "", "", nil
	}
	return
}

// dialSetupOpts gives the dial opts prior to any authentication
func (c *Client) dialSetupOpts(endpoint string, dopts ...grpc.DialOption) (opts []grpc.DialOption) {
	if c.cfg.DialTimeout > 0 {
		opts = []grpc.DialOption{grpc.WithTimeout(c.cfg.DialTimeout)}
	}
	opts = append(opts, dopts...)

	// grpc issues TLS cert checks using the string passed into dial so
	// that string must be the host. To recover the full scheme://host URL,
	// have a map from hosts to the original endpoint.
	host2ep := make(map[string]string)
	for i := range c.cfg.Endpoints {
		_, host, _ := c.dialTarget(c.cfg.Endpoints[i])
		host2ep[host] = c.cfg.Endpoints[i]
	}

	f := func(host string, t time.Duration) (net.Conn, error) {
		proto, host, _ := c.dialTarget(host2ep[host])
		if proto == "" {
			return nil, fmt.Errorf("unknown scheme for %q", host)
		}
		select {
		case <-c.ctx.Done():
			return nil, c.ctx.Err()
		default:
		}
		return net.DialTimeout(proto, host, t)
	}
	opts = append(opts, grpc.WithDialer(f))

	_, _, creds := c.dialTarget(endpoint)
	if creds != nil {
		opts = append(opts, grpc.WithTransportCredentials(*creds))
	} else {
		opts = append(opts, grpc.WithInsecure())
	}

	return opts
}

// Dial connects to a single endpoint using the client's config.
func (c *Client) Dial(endpoint string) (*grpc.ClientConn, error) {
	return c.dial(endpoint)
}

func (c *Client) dial(endpoint string, dopts ...grpc.DialOption) (*grpc.ClientConn, error) {
	opts := c.dialSetupOpts(endpoint, dopts...)
	host := getHost(endpoint)
	if c.Username != "" && c.Password != "" {
		// use dial options without dopts to avoid reusing the client balancer
		auth, err := newAuthenticator(host, c.dialSetupOpts(endpoint))
		if err != nil {
			return nil, err
		}
		defer auth.close()

		resp, err := auth.authenticate(c.ctx, c.Username, c.Password)
		if err != nil {
			return nil, err
		}
		opts = append(opts, grpc.WithPerRPCCredentials(authTokenCredential{token: resp.Token}))
	}

	conn, err := grpc.Dial(host, opts...)
	if err != nil {
		return nil, err
	}
	return conn, nil
}

// WithRequireLeader requires client requests to only succeed
// when the cluster has a leader.
func WithRequireLeader(ctx context.Context) context.Context {
	md := metadata.Pairs(rpctypes.MetadataRequireLeaderKey, rpctypes.MetadataHasLeader)
	return metadata.NewContext(ctx, md)
}

func newClient(cfg *Config) (*Client, error) {
	if cfg == nil {
		cfg = &Config{}
	}
	var creds *credentials.TransportCredentials
	if cfg.TLS != nil {
		c := credentials.NewTLS(cfg.TLS)
		creds = &c
	}

	// use a temporary skeleton client to bootstrap first connection
	ctx, cancel := context.WithCancel(context.TODO())
	client := &Client{
		conn:   nil,
		cfg:    *cfg,
		creds:  creds,
		ctx:    ctx,
		cancel: cancel,
	}
	if cfg.Username != "" && cfg.Password != "" {
		client.Username = cfg.Username
		client.Password = cfg.Password
	}

	client.balancer = newSimpleBalancer(cfg.Endpoints)
	conn, err := client.dial(cfg.Endpoints[0], grpc.WithBalancer(client.balancer))
	if err != nil {
		return nil, err
	}
	client.conn = conn
	client.retryWrapper = client.newRetryWrapper()

	// wait for a connection
	if cfg.DialTimeout > 0 {
		hasConn := false
		waitc := time.After(cfg.DialTimeout)
		select {
		case <-client.balancer.readyc:
			hasConn = true
		case <-ctx.Done():
		case <-waitc:
		}
		if !hasConn {
			client.cancel()
			conn.Close()
			return nil, grpc.ErrClientConnTimeout
		}
	}

	client.Cluster = NewCluster(client)
	client.KV = NewKV(client)
	client.Lease = NewLease(client)
	client.Watcher = NewWatcher(client)
	client.Auth = NewAuth(client)
	client.Maintenance = NewMaintenance(client)
	if cfg.Logger != nil {
		logger.Set(cfg.Logger)
	} else {
		// disable client side grpc by default
		logger.Set(log.New(ioutil.Discard, "", 0))
	}

	return client, nil
}

// ActiveConnection returns the current in-use connection
func (c *Client) ActiveConnection() *grpc.ClientConn { return c.conn }

// isHaltErr returns true if the given error and context indicate no forward
// progress can be made, even after reconnecting.
func isHaltErr(ctx context.Context, err error) bool {
	if ctx != nil && ctx.Err() != nil {
		return true
	}
	if err == nil {
		return false
	}
	code := grpc.Code(err)
	// Unavailable codes mean the system will be right back.
	// (e.g., can't connect, lost leader)
	// Treat Internal codes as if something failed, leaving the
	// system in an inconsistent state, but retrying could make progress.
	// (e.g., failed in middle of send, corrupted frame)
	// TODO: are permanent Internal errors possible from grpc?
	return code != codes.Unavailable && code != codes.Internal
}

func toErr(ctx context.Context, err error) error {
	if err == nil {
		return nil
	}
	err = rpctypes.Error(err)
	if _, ok := err.(rpctypes.EtcdError); ok {
		return err
	}
	code := grpc.Code(err)
	switch code {
	case codes.DeadlineExceeded:
		fallthrough
	case codes.Canceled:
		if ctx.Err() != nil {
			err = ctx.Err()
		}
	case codes.Unavailable:
		err = ErrNoAvailableEndpoints
	case codes.FailedPrecondition:
		err = grpc.ErrClientConnClosing
	}
	return err
}


text:
package org.apache.camel.component.whatsapp;

import org.apache.camel.AsyncCallback;
import org.apache.camel.Exchange;
import org.apache.camel.component.whatsapp.model.BaseMessage;

/**
 * Send messages to WhatsApp Business Cloud API
 */
public interface WhatsAppService {

    void sendMessage(Exchange exchange, AsyncCallback callback, BaseMessage message);

}


text:
public class A {

  public void testInlineRefactoring() {
    int[] array = new int[10];
    int index = computeIndex();
    array[in<caret>dex] = 22;
  }

  private int computeIndex() {
    return 0;
  }
}


text:
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE AllowAmbiguousTypes #-}

module Control.CP.FD.Example (
  example_main,
  example_sat_main,
  example_sat_main_void,
  example_sat_main_single,
  example_sat_main_single_expr,
  example_sat_main_coll_expr,
  example_min_main,
  example_min_main_void,
  example_min_main_single,
  example_min_main_single_expr,
  example_min_main_coll_expr,
  runSolve,
  labeller,
  postMinimize,
  ExampleModel, ExampleMinModel,
  module Control.CP.FD.Interface,
) where

import System.Environment (getArgs)
import Data.Maybe (fromJust,isJust)
import Data.Map (Map)
import qualified Data.Map as Map
import Data.List (init,last)

import Control.CP.FD.OvertonFD.OvertonFD
import Control.CP.FD.OvertonFD.Sugar
import Control.CP.FD.FD
import Control.CP.FD.Model

import Control.CP.Debug

import Control.CP.FD.Interface
import Control.CP.SearchTree
import Control.CP.EnumTerm
import Control.CP.ComposableTransformers
import Control.CP.FD.Solvers

import Control.Monad.Cont

type ExampleModel t =    (forall s m. (Show (FDIntTerm s), FDSolver s, MonadTree m, TreeSolver m ~ (FDInstance s)) => t -> m (ModelCol))
type ExampleMinModel t = (forall s m. (Show (FDIntTerm s), FDSolver s, MonadTree m, TreeSolver m ~ (FDInstance s)) => t -> m (ModelInt,ModelCol))

postMinimize :: ExampleMinModel t -> ExampleModel t
postMinimize m = \x -> do
  (min,res) <- m x
  debug ("postMinimize: min="++(show min)) $ return ()
  label $ do
    setMinimizeVar min
    return $ return res

runSolveSAT x = solve dfs fs x
runSolveMIN x = solve dfs (bb boundMinimize) x

runSolve False x = runSolveSAT x
runSolve True  x = runSolveMIN x

labeller col = do
  label $ do
    min <- getMinimizeVar
    case min of
      Nothing -> return $ labelCol col
      Just v -> return $ do
        enumerate [v]
        labelCol col

example_main :: ExampleModel [String] -> ExampleModel ModelInt -> ExampleModel ModelCol -> Bool -> IO ()
example_main f fx fcx typ = do
  args <- getArgs
  case args of
    ("overton_run":r) -> print $ runSolve typ $ ((f r) :: Tree (FDInstance OvertonFD) ModelCol) >>= labeller
    [] -> putStr "Solver type required: must be overton_run\n"
    (a:r) -> putStr ("Unsupported solver: " ++ a ++ "\n")

example_min_main :: ExampleMinModel [String] -> ExampleMinModel ModelInt -> ExampleMinModel ModelCol -> IO ()
example_min_main f fx fcx = example_main (postMinimize f) (postMinimize fx) (postMinimize fcx) True

example_sat_main :: ExampleModel [String] -> ExampleModel ModelInt -> ExampleModel ModelCol -> IO ()
example_sat_main f fx fcx = example_main f fx fcx False

example_sat_main_void :: ExampleModel () -> IO ()
example_sat_main_void f = example_sat_main (const $ f ()) (const $ f ()) (const $ f ())

example_min_main_void :: ExampleMinModel () -> IO ()
example_min_main_void f = example_min_main (const $ f ()) (const $ f ()) (const $ f ())

example_sat_main_single :: Read n => ExampleModel n -> IO ()
example_sat_main_single f = example_sat_main (f . read . head) (error "Uncompilable model") (error "Uncompilable model")

example_min_main_single :: Read n => ExampleMinModel n -> IO ()
example_min_main_single f = example_min_main (f . read . head) (error "Uncompilable model") (error "Uncompilable model")

example_sat_main_single_expr :: ExampleModel ModelInt -> IO ()
example_sat_main_single_expr f = example_sat_main (f . fromInteger . read . head) f (\x -> f $ x!(cte (0::Integer)))

example_min_main_single_expr :: ExampleMinModel ModelInt -> IO ()
example_min_main_single_expr f = example_min_main (f . fromInteger . read . head) f (\x -> f $ x!(cte (0::Integer)))

example_sat_main_coll_expr :: ExampleModel ModelCol -> IO ()
example_sat_main_coll_expr f = example_sat_main (f . list . foldr (++) [] . map (map fromInteger . read . (\x -> "[" ++ x ++ "]"))) (f. list . (\x -> [x])) f

example_min_main_coll_expr :: ExampleMinModel ModelCol -> IO ()
example_min_main_coll_expr f = example_min_main (f . list . foldr (++) [] . map (map fromInteger . read . (\x -> "[" ++ x ++ "]"))) (f. list . (\x -> [x])) f


text:
import unittest
import shutil
import tempfile
import datetime
import json
import os
from mock import patch, call
from dateutil.relativedelta import relativedelta

from taca_ngi_pipeline.deliver.deliver_grus import GrusProjectDeliverer, GrusSampleDeliverer, proceed_or_not, check_mover_version

SAMPLECFG = {
    'deliver': {
        'analysispath': '<ROOTDIR>/ANALYSIS',
        'datapath': '<ROOTDIR>/DATA',
        'stagingpath': '<ROOTDIR>/STAGING',
        'stagingpathhard': '<ROOTDIR>/STAGING_HARD',
        'deliverypath': '<ROOTDIR>/DELIVERY_DESTINATION',
        'operator': 'operator@domain.com',
        'logpath': '<ROOTDIR>/ANALYSIS/logs',
        'reportpath': '<ANALYSISPATH>',
        'copy_reports_to_reports_outbox': 'True',
        'reports_outbox': '/test/this/path',
        'deliverystatuspath': '<ANALYSISPATH>',
        'report_aggregate': 'ngi_reports ign_aggregate_report -n uppsala',
        'report_sample': 'ngi_reports ign_sample_report -n uppsala',
        'hash_algorithm': 'md5',
        'save_meta_info': 'True',
        'files_to_deliver': [
            ['<ANALYSISPATH>/level0_folder?_file*',
             '<STAGINGPATH>']]
        },
    'snic': {
        'snic_api_url': 'url',
        'snic_api_user': 'usr',
        'snic_api_password': 'pwd'
        },
    'statusdb': {
        'url': 'sdb_url',
        'username': 'sdb_usr',
        'password': 'sdb_pwd'
        }
    }

class TestMisc(unittest.TestCase):

    @patch('taca_ngi_pipeline.deliver.deliver_grus.input')
    def test_proceed_or_not(self, mock_input):
        mock_input.return_value = 'y'
        self.assertTrue(proceed_or_not('Q'))

        mock_input.return_value = 'no'
        self.assertFalse(proceed_or_not('Q'))

    @patch('taca_ngi_pipeline.deliver.deliver_grus.subprocess.check_output')
    def test_check_mover_version(self, mock_output):
        # No pattern match
        mock_output.return_value = 'no match'
        self.assertFalse(check_mover_version())

        # Match but wrong version
        mock_output.return_value = '/usr/local/mover/1.0.0/moverinfo version 0.9.0 calling Getopt::Std::getopts (version 1.07),'
        self.assertFalse(check_mover_version())

        # Match to right version
        mock_output.return_value = '/usr/local/mover/1.0.0/moverinfo version 1.0.0 calling Getopt::Std::getopts (version 1.07),'
        self.assertTrue(check_mover_version())

class TestGrusProjectDeliverer(unittest.TestCase):

    @classmethod
    @patch.dict('taca_ngi_pipeline.deliver.deliver_grus.CONFIG', SAMPLECFG)
    def setUpClass(self):
        db_entry = {'name': 'S.One_20_01',
                    'uppnex_id': 'a2099999',
                    'delivery_token': 'atoken'}
        with patch('taca_ngi_pipeline.utils.database.project_entry',
                   return_value=db_entry) as dbmock:
            self.tmp_dir = tempfile.mkdtemp()
            self.pid = 'P12345'
            self.deliverer = GrusProjectDeliverer(projectid=self.pid,
                                                  fcid='FC1',
                                                  **SAMPLECFG['deliver'])
            self.deliverer.pi_email = 'pi@email.com'
            self.deliverer.rootdir = self.tmp_dir

    @classmethod
    def tearDownClass(self):
        shutil.rmtree(self.tmp_dir)

    def test_get_delivery_status(self):
        dbentry_in_progress = {'delivery_token': 'token'}
        got_status_in_progress = self.deliverer.get_delivery_status(dbentry=dbentry_in_progress)
        self.assertEqual(got_status_in_progress, 'IN_PROGRESS')

        dbentry_delivered = {'delivery_token': 'NO-TOKEN',
                             'delivery_status': 'DELIVERED'}
        got_status_delivered = self.deliverer.get_delivery_status(dbentry=dbentry_delivered)
        self.assertEqual(got_status_delivered, 'DELIVERED')

        dbentry_partial = {'delivery_projects': 'delivery0123'}
        got_status_partial = self.deliverer.get_delivery_status(dbentry=dbentry_partial)
        self.assertEqual(got_status_partial, 'PARTIAL')

        dbentry_not_delivered = {'delivery_token': 'not_under_delivery'}
        got_status_not_delivered = self.deliverer.get_delivery_status(dbentry=dbentry_not_delivered)
        self.assertEqual(got_status_not_delivered, 'NOT_DELIVERED')

    @patch('taca_ngi_pipeline.deliver.deliver_grus.check_mover_version')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.get_delivery_status')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.subprocess.check_output')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.time.sleep')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.get_samples_from_charon')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusSampleDeliverer')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.delete_delivery_token_in_charon')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.update_delivery_status')
    def test_check_mover_delivery_status(self,
                                         mock_update_delivery,
                                         mock_update_charon,
                                         mock_sample_deliverer,
                                         mock_samples,
                                         mock_sleep,
                                         mock_check_output,
                                         mock_status,
                                         mock_version):
        mock_status.return_value = 'IN_PROGRESS'
        mock_check_output.side_effect = ['Accepted:', 'Delivered:']
        mock_samples.return_value = ['P12345_1001']
        mock_sample_deliverer().get_delivery_status.return_value = 'DELIVERED'

        db_entry = {'name': 'S.One_20_01',
                    'uppnex_id': 'a2099999',
                    'delivery_token': 'atoken'}
        with patch('taca_ngi_pipeline.utils.database.project_entry',
                   return_value=db_entry) as dbmock:
            self.deliverer.check_mover_delivery_status()
            mock_update_delivery.assert_called_once_with(status='DELIVERED')

    @patch('taca_ngi_pipeline.deliver.deliver_grus.check_mover_version')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.get_delivery_status')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.proceed_or_not')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.get_samples_from_charon')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusSampleDeliverer')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer._create_delivery_project')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.do_delivery')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.save_delivery_token_in_charon')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.add_supr_name_delivery_in_charon')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.add_supr_name_delivery_in_statusdb')
    def test_deliver_project(self,
                             mock_statusdb_name,
                             mock_charon_name,
                             mock_charon_token,
                             mock_deliver,
                             mock_create_project,
                             mock_sample_deliverer,
                             mock_samples,
                             mock_query,
                             mock_status,
                             mock_check_mover):
        mock_status.return_value = 'NOT_DELIVERED'
        mock_query.return_value = True
        mock_samples.return_value = ['S1']
        mock_create_project.return_value = {'name': 'delivery123'}
        mock_deliver.return_value = 'token123'

        os.makedirs(os.path.join(self.tmp_dir, 'STAGING'))
        open(os.path.join(self.tmp_dir, 'STAGING', 'misc_file.txt'), 'w').close()

        delivered = self.deliverer.deliver_project()
        self.assertTrue(delivered)

    @patch('taca_ngi_pipeline.deliver.deliver_grus.proceed_or_not')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.shutil')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer._create_delivery_project')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.do_delivery')
    def test_deliver_run_folder(self, mock_deliver, mock_create_project, mock_shutil, mock_query):
        mock_query.return_value = True
        mock_create_project.return_value = {'name': 'delivery123'}
        mock_deliver.return_value = 'token123'
        got_status = self.deliverer.deliver_run_folder()
        self.assertTrue(got_status)
        mock_deliver.assert_called_once_with('delivery123')

    @patch('taca_ngi_pipeline.deliver.deliver_grus.CharonSession')
    def test_add_supr_name_delivery_in_charon(self, mock_charon):
        mock_charon().project_get.return_value = {'delivery_projects': ['delivery123']}
        self.deliverer.add_supr_name_delivery_in_charon('delivery456')
        mock_charon().project_update.assert_called_once_with(self.pid,
                                                             delivery_projects=['delivery123',
                                                                                'delivery456'])

    @patch('taca_ngi_pipeline.deliver.deliver_grus.ProjectSummaryConnection')
    def test_add_supr_name_delivery_in_statusdb(self, mock_project_summary):
        mock_project_summary().get_entry.return_value = {'delivery_projects': ['delivery123']}
        self.deliverer.add_supr_name_delivery_in_statusdb('delivery456')
        mock_project_summary().save_db_doc.assert_called_once_with(
            {'delivery_projects':
                ['delivery123', 'delivery456']
                }
            )

    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer.expand_path')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.os.chown')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.subprocess')
    def test_do_delivery(self, mock_subprocess, mock_chown, mock_path):
        mock_path.return_value = self.tmp_dir
        mock_subprocess.check_output.return_value = 'deliverytoken'
        got_token = self.deliverer.do_delivery('supr_delivery')
        self.assertEqual(got_token, 'deliverytoken')

    @patch('taca_ngi_pipeline.deliver.deliver_grus.CharonSession')
    def test_get_samples_from_charon(self, mock_charon):
        mock_charon().project_get_samples.return_value = {
            'samples':
                [{'sampleid': 'S1',
                  'delivery_status': 'STAGED'},
                 {'sampleid': 'S2',
                  'delivery_status': 'DELIVERED'}]
                }
        got_samples = self.deliverer.get_samples_from_charon(delivery_status='STAGED')
        expected_samples = ['S1']
        self.assertEqual(got_samples, expected_samples)

    @patch('taca_ngi_pipeline.deliver.deliver_grus.requests')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.datetime')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.json.loads')
    def test__create_delivery_project(self, mock_json_load, mock_datetime, mock_requests):
        self.deliverer.pi_snic_id = '123'
        self.deliverer.other_member_snic_ids = []
        supr_date_format = '%Y-%m-%d'
        today = datetime.date.today()
        three_months_from_now = (today + relativedelta(months=+3))
        mock_datetime.date.today.return_value = today
        data = {
            'ngi_project_name': 'P12345',
            'title': "DELIVERY_P12345_{}".format(today.strftime(supr_date_format)),
            'pi_id': '123',
            'start_date': today.strftime(supr_date_format),
            'end_date': three_months_from_now.strftime(supr_date_format),
            'continuation_name': '',
            'api_opaque_data': '',
            'ngi_ready': False,
            'ngi_delivery_status': '',
            'ngi_sensitive_data': True,
            'member_ids': []
            }
        mock_requests.post().status_code = 200
        got_result = self.deliverer._create_delivery_project()
        calls = [call(),
                 call('url/ngi_delivery/project/create/',
                      data=json.dumps(data),
                      auth=('usr', 'pwd'))]
        mock_requests.post.assert_has_calls(calls)

    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer._get_order_detail')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer._get_user_snic_id')
    def test__set_pi_details(self, mock_id, mock_detail):
        mock_detail.return_value = {'fields': {'project_pi_email': 'pi@email.com'}}
        mock_id.return_value = '123'
        self.deliverer._set_pi_details()
        self.assertEqual(self.deliverer.pi_email, 'pi@email.com')
        self.assertEqual(self.deliverer.pi_snic_id, '123')

    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer._get_order_detail')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusProjectDeliverer._get_user_snic_id')
    def test__set_other_member_details(self, mock_snic_id, mock_get_details):
        mock_get_details.return_value = {'owner': {'email': 'owner@mail.com'},
                                         'fields': {'project_bx_email': 'bx@mail.com'}}
        mock_snic_id.side_effect = ['id1', 'id2', 'id3']
        emails = ['some@email.com']
        self.deliverer._set_other_member_details(other_member_emails=emails, include_owner=True)
        got_details = self.deliverer.other_member_snic_ids
        expected_details = ['id1', 'id2', 'id3']
        self.assertEqual(got_details, expected_details)

    @patch('taca_ngi_pipeline.deliver.deliver_grus.requests.get')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.json.loads')
    def test__get_user_snic_id(self, mock_json, mock_requests):
        mock_requests().status_code = 200
        mock_json.return_value = {'matches': [{'id': '123'}]}
        got_user_id = self.deliverer._get_user_snic_id('some@email.com')
        self.assertEqual(got_user_id, '123')

    @patch('taca_ngi_pipeline.deliver.deliver_grus.StatusdbSession')
    def test__get_order_detail(self, mock_statusdb):
        with self.assertRaises(AssertionError):
            got_details = self.deliverer._get_order_detail()

class TestGrusSampleDeliverer(unittest.TestCase):

    @classmethod
    def setUpClass(self):
        db_entry = {'name': 'S.One_20_01',
                    'uppnex_id': 'a2099999',
                    'delivery_token': 'atoken'}
        with patch('taca_ngi_pipeline.utils.database.project_entry',
                   return_value=db_entry) as dbmock:
            self.tmp_dir = tempfile.mkdtemp()
            self.pid = 'P12345'
            self.sid = 'P12345_1001'
            self.deliverer = GrusSampleDeliverer(projectid=self.pid,
                                                 sampleid=self.sid,
                                                  **SAMPLECFG['deliver'])
            self.deliverer.rootdir = self.tmp_dir

    @classmethod
    def tearDownClass(self):
        shutil.rmtree(self.tmp_dir)

    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusSampleDeliverer.get_delivery_status')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusSampleDeliverer.update_delivery_status')
    @patch('taca_ngi_pipeline.deliver.deliver_grus.GrusSampleDeliverer.do_delivery')
    def test_deliver_sample(self, mock_deliver, mock_update, mock_status):
        mock_status.return_value = 'STAGED'
        self.deliverer.deliver_sample()
        mock_update.assert_called_once_with(status='IN_PROGRESS')

    @patch('taca_ngi_pipeline.deliver.deliver_grus.CharonSession')
    def test_add_supr_name_delivery_in_charon(self, mock_charon):
        mock_charon().sample_get.return_value = {'delivery_projects': ['delivery123']}
        self.deliverer.add_supr_name_delivery_in_charon('delivery456')
        mock_charon().sample_update.assert_called_once_with(self.pid,
                                                            self.sid,
                                                             delivery_projects=['delivery123',
                                                                                'delivery456'])

    @patch('taca_ngi_pipeline.deliver.deliver_grus.shutil.copy')
    def test_do_delivery(self, mock_copy):
        os.makedirs(os.path.join(self.tmp_dir, 'STAGING', self.sid))
        open(os.path.join(self.tmp_dir, 'STAGING', 'P12345_1001.txt'), 'w').close()
        self.deliverer.do_delivery()
        mock_copy.assert_called_once_with(os.path.join(self.tmp_dir, 'STAGING', 'P12345_1001.txt'),
                                          os.path.join(self.tmp_dir, 'STAGING_HARD'))


text:
import json
import os

from tempest_lib import exceptions
import yaml

from heatclient.tests.functional import base

class SimpleReadOnlyHeatClientTest(base.ClientTestBase):
    """Basic, read-only tests for Heat CLI client.
    Basic smoke test for the heat CLI commands which do not require
    creating or modifying stacks.
    """

    def test_heat_fake_action(self):
        self.assertRaises(exceptions.CommandFailed,
                          self.heat,
                          'this-does-not-exist')

    def test_heat_stack_list(self):
        self.heat('stack-list')

    def test_heat_stack_list_debug(self):
        self.heat('stack-list', flags='--debug')

    def test_heat_resource_template_fmt_default(self):
        ret = self.heat('resource-template OS::Nova::Server')
        self.assertIn('Type: OS::Nova::Server', ret)

    def test_heat_resource_template_fmt_arg_short_yaml(self):
        ret = self.heat('resource-template -F yaml OS::Nova::Server')
        self.assertIn('Type: OS::Nova::Server', ret)
        self.assertIsInstance(yaml.safe_load(ret), dict)

    def test_heat_resource_template_fmt_arg_long_json(self):
        ret = self.heat('resource-template --format json OS::Nova::Server')
        self.assertIn('"Type": "OS::Nova::Server"', ret)
        self.assertIsInstance(json.loads(ret), dict)

    def test_heat_resource_type_list(self):
        ret = self.heat('resource-type-list')
        rsrc_types = self.parser.listing(ret)
        self.assertTableStruct(rsrc_types, ['resource_type'])

    def test_heat_resource_type_show(self):
        rsrc_schema = self.heat('resource-type-show OS::Heat::RandomString')
        # resource-type-show returns a json resource schema
        self.assertIsInstance(json.loads(rsrc_schema), dict)

    def _template_validate(self, templ_name):
        heat_template_path = os.path.join(
            os.path.dirname(os.path.realpath(__file__)),
            'templates/%s' % templ_name)
        ret = self.heat('template-validate -f %s' % heat_template_path)
        # On success template-validate returns a json representation
        # of the template parameters
        self.assertIsInstance(json.loads(ret), dict)

    def test_heat_template_validate_yaml(self):
        self._template_validate('heat_minimal.yaml')

    def test_heat_template_validate_hot(self):
        self._template_validate('heat_minimal_hot.yaml')

    def test_heat_help(self):
        self.heat('help')

    def test_heat_bash_completion(self):
        self.heat('bash-completion')

    def test_heat_help_cmd(self):
        # Check requesting help for a specific command works
        help_text = self.heat('help resource-template')
        lines = help_text.split('\n')
        self.assertFirstLineStartsWith(lines, 'usage: heat resource-template')

    def test_heat_version(self):
        self.heat('', flags='--version')

    def test_heat_template_version_list(self):
        ret = self.heat('template-version-list')
        tmpl_types = self.parser.listing(ret)
        self.assertTableStruct(tmpl_types, ['version', 'type'])

    def test_heat_template_function_list(self):
        ret = self.heat('template-function-list '
                        'heat_template_version.2013-05-23')
        tmpl_functions = self.parser.listing(ret)
        self.assertTableStruct(tmpl_functions, ['functions', 'description'])


text:
<?php
	class States extends CI_Model {
		function __construct()
		{
			parent::__construct();
		}

		function getName($abbreviation)
		{
			$query = $this->db->query("SELECT name FROM states WHERE abbreviation='" . $abbreviation . "'");

			if ($query->num_rows() > 0) {
				return $query->result();
			} else {
				return NULL;
			}
		}

		function getAllStates()
		{
			$query = $this->db->query("SELECT * FROM states");

			if ($query->num_rows() > 0) {
				return $query->result();
			} else {
				return NULL;
			}
		}
	}
?>


text:
using Parakeet.Models.Inputs;
using Prism.Mvvm;
using System.Collections.ObjectModel;

namespace Parakeet.Models
{
	public class Project : BindableBase
	{
		private ObservableCollection<RenameRule> _renameRules;
		private ObservableCollection<RemoveRule> _removeRules;
		private ObservableCollection<PathModel> _pathModels;
		private ObservableCollection<SortByRule> _sortingRules;
		private DocDistModel _docDist;

		public ObservableCollection<RenameRule> RenameRules
		{
			get { return _renameRules; }
			set { SetProperty(ref _renameRules, value); }
		}

		public ObservableCollection<RemoveRule> RemoveRules
		{
			get { return _removeRules; }
			set { SetProperty(ref _removeRules, value); }
		}

		public ObservableCollection<PathModel> PathModels
		{
			get { return _pathModels; }
			set { SetProperty(ref _pathModels, value); }
		}

		public ObservableCollection<SortByRule> SortingRules
		{
			get { return _sortingRules; }
			set { SetProperty(ref _sortingRules, value); }
		}

		public DocDistModel DocDist
		{
			get { return _docDist; }
			set { SetProperty(ref _docDist, value); }
		}

		public Project()
		{
			DocDist = new DocDistModel();
			RenameRules = new ObservableCollection<RenameRule>();
			RemoveRules = new ObservableCollection<RemoveRule>();
			PathModels = new ObservableCollection<PathModel>();
			SortingRules = new ObservableCollection<SortByRule>();
		}
	}
}


text:
//
//  HLLabelButtonNode.h
//  HLSpriteKit
//
//  Created by Karl Voskuil on 5/2/14.
//  Copyright (c) 2014 Hilo Games. All rights reserved.
//

#import <SpriteKit/SpriteKit.h>

#import "HLComponentNode.h"
#import "SKLabelNode+HLLabelNodeAdditions.h"

/**
 HLLabelButtonNode displays a label over a textured or colored background.  It
 intentionally mimics an `SKLabelNode` on top of a `SKSpriteNode`, but has extra sizing
 and alignment options.

 ## Common Gesture Handling Configurations

 * Leave the gesture target unset for no gesture handling.

 * Allocate a `HLTapGestureTarget`, initialize it with a block for execution on tap, and
   set it as gesture target (via `[SKNode+HLGestureTarget hlSetGestureTarget]`).

 * For double-tap, long press, or other gestures, set a custom `HLGestureTarget`
   instead.

 @bug There is no current self-as-target option for `HLLabelButtonNode` (as there is in,
      for example, `HLGridNode` and `HLMenuNode`).  It would be pretty easy to make one: A
      callback block for taps, probably.  But of course that functionality is pretty
      easily specified by instantiating a tap delegate.  Other components have
      more-complex interactions (e.g. for `HLGridNode`, not just that a tap occurred, but
      *which* square it occurred on) (and e.g. for `HLMenuNode`, both `shouldTap` and
      `didTap` delegate methods).  The button might be too generic and simple to have a
      natural self-as-target built-in behavior.
 */

@interface HLLabelButtonNode : HLComponentNode <NSCopying, NSCoding>

/// @name Creating a Label Button Node

/**
 Initializes a new label button node with a solid color background.
 */
- (instancetype)initWithColor:(SKColor *)color size:(CGSize)size;

/**
 Initializes a new label button node with a texture.
 */
- (instancetype)initWithTexture:(SKTexture *)texture;

/**
 Initializes a new label button node with a texture created from the named image.

 See `[SKSpriteNode initWithImageNamed:]` for details; texture atlases and the application
 bundle are both searched for the image.
 */
- (instancetype)initWithImageNamed:(NSString *)name;

/// @name Getting and Setting Content

/**
 The text of the label button node.

 **Layout of the components of the label button will not be performed if the text is
 unset.** During initial configuration, then, the caller may set the text after setting
 all other layout-affecting properties, and layout will only be performed once.
 */
@property (nonatomic, copy) NSString *text;

/// @name Configuring Geometry and Alignment

/**
 Sets or returns the overall size of the button.

 When setting, size dimensions may be ignored (and overwritten) depending on the values of
 `automaticWidth` and `automaticHeight`.
 */
@property (nonatomic, assign) CGSize size;

/**
 Specifies the anchor point of the button.

 Default value `(0.5,0.5)`.
 */
@property (nonatomic, assign) CGPoint anchorPoint;

/**
 Specifies if the button should automatically set its width based on the label width.

 Label width is determined by various properties including its text, font, and padding.

 Default value is `NO`.
 */
@property (nonatomic, assign) BOOL automaticWidth;

/**
 Specifies if the button should automatically set its height based on the label height.

 Label height is determined by various properties including its text, font, padding, and
 vertical alignment mode.

 Default value is `NO`.
 */
@property (nonatomic, assign) BOOL automaticHeight;

/**
 Specifies how to align the label within the button frame.

 See documentation for `HLLabelNodeVerticalAlignmentMode`.  This alignment mode also
 determines the calculated height used for the button when `automaticHeight` is true.

 Default value is `HLLabelNodeAlignText`.
 */
@property (nonatomic, assign) HLLabelNodeVerticalAlignmentMode verticalAlignmentMode;

/**
 The amount of space, when using `automaticWidth`, to leave between the label and the edge
 of the button.

 Default value is `0.0`.
 */
@property (nonatomic, assign) CGFloat labelPadX;

/**
 The amount of space, when using `automaticHeight`, to leave between the label and the
 edge of the button.

 Default value is `0.0`.
 */
@property (nonatomic, assign) CGFloat labelPadY;

/**
 The font used by the label.
 */
@property (nonatomic, copy) NSString *fontName;

/**
 The font size used by the label.

 The default value is determined by `[SKLabelNode fontSize]` (currently `32` points).
 */
@property (nonatomic, assign) CGFloat fontSize;

/// @name Configuring Appearance

/**
 The font color used by the label.

 The defualt value is determined by `[SKLabelNode fontColor]` (currently white).
 */
@property (nonatomic, strong) SKColor *fontColor;

/**
 The color used by the background node, or the color blended into the background node's
 texture by a non-zero `colorBlendFactor`.
 */
@property (nonatomic, strong) SKColor *color;

/**
 The amount to blend the `color` into the background node's texture, if any.
 */
@property (nonatomic, assign) CGFloat colorBlendFactor;

/**
 A rectangle which defines how the texture (if any) should be stretched to fit the label
 button node's size.

 See `[SKSpriteNode centerRect]`.
 */
@property (nonatomic, assign) CGRect centerRect;

/**
 The corner radius of the button.

 Default value is `0.0`.

 Note: property will only work for label buttons that don't have a texture.
 */
@property (nonatomic, assign) CGFloat cornerRadius;

/**
 The boarder width of the button.

 Default value is `0.0`.
 Default color is [SKColor blackColor]
 */
@property (nonatomic, assign) CGFloat borderWidth;

/**
 The color of the border for the button.

 Default value is [SKColor blackColor]
 */
@property (nonatomic, strong) SKColor *borderColor;

@end


text:
package com.epimorphics.registry.security;

/**
 * Struct used to report the permissions that a user has over some path.
 *
 * @author Dave Reynolds
 */
public class UserPermission {

    protected UserInfo user;
    protected String permissions;

    public UserPermission(UserInfo user, String permissions) {
        this.user = user;
        this.permissions = permissions;
    }

    public UserInfo getUser() {
        return user;
    }

    public String getPermissions() {
        return permissions;
    }
}


text:
const { Command } = require('discord-akairo')
const { stripIndents } = require('../../util')
const Embed = require('../../structures/HakuEmbed')
const Roulette = require('../../structures/games/Roulette')
const Inventory = require('../../structures/items/InventoryHandler')

const time = 30

class RouletteCommand extends Command {
  constructor () {
    super('roulette', {
      aliases: ['roulette', 'rlt'],
      args: [
        {
          id: 'bet',
          type: Roulette.resolveBet,
          match: 'rest'
        }
      ],
      description: stripIndents`
        Play casino roulette!
        **Mandatory arguments:**
        \`amount\` - the amount of money you want to bet.
        \`space\` - the space you want to be on

        **Usage:**
        \`roulette 3 gold on 1-12\` => bet 3 gold on the 1-12 space.
        \`rlt 5 silver odd\` => bet 5 silver on the odd space.

        Refer to the image below for valid betting spaces:
        https://i.imgur.com/eYQV1my.png
      `
    })
  }

  async exec (msg, args) {
    const { space, bet } = args.bet

    if (!space) {
      return msg.util.error('invalid usage. Please refer to `help roulette`.')
    }
    if (!bet) return msg.util.error("couldn't resolve your bet.")
    if (bet.currencyValue === 0) {
      return msg.util.error('you have to bet some money.')
    }
    if (bet.currencyValue > Roulette.MAXBET.price) {
      return msg.util.error(`can't bet more than ${Roulette.MAXBET}.`)
    }
    if (!Roulette.SPACES.includes(space)) {
      return msg.util.error('invalid space. Please refer to `help roulette`')
    }

    const inventory = await Inventory.fetch(msg.author.id)
    if (!inventory.includes(bet)) {
      return msg.util.error('you have insufficient funds.')
    }

    const player = {
      id: msg.member.id,
      displayName: msg.member.displayName,
      inventory
    }

    const game = Roulette.findCreate(msg.channel)

    if (game.ongoing) {
      const reply = game.hasBet(msg.member, space)
        ? `you have changed your bet on ${space} to ${bet}.`
        : `you have placed your bet of ${bet} on ${space}.`

      game.addBet(player, space, bet)
      return msg.util.success(reply, game.statusEmbed)
    }

    game.addBet(player, space, bet)
    await msg.util.success(
      `You have started a new game of game with a bet of ${bet} on ${space}!`,
      game.statusEmbed
    )

    return game.start(msg.channel, time).then(() => {
      game.rewardWinners()

      let content = `The ball landed on **${game.winningSpaces[1]} ${
        game.winningSpaces[0]
      }**!`

      if (game.winnerFields.length > 0) content += '\n**WINNERS:**'
      else content += '\nNobody won this round.'

      return new Embed(msg.channel)
        .setTitle('Roulette Results')
        .setDescription(content)
        .setFields(game.winnerFields)
        .setIcon(Embed.icons.GAME)
        .setColor(Embed.colors.SCARLET)
        .send()
    })
  }
}

module.exports = RouletteCommand


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="ForecastListItemStyle">
        <item name="android:choiceMode">singleChoice</item>
    </style>

    <!--For Max and min temperatures text views in list item-->
    <style name="MaxTemperatureTextStyle">
        <item name="android:textSize">20sp</item>
        <item name="android:fontFamily">sans-serif-condensed</item>
        <item name="android:textColor">@color/sunshine_headline_black</item>
    </style>
    <style name="MinTemperatureTextStyle">
        <item name="android:textSize">12sp</item>
        <item name="android:fontFamily">sans-serif-condensed</item>

    </style>
</resources>


text:
'use strict';

/* Pages - About module */

angular.module('about', [
        'ui.compat',
        'appServices'
    ])

    .config(['$stateProvider', '$routeProvider', '$urlRouterProvider', '$locationProvider',
        function ($stateProvider, $routeProvider, $urlRouterProvider, $locationProvider) {

            var about = {
                name: 'about',
                url: '/about',
                views: {
                    'header': {
                        templateUrl: 'templates/shared/header.html'
                    },
                    'content': {
                        templateUrl: 'templates/pages/about.html',
                        controller: 'AboutCtrl'
                    }
                }
            };

            $stateProvider
                .state(about);

            $locationProvider.html5Mode(true);
        }
    ])

    .controller('AboutCtrl', ['$scope', 'titleService', function ($scope, titleService) {
        var pageTitle = 'About Us';
        titleService.setTitle(pageTitle);
    }]);


text:
namespace Urho3D
{

/// Frame begin event.
EVENT(E_BEGINFRAME, BeginFrame)
{
    PARAM(P_FRAMENUMBER, FrameNumber);      // unsigned
    PARAM(P_TIMESTEP, TimeStep);            // float
}

/// Application-wide logic update event.
EVENT(E_UPDATE, Update)
{
    PARAM(P_TIMESTEP, TimeStep);            // float
}

/// Application-wide logic post-update event.
EVENT(E_POSTUPDATE, PostUpdate)
{
    PARAM(P_TIMESTEP, TimeStep);            // float
}

/// Render update event.
EVENT(E_RENDERUPDATE, RenderUpdate)
{
    PARAM(P_TIMESTEP, TimeStep);            // float
}

/// Post-render update event.
EVENT(E_POSTRENDERUPDATE, PostRenderUpdate)
{
    PARAM(P_TIMESTEP, TimeStep);            // float
}

/// Frame end event.
EVENT(E_ENDFRAME, EndFrame)
{
}

}


text:
@implementation MSXLFormAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];

    MSXLFormViewController* viewController = [[MSXLFormViewController alloc] init];
    UINavigationController* nc = [[UINavigationController alloc] initWithRootViewController:viewController];
    nc.navigationBar.tintColor = [UIColor whiteColor];
    nc.navigationBar.barStyle = UIBarStyleBlack;
    self.window.rootViewController = nc;

    [self.window makeKeyAndVisible];

    return YES;
}

@end


text:
__all__ = ['Parser']

import struct

# import kaa.metadata.audio core
from . import core

# ADTS Fixed header: these don't change from frame to frame
#
# syncword                       12        always: '111111111111'
# ID                              1        0: MPEG-4, 1: MPEG-2
# layer                           2        always: '00'
# protection_absent               1

# profile                         2
# sampling_frequency_index        4
# private_bit                     1
# channel_configuration           3

# original/copy                   1
# home                            1
#
# ADTS Variable header: these can change from frame to frame
#
# copyright_identification_bit    1
# copyright_identification_start  1
# aac_frame_length               13  length of the frame including header (in bytes)
# adts_buffer_fullness           11  0x7FF indicates VBR
# no_raw_data_blocks_in_frame     2
#
# ADTS Error check
#
# crc_check                      16  only if protection_absent == 0
#
class ADTS(core.Music):
    def __init__(self,file):
        core.Music.__init__(self)
        if not file.name.endswith('aac'):
            # we have a bad detection here, so if the filename does
            # not match, we skip.
            raise core.ParseError()
        header = struct.unpack('>7B', file.read(7))
        if header[0] != 255 or (header[1] >> 4) != 15:
            raise core.ParseError()
        self.mime = 'audio/aac'

Parser = ADTS