text:
<?php
/*************************************
**  Lightweight  Database  Handler  **
**************************************
**     Author:	James Mouat         **
**    Version:	2.3                 **
**    Written:	June 2004           **
**    Revised:	June 2011           **
*************************************/
class MySQL {
	private $link;
	private $hostname;
	private $username;
	private $password;

	// Constructor of this class
	// UPDATE v2.0: Supports passing an array(hostname, username, password)
	public function __construct($hostname, $database = false, $username = null, $password = null){
		if (is_array($hostname)){
			$this->hostname = $hostname['hostname'];
			$this->username = $hostname['username'];
			$this->password = $hostname['password'];
		} else {
			$this->hostname = $hostname;
			$this->username = $username;
			$this->password = $password;
		}
		$this->connect();
		if($database){
			$this->select_db($database);
		} else if (array_key_exists('database',$hostname)){
			$this->select_db($hostname['database']);
		}
	}

	// Make connection to Database
	private function connect(){
		$this->link = mysql_connect($this->hostname, $this->username, $this->password);
		if (!$this->link){ die($this->__errortxt('Unable to Establish Link')); }
	}

	// Select a Database on the active connection
	public function select_db($database){
		if(!$this->link){ $this->connect(); }
		if($this->link){
			$result = mysql_select_db($database, $this->link) or die($this->__errortxt("Unable to Select Database {$database}"));
		} else { die($this->__errortxt('No Database Link')); }
	}

	// Execute an SQL Query
	public function query($query,$params=false){
		// UPDATE v2.1: Supports passing variables to be escaped as a parameter array
		// USEAGE: "SELECT * FROM `table` WHERE `table`.`field`= ?", subsequent ?'s will be replaced with their respective values
		// REMINDER: do not quote (' or ") around ?, as they will be added automatically.
		// NOTE: Update required to use backtics for table names, don't use subsitution for tablenames.
		if ($params){
			foreach ($params as &$v) { $v = mysql_real_escape_string((string)$v); }
			$esc_query = vsprintf( str_replace("?","'%s'",$query), $params );
			$result = mysql_query($esc_query) or die($this->__errortxt($query));
		} else {
			$result = mysql_query($query) or die($this->__errortxt($query));
		}
		if(strcmp(gettype($result),"resource")===0){
			$data = array();
			while( $row = mysql_fetch_assoc($result) ){
				$data[] = $row;
			}
			// Auto Flattern Result
			if( count($data)>1 ){ return $data;
			} else { return $data; }
		} else {
			return $result;
		}
	}

	// Error feedback - Added in v2.3
	private function __errortxt($txt){
		return mysql_error()."
$txt
";
	}

	// Close link and Destruct - PHP GC will already do this...
	public function __destruct(){
		if($this->link) @mysql_close($this->link);
	}

	// Absent features: databaseExists(), tableExists()
}
?>


text:
"""
    werkzeug.exceptions
    ~~~~~~~~~~~~~~~~~~~

    This module implements a number of Python exceptions you can raise from
    within your views to trigger a standard non-200 response.

    Usage Example
    -------------

    ::

        from werkzeug.wrappers import BaseRequest
        from werkzeug.wsgi import responder
        from werkzeug.exceptions import HTTPException, NotFound

        def view(request):
            raise NotFound()

        @responder
        def application(environ, start_response):
            request = BaseRequest(environ)
            try:
                return view(request)
            except HTTPException as e:
                return e

    As you can see from this example those exceptions are callable WSGI
    applications.  Because of Python 2.4 compatibility those do not extend
    from the response objects but only from the python exception class.

    As a matter of fact they are not Werkzeug response objects.  However you
    can get a response object by calling ``get_response()`` on a HTTP
    exception.

    Keep in mind that you have to pass an environment to ``get_response()``
    because some errors fetch additional information from the WSGI
    environment.

    If you want to hook in a different exception page to say, a 404 status
    code, you can add a second except for a specific subclass of an error::

        @responder
        def application(environ, start_response):
            request = BaseRequest(environ)
            try:
                return view(request)
            except NotFound, e:
                return not_found(request)
            except HTTPException, e:
                return e

    :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
    :license: BSD, see LICENSE for more details.
"""
import sys

# Because of bootstrapping reasons we need to manually patch ourselves
# onto our parent module.
import werkzeug
werkzeug.exceptions = sys.modules[__name__]

from werkzeug._internal import _get_environ
from werkzeug._compat import iteritems, integer_types, text_type, \
    implements_to_string

from werkzeug.wrappers import Response

@implements_to_string
class HTTPException(Exception):

    """
    Baseclass for all HTTP exceptions.  This exception can be called as WSGI
    application to render a default error page or you can catch the subclasses
    of it independently and render nicer error messages.
    """

    code = None
    description = None

    def __init__(self, description=None, response=None):
        Exception.__init__(self)
        if description is not None:
            self.description = description
        self.response = response

    @classmethod
    def wrap(cls, exception, name=None):
        """This method returns a new subclass of the exception provided that
        also is a subclass of `BadRequest`.
        """
        class newcls(cls, exception):

            def __init__(self, arg=None, *args, **kwargs):
                cls.__init__(self, *args, **kwargs)
                exception.__init__(self, arg)
        newcls.__module__ = sys._getframe(1).f_globals.get('__name__')
        newcls.__name__ = name or cls.__name__ + exception.__name__
        return newcls

    @property
    def name(self):
        """The status name."""
        return HTTP_STATUS_CODES.get(self.code, 'Unknown Error')

    def get_description(self, environ=None):
        """Get the description."""
        return u'
%s
' % escape(self.description)

    def get_body(self, environ=None):
        """Get the HTML body."""
        return text_type((
            u'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n'
            u'<title>%(code)s %(name)s</title>\n'
            u'
%(name)s
\n'
            u'%(description)s\n'
        ) % {
            'code':         self.code,
            'name':         escape(self.name),
            'description':  self.get_description(environ)
        })

    def get_headers(self, environ=None):
        """Get a list of headers."""
        return [('Content-Type', 'text/html')]

    def get_response(self, environ=None):
        """Get a response object.  If one was passed to the exception
        it's returned directly.

        :param environ: the optional environ for the request.  This
                        can be used to modify the response depending
                        on how the request looked like.
        :return: a :class:`Response` object or a subclass thereof.
        """
        if self.response is not None:
            return self.response
        if environ is not None:
            environ = _get_environ(environ)
        headers = self.get_headers(environ)
        return Response(self.get_body(environ), self.code, headers)

    def __call__(self, environ, start_response):
        """Call the exception as WSGI application.

        :param environ: the WSGI environment.
        :param start_response: the response callable provided by the WSGI
                               server.
        """
        response = self.get_response(environ)
        return response(environ, start_response)

    def __str__(self):
        code = self.code if self.code is not None else '???'
        return '%s %s: %s' % (code, self.name, self.description)

    def __repr__(self):
        code = self.code if self.code is not None else '???'
        return "<%s '%s: %s'>" % (self.__class__.__name__, code, self.name)

class BadRequest(HTTPException):

    """*400* `Bad Request`

    Raise if the browser sends something to the application the application
    or server cannot handle.
    """
    code = 400
    description = (
        'The browser (or proxy) sent a request that this server could '
        'not understand.'
    )

class ClientDisconnected(BadRequest):

    """Internal exception that is raised if Werkzeug detects a disconnected
    client.  Since the client is already gone at that point attempting to
    send the error message to the client might not work and might ultimately
    result in another exception in the server.  Mainly this is here so that
    it is silenced by default as far as Werkzeug is concerned.

    Since disconnections cannot be reliably detected and are unspecified
    by WSGI to a large extent this might or might not be raised if a client
    is gone.

    .. versionadded:: 0.8
    """

class SecurityError(BadRequest):

    """Raised if something triggers a security error.  This is otherwise
    exactly like a bad request error.

    .. versionadded:: 0.9
    """

class BadHost(BadRequest):

    """Raised if the submitted host is badly formatted.

    .. versionadded:: 0.11.2
    """

class Unauthorized(HTTPException):

    """*401* `Unauthorized`

    Raise if the user is not authorized.  Also used if you want to use HTTP
    basic auth.
    """
    code = 401
    description = (
        'The server could not verify that you are authorized to access '
        'the URL requested.  You either supplied the wrong credentials (e.g. '
        'a bad password), or your browser doesn\'t understand how to supply '
        'the credentials required.'
    )

class Forbidden(HTTPException):

    """*403* `Forbidden`

    Raise if the user doesn't have the permission for the requested resource
    but was authenticated.
    """
    code = 403
    description = (
        'You don\'t have the permission to access the requested resource. '
        'It is either read-protected or not readable by the server.'
    )

class NotFound(HTTPException):

    """*404* `Not Found`

    Raise if a resource does not exist and never existed.
    """
    code = 404
    description = (
        'The requested URL was not found on the server.  '
        'If you entered the URL manually please check your spelling and '
        'try again.'
    )

class MethodNotAllowed(HTTPException):

    """*405* `Method Not Allowed`

    Raise if the server used a method the resource does not handle.  For
    example `POST` if the resource is view only.  Especially useful for REST.

    The first argument for this exception should be a list of allowed methods.
    Strictly speaking the response would be invalid if you don't provide valid
    methods in the header which you can do with that list.
    """
    code = 405
    description = 'The method is not allowed for the requested URL.'

    def __init__(self, valid_methods=None, description=None):
        """Takes an optional list of valid http methods
        starting with werkzeug 0.3 the list will be mandatory."""
        HTTPException.__init__(self, description)
        self.valid_methods = valid_methods

    def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.valid_methods:
            headers.append(('Allow', ', '.join(self.valid_methods)))
        return headers

class NotAcceptable(HTTPException):

    """*406* `Not Acceptable`

    Raise if the server can't return any content conforming to the
    `Accept` headers of the client.
    """
    code = 406

    description = (
        'The resource identified by the request is only capable of '
        'generating response entities which have content characteristics '
        'not acceptable according to the accept headers sent in the '
        'request.'
    )

class RequestTimeout(HTTPException):

    """*408* `Request Timeout`

    Raise to signalize a timeout.
    """
    code = 408
    description = (
        'The server closed the network connection because the browser '
        'didn\'t finish the request within the specified time.'
    )

class Conflict(HTTPException):

    """*409* `Conflict`

    Raise to signal that a request cannot be completed because it conflicts
    with the current state on the server.

    .. versionadded:: 0.7
    """
    code = 409
    description = (
        'A conflict happened while processing the request.  The resource '
        'might have been modified while the request was being processed.'
    )

class Gone(HTTPException):

    """*410* `Gone`

    Raise if a resource existed previously and went away without new location.
    """
    code = 410
    description = (
        'The requested URL is no longer available on this server and there '
        'is no forwarding address. If you followed a link from a foreign '
        'page, please contact the author of this page.'
    )

class LengthRequired(HTTPException):

    """*411* `Length Required`

    Raise if the browser submitted data but no ``Content-Length`` header which
    is required for the kind of processing the server does.
    """
    code = 411
    description = (
        'A request with this method requires a valid Content-'
        'Length header.'
    )

