text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/selenium-java.iml" filepath="$PROJECT_DIR$/selenium-java.iml" />
      <module fileurl="file://$PROJECT_DIR$/.idea/modules/selenium-java_main.iml" filepath="$PROJECT_DIR$/.idea/modules/selenium-java_main.iml" group="selenium-java" />
      <module fileurl="file://$PROJECT_DIR$/.idea/modules/selenium-java_test.iml" filepath="$PROJECT_DIR$/.idea/modules/selenium-java_test.iml" group="selenium-java" />
    </modules>
  </component>
</project>

redpajama_set_name: RedPajamaGithub


text:
<?php

class Google_Service_DisplayVideo_ExchangeAssignedTargetingOptionDetails extends Google_Model
{
  public $targetingOptionId;

  public function setTargetingOptionId($targetingOptionId)
  {
    $this->targetingOptionId = $targetingOptionId;
  }
  public function getTargetingOptionId()
  {
    return $this->targetingOptionId;
  }
}


text:
'use strict';

function eva (id) {
    var TheTextBox, source;

    function erra (e) {
        console.log('Error in WaveJS: ', e);
        var msg = ['tspan', ['tspan', {class:'error h5'}, 'Error: '], e.message];
        msg.textWidth = 1000;  // set dummy width because we cannot measure tspans
        return { signal: [{ name: msg }]};
    }

    TheTextBox = document.getElementById(id);

    /* eslint-disable no-eval */
    if (TheTextBox.type && TheTextBox.type === 'textarea') {
        try { source = eval('(' + TheTextBox.value + ')'); } catch (e) { return erra(e); }
    } else {
        try { source = eval('(' + TheTextBox.innerHTML + ')'); } catch (e) { return erra(e); }
    }
    /* eslint-enable  no-eval */

    if (Object.prototype.toString.call(source) !== '[object Object]') {
        return erra({ message: '[Semantic]: The root has to be an Object: "{signal:[...]}"'});
    }
    if (source.signal) {
        if (Object.prototype.toString.call(source.signal) !== '[object Array]') {
            return erra({ message: '[Semantic]: "signal" object has to be an Array "signal:[]"'});
        }
    } else if (source.assign) {
        if (Object.prototype.toString.call(source.assign) !== '[object Array]') {
            return erra({ message: '[Semantic]: "assign" object hasto be an Array "assign:[]"'});
        }
    } else if (source.reg) {
        // test register
    } else {
        return erra({ message: '[Semantic]: "signal:[...]" or "assign:[...]" property is missing inside the root Object'});
    }
    return source;
}

module.exports = eva;

/* eslint-env browser */
/* eslint no-console: 0 */


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, width=device-width" />
    <title>{{ event_name }}</title>
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/css/style.css" rel="stylesheet" type="text/css">
    {% block moremeta %}{% endblock %}

{{ event_name }}{% if environment_name %} - {{ environment_name }}{% endif %}

      {% block content %}{% endblock %}

    {% block pagescripts %}{% endblock %}


text:
require('shelljs/global')
env.NODE_ENV = process.env.NODE_ENV === 'beta' ? 'beta' : 'production'

var path = require('path')
var config = require('../config')
var ora = require('ora')
var webpack = require('webpack')
var webpackConfig = require('./webpack.prod.conf')

console.log(
  '  Tip:\n' +
  '  Built files are meant to be served over an HTTP server.\n' +
  '  Opening index.html over file:// won\'t work.\n'
)

var spinner = ora('building for ' + env.NODE_ENV +'...')
spinner.start()

var configEnv = env.NODE_ENV === 'beta' ? config.beta : config.build
var assetsPath = path.join(configEnv.assetsRoot, configEnv.assetsSubDirectory)
rm('-rf', assetsPath)
mkdir('-p', assetsPath)
cp('-R', 'static/*', assetsPath)

webpack(webpackConfig, function (err, stats) {
  spinner.stop()
  if (err) throw err
  process.stdout.write(stats.toString({
    colors: true,
    modules: false,
    children: false,
    chunks: false,
    chunkModules: false
  }) + '\n')
})