class PreconditionFailed(HTTPException):

    """*412* `Precondition Failed`

    Status code used in combination with ``If-Match``, ``If-None-Match``, or
    ``If-Unmodified-Since``.
    """
    code = 412
    description = (
        'The precondition on the request for the URL failed positive '
        'evaluation.'
    )

class RequestEntityTooLarge(HTTPException):

    """*413* `Request Entity Too Large`

    The status code one should return if the data submitted exceeded a given
    limit.
    """
    code = 413
    description = (
        'The data value transmitted exceeds the capacity limit.'
    )

class RequestURITooLarge(HTTPException):

    """*414* `Request URI Too Large`

    Like *413* but for too long URLs.
    """
    code = 414
    description = (
        'The length of the requested URL exceeds the capacity limit '
        'for this server.  The request cannot be processed.'
    )

class UnsupportedMediaType(HTTPException):

    """*415* `Unsupported Media Type`

    The status code returned if the server is unable to handle the media type
    the client transmitted.
    """
    code = 415
    description = (
        'The server does not support the media type transmitted in '
        'the request.'
    )

class RequestedRangeNotSatisfiable(HTTPException):

    """*416* `Requested Range Not Satisfiable`

    The client asked for an invalid part of the file.

    .. versionadded:: 0.7
    """
    code = 416
    description = (
        'The server cannot provide the requested range.'
    )

    def __init__(self, length=None, units="bytes", description=None):
        """Takes an optional `Content-Range` header value based on ``length``
        parameter.
        """
        HTTPException.__init__(self, description)
        self.length = length
        self.units = units

    def get_headers(self, environ):
        headers = HTTPException.get_headers(self, environ)
        if self.length is not None:
            headers.append(
                ('Content-Range', '%s */%d' % (self.units, self.length)))
        return headers

class ExpectationFailed(HTTPException):

    """*417* `Expectation Failed`

    The server cannot meet the requirements of the Expect request-header.

    .. versionadded:: 0.7
    """
    code = 417
    description = (
        'The server could not meet the requirements of the Expect header'
    )

class ImATeapot(HTTPException):

    """*418* `I'm a teapot`

    The server should return this if it is a teapot and someone attempted
    to brew coffee with it.

    .. versionadded:: 0.7
    """
    code = 418
    description = (
        'This server is a teapot, not a coffee machine'
    )

class UnprocessableEntity(HTTPException):

    """*422* `Unprocessable Entity`

    Used if the request is well formed, but the instructions are otherwise
    incorrect.
    """
    code = 422
    description = (
        'The request was well-formed but was unable to be followed '
        'due to semantic errors.'
    )

class Locked(HTTPException):

    """*423* `Locked`

    Used if the resource that is being accessed is locked.
    """
    code = 423
    description = (
        'The resource that is being accessed is locked.'
    )

class PreconditionRequired(HTTPException):

    """*428* `Precondition Required`

    The server requires this request to be conditional, typically to prevent
    the lost update problem, which is a race condition between two or more
    clients attempting to update a resource through PUT or DELETE. By requiring
    each client to include a conditional header ("If-Match" or "If-Unmodified-
    Since") with the proper value retained from a recent GET request, the
    server ensures that each client has at least seen the previous revision of
    the resource.
    """
    code = 428
    description = (
        'This request is required to be conditional; try using "If-Match" '
        'or "If-Unmodified-Since".'
    )

class TooManyRequests(HTTPException):

    """*429* `Too Many Requests`

    The server is limiting the rate at which this user receives responses, and
    this request exceeds that rate. (The server may use any convenient method
    to identify users and their request rates). The server may include a
    "Retry-After" header to indicate how long the user should wait before
    retrying.
    """
    code = 429
    description = (
        'This user has exceeded an allotted request count. Try again later.'
    )

class RequestHeaderFieldsTooLarge(HTTPException):

    """*431* `Request Header Fields Too Large`

    The server refuses to process the request because the header fields are too
    large. One or more individual fields may be too large, or the set of all
    headers is too large.
    """
    code = 431
    description = (
        'One or more header fields exceeds the maximum size.'
    )

class UnavailableForLegalReasons(HTTPException):

    """*451* `Unavailable For Legal Reasons`

    This status code indicates that the server is denying access to the
    resource as a consequence of a legal demand.
    """
    code = 451
    description = (
        'Unavailable for legal reasons.'
    )

class InternalServerError(HTTPException):

    """*500* `Internal Server Error`

    Raise if an internal server error occurred.  This is a good fallback if an
    unknown error occurred in the dispatcher.
    """
    code = 500
    description = (
        'The server encountered an internal error and was unable to '
        'complete your request.  Either the server is overloaded or there '
        'is an error in the application.'
    )

class NotImplemented(HTTPException):

    """*501* `Not Implemented`

    Raise if the application does not support the action requested by the
    browser.
    """
    code = 501
    description = (
        'The server does not support the action requested by the '
        'browser.'
    )

class BadGateway(HTTPException):

    """*502* `Bad Gateway`

    If you do proxying in your application you should return this status code
    if you received an invalid response from the upstream server it accessed
    in attempting to fulfill the request.
    """
    code = 502
    description = (
        'The proxy server received an invalid response from an upstream '
        'server.'
    )

class ServiceUnavailable(HTTPException):

    """*503* `Service Unavailable`

    Status code you should return if a service is temporarily unavailable.
    """
    code = 503
    description = (
        'The server is temporarily unable to service your request due to '
        'maintenance downtime or capacity problems.  Please try again '
        'later.'
    )

class GatewayTimeout(HTTPException):

    """*504* `Gateway Timeout`

    Status code you should return if a connection to an upstream server
    times out.
    """
    code = 504
    description = (
        'The connection to an upstream server timed out.'
    )

class HTTPVersionNotSupported(HTTPException):

    """*505* `HTTP Version Not Supported`

    The server does not support the HTTP protocol version used in the request.
    """
    code = 505
    description = (
        'The server does not support the HTTP protocol version used in the '
        'request.'
    )

default_exceptions = {}
__all__ = ['HTTPException']

def _find_exceptions():
    for name, obj in iteritems(globals()):
        try:
            is_http_exception = issubclass(obj, HTTPException)
        except TypeError:
            is_http_exception = False
        if not is_http_exception or obj.code is None:
            continue
        __all__.append(obj.__name__)
        old_obj = default_exceptions.get(obj.code, None)
        if old_obj is not None and issubclass(obj, old_obj):
            continue
        default_exceptions[obj.code] = obj
_find_exceptions()
del _find_exceptions

class Aborter(object):

    """
    When passed a dict of code -> exception items it can be used as
    callable that raises exceptions.  If the first argument to the
    callable is an integer it will be looked up in the mapping, if it's
    a WSGI application it will be raised in a proxy exception.

    The rest of the arguments are forwarded to the exception constructor.
    """

    def __init__(self, mapping=None, extra=None):
        if mapping is None:
            mapping = default_exceptions
        self.mapping = dict(mapping)
        if extra is not None:
            self.mapping.update(extra)

    def __call__(self, code, *args, **kwargs):
        if not args and not kwargs and not isinstance(code, integer_types):
            raise HTTPException(response=code)
        if code not in self.mapping:
            raise LookupError('no exception for %r' % code)
        raise self.mapping[code](*args, **kwargs)

abort = Aborter()

#: an exception that is used internally to signal both a key error and a
#: bad request.  Used by a lot of the datastructures.
BadRequestKeyError = BadRequest.wrap(KeyError)

# imported here because of circular dependencies of werkzeug.utils
from werkzeug.utils import escape
from werkzeug.http import HTTP_STATUS_CODES

redpajama_set_name: RedPajamaGithub


text:
package v1beta1

import (
	"stash.appscode.dev/apimachinery/apis/stash"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
)

var SchemeGroupVersion = schema.GroupVersion{Group: stash.GroupName, Version: "v1beta1"}

var (
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder      runtime.SchemeBuilder
	localSchemeBuilder = &SchemeBuilder
	AddToScheme        = localSchemeBuilder.AddToScheme
)

func init() {
	// We only register manually written functions here. The registration of the
	// generated functions takes place in the generated files. The separation
	// makes the code compile even when the generated files are missing.
	localSchemeBuilder.Register(addKnownTypes)
}

// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
	return SchemeGroupVersion.WithResource(resource).GroupResource()
}

// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&BackupBatchList{},
		&BackupBatch{},
		&BackupBlueprintList{},
		&BackupBlueprint{},
		&BackupConfigurationList{},
		&BackupConfiguration{},
		&BackupSessionList{},
		&BackupSession{},
		&FunctionList{},
		&Function{},
		&RestoreSessionList{},
		&RestoreSession{},
		&RestoreBatchList{},
		&RestoreBatch{},
		&TaskList{},
		&Task{},
	)

	scheme.AddKnownTypes(SchemeGroupVersion,
		&metav1.Status{},
	)
	metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
	return nil
}


text:
const shuffleSeed = require('shuffle-seed')

const { documents } = require('./data.json')

module.exports = (app) => {
  app.get(
    '/full-page-examples/news-and-communications',
    (request, response) => {
      let { order, brexit, organisation } = request.query
      if (!order) {
        order = 'most-viewed'
      }

      // Shuffle the documents based on the query string, to simulate different responses.
      const seed = order + brexit + organisation
      const shuffledDocuments = shuffleSeed.shuffle(documents, seed)

      const total = '128124'
      // Shuffle the total based on the query string
      const randomizedTotal = shuffleSeed.shuffle(total.split(''), seed).join('')
      // Make the total more readable
      const formattedTotal = randomizedTotal.substring(0, 3) + ',' + randomizedTotal.substring(3)

      response.render('./full-page-examples/news-and-communications/index', {
        total: formattedTotal,
        documents: shuffledDocuments,
        order,
        brexit,
        values: request.query // In production this should sanitized.
      })
    }
  )
}


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('game', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='user',
            name='id',
            field=models.AutoField(primary_key=True, serialize=False),
        ),
    ]


text:
CVpu::CVpu(unsigned int number, const VPUINIT& vpuInit, CGIF& gif, uint8* ram, uint8* spr)
: m_number(number)
, m_vif((number == 0) ? std::make_unique<CVif>(0, *this, ram, spr) : std::make_unique<CVif1>(1, *this, gif, ram, spr))
, m_microMem(vpuInit.microMem)
, m_vuMem(vpuInit.vuMem)
, m_ctx(vpuInit.context)
, m_gif(gif)
, m_executor(*vpuInit.context)
, m_vuProfilerZone(CProfiler::GetInstance().RegisterZone("VU"))
#ifdef DEBUGGER_INCLUDED
, m_microMemMiniState(new uint8[(number == 0) ? PS2::MICROMEM0SIZE : PS2::MICROMEM1SIZE])
, m_vuMemMiniState(new uint8[(number == 0) ? PS2::VUMEM0SIZE : PS2::VUMEM1SIZE])
, m_topMiniState(0)
, m_itopMiniState(0)
#endif
{

}

CVpu::~CVpu()
{
#ifdef DEBUGGER_INCLUDED
	delete [] m_microMemMiniState;
	delete [] m_vuMemMiniState;
#endif
}