text:
module.exports = function init(global, console, messages) {
  var interface = {
    checkBlobApi: checkBlobApi,
    checkFileReaderApi: checkFileReaderApi,
    checkFormDataInstance: checkFormDataInstance,
    checkTextEncoderApi: checkTextEncoderApi,
    logWarnings: logWarnings,
  };

  return interface;

  function logWarnings() {
    if (!global.FormData) {
      console.warn(messages.MISSING_FORMDATA_API);
    } else if (!global.FormData.prototype || !global.FormData.prototype.entries) {
      console.warn(messages.MISSING_FORMDATA_ENTRIES_API);
    }
  }

  function checkBlobApi() {
    if (!global.Blob || !global.Blob.prototype) {
      throw new Error(messages.MISSING_BLOB_API);
    }
  }

  function checkFileReaderApi() {
    if (!global.FileReader || !global.FileReader.prototype) {
      throw new Error(messages.MISSING_FILE_READER_API);
    }
  }

  function checkFormDataInstance(instance) {
    if (!instance || !instance.entries) {
      throw new Error(messages.MISSING_FORMDATA_ENTRIES_API);
    }
  }

  function checkTextEncoderApi() {
    if (!global.TextEncoder || !global.TextEncoder.prototype) {
      throw new Error(messages.MISSING_TEXT_ENCODER_API);
    }
  }
};


text:
package pl.themolka.arcade.dom.preprocess;

import pl.themolka.arcade.dom.Node;
import pl.themolka.arcade.dom.Parent;
import pl.themolka.arcade.dom.Property;

import java.util.List;
import java.util.Objects;

public class TreePreprocess extends NodePreprocess
                            implements TreePreprocessHandler {
    private final TreePreprocessHandler handler;

    public TreePreprocess(TreePreprocessHandler handler) {
        this.handler = Objects.requireNonNull(handler, "handler cannot be null");
    }

    @Override
    public final List<Node> define(Parent<Node> parent) {
        return parent.children();
    }

    @Override
    public final void invoke(Node node) throws PreprocessException {
        List<Node> nodeDefinition = this.defineNode(node);
        if (nodeDefinition != null) {
            for (Node definedChild : nodeDefinition) {
                this.invokeNode(definedChild);

                List<Property> propertyDefinition = this.defineProperty(definedChild);
                if (propertyDefinition != null) {
                    for (Property property : propertyDefinition) {
                        this.invokeProperty(property);
                    }
                }
            }
        }

        for (Node child : this.define(node)) {
            this.process(child);
        }
    }

    //
    // TreePreprocessHandler
    //

    @Override
    public List<Node> defineNode(Node parent) {
        return this.handler.defineNode(parent);
    }

    @Override
    public List<Property> defineProperty(Node parent) {
        return this.handler.defineProperty(parent);
    }

    @Override
    public void invokeNode(Node node) throws PreprocessException {
        this.handler.invokeNode(node);
    }

    @Override
    public void invokeProperty(Property property) throws PreprocessException {
        this.handler.invokeProperty(property);
    }

    public TreePreprocessHandler getHandler() {
        return this.handler;
    }
}


text:
<?php

namespace Magento\Core\Model\Theme;

class ThemeProviderTest extends \PHPUnit_Framework_TestCase
{
    public function testGetByFullPath()
    {
        $path = 'frontend/Magento/luma';
        $collectionFactory = $this->getMock(
            'Magento\Core\Model\Resource\Theme\CollectionFactory',
            ['create'],
            [],
            '',
            false
        );
        $collectionMock = $this->getMock('Magento\Core\Model\Resource\Theme\Collection', [], [], '', false);
        $theme = $this->getMock('Magento\Framework\View\Design\ThemeInterface', [], [], '', false);
        $collectionMock->expects(
            $this->once()
        )->method(
            'getThemeByFullPath'
        )->with(
            $path
        )->will(
            $this->returnValue($theme)
        );
        $collectionFactory->expects($this->once())->method('create')->will($this->returnValue($collectionMock));
        $themeFactory = $this->getMock('\Magento\Core\Model\ThemeFactory', [], [], '', false);

        $themeProvider = new ThemeProvider($collectionFactory, $themeFactory);
        $this->assertSame($theme, $themeProvider->getThemeByFullPath($path));
    }

    public function testGetById()
    {
        $themeId = 755;
        $collectionFactory = $this->getMock(
            'Magento\Core\Model\Resource\Theme\CollectionFactory',
            [],
            [],
            '',
            false
        );
        $theme = $this->getMock('Magento\Core\Model\Theme', [], [], '', false);
        $theme->expects($this->once())->method('load')->with($themeId)->will($this->returnSelf());
        $themeFactory = $this->getMock('\Magento\Core\Model\ThemeFactory', ['create'], [], '', false);
        $themeFactory->expects($this->once())->method('create')->will($this->returnValue($theme));

        $themeProvider = new ThemeProvider($collectionFactory, $themeFactory);
        $this->assertSame($theme, $themeProvider->getThemeById($themeId));
    }
}


text:
echo 'deb http://archive.ubuntu.com/ubuntu/ bionic-proposed main' > /etc/apt/sources.list.d/bionic-proposed.list

apt-get update -y && \
apt-get install --no-install-recommends -y libpcap-dev gcc g++ libnuma-dev make python3 python3-dev python3-pip wget linux-headers-$(uname -r) patch sudo iproute2 git && \
mkdir -p bin && \
mkdir -p tools/cmake && \
cd tools/cmake && \
wget -nc https://github.com/Kitware/CMake/releases/download/v3.15.3/cmake-3.15.3-Linux-x86_64.tar.gz && \
tar -xzvf cmake-3.15.3-Linux-x86_64.tar.gz && \
cd - && \
ln -sf tools/cmake/cmake-3.15.3-Linux-x86_64/bin/cmake . && \
pip3 install "docker==4.4.4" netifaces==0.11.0


text:
//
//  DCOURLGrabber.m
//  Tapetrap
//
//  Created by Boy van Amstel on 18-11-13.
//  Copyright (c) 2013 Danger Cove. All rights reserved.
//

#import "DCOURLGrabber.h"

// The DCOURLGrabber error domain.
NSString        *   const   kDCOURLGrabberErrorDomain                   = @"com.dangercove.DCOURLGrabber.ErrorDomain";

// The DCOURLGrabber error that is displayed when the bundle ID was not set
NSString        *   const   kDCOURLGrabberErrorBundleIDNotSet           = @"Failed to find application to get URL from";
// The DCOURLGrabber error that is displayed when the AppleScript was not found
NSString        *   const   kDCOURLGrabberErrorScriptNotFound           = @"Failed to find script for %@";
// The DCOURLGrabber error that is displayed when the AppleScript was not found
NSString        *   const   kDCOURLGrabberErrorBrowserNotRunning        = @"The browser with bundle ID %@ is not running";
// The DCOURLGrabber error that is displayed when the AppleScript failed to execute
NSString        *   const   kDCOURLGrabberErrorScriptExecutionFailed    = @"Failed to run script for %@:\n%@";

@interface DCOURLGrabber()

/* The bundle ID of the app that was activated last. */
@property (copy) NSString *lastActiveBundleID;

/* Registers whether the object is monitoring app switches. */
@property (assign, getter = isMonitoring) BOOL monitoring;

/*
 * Bundle IDs of apps that have supported AppleScripts.
 */
+ (NSArray *)supportedBundleIDs;

/*
 * Fires each time the user switches apps.
 *
 * @param notification The app switch notification.
 */
- (void)appDidActivate:(NSNotification *)notification;

/*
 * Returns a new error with the DCOURLGrabber error domain.
 *
 * @param code The `DCOURLErrorCode` that corresponds with the error.
 * @param message The localized description for the error.
 */
- (NSError *)errorForCode:(DCOURLGrabberErrorCode)code withDescription:(NSString *)description;

@end

@implementation DCOURLGrabber

#pragma mark - Class Methods

+ (NSArray *)supportedBundleIDs {
    static id supportedBundleIDs = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        supportedBundleIDs = [NSArray arrayWithObjects:
                              @"com.apple.Safari",
                              @"com.google.Chrome",
                              @"com.operasoftware.Opera",
                              @"org.mozilla.firefox",
                              nil];
    });
    return supportedBundleIDs;
}