void CVpu::Execute(bool singleStep)
{
	if(!m_running) return;

#ifdef PROFILE
	CProfilerZone profilerZone(m_vuProfilerZone);
#endif

	unsigned int quota = singleStep ? 1 : 5000;
	m_executor.Execute(quota);
	if(m_ctx->m_State.nHasException)
	{
		//E bit encountered
		m_running = false;
	}
}

#ifdef DEBUGGER_INCLUDED

bool CVpu::MustBreak() const
{
	return m_executor.MustBreak();
}

void CVpu::DisableBreakpointsOnce()
{
	m_executor.DisableBreakpointsOnce();
}

void CVpu::SaveMiniState()
{
	memcpy(m_microMemMiniState, m_microMem, (m_number == 0) ? PS2::MICROMEM0SIZE : PS2::MICROMEM1SIZE);
	memcpy(m_vuMemMiniState, m_vuMem, (m_number == 0) ? PS2::VUMEM0SIZE : PS2::VUMEM1SIZE);
	memcpy(&m_vuMiniState, &m_ctx->m_State, sizeof(MIPSSTATE));
	m_topMiniState = (m_number == 0) ? 0 : m_vif->GetTOP();
	m_itopMiniState = m_vif->GetITOP();
}

const MIPSSTATE& CVpu::GetVuMiniState() const
{
	return m_vuMiniState;
}

uint8* CVpu::GetVuMemoryMiniState() const
{
	return m_vuMemMiniState;
}

uint8* CVpu::GetMicroMemoryMiniState() const
{
	return m_microMemMiniState;
}

uint32 CVpu::GetVuTopMiniState() const
{
	return m_topMiniState;
}

uint32 CVpu::GetVuItopMiniState() const
{
	return m_itopMiniState;
}

#endif

void CVpu::Reset()
{
	m_running = false;
	m_executor.Reset();
	m_vif->Reset();
}

void CVpu::SaveState(Framework::CZipArchiveWriter& archive)
{
	m_vif->SaveState(archive);
}

void CVpu::LoadState(Framework::CZipArchiveReader& archive)
{
	m_vif->LoadState(archive);
}

CMIPS& CVpu::GetContext() const
{
	return *m_ctx;
}

uint8* CVpu::GetMicroMemory() const
{
	return m_microMem;
}

uint8* CVpu::GetVuMemory() const
{
	return m_vuMem;
}

bool CVpu::IsVuRunning() const
{
	return m_running;
}

CVif& CVpu::GetVif()
{
	return *m_vif.get();
}

void CVpu::ExecuteMicroProgram(uint32 nAddress)
{
	CLog::GetInstance().Print(LOG_NAME, "Starting microprogram execution at 0x%0.8X.\r\n", nAddress);

	m_ctx->m_State.nPC = nAddress;
	m_ctx->m_State.pipeTime = 0;
	m_ctx->m_State.nHasException = 0;

#ifdef DEBUGGER_INCLUDED
	SaveMiniState();
#endif

	assert(!m_running);
	m_running = true;
	for(unsigned int i = 0; i < 100; i++)
	{
		Execute(false);
		if(!m_running) break;
	}
}

void CVpu::InvalidateMicroProgram()
{
	m_executor.ClearActiveBlocks();
}

void CVpu::ProcessXgKick(uint32 address)
{
	address &= 0x3FF;
	address *= 0x10;

//	assert(nAddress < PS2::VUMEM1SIZE);

	CGsPacketMetadata metadata;
#ifdef DEBUGGER_INCLUDED
	metadata.pathIndex				= 1;
	metadata.vuMemPacketAddress		= address;
	metadata.vpu1Top				= GetVuTopMiniState();
	metadata.vpu1Itop				= GetVuItopMiniState();
	memcpy(&metadata.vu1State, &GetVuMiniState(), sizeof(MIPSSTATE));
	memcpy(metadata.vuMem1, GetVuMemoryMiniState(), PS2::VUMEM1SIZE);
	memcpy(metadata.microMem1, GetMicroMemoryMiniState(), PS2::MICROMEM1SIZE);
#endif

	m_gif.ProcessPacket(GetVuMemory(), address, PS2::VUMEM1SIZE, metadata);

#ifdef DEBUGGER_INCLUDED
	SaveMiniState();
#endif
}


text:
.. image:: http://www.zipline-live.io/images/zipline_live.png
    :target: http://www.zipline-live.io
    :width: 212px
    :align: center
    :alt: zipline-live

zipline-live
============

|pypi badge|
|travis status|
|appveyor status|
|Coverage Status|
|Apache License|

Welcome to zipline-live, the on-premise trading platform built on top of Quantopian's
`zipline <https://github.com/quantopian/zipline>`_.

zipline-live is designed to be an extensible, drop-in replacement for zipline with
multiple brokerage support to enable on premise trading of zipline algorithms.

See the `tutorial <http://www.zipline-live.io/tutorial>`_ and `features <http://www.zipline-live.io/features>`_ for further details.

.. |pypi badge| image:: https://badge.fury.io/py/zipline-live.svg
    :target: https://pypi.python.org/pypi/zipline-live
.. |travis status| image:: https://travis-ci.org/zipline-live/zipline.svg?branch=master
    :target: https://travis-ci.org/zipline-live/zipline
.. |appveyor status| image:: https://ci.appveyor.com/api/projects/status/jkuo1hca8v8aueym?svg=true
   :target: https://ci.appveyor.com/project/pbharrin/zipline/branch/master
.. |Coverage Status| image:: https://coveralls.io/repos/github/zipline-live/zipline/badge.svg?branch=master
   :target: https://coveralls.io/github/zipline-live/zipline?branch=master
.. |Apache License| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
   :target: https://www.apache.org/licenses/LICENSE-2.0

.. _`Zipline Install Documentation` : http://www.zipline.io/install.html


text:
#pragma once
#include <aws/autoscaling/AutoScaling_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSStreamFwd.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Xml
{
  class XmlNode;
} // namespace Xml
} // namespace Utils
namespace AutoScaling
{
namespace Model
{

  /**
   *
Describes a notification.

See Also:
   AWS
   * API Reference

   */
  class AWS_AUTOSCALING_API NotificationConfiguration
  {
  public:
    NotificationConfiguration();
    NotificationConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode);
    NotificationConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);

    void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const;
    void OutputToStream(Aws::OStream& oStream, const char* location) const;

    /**
     *
The name of the Auto Scaling group.

     */
    inline const Aws::String& GetAutoScalingGroupName() const{ return m_autoScalingGroupName; }

    /**
     *
The name of the Auto Scaling group.

     */
    inline bool AutoScalingGroupNameHasBeenSet() const { return m_autoScalingGroupNameHasBeenSet; }

    /**
     *
The name of the Auto Scaling group.

     */
    inline void SetAutoScalingGroupName(const Aws::String& value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName = value; }

    /**
     *
The name of the Auto Scaling group.

     */
    inline void SetAutoScalingGroupName(Aws::String&& value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName = std::move(value); }

    /**
     *
The name of the Auto Scaling group.

     */
    inline void SetAutoScalingGroupName(const char* value) { m_autoScalingGroupNameHasBeenSet = true; m_autoScalingGroupName.assign(value); }

    /**
     *
The name of the Auto Scaling group.

     */
    inline NotificationConfiguration& WithAutoScalingGroupName(const Aws::String& value) { SetAutoScalingGroupName(value); return *this;}

    /**
     *
The name of the Auto Scaling group.

     */
    inline NotificationConfiguration& WithAutoScalingGroupName(Aws::String&& value) { SetAutoScalingGroupName(std::move(value)); return *this;}