#pragma mark - Overrides

- (void)dealloc {
    [self stopMonitoring];
}

#pragma mark - Utilities

- (NSError *)errorForCode:(DCOURLGrabberErrorCode)code withDescription:(NSString *)description {
    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
                          description, NSLocalizedDescriptionKey,
                          nil];
    return [[NSError alloc] initWithDomain:kDCOURLGrabberErrorDomain code:code userInfo:dict];
}

#pragma mark - Event Listeners

- (void)startMonitoring {
    if(self.isMonitoring) return;

    // Register for app switching
    self.monitoring = YES;
    [[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
                                                           selector:@selector(appDidActivate:)
                                                               name:NSWorkspaceDidActivateApplicationNotification
                                                             object:nil];
}

- (void)stopMonitoring {
    if(!self.monitoring) return;

    // Stop listening
    self.monitoring = NO;
    [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self name:NSWorkspaceDidActivateApplicationNotification object:nil];

}

- (void)appDidActivate:(NSNotification *)notification {
    NSRunningApplication *app = [notification.userInfo objectForKey:@"NSWorkspaceApplicationKey"];

    if([[DCOURLGrabber supportedBundleIDs] containsObject:app.bundleIdentifier]) {
        // Set last activated app
        self.lastActiveBundleID = app.bundleIdentifier;
    }
}

#pragma mark - Actual URL Grabbing

- (NSURL *)grabURLFromBundleID:(NSString *)bundleID withError:(NSError *__autoreleasing *)error {

    // Check if applescript is available
    NSString *scriptPath = [[NSBundle mainBundle] pathForResource:self.lastActiveBundleID ofType:@"scpt"];
    NSDictionary *scriptLoadError;
    NSAppleScript *script = [[NSAppleScript alloc] initWithContentsOfURL:[NSURL fileURLWithPath:scriptPath] error:&scriptLoadError];

    if(scriptLoadError) {
        *error = [self errorForCode:DCOURLGrabberErrorCodeScriptNotFound withDescription:kDCOURLGrabberErrorScriptNotFound];

        return nil;
    }

    // Check if app with bundle ID is running
    if([NSRunningApplication runningApplicationsWithBundleIdentifier:self.lastActiveBundleID].count < 1) {
        *error = [self errorForCode:DCOURLGrabberErrorCodeBrowserNotRunning withDescription:kDCOURLGrabberErrorBrowserNotRunning];

        return nil;
    }

    // Grab URL using AppleScript
    NSDictionary *scriptExecuteError;
    NSAppleEventDescriptor *result = [script executeAndReturnError:&scriptExecuteError];
    if(scriptExecuteError) {

        *error = [self errorForCode:DCOURLGrabberErrorCodeScriptExecutionFailed withDescription:[NSString stringWithFormat:kDCOURLGrabberErrorScriptExecutionFailed, self.lastActiveBundleID, scriptExecuteError]];

        return nil;
    }

    // Return what we got
    return [[NSURL alloc] initWithString:result.stringValue];
}

- (NSURL *)grabURLWithError:(NSError *__autoreleasing *)error {
    if(!self.lastActiveBundleID) { // No compatible app was switched to, or the bundle hasn't been set
        *error = [self errorForCode:DCOURLGrabberErrorCodeBundleIDNotSet withDescription:kDCOURLGrabberErrorBundleIDNotSet];
        return nil;
    }

    return [self grabURLFromBundleID:self.lastActiveBundleID withError:error];
}

@end


text:
namespace DatabasePool
{

    public class ConnectionData : ConnectionBase
    {
        public string Name;
        public string ServerType;
    }
}


text:
package org.apache.camel.management;

import javax.management.MBeanServer;
import javax.management.ObjectName;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.Test;

/**
 * @version
 */
public class ManagedCamelContextSuspendResumeTest extends ManagementTestSupport {

    @Test
    public void testManagedCamelContext() throws Exception {
        // JMX tests dont work well on AIX CI servers (hangs them)
        if (isPlatform("aix")) {
            return;
        }

        MBeanServer mbeanServer = getMBeanServer();

        ObjectName on = ObjectName.getInstance("org.apache.camel:context=camel-1,type=context,name=\"camel-1\"");

        assertTrue("Should be registered", mbeanServer.isRegistered(on));
        String name = (String) mbeanServer.getAttribute(on, "CamelId");
        assertEquals("camel-1", name);

        String uptime = (String) mbeanServer.getAttribute(on, "Uptime");
        assertNotNull(uptime);

        long uptimeMillis = (Long) mbeanServer.getAttribute(on, "UptimeMillis");
        assertTrue(uptimeMillis > 0);

        String status = (String) mbeanServer.getAttribute(on, "State");
        assertEquals("Started", status);

        // invoke operations
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");

        Object reply = mbeanServer.invoke(on, "requestBody", new Object[]{"direct:foo", "Hello World"}, new String[]{"java.lang.String", "java.lang.Object"});
        assertEquals("Bye World", reply);

        // suspend Camel
        mbeanServer.invoke(on, "suspend", null, null);

        status = (String) mbeanServer.getAttribute(on, "State");
        assertEquals("Suspended", status);

        // resume Camel
        mbeanServer.invoke(on, "resume", null, null);

        status = (String) mbeanServer.getAttribute(on, "State");
        assertEquals("Started", status);

        reply = mbeanServer.invoke(on, "requestBody", new Object[]{"direct:foo", "Hello Camel"}, new String[]{"java.lang.String", "java.lang.Object"});
        assertEquals("Bye World", reply);
    }

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:foo").delay(10).transform(constant("Bye World"));
            }
        };
    }

}


text:
<?php
namespace Tests\Whizark\DesignPatterns\Uncategorized\HookOperation;

use Whizark\DesignPatterns\Uncategorized\HookOperation\Hook;
use Whizark\DesignPatterns\Uncategorized\HookOperation\HookedClass;

class ClientTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Test an use case.
     */
    public function testAnUseCase()
    {
        $hookedObject = new HookedClass(new Hook());
        $hookedObject->doSomething();
    }
}


text:
module TDev.RT {
    //? A scene contains layers of parralax backgrounds.
    //@ stem("scene")
    export class BoardBackgroundScene
        extends RTValue {
        private _offsetX : number = 0;
        private _offsetY: number = 0;
        private _layers: BoardBackgroundLayer[] = [];

        constructor(private _board : Board) {
            super();
        }

        //? Gets the view horizontal offset
        //@ readsMutable
        public view_x(): number {
            return this._offsetX;
        }
        //? Sets the view horizontal offset
        //@ writesMutable
        public set_view_x(x: number) {
            if (!isNaN(x))
                this._offsetX = x;
        }
        //? Gets the view vertical offset
        //@ readsMutable
        public view_y(): number {
            return this._offsetY;
        }
        //? Sets the view vertical offset
        //@ writesMutable
        public set_view_y(y: number) {
            if (!isNaN(y))
                this._offsetY = y;
        }

        public sortLayers() {
            this._layers.sort((a, b) => b.distance() - a.distance());
        }

        //? Creates a new layer on the scene. The distance determines the order of rendering and how fast the layer moves
        //@ writesMutable picAsync ignoreReturnValue
        //@ embedsLink("BoardBackgroundScene", "BoardBackgroundLayer")
        //@ returns(BoardBackgroundLayer)
        public create_layer(distance: number, pic: Picture, r: ResumeCtx) {
            pic.loadFirst(r, () => {
                var layer = new BoardBackgroundLayer(this, distance, pic);
                this._layers.push(layer);
                this.sortLayers();
                return layer;
            });
        }

        //? Gets the number of layers in the scene
        //@ readsMutable
        public count() : number { return this._layers.length; }

        //? Gets the layer at the given index
        //@ readsMutable
        public at(index: number): BoardBackgroundLayer { return this._layers[Math.floor(index)]; }

        //? Removes all layers from scene and resets the viewport
        public clear() {
            this._layers = [];
            this._offsetX = this._offsetY = 0;
        }

        public render(w: number, h: number, ctx: CanvasRenderingContext2D) {
            this._layers.forEach(layer => {
                // compute displacement based on distance
                var ox = Math.round(this._offsetX / (1 + layer.distance()));
                var oy = Math.round(this._offsetY / (1 + layer.distance()));

                layer.render(w, h, ctx, ox, oy);
            });
        }

        //? Displays the sprite sheet.
        //@ readsMutable
        public post_to_wall(s: IStackFrame): void {
            super.post_to_wall(s)
        }
    }