    /**
     *
The name of the Auto Scaling group.

     */
    inline NotificationConfiguration& WithAutoScalingGroupName(const char* value) { SetAutoScalingGroupName(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic.

     */
    inline const Aws::String& GetTopicARN() const{ return m_topicARN; }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic.

     */
    inline bool TopicARNHasBeenSet() const { return m_topicARNHasBeenSet; }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic.

     */
    inline void SetTopicARN(const Aws::String& value) { m_topicARNHasBeenSet = true; m_topicARN = value; }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic.

     */
    inline void SetTopicARN(Aws::String&& value) { m_topicARNHasBeenSet = true; m_topicARN = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic.

     */
    inline void SetTopicARN(const char* value) { m_topicARNHasBeenSet = true; m_topicARN.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic.

     */
    inline NotificationConfiguration& WithTopicARN(const Aws::String& value) { SetTopicARN(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic.

     */
    inline NotificationConfiguration& WithTopicARN(Aws::String&& value) { SetTopicARN(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Amazon SNS topic.

     */
    inline NotificationConfiguration& WithTopicARN(const char* value) { SetTopicARN(value); return *this;}

    /**
     *
One of the following event notification types:

     * autoscaling:EC2_INSTANCE_LAUNCH

     * autoscaling:EC2_INSTANCE_LAUNCH_ERROR

     * autoscaling:EC2_INSTANCE_TERMINATE

     * autoscaling:EC2_INSTANCE_TERMINATE_ERROR

     * autoscaling:TEST_NOTIFICATION

     */
    inline const Aws::String& GetNotificationType() const{ return m_notificationType; }

    /**
     *
One of the following event notification types:

     * autoscaling:EC2_INSTANCE_LAUNCH

     * autoscaling:EC2_INSTANCE_LAUNCH_ERROR

     * autoscaling:EC2_INSTANCE_TERMINATE

     * autoscaling:EC2_INSTANCE_TERMINATE_ERROR

     * autoscaling:TEST_NOTIFICATION

     */
    inline bool NotificationTypeHasBeenSet() const { return m_notificationTypeHasBeenSet; }

    /**
     *
One of the following event notification types:

     * autoscaling:EC2_INSTANCE_LAUNCH

     * autoscaling:EC2_INSTANCE_LAUNCH_ERROR

     * autoscaling:EC2_INSTANCE_TERMINATE

     * autoscaling:EC2_INSTANCE_TERMINATE_ERROR

     * autoscaling:TEST_NOTIFICATION

     */
    inline void SetNotificationType(const Aws::String& value) { m_notificationTypeHasBeenSet = true; m_notificationType = value; }

    /**
     *
One of the following event notification types:

     * autoscaling:EC2_INSTANCE_LAUNCH

     * autoscaling:EC2_INSTANCE_LAUNCH_ERROR

     * autoscaling:EC2_INSTANCE_TERMINATE

     * autoscaling:EC2_INSTANCE_TERMINATE_ERROR

     * autoscaling:TEST_NOTIFICATION

     */
    inline void SetNotificationType(Aws::String&& value) { m_notificationTypeHasBeenSet = true; m_notificationType = std::move(value); }

    /**
     *
One of the following event notification types:

     * autoscaling:EC2_INSTANCE_LAUNCH

     * autoscaling:EC2_INSTANCE_LAUNCH_ERROR

     * autoscaling:EC2_INSTANCE_TERMINATE

     * autoscaling:EC2_INSTANCE_TERMINATE_ERROR

     * autoscaling:TEST_NOTIFICATION

     */
    inline void SetNotificationType(const char* value) { m_notificationTypeHasBeenSet = true; m_notificationType.assign(value); }

    /**
     *
One of the following event notification types:

     * autoscaling:EC2_INSTANCE_LAUNCH

     * autoscaling:EC2_INSTANCE_LAUNCH_ERROR

     * autoscaling:EC2_INSTANCE_TERMINATE

     * autoscaling:EC2_INSTANCE_TERMINATE_ERROR

     * autoscaling:TEST_NOTIFICATION

     */
    inline NotificationConfiguration& WithNotificationType(const Aws::String& value) { SetNotificationType(value); return *this;}

    /**
     *
One of the following event notification types:

     * autoscaling:EC2_INSTANCE_LAUNCH

     * autoscaling:EC2_INSTANCE_LAUNCH_ERROR

     * autoscaling:EC2_INSTANCE_TERMINATE

     * autoscaling:EC2_INSTANCE_TERMINATE_ERROR

     * autoscaling:TEST_NOTIFICATION

     */
    inline NotificationConfiguration& WithNotificationType(Aws::String&& value) { SetNotificationType(std::move(value)); return *this;}

    /**
     *
One of the following event notification types:

     * autoscaling:EC2_INSTANCE_LAUNCH

     * autoscaling:EC2_INSTANCE_LAUNCH_ERROR

     * autoscaling:EC2_INSTANCE_TERMINATE

     * autoscaling:EC2_INSTANCE_TERMINATE_ERROR

     * autoscaling:TEST_NOTIFICATION

     */
    inline NotificationConfiguration& WithNotificationType(const char* value) { SetNotificationType(value); return *this;}

  private:

    Aws::String m_autoScalingGroupName;
    bool m_autoScalingGroupNameHasBeenSet;

    Aws::String m_topicARN;
    bool m_topicARNHasBeenSet;

    Aws::String m_notificationType;
    bool m_notificationTypeHasBeenSet;
  };

} // namespace Model
} // namespace AutoScaling
} // namespace Aws


text:
/* $Id: GlyphsTest.java 750418 2009-03-05 11:03:54Z vhennebert $ */

package org.apache.xmlgraphics.fonts;

import junit.framework.TestCase;

/**
 * Tests for the Glyphs class.
 */
public class GlyphsTest extends TestCase {

    public void testGetUnicodeSequenceForGlyphName() throws Exception {
        String glyph;
        String unicodes;

        glyph = "Omega";
        unicodes = Glyphs.getUnicodeSequenceForGlyphName(glyph);
        assertEquals(1, unicodes.length());
        assertEquals("Must contain 2126 - OHM SIGN",
                unicodes.charAt(0), '\u2126');

        glyph = "Omegagreek";
        unicodes = Glyphs.getUnicodeSequenceForGlyphName(glyph);
        assertEquals(1, unicodes.length());
        assertEquals("Must contain 03A9 - GREEK CAPITAL LETTER OMEGA",
                unicodes.charAt(0), '\u03A9');

        glyph = "A";
        unicodes = Glyphs.getUnicodeSequenceForGlyphName(glyph);
        assertEquals(1, unicodes.length());
        assertEquals("Must contain 0041 - LATIN CAPITAL LETTER A",
                unicodes.charAt(0), '\u0041');

        glyph = "rehyehaleflamarabic";
        unicodes = Glyphs.getUnicodeSequenceForGlyphName(glyph);
        assertEquals(4, unicodes.length());
        assertEquals("Expected 0631 - ARABIC LETTER REH at position 0",
                unicodes.charAt(0), '\u0631');
        assertEquals("Expected FEF3 - ARABIC LETTER YEH INITAL FORM at position 1",
                unicodes.charAt(1), '\uFEF3');
        assertEquals("Expected FE8E - ARABIC LETTER ALEF FINAL FORM at position 2",
                unicodes.charAt(2), '\uFE8E');
        assertEquals("Expected 0644 - ARABIC LETTER LAM at position 3",
                unicodes.charAt(3), '\u0644');

        glyph = "Lcommaaccent_uni20AC0308_u20AC";
        unicodes = Glyphs.getUnicodeSequenceForGlyphName(glyph);
        assertEquals(4, unicodes.length());
        assertEquals("Must contain 013B",
                unicodes.charAt(0), '\u013B');
        assertEquals("Must contain 20AC",
                unicodes.charAt(1), '\u20AC');
        assertEquals("Must contain 0308",
                unicodes.charAt(2), '\u0308');
        assertEquals("Must contain 20AC",
                unicodes.charAt(3), '\u20AC');

        glyph = "blah";
        unicodes = Glyphs.getUnicodeSequenceForGlyphName(glyph);
        assertNull(unicodes);
    }

    public void testGetCharNameAlternativesFor() throws Exception {
        String[] alts = Glyphs.getCharNameAlternativesFor("Omega");
        assertEquals(1, alts.length);
        assertEquals("Omegagreek", alts[0]);

        alts = Glyphs.getCharNameAlternativesFor("nbspace");
        assertEquals(2, alts.length);
        assertEquals("space", alts[0]);
        assertEquals("nonbreakingspace", alts[1]);

        alts = Glyphs.getCharNameAlternativesFor("A");
        assertNull(alts);
    }
}


text:
/*	Public domain	*/

#ifndef _AGAR_GUI_ICONMGR_H_
#define _AGAR_GUI_ICONMGR_H_
#include <agar/gui/begin.h>

/* Description of icon stored in data segment. */
typedef struct ag_static_icon {
	Uint w, h;			/* Dimensions in pixels */
	Uint32 Rmask;			/* Red mask */
	Uint32 Gmask;			/* Green mask */
	Uint32 Bmask;			/* Blue mask */
	Uint32 Amask;			/* Alpha mask */
	const Uint32 *data;		/* Pixel data */
	AG_Surface *s;			/* Initialized surface */
} AG_StaticIcon;

/* Begin generated block */
__BEGIN_DECLS
extern DECLSPEC void AG_InitStaticIcon(AG_StaticIcon *);
extern DECLSPEC void AG_FreeStaticIcon(AG_StaticIcon *);
__END_DECLS
/* Close generated block */

#include <agar/gui/close.h>
#endif	/* _AGAR_GUI_ICONMGR_H_ */


text:
import unittest

from flask.ext.testing import Twill, twill
from tests.test_app.sqlalchemy import create_app as create_sql_app
from tests.test_app.mongoengine import create_app as create_mongo_app

class SocialTest(unittest.TestCase):

    SOCIAL_CONFIG = None
    APP_TYPE = None

    def setUp(self):
        super(SocialTest, self).setUp()

        self.app = self._create_app(self.SOCIAL_CONFIG or None)
        self.app.debug = False
        self.app.config['TESTING'] = True

        self.client = self.app.test_client()

    def _create_app(self, auth_config):
        app_type = self.APP_TYPE or 'sql'
        if app_type == 'sql':
            return create_sql_app(auth_config, False)
        if app_type == 'mongo':
            return create_mongo_app(auth_config, False)

    def _login(self, t):
        t.browser.go(t.url('/login'))
        twill.commands.fv('login_user_form', 'email', 'matt@lp.com')
        twill.commands.fv('login_user_form', 'password', 'password')
        twill.commands.submit(0)

    def _login_provider(self, t, provider):
        t.browser.go(t.url('/login'))
        twill.commands.fv('%s_login_form' % provider, 'login_%s' % provider, '')
        t.browser.submit(1)

    def _start_connect(self, t, provider):
        t.browser.go(t.url('/profile'))
        twill.commands.fv('%s_connect_form' % provider,
                          'connect_' + provider,
                          '')
        t.browser.submit('connect_' + provider)

    def _remove_connection(self, t, provider):
        t.browser.go(t.url('/profile'))
        twill.commands.fv('%s_disconnect_form' % provider,
                          'disconnect_' + provider,
                          '')
        t.browser.submit('disconnect_' + provider)

class TwitterSocialTests(SocialTest):

    def _fill_twitter_oauth(self, t, username, password):
        try:
            twill.commands.fv('oauth_form', 'session[username_or_email]', username)
            twill.commands.fv('oauth_form', 'session[password]', password)
        except:
            pass

    def _authorize_twitter(self, t, username=None, password=None):
        if not 'oauth_form' in t.browser.get_html():
            return
        username = username or self.app.config['TWITTER_USERNAME']
        password = password or self.app.config['TWITTER_PASSWORD']
        self._fill_twitter_oauth(t, username, password)
        form = t.browser.get_form('oauth_form')
        twill.commands.fv('oauth_form', 'cancel', '')
        form.find_control('cancel').disabled = True
        t.browser.submit(0)

    def _deny_twitter(self, t, username, password):
        self._fill_twitter_oauth(username, password)
        t.browser.submit(0)

    def test_connect_twitter(self):
        with Twill(self.app) as t:
            self._login(t)
            self._start_connect(t, 'twitter')
            self._authorize_twitter(t)
            self.assertIn('Connection established to Twitter', t.browser.get_html())

    def test_double_connect_twitter(self):
        with Twill(self.app) as t:
            self._login(t)
            self._start_connect(t, 'twitter')
            self._authorize_twitter(t)
            self._start_connect(t, 'twitter')
            self._authorize_twitter(t)
            self.assertIn('A connection is already established with', t.browser.get_html())

    def test_unconnected_twitter_login(self):
        with Twill(self.app) as t:
            self._login_provider(t, 'twitter')
            self._authorize_twitter(t)
            self.assertIn('Twitter account not associated with an existing user',
                          t.browser.get_html())

    def test_connected_login_with_twitter(self):
        with Twill(self.app) as t:
            self._login(t)
            self._start_connect(t, 'twitter')
            self._authorize_twitter(t)
            t.browser.go(t.url('/logout'))
            self._login_provider(t, 'twitter')
            self._authorize_twitter(t)
            self.assertIn('Profile Page', t.browser.get_html())

    def test_remove_connection(self):
        with Twill(self.app) as t:
            self._login(t)
            self._start_connect(t, 'twitter')
            self._authorize_twitter(t)
            self._remove_connection(t, 'twitter')
            assert 'Connection to Twitter removed' in t.browser.get_html()

class MongoEngineTwitterSocialTests(TwitterSocialTests):
    APP_TYPE = 'mongo'

"""
# Unfortunately Facebook can't be tested because
# the Twill client is not a supported browser.
# Leaving this in for reference
class FacebookSocialTests(SocialTest):

    def _login_facebook(self, t, email=None, password=None):
        email = email or self.app.config['FACEBOOK_EMAIL']
        password = password or self.app.config['FACEBOOK_PASSWORD']
        twill.commands.fv('login_form', 'email', email)
        twill.commands.fv('login_form', 'pass', password)
        t.browser.submit(0)

    def _authorize_facebook(self, t, username=None, password=None):
        if 'login_form' in t.browser.get_html():
            self._login_facebook(t)

        if 'uiserver_form' in t.browser.get_html():
            t.browser.get_form('uiserver_form')
            #t.browser.submit('grant_clicked')
            t.browser.submit(0)

    def test_connect_facebook(self):
        with Twill(self.app) as t:
            self._login(t)
            self._start_connect(t, 'facebook')
            self._authorize_facebook(t)
            assert 'Connection established to Facebook' in t.browser.get_html()
"""


text:
using System;
using System.Collections.Generic;

namespace QuickFont.Configuration
{
    /// <summary>
    /// Kerning Rules
    /// </summary>
    public enum CharacterKerningRule
    {
        /// <summary>
        /// Ordinary kerning
        /// </summary>
        Normal,
        /// <summary>
        /// All kerning pairs involving this character will kern by 0. This will
        /// override both Normal and NotMoreThanHalf for any pair.
        /// </summary>
        Zero,
        /// <summary>
        /// Any kerning pairs involving this character will not kern
        /// by more than half the minimum width of the two characters
        /// involved. This will override Normal for any pair.
        /// </summary>
        NotMoreThanHalf
    }

    /// <summary>
    /// Font kerning configuration
    /// Only used with GDIFont, FreeTypeFont uses it's own kerning directly from
    /// the font file
    /// </summary>
    public class QFontKerningConfiguration
    {
        /// <summary>
        /// Kerning rules for particular characters
        /// </summary>
        private readonly Dictionary<char, CharacterKerningRule> _characterKerningRules = new Dictionary<char, CharacterKerningRule>();

        /// <summary>
        /// When measuring the bounds of glyphs, and performing kerning calculations,
        /// this is the minimum alpha level that is necessray for a pixel to be considered
        /// non-empty. This should be set to a value on the range [0,255]
        /// </summary>
        public byte AlphaEmptyPixelTolerance = 0;

        /// <summary>
        /// Sets all characters in the given string to the specified kerning rule.
        /// </summary>
        /// <param name="chars"></param>
        /// <param name="rule"></param>
        public void BatchSetCharacterKerningRule(String chars, CharacterKerningRule rule)
        {
            foreach (var c in chars)
            {
                _characterKerningRules[c] = rule;
            }
        }

        /// <summary>
        /// Sets the specified character kerning rule.
        /// </summary>
        /// <param name="c"></param>
        /// <param name="rule"></param>
        public void SetCharacterKerningRule(char c, CharacterKerningRule rule)
        {
            _characterKerningRules[c] = rule;
        }

		/// <summary>
		/// Returns the kerning rule corresponding to the character.
		/// </summary>
		/// <param name="c">The character to return the kerning rule for</param>
		/// <returns>The kerning rule corresponding to the given character</returns>
        public CharacterKerningRule GetCharacterKerningRule(char c)
        {
            if (_characterKerningRules.ContainsKey(c))
            {
                return _characterKerningRules[c];
            }
            return CharacterKerningRule.Normal;
        }

        /// <summary>
        /// Given a pair of characters, this will return the overriding
        /// CharacterKerningRule.
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public CharacterKerningRule GetOverridingCharacterKerningRuleForPair(String str)
        {

            if (str.Length < 2)
            {
                return CharacterKerningRule.Normal;
            }

            char c1 = str[0];
            char c2 = str[1];

            if (GetCharacterKerningRule(c1) == CharacterKerningRule.Zero || GetCharacterKerningRule(c2) == CharacterKerningRule.Zero)
            {
                return CharacterKerningRule.Zero;
            }
            else if (GetCharacterKerningRule(c1) == CharacterKerningRule.NotMoreThanHalf || GetCharacterKerningRule(c2) == CharacterKerningRule.NotMoreThanHalf)
            {
                return CharacterKerningRule.NotMoreThanHalf;
            }
            return CharacterKerningRule.Normal;
        }

		/// <summary>
		/// Default kerning constructor
		/// </summary>
        public QFontKerningConfiguration()
        {
            BatchSetCharacterKerningRule("_^", CharacterKerningRule.Zero);
            SetCharacterKerningRule('\"', CharacterKerningRule.NotMoreThanHalf);
            SetCharacterKerningRule('\'', CharacterKerningRule.NotMoreThanHalf);
        }
    }
}


text:
package com.noelherrick.jell.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

public class DynoMapper implements Mapper
{
    private DynoCreator dynoCreator;

    @Override
    public <T> T createObjectFromResultSet(ResultSet resultSet, Class<T> clazz)
            throws SQLException, IllegalAccessException, InstantiationException
    {
        if (dynoCreator == null)
        {
            dynoCreator = new DynoCreator(resultSet);
        }

        return (T) dynoCreator.createDyno();
    }
}


text:
<?php

namespace Deploy\Phinx;

include dirname(__FILE__) . '/../../bootstrap.php';

use Deploy\Core\Event\DeployEvent;
use Deploy\Core\Event\RollbackEvent;
use Deploy\Core\Utils;
use Monolog\Logger;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
use Symfony\Component\Filesystem\Filesystem;

class DeployTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var  vfsStreamDirectory
     */
    private $root;

    /**
     * @var Deploy
     */
    private $phinxDeploy;

    /**
     * @var Utils
     */
    private $utils;

    /**
     * @var Logger
     */
    private $logger;

    /**
     * @var string
     */
    private $deploy_path;

    /**
     * set up test environment
     */
    public function setUp()
    {
        $this->deploy_path = 'deploy_dir';
        $this->root = vfsStream::setup($this->deploy_path, null, array(
            'releases' => array(
                'previous_release' => array(
                    'bin' => array(
                        'phinx' => "phinx binary"
                    ),
                    'phinx.yml' => "phinx config"
                ),
                'current_release' => array(
                    'bin' => array(
                        'phinx' => "phinx binary"
                    ),
                    'phinx.yml' => "phinx config"
                ),
                'new_release' => array(
                    'bin' => array(
                        'phinx' => "phinx binary"
                    ),
                    'phinx.yml' => "phinx config"
                )
            )
        ));

        $this->phinxDeploy = new Deploy('bin/phinx', array('phinx.yml'));
        $this->phinxDeploy->setDeployPath(vfsStream::url($this->deploy_path));

        $this->logger = $this->getMock('Monolog\Logger', array(), array("deploy"));
        $this->phinxDeploy->setLogger($this->logger);

        $this->utils = $this->getMock('Deploy\Core\Utils', array('exec'), array($this->logger));
        $this->phinxDeploy->setUtils($this->utils);

        $filesystem = new TestFileSystem();
        $this->utils->setFilesystem($filesystem);
    }

    private function getPath($resource)
    {
        return vfsStream::url($this->deploy_path . $resource);
    }

    public function testOnDeployEvent()
    {
        $migration_id = 123456;
        $phinx_status_output = "     up  {$migration_id}  test_migration";
        $phinx_migrate_output = "phinx migrate output";

        $process = $this
            ->getMockBuilder('Symfony\Component\Process\Process')
            ->disableOriginalConstructor()
            ->getMock();

        $process
            ->expects($this->any())
            ->method('getOutput')
            ->will($this->onConsecutiveCalls($phinx_migrate_output, $phinx_status_output));

        // it needs to call only 'phinx migrate' and then 'phinx status'
        $this->utils
            ->expects($this->exactly(2))
            ->method('exec')
            ->will($this->returnValue($process));

        $event = new DeployEvent();
        $event->setTargetDir($this->getPath('/releases/new_release'));
        $event->setCurrentDir($this->getPath('/releases/current_release'));
        $event->setTimestamp('new_release');
        $event->setSourceDir($this->getPath('/source'));

        $this->phinxDeploy->onDeployEvent($event);

        // it should create PHINX_CURRENT, PHINX_MIGRATE and PHINX_STATUS
        $this->assertTrue($this->root->hasChild('releases/new_release/PHINX_CURRENT'));
        $content = file_get_contents($this->getPath('/releases/new_release/PHINX_CURRENT'));
        $this->assertEquals($migration_id, $content);

        $this->assertTrue($this->root->hasChild('releases/new_release/PHINX_MIGRATE'));
        $content = file_get_contents($this->getPath('/releases/new_release/PHINX_MIGRATE'));
        $this->assertEquals($phinx_migrate_output, $content);

        $this->assertTrue($this->root->hasChild('releases/new_release/PHINX_STATUS'));
        $content = file_get_contents($this->getPath('/releases/new_release/PHINX_STATUS'));
        $this->assertEquals($phinx_status_output, $content);
    }

    public function testOnDeployEventUndo()
    {
        $current_migration_id = 44444;
        $new_migration_id = 3333;

        $this->utils->getFs()->dumpFile(
            $this->getPath("/releases/current_release/PHINX_CURRENT"),
            $current_migration_id
        );

        $this->utils->getFs()->dumpFile(
            $this->getPath("/releases/new_release/PHINX_CURRENT"),
            $new_migration_id
        );

        $phinx_undo_output = "phinx undo output";
        $phinx_status_output = "     up  {$current_migration_id}  test_migration";

        $process = $this
            ->getMockBuilder('Symfony\Component\Process\Process')
            ->disableOriginalConstructor()
            ->getMock();

        $process
            ->expects($this->any())
            ->method('getOutput')
            ->will($this->onConsecutiveCalls($phinx_undo_output, $phinx_status_output));

        // it needs to call only 'phinx rollback' and then 'phinx status'
        $this->utils
            ->expects($this->exactly(2))
            ->method('exec')
            ->will($this->returnValue($process));

        $event = new DeployEvent();
        $event->setTargetDir($this->getPath('/releases/new_release'));
        $event->setCurrentDir($this->getPath('/releases/current_release'));
        $event->setTimestamp('new_release');
        $event->setSourceDir($this->getPath('/source'));

        $this->phinxDeploy->onDeployEventUndo($event);

        // it shouldn't change versions stored in PHINX_CURRENT files
        $this->assertTrue($this->root->hasChild('releases/current_release/PHINX_CURRENT'));
        $content = file_get_contents($this->getPath('/releases/current_release/PHINX_CURRENT'));
        $this->assertEquals($current_migration_id, $content);

        $this->assertTrue($this->root->hasChild('releases/new_release/PHINX_CURRENT'));
        $content = file_get_contents($this->getPath('/releases/new_release/PHINX_CURRENT'));
        $this->assertEquals($new_migration_id, $content);

        // it should create PHINX_UNDO, PHINX_UNDO_TARGET and PHINX_AFTER_UNDO_STATUS
        $this->assertTrue($this->root->hasChild('releases/new_release/PHINX_UNDO'));
        $content = file_get_contents($this->getPath('/releases/new_release/PHINX_UNDO'));
        $this->assertEquals($phinx_undo_output, $content);

        $this->assertTrue($this->root->hasChild('releases/new_release/PHINX_UNDO_TARGET'));
        $content = file_get_contents($this->getPath('/releases/new_release/PHINX_UNDO_TARGET'));
        $this->assertEquals($current_migration_id, $content);

        $this->assertTrue($this->root->hasChild('releases/new_release/PHINX_AFTER_UNDO_STATUS'));
        $content = file_get_contents($this->getPath('/releases/new_release/PHINX_AFTER_UNDO_STATUS'));
        $this->assertEquals($phinx_status_output, $content);
    }

    public function testOnDeployEventUndoWithoutCurrentRelease()
    {
        $event = new DeployEvent();
        $event->setTargetDir($this->getPath('/releases/new_release'));
        $event->setTimestamp('new_release');
        $event->setSourceDir($this->getPath('/source'));

        try {
            $this->phinxDeploy->onDeployEventUndo($event);
        } catch (\Exception $e) {
            $this->fail('An exception has been raised. ' . $e->getMessage());
        }
        $this->assertTrue(true);
    }

    public function testOnRollbackEvent()
    {
        $previous_migration_id = 12345;
        $current_migration_id = 99999;

        $this->utils->getFs()->dumpFile(
            $this->getPath("/releases/previous_release/PHINX_CURRENT"),
            $previous_migration_id
        );

        $this->utils->getFs()->dumpFile(
            $this->getPath("/releases/current_release/PHINX_CURRENT"),
            $current_migration_id
        );

        $phinx_rollback_output = "phinx rollback output";
        $phinx_status_output = "     up  {$previous_migration_id}  test_migration";

        $process = $this
            ->getMockBuilder('Symfony\Component\Process\Process')
            ->disableOriginalConstructor()
            ->getMock();

        $process
            ->expects($this->any())
            ->method('getOutput')
            ->will($this->onConsecutiveCalls($phinx_rollback_output, $phinx_status_output));

        // it needs to call only 'phinx rollback' and then 'phinx status'
        $this->utils
            ->expects($this->exactly(2))
            ->method('exec')
            ->will($this->returnValue($process));

        $event = new RollbackEvent();
        $event->setCurrentDir($this->getPath('/releases/current_release'));
        $event->setTargetDir($this->getPath('/releases/previous_release'));

        $this->phinxDeploy->onRollbackEvent($event);

        $this->assertTrue($this->root->hasChild('releases/current_release/PHINX_CURRENT'));
        $content = file_get_contents($this->getPath('/releases/current_release/PHINX_CURRENT'));
        $this->assertEquals($current_migration_id, $content);

        $this->assertTrue($this->root->hasChild('releases/previous_release/PHINX_CURRENT'));
        $content = file_get_contents($this->getPath('/releases/previous_release/PHINX_CURRENT'));
        $this->assertEquals($previous_migration_id, $content);

        // it should create PHINX_ROLLBACK, PHINX_ROLLBACK_TARGET and PHINX_AFTER_ROLLBACK_STATUS
        $this->assertTrue($this->root->hasChild('releases/current_release/PHINX_ROLLBACK'));
        $content = file_get_contents($this->getPath('/releases/current_release/PHINX_ROLLBACK'));
        $this->assertEquals($phinx_rollback_output, $content);

        $this->assertTrue($this->root->hasChild('releases/current_release/PHINX_ROLLBACK_TARGET'));
        $content = file_get_contents($this->getPath('/releases/current_release/PHINX_ROLLBACK_TARGET'));
        $this->assertEquals($previous_migration_id, $content);

        $this->assertTrue($this->root->hasChild('releases/current_release/PHINX_AFTER_ROLLBACK_STATUS'));
        $content = file_get_contents($this->getPath('/releases/current_release/PHINX_AFTER_ROLLBACK_STATUS'));
        $this->assertEquals($phinx_status_output, $content);
    }

    public function testOnRollbackEventUndoWithoutCurrentRelease()
    {
        $event = new RollbackEvent();
        $event->setCurrentDir($this->getPath('/releases/current_release'));

        try {
            $this->phinxDeploy->onRollbackEvent($event);
        } catch (\Exception $e) {
            $this->fail('An exception has been raised. ' . $e->getMessage());
        }
        $this->assertTrue(true);
    }
}

class TestFileSystem extends Filesystem
{
    public function dumpFile($filename, $content, $mode = 0666)
    {
        file_put_contents($filename, $content);
    }
}


text:
package ip_allow

import (
	"net"
	"net/http"
	"strings"

	"github.com/micro/cli/v2"
	log "github.com/micro/go-micro/v2/logger"
	"github.com/micro/micro/v2/plugin"
)

type allow struct {
	cidrs map[string]*net.IPNet
	ips   map[string]bool
}

func (w *allow) Flags() []cli.Flag {
	return []cli.Flag{
		&cli.StringFlag{
			Name:    "ip_allow",
			Usage:   "Comma separated list of allowed IPs",
			EnvVars: []string{"IP_ALLOW"},
		},
	}
}

func (w *allow) load(ips ...string) {
	for _, ip := range ips {
		parts := strings.Split(ip, "/")

		switch len(parts) {
		// assume just an ip
		case 1:
			w.ips[ip] = true
		case 2:
			// parse cidr
			_, ipnet, err := net.ParseCIDR(ip)
			if err != nil {
				log.Fatalf("[ip_allow] failed to parse %v: %v", ip, err)
			}
			w.cidrs[ipnet.String()] = ipnet
		default:
			log.Fatalf("[ip_allow] failed to parse %v", ip)
		}
	}

}

func (w *allow) match(ip string) bool {
	// make ip
	nip := net.ParseIP(ip)

	// check ips
	if ok := w.ips[nip.String()]; ok {
		return true
	}

	// check cidrs
	for _, cidr := range w.cidrs {
		if cidr.Contains(nip) {
			return true
		}
	}

	// no match
	return false
}

func (w *allow) Commands() []*cli.Command {
	return nil
}

func (w *allow) Handler() plugin.Handler {
	return func(h http.Handler) http.Handler {
		return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
			// check remote addr; if we can't parse it passes through
			if ip, _, err := net.SplitHostPort(r.RemoteAddr); err == nil {
				// reject if no match
				if !w.match(ip) {
					http.Error(rw, "forbidden", 403)
					return
				}
			}

			// serve the request
			h.ServeHTTP(rw, r)
		})
	}
}

func (w *allow) Init(ctx *cli.Context) error {
	if allow := ctx.String("ip_allow"); len(allow) > 0 {
		w.load(strings.Split(allow, ",")...)
	}
	return nil
}

func (w *allow) String() string {
	return "ip_allow"
}

func NewPlugin() plugin.Plugin {
	return NewIPAllow()
}

func NewIPAllow(ips ...string) plugin.Plugin {
	// create plugin
	w := &allow{
		cidrs: make(map[string]*net.IPNet),
		ips:   make(map[string]bool),
	}

	// load ips
	w.load(ips...)

	return w
}


text:
'use strict';

const merge = require('lodash.merge');
const HTMLBuilder = require('./htmlBuilder');

// lets keep this in the HTML context, since we need things from the
// regular options object in the output
const defaultConfig = {
  html: {
    showAllWaterfallSummary: false
  }
};

module.exports = {
  open(context, options) {
    this.options = merge({}, defaultConfig, options);
    this.HTMLBuilder = new HTMLBuilder(context, this.options);
  },

  close() {
    return this.HTMLBuilder.render();
  },
  config: defaultConfig
};


text:
<configuration>

    <!-- logをファイルに出力 -->
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>./log/slack-capybara.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>./log/slack-capybara.%d{yyyy-MM-dd}.log</FileNamePattern>
            <MaxHistory>7</MaxHistory>
        </rollingPolicy>
        <encoder>
            <charset>UTF-8</charset>
            <Pattern>[%-5level][%d{yyyy-MM-dd HH:mm:ss.SSS}] %class - %msg%n</Pattern>
        </encoder>
    </appender>

    <!-- logを標準出力に出力 -->
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <Target>System.out</Target>
        <encoder>
            <Pattern>[%-5level][%d{yyyy-MM-dd HH:mm:ss.SSS}] %class - %msg%n</Pattern>
        </encoder>
    </appender>

    <!-- ログ出力に関する設定 -->
    <root>
        <level value="info" />
        <appender-ref ref="FILE" />
        <appender-ref ref="STDOUT" />
    </root>

</configuration>


text:
(function (angular) {
    'use strict';

    angular
        .module('mllApp.upload')
        .controller('MusicSummaryFormController', MusicSummaryFormController);

    MusicSummaryFormController.$inject = ['$state', 'authenticationService'];

    function MusicSummaryFormController($state, authenticationService) {
        this.authService = authenticationService;

        this.quit = () => {
            $state.go(this.authService.details.data.type, { id: this.authService.details.data.id }, {reload: true});
        };
    }
})(window.angular);


text:
package uk.co.drnaylor.antipotionfield;

import uk.co.drnaylor.antipotionfield.configaccessor.ConfigAccessor;

public class RegionConfig {

    private ConfigAccessor _regionConfig;

    /**
     * Creates an object that interfaces with a config file.
     *
     * @param filename Name of the file to interface with.
     */
    public RegionConfig(String filename) {
        _regionConfig = new ConfigAccessor(AntiPotionField.getPlugin(), filename);
    }

    /**
     * Get the configuration object represented by this object.
     *
     * @return ConfigAccessor object containing the object.
     */
    public ConfigAccessor getRegionConfig() {
        return _regionConfig;
    }
}


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

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

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            DfBAdminToolkit.Common.Component.Office2010Blue office2010Blue1 = new DfBAdminToolkit.Common.Component.Office2010Blue();
            this.tableLayoutPanel_DevicesMain = new System.Windows.Forms.TableLayoutPanel();
            this.tableLayoutPanel_MemberListGroup = new System.Windows.Forms.TableLayoutPanel();
            this.tableLayoutPanel_DevicesFileCommandGroup = new System.Windows.Forms.TableLayoutPanel();
            this.label_DevicesOutputDir = new System.Windows.Forms.Label();
            this.tableLayoutPanel_DevicesFileSelection = new System.Windows.Forms.TableLayoutPanel();
            this.objectListView_DeviceList = new BrightIdeasSoftware.ObjectListView();
            this.olvColumnContent_Email = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumnContent_DeviceName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumnContent_IpAddress = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumnContent_ClientType = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumnContent_Created = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumnContent_TeamId = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.olvColumnContent_SessionId = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.tableLayoutPanel_DevicesSplitContainer = new System.Windows.Forms.TableLayoutPanel();
            this.buttonEx_DevicesDump = new DfBAdminToolkit.Common.Component.ButtonEx();
            this.buttonLoadDevices = new DfBAdminToolkit.Common.Component.ButtonEx();
            this.textBoxDeviceFilter = new System.Windows.Forms.TextBox();
            this.radioIpAddress = new System.Windows.Forms.RadioButton();
            this.radioDeviceFilter = new System.Windows.Forms.RadioButton();
            this.buttonDeviceFilterList = new DfBAdminToolkit.Common.Component.ButtonEx();
            this.comboFilterCriteria = new System.Windows.Forms.ComboBox();
            this.textBox_DeviceListAccessToken = new System.Windows.Forms.TextBox();
            this.tableLayoutPanel_DevicesMain.SuspendLayout();
            this.tableLayoutPanel_MemberListGroup.SuspendLayout();
            this.tableLayoutPanel_DevicesFileCommandGroup.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.objectListView_DeviceList)).BeginInit();
            this.tableLayoutPanel_DevicesSplitContainer.SuspendLayout();
            this.SuspendLayout();
            //
            // tableLayoutPanel_DevicesMain
            //
            this.tableLayoutPanel_DevicesMain.ColumnCount = 1;
            this.tableLayoutPanel_DevicesMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_DevicesMain.Controls.Add(this.tableLayoutPanel_MemberListGroup, 0, 0);
            this.tableLayoutPanel_DevicesMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel_DevicesMain.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel_DevicesMain.Name = "tableLayoutPanel_DevicesMain";
            this.tableLayoutPanel_DevicesMain.RowCount = 1;
            this.tableLayoutPanel_DevicesMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_DevicesMain.Size = new System.Drawing.Size(481, 457);
            this.tableLayoutPanel_DevicesMain.TabIndex = 0;
            //
            // tableLayoutPanel_MemberListGroup
            //
            this.tableLayoutPanel_MemberListGroup.ColumnCount = 1;
            this.tableLayoutPanel_MemberListGroup.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_MemberListGroup.Controls.Add(this.tableLayoutPanel_DevicesFileCommandGroup, 0, 3);
            this.tableLayoutPanel_MemberListGroup.Controls.Add(this.objectListView_DeviceList, 0, 2);
            this.tableLayoutPanel_MemberListGroup.Controls.Add(this.tableLayoutPanel_DevicesSplitContainer, 0, 1);
            this.tableLayoutPanel_MemberListGroup.Controls.Add(this.textBox_DeviceListAccessToken, 0, 0);
            this.tableLayoutPanel_MemberListGroup.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel_MemberListGroup.Location = new System.Drawing.Point(3, 3);
            this.tableLayoutPanel_MemberListGroup.Name = "tableLayoutPanel_MemberListGroup";
            this.tableLayoutPanel_MemberListGroup.RowCount = 4;
            this.tableLayoutPanel_MemberListGroup.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 6F));
            this.tableLayoutPanel_MemberListGroup.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 35F));
            this.tableLayoutPanel_MemberListGroup.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_MemberListGroup.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 38F));
            this.tableLayoutPanel_MemberListGroup.Size = new System.Drawing.Size(475, 451);
            this.tableLayoutPanel_MemberListGroup.TabIndex = 0;
            //
            // tableLayoutPanel_DevicesFileCommandGroup
            //
            this.tableLayoutPanel_DevicesFileCommandGroup.ColumnCount = 3;
            this.tableLayoutPanel_DevicesFileCommandGroup.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 90F));
            this.tableLayoutPanel_DevicesFileCommandGroup.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_DevicesFileCommandGroup.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 115F));
            this.tableLayoutPanel_DevicesFileCommandGroup.Controls.Add(this.label_DevicesOutputDir, 0, 0);
            this.tableLayoutPanel_DevicesFileCommandGroup.Controls.Add(this.tableLayoutPanel_DevicesFileSelection, 1, 0);
            this.tableLayoutPanel_DevicesFileCommandGroup.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel_DevicesFileCommandGroup.Enabled = false;
            this.tableLayoutPanel_DevicesFileCommandGroup.Location = new System.Drawing.Point(1, 414);
            this.tableLayoutPanel_DevicesFileCommandGroup.Margin = new System.Windows.Forms.Padding(1);
            this.tableLayoutPanel_DevicesFileCommandGroup.Name = "tableLayoutPanel_DevicesFileCommandGroup";
            this.tableLayoutPanel_DevicesFileCommandGroup.RowCount = 1;
            this.tableLayoutPanel_DevicesFileCommandGroup.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_DevicesFileCommandGroup.Size = new System.Drawing.Size(473, 36);
            this.tableLayoutPanel_DevicesFileCommandGroup.TabIndex = 2;
            //
            // label_DevicesOutputDir
            //
            this.label_DevicesOutputDir.AutoSize = true;
            this.label_DevicesOutputDir.Dock = System.Windows.Forms.DockStyle.Fill;
            this.label_DevicesOutputDir.Location = new System.Drawing.Point(3, 0);
            this.label_DevicesOutputDir.Name = "label_DevicesOutputDir";
            this.label_DevicesOutputDir.Size = new System.Drawing.Size(84, 36);
            this.label_DevicesOutputDir.TabIndex = 0;
            this.label_DevicesOutputDir.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //
            // tableLayoutPanel_DevicesFileSelection
            //
            this.tableLayoutPanel_DevicesFileSelection.ColumnCount = 2;
            this.tableLayoutPanel_DevicesFileSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_DevicesFileSelection.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60F));
            this.tableLayoutPanel_DevicesFileSelection.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel_DevicesFileSelection.Location = new System.Drawing.Point(91, 1);
            this.tableLayoutPanel_DevicesFileSelection.Margin = new System.Windows.Forms.Padding(1);
            this.tableLayoutPanel_DevicesFileSelection.Name = "tableLayoutPanel_DevicesFileSelection";
            this.tableLayoutPanel_DevicesFileSelection.RowCount = 1;
            this.tableLayoutPanel_DevicesFileSelection.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_DevicesFileSelection.Size = new System.Drawing.Size(266, 34);
            this.tableLayoutPanel_DevicesFileSelection.TabIndex = 1;
            //
            // objectListView_DeviceList
            //
            this.objectListView_DeviceList.AllColumns.Add(this.olvColumnContent_Email);
            this.objectListView_DeviceList.AllColumns.Add(this.olvColumnContent_DeviceName);
            this.objectListView_DeviceList.AllColumns.Add(this.olvColumnContent_IpAddress);
            this.objectListView_DeviceList.AllColumns.Add(this.olvColumnContent_ClientType);
            this.objectListView_DeviceList.AllColumns.Add(this.olvColumnContent_Created);
            this.objectListView_DeviceList.AllColumns.Add(this.olvColumnContent_TeamId);
            this.objectListView_DeviceList.AllColumns.Add(this.olvColumnContent_SessionId);
            this.objectListView_DeviceList.CellEditUseWholeCell = false;
            this.objectListView_DeviceList.CheckBoxes = true;
            this.objectListView_DeviceList.CheckedAspectName = "IsChecked";
            this.objectListView_DeviceList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.olvColumnContent_Email,
            this.olvColumnContent_DeviceName,
            this.olvColumnContent_IpAddress,
            this.olvColumnContent_ClientType,
            this.olvColumnContent_Created,
            this.olvColumnContent_TeamId,
            this.olvColumnContent_SessionId});
            this.objectListView_DeviceList.Cursor = System.Windows.Forms.Cursors.Default;
            this.objectListView_DeviceList.Dock = System.Windows.Forms.DockStyle.Fill;
            this.objectListView_DeviceList.EmptyListMsg = "No Result";
            this.objectListView_DeviceList.FullRowSelect = true;
            this.objectListView_DeviceList.HideSelection = false;
            this.objectListView_DeviceList.SelectedBackColor = System.Drawing.Color.Empty;
            this.objectListView_DeviceList.SelectedBackColor = System.Drawing.Color.Empty;
            this.objectListView_DeviceList.Location = new System.Drawing.Point(3, 50);
            this.objectListView_DeviceList.Margin = new System.Windows.Forms.Padding(3, 9, 3, 3);
            this.objectListView_DeviceList.Name = "objectListView_DeviceList";
            this.objectListView_DeviceList.ShowFilterMenuOnRightClick = false;
            this.objectListView_DeviceList.ShowGroups = false;
            this.objectListView_DeviceList.ShowImagesOnSubItems = true;
            this.objectListView_DeviceList.ShowItemCountOnGroups = true;
            this.objectListView_DeviceList.Size = new System.Drawing.Size(469, 360);
            this.objectListView_DeviceList.SortGroupItemsByPrimaryColumn = false;
            this.objectListView_DeviceList.TabIndex = 0;
            this.objectListView_DeviceList.UseCellFormatEvents = true;
            this.objectListView_DeviceList.UseCompatibleStateImageBehavior = false;
            this.objectListView_DeviceList.UseFilterIndicator = true;
            this.objectListView_DeviceList.UseHotItem = true;
            this.objectListView_DeviceList.UseNotifyPropertyChanged = true;
            this.objectListView_DeviceList.UseTranslucentHotItem = true;
            this.objectListView_DeviceList.View = System.Windows.Forms.View.Details;
            //
            // olvColumnContent_Email
            //
            this.olvColumnContent_Email.AspectName = "Email";
            this.olvColumnContent_Email.HeaderCheckBox = true;
            this.olvColumnContent_Email.Text = "Email";
            this.olvColumnContent_Email.Width = 170;
            //
            // olvColumnContent_DeviceName
            //
            this.olvColumnContent_DeviceName.AspectName = "DeviceName";
            this.olvColumnContent_DeviceName.MinimumWidth = 130;
            this.olvColumnContent_DeviceName.Text = "Device Name";
            this.olvColumnContent_DeviceName.Width = 180;
            //
            // olvColumnContent_IpAddress
            //
            this.olvColumnContent_IpAddress.AspectName = "IpAddress";
            this.olvColumnContent_IpAddress.Hideable = false;
            this.olvColumnContent_IpAddress.MinimumWidth = 90;
            this.olvColumnContent_IpAddress.Text = "Ip Address";
            this.olvColumnContent_IpAddress.Width = 90;
            //
            // olvColumnContent_ClientType
            //
            this.olvColumnContent_ClientType.AspectName = "ClientType";
            this.olvColumnContent_ClientType.Text = "Client Type";
            this.olvColumnContent_ClientType.Width = 75;
            //
            // olvColumnContent_Created
            //
            this.olvColumnContent_Created.AspectName = "Created";
            this.olvColumnContent_Created.Text = "Created";
            this.olvColumnContent_Created.Width = 130;
            //
            // olvColumnContent_TeamId
            //
            this.olvColumnContent_TeamId.AspectName = "TeamId";
            this.olvColumnContent_TeamId.MinimumWidth = 200;
            this.olvColumnContent_TeamId.Text = "Team ID";
            this.olvColumnContent_TeamId.Width = 200;
            //
            // olvColumnContent_SessionId
            //
            this.olvColumnContent_SessionId.AspectName = "SessionId";
            this.olvColumnContent_SessionId.FillsFreeSpace = true;
            this.olvColumnContent_SessionId.Text = "Session Id";
            this.olvColumnContent_SessionId.Width = 100;
            //
            // tableLayoutPanel_DevicesSplitContainer
            //
            this.tableLayoutPanel_DevicesSplitContainer.ColumnCount = 7;
            this.tableLayoutPanel_DevicesSplitContainer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel_DevicesSplitContainer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel_DevicesSplitContainer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35F));
            this.tableLayoutPanel_DevicesSplitContainer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 65F));
            this.tableLayoutPanel_DevicesSplitContainer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel_DevicesSplitContainer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel_DevicesSplitContainer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel_DevicesSplitContainer.Controls.Add(this.buttonEx_DevicesDump, 0, 1);
            this.tableLayoutPanel_DevicesSplitContainer.Controls.Add(this.buttonLoadDevices, 0, 1);
            this.tableLayoutPanel_DevicesSplitContainer.Controls.Add(this.textBoxDeviceFilter, 3, 1);
            this.tableLayoutPanel_DevicesSplitContainer.Controls.Add(this.radioIpAddress, 4, 1);
            this.tableLayoutPanel_DevicesSplitContainer.Controls.Add(this.radioDeviceFilter, 5, 1);
            this.tableLayoutPanel_DevicesSplitContainer.Controls.Add(this.buttonDeviceFilterList, 6, 1);
            this.tableLayoutPanel_DevicesSplitContainer.Controls.Add(this.comboFilterCriteria, 2, 1);
            this.tableLayoutPanel_DevicesSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel_DevicesSplitContainer.Location = new System.Drawing.Point(3, 9);
            this.tableLayoutPanel_DevicesSplitContainer.Name = "tableLayoutPanel_DevicesSplitContainer";
            this.tableLayoutPanel_DevicesSplitContainer.RowCount = 2;
            this.tableLayoutPanel_DevicesSplitContainer.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 4F));
            this.tableLayoutPanel_DevicesSplitContainer.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel_DevicesSplitContainer.Size = new System.Drawing.Size(469, 29);
            this.tableLayoutPanel_DevicesSplitContainer.TabIndex = 3;
            //
            // buttonEx_DevicesDump
            //
            office2010Blue1.BorderColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(72)))), ((int)(((byte)(161)))));
            office2010Blue1.BorderColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(135)))), ((int)(((byte)(228)))));
            office2010Blue1.ButtonMouseOverColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(199)))), ((int)(((byte)(87)))));
            office2010Blue1.ButtonMouseOverColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(243)))), ((int)(((byte)(215)))));
            office2010Blue1.ButtonMouseOverColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(249)))), ((int)(((byte)(225)))), ((int)(((byte)(137)))));
            office2010Blue1.ButtonMouseOverColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(251)))), ((int)(((byte)(249)))), ((int)(((byte)(224)))));
            office2010Blue1.ButtonNormalColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(31)))), ((int)(((byte)(72)))), ((int)(((byte)(161)))));
            office2010Blue1.ButtonNormalColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(68)))), ((int)(((byte)(135)))), ((int)(((byte)(228)))));
            office2010Blue1.ButtonNormalColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(41)))), ((int)(((byte)(97)))), ((int)(((byte)(181)))));
            office2010Blue1.ButtonNormalColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(125)))), ((int)(((byte)(219)))));
            office2010Blue1.ButtonSelectedColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(199)))), ((int)(((byte)(87)))));
            office2010Blue1.ButtonSelectedColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(252)))), ((int)(((byte)(243)))), ((int)(((byte)(215)))));
            office2010Blue1.ButtonSelectedColor3 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(229)))), ((int)(((byte)(117)))));
            office2010Blue1.ButtonSelectedColor4 = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(216)))), ((int)(((byte)(107)))));
            office2010Blue1.HoverTextColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
            office2010Blue1.SelectedTextColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91)))));
            office2010Blue1.TextColor = System.Drawing.Color.White;
            this.buttonEx_DevicesDump.ColorTable = office2010Blue1;
            this.buttonEx_DevicesDump.Dock = System.Windows.Forms.DockStyle.Fill;
            this.buttonEx_DevicesDump.Enabled = false;
            this.buttonEx_DevicesDump.Location = new System.Drawing.Point(118, 7);
            this.buttonEx_DevicesDump.Name = "buttonEx_DevicesDump";
            this.buttonEx_DevicesDump.Size = new System.Drawing.Size(133, 19);
            this.buttonEx_DevicesDump.TabIndex = 8;
            this.buttonEx_DevicesDump.Text = "Remove Device(s)";
            this.buttonEx_DevicesDump.Theme = DfBAdminToolkit.Common.Component.Theme.MSOffice2010_Blue;
            this.buttonEx_DevicesDump.UseVisualStyleBackColor = true;
            //
            // buttonLoadDevices
            //
            this.buttonLoadDevices.ColorTable = office2010Blue1;
            this.buttonLoadDevices.Dock = System.Windows.Forms.DockStyle.Fill;
            this.buttonLoadDevices.Location = new System.Drawing.Point(3, 7);
            this.buttonLoadDevices.Name = "buttonLoadDevices";
            this.buttonLoadDevices.Size = new System.Drawing.Size(109, 19);
            this.buttonLoadDevices.TabIndex = 5;
            this.buttonLoadDevices.Text = "Search Device(s)";
            this.buttonLoadDevices.Theme = DfBAdminToolkit.Common.Component.Theme.MSOffice2010_Blue;
            this.buttonLoadDevices.UseVisualStyleBackColor = true;
            //
            // textBoxDeviceFilter
            //
            this.textBoxDeviceFilter.Dock = System.Windows.Forms.DockStyle.Fill;
            this.textBoxDeviceFilter.Location = new System.Drawing.Point(245, 7);
            this.textBoxDeviceFilter.Name = "textBoxDeviceFilter";
            this.textBoxDeviceFilter.Size = new System.Drawing.Size(1, 20);
            this.textBoxDeviceFilter.TabIndex = 1;
            //
            // radioIpAddress
            //
            this.radioIpAddress.AutoSize = true;
            this.radioIpAddress.Location = new System.Drawing.Point(223, 7);
            this.radioIpAddress.Name = "radioIpAddress";
            this.radioIpAddress.Size = new System.Drawing.Size(76, 17);
            this.radioIpAddress.TabIndex = 2;
            this.radioIpAddress.TabStop = true;
            this.radioIpAddress.Text = "IP Address";
            this.radioIpAddress.UseVisualStyleBackColor = true;
            //
            // radioDeviceFilter
            //
            this.radioDeviceFilter.AutoSize = true;
            this.radioDeviceFilter.Location = new System.Drawing.Point(305, 7);
            this.radioDeviceFilter.Name = "radioDeviceFilter";
            this.radioDeviceFilter.Size = new System.Drawing.Size(90, 17);
            this.radioDeviceFilter.TabIndex = 3;
            this.radioDeviceFilter.TabStop = true;
            this.radioDeviceFilter.Text = "Device Name";
            this.radioDeviceFilter.UseVisualStyleBackColor = true;
            //
            // buttonDeviceFilterList
            //
            this.buttonDeviceFilterList.ColorTable = office2010Blue1;
            this.buttonDeviceFilterList.Dock = System.Windows.Forms.DockStyle.Fill;
            this.buttonDeviceFilterList.Location = new System.Drawing.Point(401, 7);
            this.buttonDeviceFilterList.Name = "buttonDeviceFilterList";
            this.buttonDeviceFilterList.Size = new System.Drawing.Size(66, 19);
            this.buttonDeviceFilterList.TabIndex = 4;
            this.buttonDeviceFilterList.Text = "Filter";
            this.buttonDeviceFilterList.Theme = DfBAdminToolkit.Common.Component.Theme.MSOffice2010_Blue;
            this.buttonDeviceFilterList.UseVisualStyleBackColor = true;
            this.buttonDeviceFilterList.Visible = false;
            //
            // comboFilterCriteria
            //
            this.comboFilterCriteria.Dock = System.Windows.Forms.DockStyle.Fill;
            this.comboFilterCriteria.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.comboFilterCriteria.FormattingEnabled = true;
            this.comboFilterCriteria.Items.AddRange(new object[] {
            "CONTAINS",
            "NOT CONTAINS",
            "BEGINS WITH",
            "ENDS WITH"});
            this.comboFilterCriteria.Location = new System.Drawing.Point(257, 7);
            this.comboFilterCriteria.Name = "comboFilterCriteria";
            this.comboFilterCriteria.Size = new System.Drawing.Size(1, 21);
            this.comboFilterCriteria.TabIndex = 9;
            //
            // textBox_DeviceListAccessToken
            //
            this.textBox_DeviceListAccessToken.Location = new System.Drawing.Point(2, 2);
            this.textBox_DeviceListAccessToken.Margin = new System.Windows.Forms.Padding(2);
            this.textBox_DeviceListAccessToken.Name = "textBox_DeviceListAccessToken";
            this.textBox_DeviceListAccessToken.Size = new System.Drawing.Size(68, 20);
            this.textBox_DeviceListAccessToken.TabIndex = 4;
            this.textBox_DeviceListAccessToken.Visible = false;
            //
            // DevicesView
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(481, 457);
            this.Controls.Add(this.tableLayoutPanel_DevicesMain);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Name = "DevicesView";
            this.Text = "DevicesView";
            this.tableLayoutPanel_DevicesMain.ResumeLayout(false);
            this.tableLayoutPanel_MemberListGroup.ResumeLayout(false);
            this.tableLayoutPanel_MemberListGroup.PerformLayout();
            this.tableLayoutPanel_DevicesFileCommandGroup.ResumeLayout(false);
            this.tableLayoutPanel_DevicesFileCommandGroup.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.objectListView_DeviceList)).EndInit();
            this.tableLayoutPanel_DevicesSplitContainer.ResumeLayout(false);
            this.tableLayoutPanel_DevicesSplitContainer.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_DevicesMain;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_MemberListGroup;
        private BrightIdeasSoftware.ObjectListView objectListView_DeviceList;
        private BrightIdeasSoftware.OLVColumn olvColumnContent_TeamId;
        private BrightIdeasSoftware.OLVColumn olvColumnContent_DeviceName;
        private BrightIdeasSoftware.OLVColumn olvColumnContent_SessionId;
        private BrightIdeasSoftware.OLVColumn olvColumnContent_IpAddress;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_DevicesFileCommandGroup;
        private System.Windows.Forms.Label label_DevicesOutputDir;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_DevicesFileSelection;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel_DevicesSplitContainer;
        private BrightIdeasSoftware.OLVColumn olvColumnContent_ClientType;
        private System.Windows.Forms.TextBox textBox_DeviceListAccessToken;
        private BrightIdeasSoftware.OLVColumn olvColumnContent_Created;
        private System.Windows.Forms.ComboBox comboFilterCriteria;
        private Common.Component.ButtonEx buttonDeviceFilterList;
        private System.Windows.Forms.RadioButton radioDeviceFilter;
        private System.Windows.Forms.RadioButton radioIpAddress;
        private System.Windows.Forms.TextBox textBoxDeviceFilter;
        private Common.Component.ButtonEx buttonLoadDevices;
        private Common.Component.ButtonEx buttonEx_DevicesDump;
        private BrightIdeasSoftware.OLVColumn olvColumnContent_Email;
    }
}


text:
<!DOCTYPE HTML>

<title>org.apache.sysds.runtime.io.hdf5 (Apache SystemDS 2.3.0-SNAPSHOT API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Package org.apache.sysds.runtime.io.hdf5

Class Summary

Class
Description

H5

H5BTree

H5BufferBuilder

H5Constants

H5ContiguousDataset

H5DoubleDataType

H5GroupSymbolTableNode

H5LocalHeap

H5ObjectHeader

H5RootObject

H5Superblock

H5SymbolTableEntry

Utils

Exception Summary

Exception
Description

H5RuntimeException

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

All Classes

JavaScript is disabled on your browser.

Copyright © 2021 The Apache Software Foundation. All rights reserved.


text:
<?php

namespace Blackfire\Player\Guzzle;

use GuzzleHttp\Promise\PromiseInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

/**
 * @author Fabien Potencier <fabien@blackfire.io>
 *
 * @internal
 */
class PlayerMiddleware
{
    private $handler;

    public function __construct(callable $handler)
    {
        $this->handler = $handler;
    }

    public static function create()
    {
        return function (callable $handler) {
            return new self($handler);
        };
    }

    /**
     * @return PromiseInterface
     */
    public function __invoke(RequestInterface $request, array $options)
    {
        $handler = $this->handler;

        if (!isset($options['player_context'])) {
            return $handler($request, $options);
        }

        $generator = $options['player_context']->getGenerator();

        return $handler($request, $options)
            ->then(function (ResponseInterface $response) use ($generator, $request, $options) {
                if (!$request = $generator->send([$request, $response])) {
                    return $response;
                }

                return $this($request, $options);
            })
            ->otherwise(function (\Exception $exception) use ($generator) {
                $generator->throw($exception);
            });
    }
}