    //? A background scene layer
    //@ stem("layer")
    export class BoardBackgroundLayer
        extends RTValue {
        private _repeatX = true;
        private _repeatY = true;
        private _alignX = BoardBackgroundLayer.ARRANGE_LEFT;
        private _alignY = BoardBackgroundLayer.ARRANGE_TOP;

        static ARRANGE_LEFT: number = 1;
        static ARRANGE_RIGHT: number = 2;
        static ARRANGE_TOP: number = 3;
        static ARRANGE_BOTTOM: number = 4;
        static ARRANGE_CENTER: number = 5;

        constructor(private _scene : BoardBackgroundScene, private _distance : number, private _pic : Picture) {
            super();
        }

        //? Gets the picture associated to the layer.
        public picture() { return this._pic; }

        //? Gets the layer distance
        //@ readsMutable
        public distance() { return this._distance; }
        //? Sets the layer distance
        //@ writesMutable
        public set_distance(d: number) {
            if (isNaN(d)) d = 0;

            var d = Math.max(0, d);
            if (this._distance != d) {
                this._distance = d;
                this._scene.sortLayers();
            }
        }

        //? Gets a value indicating how the picture aligns horizontally. The default is `left`.
        //@ readsMutable
        public align_x() { return this._alignX; }
        //? Sets a value indicating how the picture aligns horizontally. The default is `left`.
        //@ [align].deflStrings("right", "left", "center")
        //@ writesMutable
        public set_align_x(align: string) {
            switch (align.trim().toLowerCase()) {
                case "left": this._alignX = BoardBackgroundLayer.ARRANGE_LEFT; break;
                case "right": this._alignX = BoardBackgroundLayer.ARRANGE_RIGHT; break;
                case "center": this._alignX = BoardBackgroundLayer.ARRANGE_CENTER; break;
            }
        }

        //? Gets a value indicating how the picture aligns vertically. The default is `top`.
        //@ readsMutable
        public align_y() { return this._alignY; }
        //? Sets a value indicating how the picture aligns vertically. The default is `top`.
        //@ [align].deflStrings("bottom", "top", "center")
        //@ writesMutable
        public set_align_y(align: string) {
            switch (align.trim().toLowerCase()) {
                case "center": this._alignY = BoardBackgroundLayer.ARRANGE_LEFT; break;
                case "top": this._alignY = BoardBackgroundLayer.ARRANGE_TOP; break;
                case "bottom": this._alignY = BoardBackgroundLayer.ARRANGE_BOTTOM; break;
            }
        }

        //? Gets a value indicating if the background repeats horizontally
        //@ readsMutable
        public repeat_x() { return this._repeatX; }
        //? Sets a value indicating if the background repeats horizontally
        //@ writesMutable
        public set_repeat_x(repeat: boolean) { this._repeatX = !!repeat; }

        //? Gets a value indicating if the background repeats horizontally
        //@ readsMutable
        public repeat_y() { return this._repeatY; }
        //? Sets a value indicating if the background repeats horizontally
        //@ writesMutable
        public set_repeat_y(repeat: boolean) { this._repeatY = !!repeat; }

        public render(w: number, h: number, ctx: CanvasRenderingContext2D, offsetX: number, offsetY: number) {
            var p = this._pic.getCanvas();
            var pw = p.width;
            var ph = p.height;

            if (!pw || !ph) return; // empty image.

            // left, top aligned
            var rx = -offsetX;
            var ry = -offsetY;

            switch (this._alignX) {
                case BoardBackgroundLayer.ARRANGE_RIGHT: rx -= (w+pw); break;
                case BoardBackgroundLayer.ARRANGE_CENTER: rx -= (w+pw) / 2; break;
            }
            switch (this._alignY) {
                case BoardBackgroundLayer.ARRANGE_BOTTOM: ry -= (h+ph); break;
                case BoardBackgroundLayer.ARRANGE_CENTER: ry -= (h+ph) / 2; break;
            }

            rx %= w; if (rx < 0) rx += w;
            ry %= h; if (ry < 0) ry += h;

            // avoid subpixel aliasing
            rx = Math.floor(rx);
            ry = Math.floor(ry);

            var renderEdge = !Browser.isWebkit;

            var y = 0;
            var py = 0;
            while (y < h) {
                py = y % ph;
                var dh = Math.min(ph - py, h - ry);
                var x = 0;
                while (x < w) {
                    var px = x % pw;
                    var dw = Math.min(pw - px, w - rx);
                    try {
                        ctx.drawImage(p, px, py, dw, dh, rx, ry, dw, dh);
                        if (renderEdge) {
                            if (this._repeatX)
                                ctx.drawImage(p, px, py, 2, dh, rx - 1, ry, 2, dh);
                            if (this._repeatY)
                                ctx.drawImage(p, px, py, dw, 2, rx, ry - 1, dw, 2);
                        }
                    } catch (e) {
                        Util.log('scene: ' + JSON.stringify({
                            w:w, h:h, pw:pw, ph:ph, dw:dw, dh:dh, x:x, y:y, px:px, py:py, rx:rx, ry:ry, edge:renderEdge
                        }))
                        Util.reportError('backgroundScene', e, false);
                        // stop rendering
                        return;
                    }
                    rx = (rx + dw) % w;
                    x += this._repeatX ? dw : w;
                }
                ry = (ry + dh) % h;
                y += this._repeatY ? dh : h;
            }
        }
    }
}


text:
#pragma once

#include "FileSystem/FilePath.h"
#include "Reflection/Reflection.h"
#include "UI/Script/UIScriptComponentController.h"

namespace DAVA
{
class UIContext;
class UIControl;
class LuaScript;

/**
    Lua Script component controller implementation.
    Implementation of UIScriptComponentController interface that based on Lua-code.

    Lua script can contains next functions:
        - `init(controlRef, componentRef)`,
        - `release(controlRef, componentRef)`.
        - `parametersChanged(controlRef, componentRef)`.
        - `process(controlRef, componentRef, frameDelta)`,
        - `processEvent(controlRef, componentRef, eventName,  ...)` (must return true for avoid sending current event next),
*/
class UILuaScriptComponentController : public UIScriptComponentController
{
    DAVA_VIRTUAL_REFLECTION(UILuaScriptComponentController, UIScriptComponentController);

public:
    /**
    Constructor from file.
     \param scriptPath Path to Lua-script file
    */
    UILuaScriptComponentController(const FilePath& scriptPath);
    ~UILuaScriptComponentController() override;

    void Init(UIScriptComponent* component) override;
    void Release(UIScriptComponent* component) override;
    void ParametersChanged(UIScriptComponent* component) override;
    void Process(UIScriptComponent* component, float32 elapsedTime) override;
    bool ProcessEvent(UIScriptComponent* component, const FastName& eventName, const Vector<Any>& params = Vector<Any>()) override;

private:
    bool loaded = false;
    bool hasProcess = false;
    bool hasProcessEvent = false;
    std::unique_ptr<LuaScript> script;
};
}


text: async function foo() { return {await} };


text:
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

defined('MOODLE_INTERNAL') || die();

global $CFG;
require_once($CFG->libdir . '/csslib.php');

/**
 * CSS optimiser test class.
 *
 * @package core_css
 * @category phpunit
 * @copyright 2012 Sam Hemelryk
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class core_csslib_testcase extends advanced_testcase {

    public function test_background() {
        $optimiser = new css_optimiser();

        $cssin = '.test {background-color: #123456;}';
        $this->assertSame($cssin, $optimiser->process($cssin));
        $this->assertDebuggingCalled('class css_optimiser is deprecated and no longer does anything, '
            . 'please consider using stylelint to optimise your css.');
    }

    /**
     * Test CSS colour matching.
     */
    public function test_css_is_colour() {
        $debugstr = 'css_is_colour() is deprecated without a replacement. Please copy the implementation '
            . 'into your plugin if you need this functionality.';
        // First lets test hex colours.
        $this->assertTrue(css_is_colour('#123456'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#123'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#ABCDEF'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#ABC'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#abcdef'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#abc'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#aBcDeF'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#aBc'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#1a2Bc3'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#1Ac'));
        $this->assertDebuggingCalled($debugstr);

        // Note the following two colour's aren't really colours but browsers process
        // them still.
        $this->assertTrue(css_is_colour('#A'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('#12'));
        $this->assertDebuggingCalled($debugstr);
        // Having four or five characters however are not valid colours and
        // browsers don't parse them. They need to fail so that broken CSS
        // stays broken after optimisation.
        $this->assertFalse(css_is_colour('#1234'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('#12345'));
        $this->assertDebuggingCalled($debugstr);

        $this->assertFalse(css_is_colour('#BCDEFG'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('#'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('#0000000'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('#132-245'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('#13 23 43'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('123456'));
        $this->assertDebuggingCalled($debugstr);

        // Next lets test real browser mapped colours.
        $this->assertTrue(css_is_colour('black'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('blue'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('BLACK'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('Black'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('bLACK'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('mediumaquamarine'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('mediumAquamarine'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('monkey'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour(''));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('not a colour'));
        $this->assertDebuggingCalled($debugstr);

        // Next lets test rgb(a) colours.
        $this->assertTrue(css_is_colour('rgb(255,255,255)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('rgb(0, 0, 0)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('RGB (255, 255   ,    255)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('rgba(0,0,0,0)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('RGBA(255,255,255,1)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('rgbA(255,255,255,0.5)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('rgb(-255,-255,-255)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_colour('rgb(256,-256,256)'));
        $this->assertDebuggingCalled($debugstr);

        // Now lets test HSL colours.
        $this->assertTrue(css_is_colour('hsl(0,0%,100%)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('hsl(180, 0%, 10%)'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_colour('hsl (360, 100%   ,    95%)'));
        $this->assertDebuggingCalled($debugstr);

        // Finally test the special values.
        $this->assertTrue(css_is_colour('inherit'));
        $this->assertDebuggingCalled($debugstr);
    }

    /**
     * Test the css_is_width function.
     */
    public function test_css_is_width() {
        $debugstr = 'css_is_width() is deprecated without a replacement. Please copy the implementation '
            . 'into your plugin if you need this functionality.';
        $this->assertTrue(css_is_width('0'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_width('0px'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_width('0em'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_width('199px'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_width('199em'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_width('199%'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_width('-1px'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_width('auto'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertTrue(css_is_width('inherit'));
        $this->assertDebuggingCalled($debugstr);

        // Valid widths but missing their unit specifier.
        $this->assertFalse(css_is_width('0.75'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_width('3'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_width('-1'));
        $this->assertDebuggingCalled($debugstr);

        // Totally invalid widths.
        $this->assertFalse(css_is_width('-'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_width('bananas'));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_width(''));
        $this->assertDebuggingCalled($debugstr);
        $this->assertFalse(css_is_width('top'));
        $this->assertDebuggingCalled($debugstr);
    }
}


text:
package com.twingly.search.domain;

/**
 * The type Operation failure messages.
 *
 * @deprecated since 1.1.0
 */
@Deprecated
public final class OperationFailureMessages {
    /**
     * The constant API_KEY_DOES_NOT_EXIST.
     */
    public static final String API_KEY_DOES_NOT_EXIST = "The API key does not exist.";
    /**
     * The constant SERVICE_UNAVAILABLE.
     */
    public static final String SERVICE_UNAVAILABLE = "Authentication service unavailable.";
    /**
     * The constant UNAUTHORIZED_API_KEY.
     */
    public static final String UNAUTHORIZED_API_KEY = "The API key does not grant access to the Search API.";
    /**
     * The constant UNDEFINED_ERROR.
     */
    public static final String UNDEFINED_ERROR = "Something went wrong.";
}