text:
/**
 * Created by narendrasisodiya on 29/07/15.
 */

var EventEmitter = require('events').EventEmitter;

class FakeStore extends EventEmitter {
	constructor(config) {
		super();
		var bridge = config.bridge;

		this.unsubid = bridge.on(config.cmdOnStateUpdate, (payload, sendBack) => {
			this.setState(payload);
		});

		bridge.post(config.cmdGetInitialState, {}, (data)=> {
			console.log("Received State from bridge");
			this.setState(data);
		});
	}

	destroy() {
		//TODO
		bridge.off(this.unsubid);
	}

	getState() {
		return this.state;
	}

	setState(state) {
		this.state = state;
		this.emit('change');
	}
}
module.exports = FakeStore;


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

namespace WWT.Providers
{
    // Constructing our URLs for the outside world. Needed since this server may
    // be running behind a gateway such that its hostname is unrelated to what
    // we want to expose.
    //
    // The way that Azure deployment slots seem to work, our staging and
    // production apps have to share identical settings if we want to use its
    // "swap" functionality -- so we can't just hardcode a single URL. So we
    // have a variable that maps from HTTP host to base-URL, in the form
    // "host1=http://url1,host2=http://url1".
    public class WwtExternalUrlInfo : IExternalUrlInfo
    {
        private Dictionary<string, string> _authorityMap;

        public WwtExternalUrlInfo(WwtOptions options)
        {
            _authorityMap = new Dictionary<string, string>();

            if (!string.IsNullOrEmpty(options.ExternalUrlMapText)) {
                foreach (var item in options.ExternalUrlMapText.Split(',')) {
                    var pieces = item.Split(new char[] { '=' }, 2);
                    var authorityIn = pieces[0].ToLower();
                    var hostOut = pieces[1];
                    _authorityMap[authorityIn] = hostOut;
                }
            }
        }

        public Uri GetExternalRequestUrl(IRequest request)
        {
            var internalUrl = request.Url;
            var ub = new UriBuilder(internalUrl);
            var authIn = internalUrl.Authority.ToLower();

            if (_authorityMap.ContainsKey(authIn)) {
                ub.Host = _authorityMap[authIn];
                ub.Port = -1; // force this to default
            }

            return ub.Uri;
        }

        public Uri GetExternalBaseUrl(IRequest request)
        {
            var internalUrl = request.Url;
            var ub = new UriBuilder(internalUrl);
            var authIn = internalUrl.Authority.ToLower();

            if (_authorityMap.ContainsKey(authIn)) {
                ub.Host = _authorityMap[authIn];
                ub.Port = -1; // force this to default
            }

            ub.Path = "/";
            ub.Query = null;
            ub.Fragment = null;
            return ub.Uri;
        }

        public UriBuilder GetWebclientBuilder(IRequest request)
        {
            // One day we might bother to make this configurable, but not today.
            var scheme = request.Url.Scheme;
            var ub = new UriBuilder($"{scheme}://worldwidetelescope.org/webclient/");
            ub.Port = -1; // avoid ":80" in default stringification
            return ub;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

use yii\helpers\Url;
use yii\helpers\Html;
use app\assets\CategoryListAsset;

CategoryListAsset::register($this);
?>
<?php if (count($categories) > 0 ) : ?>

    <?php foreach ($categories as $c) : ?>
        <?php
            // Выделяем выбранную категорию.
            if ( ($currentCategory !== null) && (intval($currentCategory) === $c->id)  ) {
                $itemCssClass = '-darkRed -darkRed--constant';
            } else {
                $itemCssClass = '-orange -orange--action';
            }

            $url = Url::to(['main/index', 'category' => $c->id]);
        ?>
        <a class="categoryListItem  <?=$itemCssClass?>" href="<?=$url?>">

                <?= Html::encode($c->title) ?>

                <?= nl2br(Html::encode($c->description) ) ?>

    <?php endforeach; ?>

<?php endif; ?>


text:
extern "Java"
{
  namespace gnu
  {
    namespace classpath
    {
      namespace jdwp
      {
          class JdwpConstants$InvokeOptions;
      }
    }
  }
}

class gnu::classpath::jdwp::JdwpConstants$InvokeOptions : public ::java::lang::Object
{

public:
  JdwpConstants$InvokeOptions();
  static const jint INVOKE_SINGLE_THREADED = 1;
  static const jint INVOKE_NONVIRTUAL = 2;
  static ::java::lang::Class class$;
};

#endif // __gnu_classpath_jdwp_JdwpConstants$InvokeOptions__


text:
using views::Widget;

typedef InProcessBrowserTest BrowserNonClientFrameViewAshTest;

IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest, WindowHeader) {
  // We know we're using Views, so static cast.
  BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
  Widget* widget = browser_view->GetWidget();
  // We know we're using Ash, so static cast.
  BrowserNonClientFrameViewAsh* frame_view =
      static_cast<BrowserNonClientFrameViewAsh*>(
          widget->non_client_view()->frame_view());

  // Restored window uses tall header.
  const int kWindowWidth = 300;
  const int kWindowHeight = 290;
  widget->SetBounds(gfx::Rect(10, 10, kWindowWidth, kWindowHeight));
  EXPECT_FALSE(frame_view->UseShortHeader());

  // Click on the top edge of a window hits the top edge resize handle.
  gfx::Point top_edge(kWindowWidth / 2, 0);
  EXPECT_EQ(HTTOP, frame_view->NonClientHitTest(top_edge));

  // Click just below the resize handle hits the caption.
  gfx::Point below_resize(kWindowWidth / 2, ash::kResizeInsideBoundsSize);
  EXPECT_EQ(HTCAPTION, frame_view->NonClientHitTest(below_resize));

  // Window at top of screen uses normal header.
  widget->SetBounds(gfx::Rect(10, 0, kWindowWidth, kWindowHeight));
  EXPECT_FALSE(frame_view->UseShortHeader());

  // Maximized window uses short header.
  widget->Maximize();
  EXPECT_TRUE(frame_view->UseShortHeader());

  // Click in the top edge of a maximized window now hits the client area,
  // because we want it to fall through to the tab strip and select a tab.
  EXPECT_EQ(HTCLIENT, frame_view->NonClientHitTest(top_edge));

  // Popups tall header.
  Browser* popup = CreateBrowserForPopup(browser()->profile());
  Widget* popup_widget =
      static_cast<BrowserView*>(popup->window())->GetWidget();
  BrowserNonClientFrameViewAsh* popup_frame_view =
      static_cast<BrowserNonClientFrameViewAsh*>(
          popup_widget->non_client_view()->frame_view());
  popup_widget->SetBounds(gfx::Rect(5, 5, 200, 200));
  EXPECT_FALSE(popup_frame_view->UseShortHeader());

  // Apps use tall header.
  Browser* app = CreateBrowserForApp("name", browser()->profile());
  Widget* app_widget =
      static_cast<BrowserView*>(app->window())->GetWidget();
  BrowserNonClientFrameViewAsh* app_frame_view =
      static_cast<BrowserNonClientFrameViewAsh*>(
          app_widget->non_client_view()->frame_view());
  app_widget->SetBounds(gfx::Rect(15, 15, 250, 250));
  EXPECT_FALSE(app_frame_view->UseShortHeader());
}

// Test that the frame view does not do any painting in non-immersive
// fullscreen.
IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest,
                       NonImmersiveFullscreen) {
  // We know we're using Views, so static cast.
  BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
  content::WebContents* web_contents = browser_view->GetActiveWebContents();
  Widget* widget = browser_view->GetWidget();
  // We know we're using Ash, so static cast.
  BrowserNonClientFrameViewAsh* frame_view =
      static_cast<BrowserNonClientFrameViewAsh*>(
          widget->non_client_view()->frame_view());

  // Frame paints by default.
  EXPECT_TRUE(frame_view->ShouldPaint());

  // No painting should occur in non-immersive fullscreen. (We enter into tab
  // fullscreen here because tab fullscreen is non-immersive even on ChromeOS).
  {
    // NOTIFICATION_FULLSCREEN_CHANGED is sent asynchronously.
    scoped_ptr<FullscreenNotificationObserver> waiter(
        new FullscreenNotificationObserver());
    browser()->fullscreen_controller()->ToggleFullscreenModeForTab(
        web_contents, true);
    waiter->Wait();
  }
  EXPECT_FALSE(browser_view->immersive_mode_controller()->IsEnabled());
  EXPECT_FALSE(frame_view->ShouldPaint());

  // The client view abuts top of the window.
  EXPECT_EQ(0, frame_view->NonClientTopBorderHeight());

  // The frame should be painted again when fullscreen is exited and the caption
  // buttons should be visible.
  {
    scoped_ptr<FullscreenNotificationObserver> waiter(
        new FullscreenNotificationObserver());
    chrome::ToggleFullscreenMode(browser());
    waiter->Wait();
  }
  EXPECT_TRUE(frame_view->ShouldPaint());
  EXPECT_TRUE(frame_view->caption_button_container_->visible());
}

IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewAshTest, ImmersiveFullscreen) {
  // We know we're using Views, so static cast.
  BrowserView* browser_view = static_cast<BrowserView*>(browser()->window());
  content::WebContents* web_contents = browser_view->GetActiveWebContents();
  Widget* widget = browser_view->GetWidget();
  // We know we're using Ash, so static cast.
  BrowserNonClientFrameViewAsh* frame_view =
      static_cast<BrowserNonClientFrameViewAsh*>(
          widget->non_client_view()->frame_view());

  ImmersiveModeController* immersive_mode_controller =
      browser_view->immersive_mode_controller();
  immersive_mode_controller->SetupForTest();

  // Immersive mode starts disabled.
  ASSERT_FALSE(widget->IsFullscreen());
  EXPECT_FALSE(immersive_mode_controller->IsEnabled());

  // Frame paints by default.
  EXPECT_TRUE(frame_view->ShouldPaint());

  // Enter both browser fullscreen and tab fullscreen. Entering browser
  // fullscreen should enable immersive fullscreen.
  {
    // NOTIFICATION_FULLSCREEN_CHANGED is sent asynchronously.
    scoped_ptr<FullscreenNotificationObserver> waiter(
        new FullscreenNotificationObserver());
    chrome::ToggleFullscreenMode(browser());
    waiter->Wait();
  }
  {
    scoped_ptr<FullscreenNotificationObserver> waiter(
        new FullscreenNotificationObserver());
    browser()->fullscreen_controller()->ToggleFullscreenModeForTab(
        web_contents, true);
    waiter->Wait();
  }
  EXPECT_TRUE(immersive_mode_controller->IsEnabled());

  // An immersive reveal shows the buttons and the top of the frame.
  scoped_ptr<ImmersiveRevealedLock> revealed_lock(
      immersive_mode_controller->GetRevealedLock(
          ImmersiveModeController::ANIMATE_REVEAL_NO));
  EXPECT_TRUE(immersive_mode_controller->IsRevealed());
  EXPECT_TRUE(frame_view->ShouldPaint());
  EXPECT_TRUE(frame_view->caption_button_container_->visible());
  EXPECT_TRUE(frame_view->UseShortHeader());
  EXPECT_FALSE(frame_view->UseImmersiveLightbarHeaderStyle());

  // End the reveal. When in both immersive browser fullscreen and tab
  // fullscreen, the tab lightbars should not be painted.
  revealed_lock.reset();
  EXPECT_FALSE(immersive_mode_controller->IsRevealed());
  EXPECT_FALSE(frame_view->ShouldPaint());

  // Repeat test but without tab fullscreen. The tab lightbars should now show
  // when the top-of-window views are not revealed.
  {
    scoped_ptr<FullscreenNotificationObserver> waiter(
        new FullscreenNotificationObserver());
    browser()->fullscreen_controller()->ToggleFullscreenModeForTab(
        web_contents, false);
    waiter->Wait();
  }

  // Immersive reveal should have same behavior as before.
  revealed_lock.reset(immersive_mode_controller->GetRevealedLock(
      ImmersiveModeController::ANIMATE_REVEAL_NO));
  EXPECT_TRUE(immersive_mode_controller->IsRevealed());
  EXPECT_TRUE(frame_view->ShouldPaint());
  EXPECT_TRUE(frame_view->caption_button_container_->visible());
  EXPECT_TRUE(frame_view->UseShortHeader());
  EXPECT_FALSE(frame_view->UseImmersiveLightbarHeaderStyle());

  // Ending the reveal should hide the caption buttons and the header should
  // be in the lightbar style.
  revealed_lock.reset();
  EXPECT_TRUE(frame_view->ShouldPaint());
  EXPECT_FALSE(frame_view->caption_button_container_->visible());
  EXPECT_TRUE(frame_view->UseShortHeader());
  EXPECT_TRUE(frame_view->UseImmersiveLightbarHeaderStyle());

  // Exiting immersive fullscreen should make the caption buttons and the frame
  // visible again.
  {
    scoped_ptr<FullscreenNotificationObserver> waiter(
        new FullscreenNotificationObserver());
    browser_view->ExitFullscreen();
    waiter->Wait();
  }
  EXPECT_FALSE(immersive_mode_controller->IsEnabled());
  EXPECT_TRUE(frame_view->ShouldPaint());
  EXPECT_TRUE(frame_view->caption_button_container_->visible());
  EXPECT_FALSE(frame_view->UseImmersiveLightbarHeaderStyle());
}


text:
[![Latest Stable Version](https://img.shields.io/packagist/v/flagshipcompany/flagship-rest-client.svg)](https://packagist.org/packages/flagshipcompany/flagship-rest-client)

Small PHP Client to help use the FlagShip API

## License: MIT

## Instruction

Please read https://docs.smartship.io/ before starting using this library. All available endpoints are found in the API docs.

## Install
```sh
composer require flagshipcompany/flagship-rest-client
```

## Usage:

```php
<?php

require_once './vendor/autoload.php';

use Flagship\Api\Client;

$client = new Client('MY_FLAGSHIP_ACCESS_TOKEN');

// example rate request
// @see https://docs.smartship.io/#shipping
//
$response = $client->post('/ship/rates', [
	'from' => [
		// ...
	],
	'to' => [
		// ...
	],
	'packages' => [
		// ...
	],
	// ...
]);

if (200 == $response->getStatusCode()) {
	var_dump($response->getContent());
}

```

### Testing endpoints:

> 1. Your production api access token **WILL NOT** work for any testing api endpoints.
> 2. You **MUST** request a testing access token via FlagShip support developers@flagshipcompany.com

```php
// use testing api
$client = new Client('MY_FLAGSHIP_TEST_ACCESS_TOKEN', 'https://test-api.smartship.io');
```


text:
package de.learnlib.alex;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class RedirectConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry reg) {
        redirect(reg, "/app/**", "/login", "/logout", "/error");
    }

    private void redirect(ViewControllerRegistry reg, String... routes) {
        for (int i = 0; i < routes.length; i++) {
            reg.addViewController(routes[i]).setViewName("forward:/index.html");
        }
    }
}


text:
package org.wso2.appserver.test.integration;

import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;

/**
 * Class for handling the WSO2 Application Server start and stop process.
 *
 * @since 6.0.0
 */
public class ApplicationServerProcessHandler {

    private final ProcessBuilder applicationServerProcessBuilder;
    private Process applicationServerProcess;
    private String jacocoArgLine;
    private String operatingSystem;

    public ApplicationServerProcessHandler(File appserverHome) {

        applicationServerProcessBuilder = new ProcessBuilder()
                .directory(appserverHome)
                .redirectErrorStream(true);

        setEnvironmentsVariables();
        operatingSystem = System.getProperty("os.name");

    }

    private void setEnvironmentsVariables() {

        String jacocoAgentDir = System.getProperty("jacoco-agent.dir");
        String jacocoRuntimeJar = System.getProperty("jacoco-agent.runtime");
        String jacocoDataFile = System.getProperty("jacoco-agent.data.file");
        jacocoArgLine = "-javaagent:" + Paths.get(jacocoAgentDir, jacocoRuntimeJar)
                + "=destfile=" + Paths.get(jacocoAgentDir, jacocoDataFile);
        applicationServerProcessBuilder.environment().put("JAVA_OPTS", jacocoArgLine);
    }

    /**
     * Get the jacoco test coverage agent argument.
     *
     * @return jacoco argument.
     */
    public String getJacocoArgLine() {
        return jacocoArgLine;
    }

    /**
     * Starts the WSO2 Application Server as a separate process.
     *
     * @throws IOException          when process fails to start.
     */
    public void startServer() throws IOException {
        File redirectFile = Paths.get(System.getProperty("build.directory"), "server.log").toFile();
        applicationServerProcessBuilder.redirectOutput(ProcessBuilder.Redirect.appendTo(redirectFile));
        if (operatingSystem.toLowerCase().contains("windows")) {
            applicationServerProcess = applicationServerProcessBuilder
                    .command("cmd.exe", "/C", "bin\\catalina.bat", "run").start();
        } else {
            applicationServerProcess = applicationServerProcessBuilder.command("./bin/catalina.sh", "run").start();
        }
    }

    /**
     * Stop the previously started WSO2 Application Server.
     *
     */
    public void stopServer() {
        if (applicationServerProcess != null) {
            applicationServerProcess.destroy();
        }
    }

    public String getOperatingSystem() {
        return operatingSystem;
    }
}


text:
package data_science.ui.loc.action;

import com.lynden.gmapsfx.javascript.object.InfoWindowOptions;
import com.lynden.gmapsfx.javascript.object.LatLong;
import com.lynden.gmapsfx.javascript.object.MarkerOptions;
import data_science.database.query.BicycleStallsRobbedFromQuery;
import data_science.model.BicycleStall;
import data_science.model.StallTheft;
import data_science.ui.ApplicationScene;
import data_science.ui.loc.LocationViewActionBar;
import javafx.application.Platform;
import javafx.beans.value.ObservableValue;
import javafx.scene.control.CheckBox;

/**
 * A {@link CheckBox} for a user to toggle whether to show bicycle thefts
 * that occurred at bicycle stalls.
 * @author I.A
 * @author Jasper Wijnhoven
 */
public final class TheftsFromStallsCheckBox extends CheckBox {
	/**
	 * The action bar this checkbox belongs to.
	 */
	private final LocationViewActionBar actionBar;

	/**
	 * Creates a new {@link TheftsFromStallsCheckBox}.
	 */
	public TheftsFromStallsCheckBox(LocationViewActionBar actionBar) {
		super("Show Bicycle Thefts From Stalls");

		this.actionBar = actionBar;

		//setTextFill(Color.WHITE);

		selectedProperty().addListener(this::stateChange);
		setIndeterminate(false);
	}

	/**
	 * Reacts to a change of state e.g on user input.
	 */
	private void stateChange(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {
		ApplicationScene scene = (ApplicationScene) getScene();

		boolean enabled = newValue;
		if (enabled) {
			applyMarkers(scene);

			scene.getListener().refresh();

			actionBar.getSafestBicycleStallsBox().setSelected(false);
			actionBar.getBicycleStallsBox().setSelected(false);
			actionBar.getLeastSafeBicycleStallsBox().setSelected(false);
		} else {
			scene.clearAllMarkers();
		}
	}

	private void applyMarkers(ApplicationScene scene) {
		BicycleStallsRobbedFromQuery.compute().subscribe((StallTheft t) -> {
			Platform.runLater(() -> { // TODO integrate Platform thread with RxJava
				BicycleStall s = t.getStall();

				LatLong coordinates = new LatLong(s.getLatitude(), s.getLongitude());

				InfoWindowOptions infoWindowOptions = new InfoWindowOptions();
				infoWindowOptions.content("
" + s.getArea() + "
"
						+ "Street Name: " + s.getName() + "
"
				    + "Theft Count: " + t.getTheftCount() + "
");

				scene.presentMarker(new MarkerOptions().position(coordinates).visible(Boolean.TRUE), infoWindowOptions);
			});
		});

		scene.clearAllMarkers();
	}
}


text:
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Contents**

- [Virtual Box](#virtual-box)
- [Deployments, see: [Google Doc](https://docs.google.com/a/wirelessanalytics.com/spreadsheets/d/1tMW-gkc0-B9T5KV6K1GLa-5ePN6SbHWJyWXtJOLTlRE/edit#gid=0)](#deployments-see-google-dochttpsdocsgooglecomawirelessanalyticscomspreadsheetsd1tmw-gkc0-b9t5kv6k1gla-5epn6sbhwjywxtjoltlreeditgid0)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Virtual Box
- Api server: http://clean.local (remember to add 192.168.56.101 to /etc/hosts, or use vagrant host manager)
- beanstalkd:  192.168.56.101:8501
- redis: 	    192.168.56.101:6379
- mailcatcher:  webconsole: 192.168.56.101:1080 | smtp: 192.168.56.101:1025

## Deployments, see: [Google Doc](https://docs.google.com/a/wirelessanalytics.com/spreadsheets/d/1tMW-gkc0-B9T5KV6K1GLa-5ePN6SbHWJyWXtJOLTlRE/edit#gid=0)


text:
package com.vaadin.tests.applicationservlet;

import org.junit.Assert;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

import com.vaadin.tests.tb3.SingleBrowserTest;

public class VaadinRefreshServletTest extends SingleBrowserTest {

    @Test
    public void redirectWorksWithContextPath() {
        getDriver().get(getBaseURL() + "/vaadinrefresh/");
        waitUntil((WebDriver d) -> "Please login"
                .equals(findElement(By.tagName("body")).getText()));
        Assert.assertEquals(getBaseURL() + "/statictestfiles/login.html",
                getDriver().getCurrentUrl());
    }
}


text:
package eu.lunisolar.magma.func.function.to;

import javax.annotation.Nonnull; // NOSONAR
import javax.annotation.Nullable; // NOSONAR
import javax.annotation.concurrent.NotThreadSafe; // NOSONAR
import java.util.Comparator; // NOSONAR
import java.util.Objects; // NOSONAR
import eu.lunisolar.magma.basics.*; //NOSONAR
import eu.lunisolar.magma.basics.builder.*; // NOSONAR
import eu.lunisolar.magma.basics.exceptions.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.aType.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.type.*; // NOSONAR
import eu.lunisolar.magma.basics.meta.functional.domain.*; // NOSONAR
import eu.lunisolar.magma.func.IA;
import eu.lunisolar.magma.func.SA;
import eu.lunisolar.magma.func.*; // NOSONAR
import eu.lunisolar.magma.func.tuple.*; // NOSONAR

import java.util.concurrent.*; // NOSONAR
import java.util.function.*; // NOSONAR
import java.util.*; // NOSONAR
import java.lang.reflect.*; // NOSONAR

import eu.lunisolar.magma.func.action.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.bi.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.obj.*; // NOSONAR
import eu.lunisolar.magma.func.consumer.primitives.tri.*; // NOSONAR
import eu.lunisolar.magma.func.function.*; // NOSONAR
import eu.lunisolar.magma.func.function.conversion.*; // NOSONAR
import eu.lunisolar.magma.func.function.from.*; // NOSONAR
import eu.lunisolar.magma.func.function.to.*; // NOSONAR
import eu.lunisolar.magma.func.operator.binary.*; // NOSONAR
import eu.lunisolar.magma.func.operator.ternary.*; // NOSONAR
import eu.lunisolar.magma.func.operator.unary.*; // NOSONAR
import eu.lunisolar.magma.func.predicate.*; // NOSONAR
import eu.lunisolar.magma.func.supplier.*; // NOSONAR

/**
 * Non-throwing functional interface (lambda) LToByteFunction for Java 8.
 *
 * Type: function
 *
 * Domain (lvl: 1): T a
 *
 * Co-domain: byte
 *
 * Special case of function that corresponds to expressions like (iterator) -> Iterator::next
 *
 */
@FunctionalInterface
@SuppressWarnings("UnusedDeclaration")
public interface LToByteFunction<T> extends MetaFunction, MetaInterface.NonThrowing, OFunction<T, aByte>, Codomain<aByte>, Domain1<a<T>> { // NOSONAR

	String DESCRIPTION = "LToByteFunction: byte applyAsByte(T a)";

	// byte applyAsByte(T a) ;
	default byte applyAsByte(T a) {
		// return nestingApplyAsByte(a);
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.nestCheckedAndThrow(e);
		}
	}

	/**
	 * Implement this, but call applyAsByte(T a)
	 */
	byte applyAsByteX(T a) throws Throwable;

	default byte tupleApplyAsByte(LSingle<T> args) {
		return applyAsByte(args.value());
	}

	/** Function call that handles exceptions according to the instructions. */
	default byte handlingApplyAsByte(T a, HandlingInstructions<Throwable, RuntimeException> handling) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handler.handleOrNest(e, handling);
		}
	}

	default LToByteFunction<T> handling(HandlingInstructions<Throwable, RuntimeException> handling) {
		return a -> handlingApplyAsByte(a, handling);
	}

	default byte applyAsByte(T a, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory, newMessage);
		}
	}

	default byte applyAsByte(T a, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory, newMessage, param1);
		}
	}

	default byte applyAsByte(T a, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory, newMessage, param1, param2);
		}
	}

	default byte applyAsByte(T a, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2, @Nullable Object param3) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory, newMessage, param1, param2, param3);
		}
	}

	default LToByteFunction<T> trying(@Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage) {
		return a -> applyAsByte(a, factory, newMessage);
	}

	default LToByteFunction<T> trying(@Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1) {
		return a -> applyAsByte(a, factory, newMessage, param1);
	}

	default LToByteFunction<T> trying(@Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2) {
		return a -> applyAsByte(a, factory, newMessage, param1, param1);
	}

	default LToByteFunction<T> trying(@Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2, @Nullable Object param3) {
		return a -> applyAsByte(a, factory, newMessage, param1, param2, param3);
	}

	default byte applyAsByte(T a, @Nonnull ExWF<RuntimeException> factory) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.wrap(e, factory);
		}
	}

	default LToByteFunction<T> trying(@Nonnull ExWF<RuntimeException> factory) {
		return a -> applyAsByte(a, factory);
	}

	default byte applyAsByteThen(T a, @Nonnull LToByteFunction<Throwable> handler) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			Handling.handleErrors(e);
			return handler.applyAsByte(e);
		}
	}

	default LToByteFunction<T> tryingThen(@Nonnull LToByteFunction<Throwable> handler) {
		return a -> applyAsByteThen(a, handler);
	}

	/** Function call that handles exceptions by always nesting checked exceptions and propagating the others as is. */
	default byte nestingApplyAsByte(T a) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.nestCheckedAndThrow(e);
		}
	}

	/** Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones. */
	default byte shovingApplyAsByte(T a) {
		try {
			return this.applyAsByteX(a);
		} catch (Throwable e) { // NOSONAR
			throw Handling.shoveIt(e);
		}
	}

	static <T> byte shovingApplyAsByte(T a, LToByteFunction<T> func) {
		Null.nonNullArg(func, "func");
		return func.shovingApplyAsByte(a);
	}

	static <T> byte handlingApplyAsByte(T a, LToByteFunction<T> func, HandlingInstructions<Throwable, RuntimeException> handling) { // <-
		Null.nonNullArg(func, "func");
		return func.handlingApplyAsByte(a, handling);
	}

	static <T> byte tryApplyAsByte(T a, LToByteFunction<T> func) {
		Null.nonNullArg(func, "func");
		return func.nestingApplyAsByte(a);
	}

	static <T> byte tryApplyAsByte(T a, LToByteFunction<T> func, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage) {
		Null.nonNullArg(func, "func");
		return func.applyAsByte(a, factory, newMessage);
	}

	static <T> byte tryApplyAsByte(T a, LToByteFunction<T> func, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1) {
		Null.nonNullArg(func, "func");
		return func.applyAsByte(a, factory, newMessage, param1);
	}

	static <T> byte tryApplyAsByte(T a, LToByteFunction<T> func, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2) {
		Null.nonNullArg(func, "func");
		return func.applyAsByte(a, factory, newMessage, param1, param2);
	}

	static <T> byte tryApplyAsByte(T a, LToByteFunction<T> func, @Nonnull ExWMF<RuntimeException> factory, @Nonnull String newMessage, @Nullable Object param1, @Nullable Object param2, @Nullable Object param3) {
		Null.nonNullArg(func, "func");
		return func.applyAsByte(a, factory, newMessage, param1, param2, param3);
	}

	static <T> byte tryApplyAsByte(T a, LToByteFunction<T> func, @Nonnull ExWF<RuntimeException> factory) {
		Null.nonNullArg(func, "func");
		return func.applyAsByte(a, factory);
	}

	static <T> byte tryApplyAsByteThen(T a, LToByteFunction<T> func, @Nonnull LToByteFunction<Throwable> handler) {
		Null.nonNullArg(func, "func");
		return func.applyAsByteThen(a, handler);
	}

	default byte failSafeApplyAsByte(T a, @Nonnull LToByteFunction<T> failSafe) {
		try {
			return applyAsByte(a);
		} catch (Throwable e) { // NOSONAR
			Handling.handleErrors(e);
			return failSafe.applyAsByte(a);
		}
	}

	static <T> byte failSafeApplyAsByte(T a, LToByteFunction<T> func, @Nonnull LToByteFunction<T> failSafe) {
		Null.nonNullArg(failSafe, "failSafe");
		if (func == null) {
			return failSafe.applyAsByte(a);
		} else {
			return func.failSafeApplyAsByte(a, failSafe);
		}
	}

	static <T> LToByteFunction<T> failSafe(LToByteFunction<T> func, @Nonnull LToByteFunction<T> failSafe) {
		Null.nonNullArg(failSafe, "failSafe");
		return a -> failSafeApplyAsByte(a, func, failSafe);
	}

	/** Just to mirror the method: Ensures the result is not null */
	default byte nonNullApplyAsByte(T a) {
		return applyAsByte(a);
	}

	/** Returns description of the functional interface. */
	@Nonnull
	default String functionalInterfaceDescription() {
		return LToByteFunction.DESCRIPTION;
	}

	/** From-To. Intended to be used with non-capturing lambda. */
	public static <T> void fromTo(int min_i, int max_i, T a, @Nonnull LToByteFunction<T> func) {
		Null.nonNullArg(func, "func");
		if (min_i <= max_i) {
			for (int i = min_i; i <= max_i; i++) {
				func.applyAsByte(a);
			}
		} else {
			for (int i = min_i; i >= max_i; i--) {
				func.applyAsByte(a);
			}
		}
	}

	/** From-To. Intended to be used with non-capturing lambda. */
	public static <T> void fromTill(int min_i, int max_i, T a, @Nonnull LToByteFunction<T> func) {
		Null.nonNullArg(func, "func");
		if (min_i <= max_i) {
			for (int i = min_i; i < max_i; i++) {
				func.applyAsByte(a);
			}
		} else {
			for (int i = min_i; i > max_i; i--) {
				func.applyAsByte(a);
			}
		}
	}

	/** From-To. Intended to be used with non-capturing lambda. */
	public static <T> void times(int max_i, T a, @Nonnull LToByteFunction<T> func) {
		if (max_i < 0)
			return;
		fromTill(0, max_i, a, func);
	}

	/** Extract and apply function. */
	public static <M, K, V> byte from(@Nonnull M container, LBiFunction<M, K, V> extractor, K key, @Nonnull LToByteFunction<V> function, byte orElse) {
		Null.nonNullArg(container, "container");
		Null.nonNullArg(function, "function");
		V value = extractor.apply(container, key);

		if (value != null) {
			return function.applyAsByte(value);
		}

		return orElse;
	}

	/** Change function to consumer that ignores output. */
	default LConsumer<T> toConsumer() {
		return this::applyAsByte;
	}

	/** Calls domain consumer before main function. */
	default LToByteFunction<T> beforeDo(@Nonnull LConsumer<T> before) {
		Null.nonNullArg(before, "before");
		return (T a) -> {
			before.accept(a);
			return applyAsByte(a);
		};
	}

	/** Calls codomain consumer after main function. */
	default LToByteFunction<T> afterDo(@Nonnull LByteConsumer after) {
		Null.nonNullArg(after, "after");
		return (T a) -> {
			final byte retval = applyAsByte(a);
			after.accept(retval);
			return retval;
		};
	}

	/** Creates function that always returns the same value. */
	static <T> LToByteFunction<T> constant(byte r) {
		return a -> r;
	}

	/** Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces). */
	@Nonnull
	static <T> LToByteFunction<T> toByteFunc(final @Nonnull LToByteFunction<T> lambda) {
		Null.nonNullArg(lambda, "lambda");
		return lambda;
	}

	// <editor-fold desc="recursive">

	final class S<T> implements LToByteFunction<T> {
		private LToByteFunction<T> target = null;
		@Override
		public byte applyAsByteX(T a) throws Throwable {
			return target.applyAsByteX(a);
		}
	}

	@Nonnull
	static <T> LToByteFunction<T> recursive(final @Nonnull LFunction<LToByteFunction<T>, LToByteFunction<T>> selfLambda) {
		final S<T> single = new S();
		LToByteFunction<T> func = selfLambda.apply(single);
		single.target = func;
		return func;
	}

	// </editor-fold>

	// <editor-fold desc="memento">

	public static <T> M<T> mementoOf(T a, LToByteFunction<T> function) {
		var initialValue = function.applyAsByte(a);
		return initializedMementoOf(initialValue, function);
	}

	public static <T> M<T> initializedMementoOf(byte initialValue, LToByteFunction<T> function) {
		return memento(initialValue, initialValue, function, (m, x1, x2) -> x2);
	}

	public static <T> M<T> deltaOf(T a, LToByteFunction<T> function, LByteBinaryOperator deltaFunction) {
		var initialValue = function.applyAsByte(a);
		return initializedDeltaOf(initialValue, function, deltaFunction);
	}

	public static <T> M<T> deltaOf(T a, LToByteFunction<T> function) {
		var initialValue = function.applyAsByte(a);
		return initializedDeltaOf(initialValue, function, (x1, x2) -> (byte) (x2 - x1));
	}

	public static <T> M<T> initializedDeltaOf(byte initialValue, LToByteFunction<T> function, LByteBinaryOperator deltaFunction) {
		return memento(initialValue, deltaFunction.applyAsByte(initialValue, initialValue), function, (m, x1, x2) -> deltaFunction.applyAsByte(x1, x2));
	}

	public static <T> M<T> memento(byte initialBaseValue, byte initialValue, LToByteFunction<T> baseFunction, LByteTernaryOperator mementoFunction) {
		return new M(initialBaseValue, initialValue, baseFunction, mementoFunction);
	}

	/**
	 * Implementation that allows to create derivative functions (do not confuse it with math concepts). Very short name is intended to be used with parent (LToByteFunction.M)
	 */
	@NotThreadSafe
	final class M<T> implements LToByteFunction<T> {

		private final LToByteFunction<T> baseFunction;
		private byte lastBaseValue;
		private byte lastValue;
		private final LByteTernaryOperator mementoFunction;

		private M(byte lastBaseValue, byte lastValue, LToByteFunction<T> baseFunction, LByteTernaryOperator mementoFunction) {
			this.baseFunction = baseFunction;
			this.lastBaseValue = lastBaseValue;
			this.lastValue = lastValue;
			this.mementoFunction = mementoFunction;
		}

		@Override
		public byte applyAsByteX(T a) throws Throwable {
			byte x1 = lastBaseValue;
			byte x2 = lastBaseValue = baseFunction.applyAsByteX(a);

			return lastValue = mementoFunction.applyAsByte(lastValue, x1, x2);
		}

		public byte lastValue() {
			return lastValue;
		};

		public byte lastBaseValue() {
			return lastBaseValue;
		};
	}

	// </editor-fold>

	@Nonnull
	static <T> LToByteFunction<T> toByteFuncThrowing(final @Nonnull ExF<Throwable> exF) {
		Null.nonNullArg(exF, "exF");
		return a -> {
			throw exF.produce();
		};
	}

	@Nonnull
	static <T> LToByteFunction<T> toByteFuncThrowing(final String message, final @Nonnull ExMF<Throwable> exF) {
		Null.nonNullArg(exF, "exF");
		return a -> {
			throw exF.produce(message);
		};
	}

	static <T> byte call(T a, final @Nonnull LToByteFunction<T> lambda) {
		Null.nonNullArg(lambda, "lambda");
		return lambda.applyAsByte(a);
	}

	// <editor-fold desc="wrap">

	// </editor-fold>

	// <editor-fold desc="compose (functional)">

	/** Allows to manipulate the domain of the function. */
	@Nonnull
	default <V> LToByteFunction<V> compose(@Nonnull final LFunction<? super V, ? extends T> before) {
		Null.nonNullArg(before, "before");
		return v -> this.applyAsByte(before.apply(v));
	}

	// </editor-fold>

	// <editor-fold desc="then (functional)">

	/** Combines two functions together in a order. */
	@Nonnull
	default <V> LFunction<T, V> then(@Nonnull LByteFunction<? extends V> after) {
		Null.nonNullArg(after, "after");
		return a -> after.apply(this.applyAsByte(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LToByteFunction<T> thenToByte(@Nonnull LByteUnaryOperator after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsByte(this.applyAsByte(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LToSrtFunction<T> thenToSrt(@Nonnull LByteToSrtFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsSrt(this.applyAsByte(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LToIntFunction<T> thenToInt(@Nonnull LByteToIntFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsInt(this.applyAsByte(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LToLongFunction<T> thenToLong(@Nonnull LByteToLongFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsLong(this.applyAsByte(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LToFltFunction<T> thenToFlt(@Nonnull LByteToFltFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsFlt(this.applyAsByte(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LToDblFunction<T> thenToDbl(@Nonnull LByteToDblFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsDbl(this.applyAsByte(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LToCharFunction<T> thenToChar(@Nonnull LByteToCharFunction after) {
		Null.nonNullArg(after, "after");
		return a -> after.applyAsChar(this.applyAsByte(a));
	}

	/** Combines two functions together in a order. */
	@Nonnull
	default LPredicate<T> thenToBool(@Nonnull LBytePredicate after) {
		Null.nonNullArg(after, "after");
		return a -> after.test(this.applyAsByte(a));
	}

	// </editor-fold>

	// <editor-fold desc="variant conversions">

	// </editor-fold>

	/** Does nothing (LToByteFunction) Function */
	public static <T> byte doNothing(T a) {
		return Function4U.defaultByte;
	}

	/**
	* For each element (or tuple) from arguments, calls the function and passes the result to consumer.
	* Thread safety, fail-fast, fail-safety of this method is not expected.
	*/
	default <C0> void forEach(IndexedRead<C0, a<T>> ia, C0 source, LByteConsumer consumer) {
		int size = ia.size(source);
		LOiFunction<Object, T> oiFunc0 = (LOiFunction) ia.getter();
		int i = 0;
		for (; i < size; i++) {
			T a = oiFunc0.apply(source, i);
			consumer.accept(this.applyAsByte(a));
		}
	}

	/**
	* For each element (or tuple) from arguments, calls the function and passes the result to consumer.
	* Thread safety, fail-fast, fail-safety of this method depends highly on the arguments.
	*/
	default <C0, I0> void iterate(SequentialRead<C0, I0, a<T>> sa, C0 source, LByteConsumer consumer) {
		Object iterator0 = ((LFunction) sa.adapter()).apply(source);
		LPredicate<Object> testFunc0 = (LPredicate) sa.tester();
		LFunction<Object, T> nextFunc0 = (LFunction) sa.supplier();
		while (testFunc0.test(iterator0)) {
			T a = nextFunc0.apply(iterator0);
			consumer.accept(this.applyAsByte(a));
		}
	}

}


text:
[![Build Status](https://travis-ci.org/asmcup/runtime.svg)](https://travis-ci.org/asmcup/runtime)
[![Join the chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asmcup/Lobby)

# asmcup

`asmcup` is a game where players create small and limited programs
to power robots in a virtual environment to compete for prizes.

It is currently in active beta development.

## Screenshot

![](http://i.imgur.com/Snvjuon.gif)

## Getting Started

The quickest way to get started is to download
[asmcup.jar](https://github.com/asmcup/runtime/releases)
and run it. This will launch the Sandbox which allows you to write, compile,
and debug your robot. **You need to have Java 8 installed to run the Jar file.**

You can find sample bots to try out over [here](https://github.com/asmcup/bots),
and there's a [first steps](https://github.com/asmcup/runtime/wiki/Programming) guide.

asmcup.jar also has command line tools:

 * `asmcup.compiler.Main` compiles assembly source into binaries
 * `asmcup.decompiler.Main` decompiles binary files into source
 * `asmcup.runtime.Main` simulates a game world via the command line

If you want to improve the Sandbox or make changes to the game code itself
you can either import the project into Eclipse or build using `gradle jar`.

## Compete

Made a robot you think can hold its own on our servers?

*Note we aren't ready for uploading until come November*

 * [Upload your robot](https://asmcup.github.io)

## Specifications

If you want to code a robot, you should take a look at the
[SPEC.md](https://github.com/asmcup/runtime/blob/master/SPEC.md) file for details
on the available instructions and operations.

## Game Basics

The game world is randomly generated based on a seed value. This allows anyone
to easily generate a new world and test their robot within it. When running the
code on our servers, the seed value will be randomized and all bots will have to
discover the world they have been placed into and compete for resources.

The world consists of tiles of size 32x32. Aside from normal ground tiles,
there are tiles with items, hazards, obstacles and walls/rooms. Robots have
multiple ways of interacting with the world, ranging from controls for motor
and steering over a beam sensor, a laser, a compass and more to being able to
(*WIP*) communicating with each other.

It is planned that multiple robots will be able to compete in the same world,
including the ability to fight each other.

### Items

The main goal of each robot is to collect gold, which occurs as item in the world.
Players will receive prizes based on the amount of gold their robots collected.
Robots can also pick up battery items to recharge their internal battery, which is
consumed when executing instructions and taking damage.

### Hazards

There are currently 4 different hazards that penalize robots for standing in them:

* Mud pit (low damage)
* Water pit (medium damage)
* Fire pit (severe damage)
* Deep pit  (instant death)

### Obstacles

There are four types of obstacles, with the first two just being basic doodads
in the game world like stumps and bushes. The last two are rocks which can be
destroyed with a laser.

### Rooms

Some areas of the game world spawn "rooms", which are walled off areas, sometimes
with rocks blocking their entrances. Some rooms can have hazards as walls, these
have more loot in them.


text:
<?php

use yii\helpers\Html;

use common\models\Engravings;

/* @var $this yii\web\View */
/* @var $searchModel common\models\EngravingsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Гравировки';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

            <?= Html::a('Добавить гравировку', ['create'], ['class' => 'btn btn-success pull-right']) ?>

    <?= $this->render('../items/_index', [
        'dataProvider' => $dataProvider,
        'searchModel' => $searchModel,
        'className' => Engravings::className()
    ]) ?>


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Nova Hedwigia, Beih. 53(1-2): 260 (1991)

#### Original name
Porina athertonii Sipman

### Remarks
null


text:
package com.cloud.bridge.service.core.s3;

public class S3ListAllMyBucketsRequest extends S3Request {
	public S3ListAllMyBucketsRequest() {
		super();
	}
}


text:
import * as React from "react";

export interface BaseProps<C> extends React.Props<C> {
    tagName?: string;
    className?: string;
    baseStyle?: Object;
    style?: Object;
    m?: number;
    mt?: number;
    mr?: number;
    mb?: number;
    ml?: number;
    mx?: number;
    my?: number;
    p?: number;
    pt?: number;
    pr?: number;
    pb?: number;
    pl?: number;
    px?: number;
    py?: number;
    color?: string;
    backgroundColor?: string;
    inverted?: boolean;
    rounded?: boolean | "top" | "right" | "bottom" | "left";
    circle?: boolean;
    pill?: boolean;
}

export interface ArrowProps extends BaseProps<ArrowClass> {
    direction?: "up" | "down";
}
type ArrowClass = React.StatelessComponent<ArrowProps>
export declare const Arrow: ArrowClass;

export interface AvatarProps extends BaseProps<AvatarClass> {
    size?: number;
    src?: string;
}
type AvatarClass = React.StatelessComponent<AvatarProps>
export declare const Avatar: AvatarClass;

export interface BadgeProps extends BaseProps<BadgeClass> {
    theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
    rounded?: boolean | "top" | "right" | "bottom" | "left";
    pill?: boolean;
    circle?: boolean;
}
type BadgeClass = React.StatelessComponent<BadgeProps>
export declare const Badge: BadgeClass;

export interface BannerProps extends BaseProps<BannerClass> {
    align?: "left" | "center" | "right";
    backgroundImage: string;
}
type BannerClass = React.StatelessComponent<BannerProps>
export declare const Banner: BannerClass;

export interface BlockProps extends BaseProps<BlockClass> {
    m?: number;
    mt?: number;
    mr?: number;
    mb?: number;
    ml?: number;
    mx?: number;
    my?: number;
    p?: number;
    pt?: number;
    pr?: number;
    pb?: number;
    pl?: number;
    px?: number;
    py?: number;
    color?: string;
    backgroundColor?: string;
    borderColor?: string;
    border?: boolean;
    borderTop?: boolean;
    borderRight?: boolean;
    borderBottom?: boolean;
    borderLeft?: boolean;
    rounded?: boolean | "top" | "right" | "bottom" | "left";
}
type BlockClass = React.StatelessComponent<BlockProps>
export declare const Block: BlockClass;

export interface BlockquoteProps extends BaseProps<BlockquoteClass> {
    source: string;
    href: string;
}
type BlockquoteClass = React.StatelessComponent<BlockquoteProps>
export declare const Blockquote: BlockquoteClass;

export interface BreadcrumbsProps extends BaseProps<BreadcrumbsClass> {
    links: {
        children: any;
        href: string;
    }[];
}
type BreadcrumbsClass = React.StatelessComponent<BreadcrumbsProps>
export declare const Breadcrumbs: BreadcrumbsClass;

export interface ButtonProps extends BaseProps<ButtonClass> {
    href?: string;
    color?: string;
    backgroundColor?: string;
    rounded?: boolean | "top" | "right" | "bottom" | "left";
    pill?: boolean;
    big?: boolean;
    theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
}
type ButtonClass = React.StatelessComponent<ButtonProps>
export declare const Button: ButtonClass;

export interface ButtonCircleProps extends BaseProps<ButtonCircleClass> {
    title?: string;
    href?: string;
    color?: string;
    backgroundColor?: string;
    size?: number;
}
type ButtonCircleClass = React.StatelessComponent<ButtonCircleProps>
export declare const ButtonCircle: ButtonCircleClass;

export interface ButtonOutlineProps extends BaseProps<ButtonOutlineClass> {
    href?: string;
    color?: string;
    rounded?: boolean | "top" | "right" | "bottom" | "left";
    pill?: boolean;
    big?: boolean;
}
type ButtonOutlineClass = React.StatelessComponent<ButtonOutlineProps>
export declare const ButtonOutline: ButtonOutlineClass;

export interface CardProps extends BaseProps<CardClass> {
    width?: number | string;
}
type CardClass = React.StatelessComponent<CardProps>
export declare const Card: CardClass;

export interface CardImageProps extends BaseProps<CardImageClass> {
    src?: string;
}
type CardImageClass = React.StatelessComponent<CardImageProps>
export declare const CardImage: CardImageClass;

export interface CheckboxProps extends BaseProps<CheckboxClass> {
    label?: string;
    checked?: boolean;
    name?: string;
    readOnly?: boolean;
    theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
}
type CheckboxClass = React.StatelessComponent<CheckboxProps>
export declare const Checkbox: CheckboxClass;

export interface CloseProps extends BaseProps<CloseClass> {
}
type CloseClass = React.StatelessComponent<CloseProps>
export declare const Close: CloseClass;

export interface ContainerProps extends BaseProps<ContainerClass> {
}
type ContainerClass = React.StatelessComponent<ContainerProps>
export declare const Container: ContainerClass;

export interface DividerProps extends BaseProps<DividerClass> {
    width?: number;
}
type DividerClass = React.StatelessComponent<DividerProps>
export declare const Divider: DividerClass;

export interface DonutProps extends BaseProps<DonutClass> {
    value?: number;
    size?: number;
    strokeWidth?: number;
    color?: string;
}
type DonutClass = React.StatelessComponent<DonutProps>
export declare const Donut: DonutClass;

export interface DotIndicatorProps extends BaseProps<DotIndicatorClass> {
    length?: number;
    active?: number;
    onClick?: Function;
}
type DotIndicatorClass = React.StatelessComponent<DotIndicatorProps>
export declare const DotIndicator: DotIndicatorClass;

export interface DrawerProps extends BaseProps<DrawerClass> {
    size?: number;
    open?: boolean;
    position?: "top" | "right" | "bottom" | "left";
    onDismiss?: Function;
}
type DrawerClass = React.StatelessComponent<DrawerProps>
export declare const Drawer: DrawerClass;

export interface DropdownProps extends BaseProps<DropdownClass> {
}
type DropdownClass = React.StatelessComponent<DropdownProps>
export declare const Dropdown: DropdownClass;

export interface DropdownMenuProps extends BaseProps<DropdownMenuClass> {
    open?: boolean;
    right?: boolean;
    top?: boolean;
    onDismiss?: Function;
}
type DropdownMenuClass = React.StatelessComponent<DropdownMenuProps>
export declare const DropdownMenu: DropdownMenuClass;

export interface EmbedProps extends BaseProps<EmbedClass> {
    ratio?: number;
}
type EmbedClass = React.StatelessComponent<EmbedProps>
export declare const Embed: EmbedClass;

export interface FixedProps extends BaseProps<FixedClass> {
    top?: boolean;
    right?: boolean;
    bottom?: boolean;
    left?: boolean;
    zIndex?: number;
}
type FixedClass = React.StatelessComponent<FixedProps>
export declare const Fixed: FixedClass;

export interface FooterProps extends BaseProps<FooterClass> {
}
type FooterClass = React.StatelessComponent<FooterProps>
export declare const Footer: FooterClass;

export interface HeadingProps extends BaseProps<HeadingClass> {
    big?: boolean;
    level?: number;
    size?: number;
    alt?: boolean;
}
type HeadingClass = React.StatelessComponent<HeadingProps>
export declare const Heading: HeadingClass;

export interface HeadingLinkProps extends BaseProps<HeadingLinkClass> {
    level?: number;
    size?: number;
    href?: string;
}
type HeadingLinkClass = React.StatelessComponent<HeadingLinkProps>
export declare const HeadingLink: HeadingLinkClass;

export interface InlineFormProps extends BaseProps<InlineFormClass> {
    label?: string;
    name?: string;
    value?: number | string;
    placeholder?: string;
    onChange?: Function;
    buttonLabel?: string;
    onClick?: Function;
}
type InlineFormClass = React.StatelessComponent<InlineFormProps>
export declare const InlineForm: InlineFormClass;

export interface InputProps extends BaseProps<InputClass> {
    label?: string;
    name?: string;
    type?: string;
    message?: string;
    hideLabel?: boolean;
    rounded?: boolean | "top" | "right" | "bottom" | "left";
    placeholder?: string;
}
type InputClass = React.StatelessComponent<InputProps>
export declare const Input: InputClass;

export interface LabelProps extends BaseProps<LabelClass> {
    hide?: boolean;
}
type LabelClass = React.StatelessComponent<LabelProps>
export declare const Label: LabelClass;

export interface LinkBlockProps extends BaseProps<LinkBlockClass> {
    is?: string | Object | Function;
    href?: string;
}
type LinkBlockClass = React.StatelessComponent<LinkBlockProps>
export declare const LinkBlock: LinkBlockClass;

export interface MediaProps extends BaseProps<MediaClass> {
    img?: string;
    right?: boolean;
    align?: "top" | "center" | "bottom";
}
type MediaClass = React.StatelessComponent<MediaProps>
export declare const Media: MediaClass;

export interface MenuProps extends BaseProps<MenuClass> {
}
type MenuClass = React.StatelessComponent<MenuProps>
export declare const Menu: MenuClass;

export interface MessageProps extends BaseProps<MessageClass> {
    theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
}
type MessageClass = React.StatelessComponent<MessageProps>
export declare const Message: MessageClass;

export interface NavItemProps extends BaseProps<NavItemClass> {
    small?: boolean;
    is?: string | Object | Function;
}
type NavItemClass = React.StatelessComponent<NavItemProps>
export declare const NavItem: NavItemClass;

export interface OverlayProps extends BaseProps<OverlayClass> {
    open?: boolean;
    dark?: boolean;
    box?: boolean;
    fullWidth?: boolean;
    onDismiss?: Function;
}
type OverlayClass = React.StatelessComponent<OverlayProps>
export declare const Overlay: OverlayClass;

export interface PageHeaderProps extends BaseProps<PageHeaderClass> {
    heading?: string;
    description?: string;
}
type PageHeaderClass = React.StatelessComponent<PageHeaderProps>
export declare const PageHeader: PageHeaderClass;

export interface PanelProps extends BaseProps<PanelClass> {
    theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
}
type PanelClass = React.StatelessComponent<PanelProps>
export declare const Panel: PanelClass;

export interface PanelFooterProps extends BaseProps<PanelFooterClass> {
    theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
}
type PanelFooterClass = React.StatelessComponent<PanelFooterProps>
export declare const PanelFooter: PanelFooterClass;

export interface PanelHeaderProps extends BaseProps<PanelHeaderClass> {
    theme?: "primary" | "secondary" | "default" | "info" | "success" | "warning" | "error";
}
type PanelHeaderClass = React.StatelessComponent<PanelHeaderProps>
export declare const PanelHeader: PanelHeaderClass;

export interface PreProps extends BaseProps<PreClass> {
}
type PreClass = React.StatelessComponent<PreProps>
export declare const Pre: PreClass;

export interface ProgressProps extends BaseProps<ProgressClass> {
    value?: number;
    color?: string;
}
type ProgressClass = React.StatelessComponent<ProgressProps>
export declare const Progress: ProgressClass;

export interface RadioProps extends BaseProps<RadioClass> {
    checked?: boolean;
    group?: string;
    label?: string;
    name?: string;
    readOnly?: boolean;
}
type RadioClass = React.StatelessComponent<RadioProps>
export declare const Radio: RadioClass;

export interface RatingProps extends BaseProps<RatingClass> {
    value?: number;
    onClick?: Function;
}
type RatingClass = React.StatelessComponent<RatingProps>
export declare const Rating: RatingClass;

export interface SectionProps extends BaseProps<SectionClass> {
}
type SectionClass = React.StatelessComponent<SectionProps>
export declare const Section: SectionClass;

export interface SectionHeaderProps extends BaseProps<SectionHeaderClass> {
    heading?: string;
    href?: string;
    description?: string;
}
type SectionHeaderClass = React.StatelessComponent<SectionHeaderProps>
export declare const SectionHeader: SectionHeaderClass;

export interface SelectProps extends BaseProps<SelectClass> {
    label?: string;
    name?: string;
    options?: {
        children: any;
        value: any;
    }[];
    message?: string;
    hideLabel?: boolean;
}
type SelectClass = React.StatelessComponent<SelectProps>
export declare const Select: SelectClass;

export interface SequenceMapProps extends BaseProps<SequenceMapClass> {
    steps?: {
        children: any;
        href: string;
    }[];
    active?: number;
}
type SequenceMapClass = React.StatelessComponent<SequenceMapProps>
export declare const SequenceMap: SequenceMapClass;

export interface SequenceMapStepProps extends BaseProps<SequenceMapStepClass> {
    width?: string;
    first?: boolean;
    active?: boolean;
}
type SequenceMapStepClass = React.StatelessComponent<SequenceMapStepProps>
export declare const SequenceMapStep: SequenceMapStepClass;

export interface SliderProps extends BaseProps<SliderClass> {
    label?: string;
    name?: string;
    fill?: boolean;
    hideLabel?: boolean;
    value?: number;
    defaultValue?: number;
    readOnly?: boolean;
}
type SliderClass = React.StatelessComponent<SliderProps>
export declare const Slider: SliderClass;

export interface SpaceProps extends BaseProps<SpaceClass> {
    x?: number;
    auto?: boolean;
}
type SpaceClass = React.StatelessComponent<SpaceProps>
export declare const Space: SpaceClass;

export interface StatProps extends BaseProps<StatClass> {
    value?: number | string;
    unit?: string;
    label?: string;
    topLabel?: boolean;
}
type StatClass = React.StatelessComponent<StatProps>
export declare const Stat: StatClass;

export interface SwitchProps extends BaseProps<SwitchClass> {
    checked?: boolean;
}
type SwitchClass = React.StatelessComponent<SwitchProps>
export declare const Switch: SwitchClass;

export interface TableProps extends BaseProps<TableClass> {
    headings?: any[];
    data?: any[][];
}
type TableClass = React.StatelessComponent<TableProps>
export declare const Table: TableClass;

export interface TextProps extends BaseProps<TextClass> {
    small?: boolean;
    bold?: boolean;
}
type TextClass = React.StatelessComponent<TextProps>
export declare const Text: TextClass;

export interface TextareaProps extends BaseProps<TextareaClass> {
    label?: string;
    name?: string;
    message?: string;
    hideLabel?: boolean;
}
type TextareaClass = React.StatelessComponent<TextareaProps>
export declare const Textarea: TextareaClass;

export interface ToolbarProps extends BaseProps<ToolbarClass> {
}
type ToolbarClass = React.StatelessComponent<ToolbarProps>
export declare const Toolbar: ToolbarClass;

export interface TooltipProps extends BaseProps<TooltipClass> {
    title?: string;
}
type TooltipClass = React.StatelessComponent<TooltipProps>
export declare const Tooltip: TooltipClass;


text:
#ifndef BipCos_h
#define BipCos_h

#ifdef __cplusplus
extern "C" {
#endif

#ifndef _WIN32
#define ImportExportPrefix
#define ImportExportSuffix
#define LilFactoryExportPrefix
#define LilFactoryExportSuffix
#else
#ifdef BIP_INTERNAL_CALL
#define ImportExportPrefix __declspec(dllexport)
#define ImportExportSuffix
#else
#define ImportExportPrefix __declspec(dllimport)
#define ImportExportSuffix
#endif
#define LilFactoryExportPrefix __declspec(dllexport)
#define LilFactoryExportSuffix
#endif

#if defined(_AIX)

#if defined(_LP64)
#include <stdint.h>
typedef uint16_t CciChar;
typedef int64_t CciInt;
#define __CCI_AIX__
#else
#error The C plugin interface for IBM Integration Bus is only available for 64-bit AIX systems
#endif

#elif defined(__hpux)

#if defined(_LP64) && defined(__ia64)
#include <stdint.h>
typedef uint16_t CciChar;
typedef int64_t CciInt;
#define __CCI_HPUX__
#else
#error The C plugin interface for IBM Integration Bus is only available for 64-bit HP-UX IA64 systems
#endif

#elif defined(__sun)

#if defined(__sparcv9) || defined(__x86_64__)
#include <stdint.h>
typedef uint16_t CciChar;
typedef int64_t CciInt;
#define __CCI_SOLARIS__
#else
#error The C plugin interface for IBM Integration Bus is only available for 64-bit Solaris SPARC and x86-64 systems
#endif

#elif defined(__linux__)

#if defined(__LP64__) && (defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__))
#include <stdint.h>
typedef uint16_t CciChar;
typedef int64_t CciInt;
#define __CCI_LINUX__
#else
#error The C plugin interface for IBM Integration Bus is only available for 64-bit Linux x86-64, POWER and z systems
#endif

#elif defined(__MVS__)

#if defined(_LP64)
#include <stdint.h>
typedef uint16_t CciChar;
typedef int64_t CciInt;
#define __CCI_MVS__
#else
#error The C plugin interface for IBM Integration Bus is only available for 64-bit z/OS systems
#endif

#elif defined(_WIN32)

#if defined(_M_AMD64)
#include <wchar.h>
typedef wchar_t CciChar;
typedef __int64 CciInt;
#define __CCI_WINDOWS__
#else
#error The C plugin interface for IBM Integration Bus is only available for 64-bit Windows x86-64 systems
#endif

#else
#error The C plugin interface for IBM Integration Bus is not available for this unknown system
#endif

#ifdef __cplusplus
}
#endif

#endif


text:
// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview
 * 'os-settings-a11y-page' is the small section of advanced settings containing
 * a subpage with Accessibility settings for ChromeOS.
 */
import 'chrome://resources/cr_elements/cr_link_row/cr_link_row.js';
import '../../a11y_page/captions_subpage.js';
import '../../controls/settings_toggle_button.js';
import '../../settings_page/settings_animated_pages.js';
import '../../settings_page/settings_subpage.js';
import '../../settings_shared.css.js';
import './manage_a11y_page.js';
import './text_to_speech_page.js';
import './display_and_magnification_page.js';
import './keyboard_and_text_input_page.js';
import './cursor_and_touchpad_page.js';
import './audio_and_captions_page.js';
import './select_to_speak_subpage.js';
import './switch_access_subpage.js';
import './tts_subpage.js';

import {WebUiListenerMixin, WebUiListenerMixinInterface} from 'chrome://resources/cr_elements/web_ui_listener_mixin.js';
import {loadTimeData} from 'chrome://resources/js/load_time_data.m.js';
import {afterNextRender, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';

import {SettingsToggleButtonElement} from '../../controls/settings_toggle_button.js';
import {Setting} from '../../mojom-webui/setting.mojom-webui.js';
import {Route, Router} from '../../router.js';
import {DeepLinkingBehavior, DeepLinkingBehaviorInterface} from '../deep_linking_behavior.js';
import {routes} from '../os_route.js';
import {RouteOriginBehavior, RouteOriginBehaviorInterface} from '../route_origin_behavior.js';

import {getTemplate} from './os_a11y_page.html.js';
import {OsA11yPageBrowserProxy, OsA11yPageBrowserProxyImpl} from './os_a11y_page_browser_proxy.js';

interface OsSettingsA11yPageElement {
  $: {
    a11yImageLabels: SettingsToggleButtonElement,
  };
}

const OsSettingsA11yPageElementBase =
    mixinBehaviors(
        [RouteOriginBehavior, DeepLinkingBehavior],
        WebUiListenerMixin(PolymerElement)) as {
      new (): PolymerElement & WebUiListenerMixinInterface &
          RouteOriginBehaviorInterface & DeepLinkingBehaviorInterface,
    };

class OsSettingsA11yPageElement extends OsSettingsA11yPageElementBase {
  static get is() {
    return 'os-settings-a11y-page';
  }

  static get template() {
    return getTemplate();
  }

  static get properties() {
    return {
      /**
       * The current active route.
       */
      currentRoute: {
        type: Object,
        notify: true,
      },

      /**
       * Preferences state.
       */
      prefs: {
        type: Object,
        notify: true,
      },

      /**
       * Whether to show accessibility labels settings.
       */
      showAccessibilityLabelsSetting_: {
        type: Boolean,
        value: false,
      },

      /**
       * Whether Select-to-speak page migration is enabled.
       */
      isAccessibilitySelectToSpeakPageMigrationEnabled_: {
        type: Boolean,
        value() {
          return loadTimeData.getBoolean(
              'isAccessibilitySelectToSpeakPageMigrationEnabled');
        },
      },

      /**
       * Whether the user is in kiosk mode.
       */
      isKioskModeActive_: {
        type: Boolean,
        value() {
          return loadTimeData.getBoolean('isKioskModeActive');
        },
      },

      /**
       * Whether the user is in guest mode.
       */
      isGuest_: {
        type: Boolean,
        value() {
          return loadTimeData.getBoolean('isGuest');
        },
      },

      /**
       * Used by DeepLinkingBehavior to focus this page's deep links.
       */
      supportedSettingIds: {
        type: Object,
        value: () => new Set([
          Setting.kA11yQuickSettings,
          Setting.kGetImageDescriptionsFromGoogle,
          Setting.kLiveCaption,
        ]),
      },
    };
  }

  currentRoute: Route;
  prefs: {[key: string]: any};
  private browserProxy_: OsA11yPageBrowserProxy;
  private isAccessibilityOSSettingsVisibilityEnabled_: boolean;
  private isGuest_: boolean;
  private isKioskModeActive_: boolean;
  private route_: Route;
  private showAccessibilityLabelsSetting_: boolean;

  constructor() {
    super();

    this.route_ = routes.OS_ACCESSIBILITY;
    this.browserProxy_ = OsA11yPageBrowserProxyImpl.getInstance();
  }

  override ready() {
    super.ready();

    if (routes.MANAGE_ACCESSIBILITY) {
      this.addFocusConfig(routes.MANAGE_ACCESSIBILITY, '#subpage-trigger');
    }
    if (routes.A11Y_TEXT_TO_SPEECH) {
      this.addFocusConfig(
          routes.A11Y_TEXT_TO_SPEECH, '#text-to-speech-page-trigger');
    }
    if (routes.A11Y_DISPLAY_AND_MAGNIFICATION) {
      this.addFocusConfig(
          routes.A11Y_DISPLAY_AND_MAGNIFICATION,
          '#display-and-magnification-page-trigger');
    }
    if (routes.A11Y_KEYBOARD_AND_TEXT_INPUT) {
      this.addFocusConfig(
          routes.A11Y_KEYBOARD_AND_TEXT_INPUT,
          '#keyboard-and-text-input-page-trigger');
    }
    if (routes.A11Y_CURSOR_AND_TOUCHPAD) {
      this.addFocusConfig(
          routes.A11Y_CURSOR_AND_TOUCHPAD, '#cursor-and-touchpad-page-trigger');
    }
    if (routes.A11Y_AUDIO_AND_CAPTIONS) {
      this.addFocusConfig(
          routes.A11Y_AUDIO_AND_CAPTIONS, '#audio-and-captions-page-trigger');
    }
    if (routes.A11Y_SELECT_TO_SPEAK) {
      this.addFocusConfig(
          routes.A11Y_SELECT_TO_SPEAK, '#select-to-speak-subpage-trigger');
    }

    this.addWebUIListener(
        'screen-reader-state-changed',
        (hasScreenReader: boolean) =>
            this.onScreenReaderStateChanged_(hasScreenReader));

    // Enables javascript and gets the screen reader state.
    this.browserProxy_.a11yPageReady();
  }

  /**
   * Overridden from DeepLinkingBehavior.
   */
  override beforeDeepLinkAttempt(settingId: Setting): boolean {
    if (settingId === Setting.kLiveCaption) {
      afterNextRender(this, () => {
        const captionsSubpage =
            this.shadowRoot!.querySelector('settings-captions');
        const captionToggle = captionsSubpage?.getLiveCaptionToggle();
        if (captionToggle) {
          this.showDeepLinkElement(captionToggle);
          return;
        }
        console.warn(`Element with deep link id ${settingId} not focusable.`);
      });

      // Stop deep link attempt since we completed it manually.
      return false;
    }

    // Continue with deep linking attempt.
    return true;
  }

  override currentRouteChanged(route: Route) {
    if (route === routes.OS_ACCESSIBILITY ||
        route === routes.MANAGE_CAPTION_SETTINGS) {
      this.attemptDeepLink();
    }
  }

  private shouldShowAdditionalFeaturesLink_(isKiosk: boolean, isGuest: boolean):
      boolean {
    return !isKiosk && !isGuest;
  }

  private onScreenReaderStateChanged_(hasScreenReader: boolean): void {
    this.showAccessibilityLabelsSetting_ = hasScreenReader;
  }

  private onToggleAccessibilityImageLabels_(): void {
    const a11yImageLabelsOn = this.$.a11yImageLabels.checked;
    if (a11yImageLabelsOn) {
      this.browserProxy_.confirmA11yImageLabels();
    }
  }

  private onManageAccessibilityFeaturesTap_(): void {
    Router.getInstance().navigateTo(routes.MANAGE_ACCESSIBILITY);
  }

  private onTextToSpeechTap_(): void {
    Router.getInstance().navigateTo(routes.A11Y_TEXT_TO_SPEECH);
  }

  private onDisplayAndMagnificationTap_(): void {
    Router.getInstance().navigateTo(routes.A11Y_DISPLAY_AND_MAGNIFICATION);
  }

  private onKeyboardAndTextInputTap_(): void {
    Router.getInstance().navigateTo(routes.A11Y_KEYBOARD_AND_TEXT_INPUT);
  }

  private onCursorAndTouchpadTap_(): void {
    Router.getInstance().navigateTo(routes.A11Y_CURSOR_AND_TOUCHPAD);
  }

  private onAudioAndCaptionsTap_(): void {
    Router.getInstance().navigateTo(routes.A11Y_AUDIO_AND_CAPTIONS);
  }

  private onAdditionalFeaturesClick_(): void {
    window.open(
        'https://chrome.google.com/webstore/category/collection/3p_accessibility_extensions');
  }
}

declare global {
  interface HTMLElementTagNameMap {
    'os-settings-a11y-page': OsSettingsA11yPageElement;
  }
}

customElements.define(OsSettingsA11yPageElement.is, OsSettingsA11yPageElement);


text:
<Alloy>
  	<Window title="Add User">
        <Label class="header" platform="android">Add User</Label>

    	<TextField id="name" hintText="name" onReturn="closeKeyboard"/>
        <View id="colorContainer">
            <View id="blue" class="color" onClick="setColor"/>
            <View id="red" class="color" onClick="setColor"/>
            <View id="orange" class="color" onClick="setColor"/>
        </View>

    	<Button class="button" onClick="addUser">Add</Button>
    	<Button class="button" onClick="closeWindow">Cancel</Button>
  	</Window>
</Alloy>


text:
<?php

namespace Magento\Framework\ObjectManager\Config\Reader;

class DomTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var \Magento\Framework\ObjectManager\Config\Reader\Dom
     */
    protected $_model;

    /**
     * @var array
     */
    protected $_fileList;

    /**
     * @var \Magento\Framework\App\Arguments\FileResolver\Primary
     */
    protected $_fileResolverMock;

    /**
     * @var \DOMDocument
     */
    protected $_mergedConfig;

    /**
     * @var \Magento\Framework\App\Arguments\ValidationState
     */
    protected $_validationState;

    /**
     * @var \Magento\Framework\ObjectManager\Config\SchemaLocator
     */
    protected $_schemaLocator;

    /**
     * @var \Magento\Framework\ObjectManager\Config\Mapper\Dom
     */
    protected $_mapper;

    protected function setUp()
    {
        $fixturePath = realpath(__DIR__ . '/../../_files') . '/';
        $this->_fileList = [
            file_get_contents($fixturePath . 'config_one.xml'),
            file_get_contents($fixturePath . 'config_two.xml'),
        ];

        $this->_fileResolverMock = $this->getMock(
            'Magento\Framework\App\Arguments\FileResolver\Primary',
            [],
            [],
            '',
            false
        );
        $this->_fileResolverMock->expects($this->once())->method('get')->will($this->returnValue($this->_fileList));
        $this->_mapper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
            'Magento\Framework\ObjectManager\Config\Mapper\Dom'
        );
        $this->_validationState = new \Magento\Framework\App\Arguments\ValidationState(
            \Magento\Framework\App\State::MODE_DEFAULT
        );
        $this->_schemaLocator = new \Magento\Framework\ObjectManager\Config\SchemaLocator();

        $this->_mergedConfig = new \DOMDocument();
        $this->_mergedConfig->load($fixturePath . 'config_merged.xml');
    }

    public function testRead()
    {
        $model = new \Magento\Framework\ObjectManager\Config\Reader\Dom(
            $this->_fileResolverMock,
            $this->_mapper,
            $this->_schemaLocator,
            $this->_validationState
        );
        $this->assertEquals($this->_mapper->convert($this->_mergedConfig), $model->read('scope'));
    }
}


text:
package org.jetbrains.plugins.textmate.language.syntax.selector;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.textmate.language.syntax.lexer.TextMateScope;

import java.util.Objects;
import java.util.concurrent.TimeUnit;

public class TextMateSelectorCachingWeigher implements TextMateSelectorWeigher {
  @NotNull private final TextMateSelectorWeigher myOriginalWeigher;
  private final Cache<@NotNull CacheKey, @NotNull TextMateWeigh> myCache;

  public TextMateSelectorCachingWeigher(@NotNull TextMateSelectorWeigher originalWeigher) {
    myOriginalWeigher = originalWeigher;
    myCache = Caffeine.newBuilder().maximumSize(100_000).expireAfterAccess(1, TimeUnit.MINUTES).build();
  }

  @Override
  public TextMateWeigh weigh(@NotNull final CharSequence scopeSelector, final @NotNull TextMateScope scope) {
    return myCache.get(new CacheKey(scopeSelector, scope), this::weigh);
  }

  private TextMateWeigh weigh(@NotNull CacheKey pair) {
    return myOriginalWeigher.weigh(pair.selector, pair.scope);
  }

  private static final class CacheKey {
    final CharSequence selector;
    final TextMateScope scope;

    private CacheKey(CharSequence selector, TextMateScope scope) {
      this.selector = selector;
      this.scope = scope;
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) return true;
      if (o == null || getClass() != o.getClass()) return false;
      CacheKey key = (CacheKey)o;
      return selector.equals(key.selector) &&
             scope.equals(key.scope);
    }

    @Override
    public int hashCode() {
      return Objects.hash(selector, scope);
    }
  }
}


text:
int main(int argc, char *argv[]) {
	const char *server = NULL;

	if (argc > 1) {
		server = argv[1];
	}

	const char *port = NULL;

	if (argc > 2) {
		port = argv[2];
	}

	struct ntp_packet packet;

	enum ntp_result result = ntp_query(&packet, server, port);

	if (result != NTP_RESULT_OK) {
		perror(NULL);

		return result;
	}

	printf("flags: li = %d, vn = %d, mode = %d\n", NTP_FLAGS_LI(packet.flags), NTP_FLAGS_VN(packet.flags), NTP_FLAGS_MODE(packet.flags));
	printf("stratum: %u\n", packet.stratum);
	printf("poll: %d\n", packet.poll);
	printf("precision: %d\n", packet.precision);
	printf("root_delay: %" PRId32 "\n", packet.root_delay);
	printf("root_dispersion: %" PRId32 "\n", packet.root_dispersion);
	printf("reference_id: %" PRIu32 "\n", packet.reference_id);
	printf("reference_timestamp: %" PRIu32 ".%" PRIu32 "\n", packet.reference_timestamp.seconds, packet.reference_timestamp.fraction);
	printf("origin_timestamp: %" PRIu32 ".%" PRIu32 "\n", packet.origin_timestamp.seconds, packet.origin_timestamp.fraction);
	printf("receive_timestamp: %" PRIu32 ".%" PRIu32 "\n", packet.receive_timestamp.seconds, packet.receive_timestamp.fraction);
	printf("transmit_timestamp: %" PRIu32 ".%" PRIu32 "\n", packet.transmit_timestamp.seconds, packet.transmit_timestamp.fraction);
}


text:
<?php

namespace Cake\Shell;

use Cake\Console\Shell;
use Cake\Routing\Exception\MissingRouteException;
use Cake\Routing\Router;

/**
 * Provides interactive CLI tools for routing.
 *
 */
class RoutesShell extends Shell
{

    /**
     * Override main() to handle action
     * Displays all routes in an application.
     *
     * @return void
     */
    public function main()
    {
        $output = [
            ['Route name', 'URI template', 'Defaults']
        ];
        foreach (Router::routes() as $route) {
            $name = isset($route->options['_name']) ? $route->options['_name'] : $route->getName();
            $output[] = [$name, $route->template, json_encode($route->defaults)];
        }
        $this->helper('table')->output($output);
        $this->out();
    }

    /**
     * Checks a url for the route that will be applied.
     *
     * @param string $url The URL to parse
     * @return null|false
     */
    public function check($url)
    {
        try {
            $route = Router::parse($url);
            foreach (Router::routes() as $r) {
                if ($r->match($route)) {
                    $name = isset($r->options['_name']) ? $r->options['_name'] : $r->getName();
                    break;
                }
            }

            unset($route['_matchedRoute']);

            $output = [
                ['Route name', 'URI template', 'Defaults'],
                [$name, $url, json_encode($route)]
            ];
            $this->helper('table')->output($output);
            $this->out();
        } catch (MissingRouteException $e) {
            $this->err("<warning>'$url' did not match any routes.</warning>");
            $this->out();

            return false;
        }
    }

    /**
     * Generate a URL based on a set of parameters
     *
     * Takes variadic arguments of key/value pairs.
     * @return null|false
     */
    public function generate()
    {
        try {
            $args = $this->_splitArgs($this->args);
            $url = Router::url($args);
            $this->out("> $url");
            $this->out();
        } catch (MissingRouteException $e) {
            $this->err("<warning>The provided parameters do not match any routes.</warning>");
            $this->out();

            return false;
        }
    }

    /**
     * Get the option parser.
     *
     * @return \Cake\Console\ConsoleOptionParser
     */
    public function getOptionParser()
    {
        $parser = parent::getOptionParser();
        $parser->description(
            'Get the list of routes connected in this application. ' .
            'This tool also lets you test URL generation and URL parsing.'
        )->addSubcommand('check', [
            'help' => 'Check a URL string against the routes. ' .
                'Will output the routing parameters the route resolves to.'
        ])->addSubcommand('generate', [
            'help' => 'Check a routing array against the routes. ' .
                "Will output the URL if there is a match.\n\n" .
                "Routing parameters should be supplied in a key:value format. " .
                "For example `controller:Articles action:view 2`"
        ]);

        return $parser;
    }

    /**
     * Split the CLI arguments into a hash.
     *
     * @param array $args The arguments to split.
     * @return array
     */
    protected function _splitArgs($args)
    {
        $out = [];
        foreach ($args as $arg) {
            if (strpos($arg, ':') !== false) {
                list($key, $value) = explode(':', $arg);
                $out[$key] = $value;
            } else {
                $out[] = $arg;
            }
        }

        return $out;
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <relatedBills />
    <latestAction>
      <actionDate>2017-09-28</actionDate>
      <links />
      <text>Referred to the House Committee on Ways and Means.</text>
    </latestAction>
    <introducedDate>2017-09-28</introducedDate>
    <committeeReports />
    <cosponsors>
      <item>
        <sponsorshipWithdrawnDate />
        <fullName>Rep. Carson, Andre [D-IN-7]</fullName>
        <identifiers>
          <lisID>1889</lisID>
          <bioguideId>C001072</bioguideId>
          <gpoId>7946</gpoId>
        </identifiers>
        <firstName>Andre</firstName>
        <state>IN</state>
        <district>7</district>
        <sponsorshipDate>2017-09-28</sponsorshipDate>
        <lastName>Carson</lastName>
        <middleName />
        <bioguideId>C001072</bioguideId>
        <party>D</party>
        <isOriginalCosponsor>True</isOriginalCosponsor>
      </item>
    </cosponsors>
    <calendarNumbers />
    <subjects>
      <billSubjects>
        <policyArea>
          <name>Taxation</name>
        </policyArea>
        <legislativeSubjects />
      </billSubjects>
    </subjects>
    <sponsors>
      <item>
        <firstName>Jackie</firstName>
        <lastName>Walorski</lastName>
        <identifiers>
          <bioguideId>W000813</bioguideId>
          <gpoId />
          <lisID>2128</lisID>
        </identifiers>
        <bioguideId>W000813</bioguideId>
        <middleName />
        <district>2</district>
        <fullName>Rep. Walorski, Jackie [R-IN-2]</fullName>
        <byRequestType />
        <party>R</party>
        <state>IN</state>
      </item>
    </sponsors>
    <notes />
    <createDate>2017-09-29T03:11:26Z</createDate>
    <recordedVotes />
    <version>1.0.0</version>
    <laws />
    <originChamber>House</originChamber>
    <summaries>
      <billSummaries />
    </summaries>
    <titles>
      <item>
        <chamberName />
        <title>To amend the Internal Revenue Code of 1986 to provide an exception for certain spun-off voluntary employees' beneficiary associations to the limitation on the exemption from tax on unrelated business taxable income of amounts set aside for qualified benefits.</title>
        <titleType>Official Title as Introduced</titleType>
        <parentTitleType />
        <chamberCode />
      </item>
      <item>
        <chamberName />
        <title>To amend the Internal Revenue Code of 1986 to provide an exception for certain spun-off voluntary employees' beneficiary associations to the limitation on the exemption from tax on unrelated business taxable income of amounts set aside for qualified benefits.</title>
        <titleType>Display Title</titleType>
        <parentTitleType />
        <chamberCode />
      </item>
    </titles>
    <title>To amend the Internal Revenue Code of 1986 to provide an exception for certain spun-off voluntary employees' beneficiary associations to the limitation on the exemption from tax on unrelated business taxable income of amounts set aside for qualified benefits.</title>
    <actions>
      <actionByCounts>
        <houseOfRepresentatives>3</houseOfRepresentatives>
      </actionByCounts>
      <actionTypeCounts>
        <billReferrals>1</billReferrals>
        <introducedInHouse>1</introducedInHouse>
        <introducedInTheHouse>1</introducedInTheHouse>
      </actionTypeCounts>
      <item>
        <links />
        <type>IntroReferral</type>
        <actionCode>H11100</actionCode>
        <sourceSystem>
          2
          <name>House floor actions</name>
        </sourceSystem>
        <committee>
          <name>Ways and Means Committee</name>
          <systemCode>hswm00</systemCode>
        </committee>
        <text>Referred to the House Committee on Ways and Means.</text>
        <actionDate>2017-09-28</actionDate>
      </item>
      <item>
        <links />
        <type>IntroReferral</type>
        <actionCode>Intro-H</actionCode>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <committee />
        <text>Introduced in House</text>
        <actionDate>2017-09-28</actionDate>
      </item>
      <item>
        <links />
        <type>IntroReferral</type>
        <actionCode>1000</actionCode>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <committee />
        <text>Introduced in House</text>
        <actionDate>2017-09-28</actionDate>
      </item>
    </actions>
    <billType>HR</billType>
    <cboCostEstimates />
    <amendments />
    <updateDate>2017-10-05T11:45:11Z</updateDate>
    <constitutionalAuthorityStatementText><![CDATA[
From the Congressional Record Online through the Government Publishing Office [www.gpo.gov]By Mrs. WALORSKI:H.R. 3892.Congress has the power to enact this legislation pursuantto the following:Article I, Section 8[Page H7636]
]]></constitutionalAuthorityStatementText>
    <committees>
      <billCommittees>
        <item>
          <subcommittees />
          <type>Standing</type>
          <systemCode>hswm00</systemCode>
          <chamber>House</chamber>
          <activities>
            <item>
              <name>Referred to</name>
              <date>2017-09-28T13:02:35Z</date>
            </item>
          </activities>
          <name>Ways and Means Committee</name>
        </item>
      </billCommittees>
    </committees>
    <congress>115</congress>
    <billNumber>3892</billNumber>
    <policyArea>
      <name>Taxation</name>
    </policyArea>
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
package tracker;

/**
 * Exeption не соответствует диапазону.
 * Created by Алексей on 26.09.2017.
 */
public class MenuOutExeption extends RuntimeException {
    /**
     * не соответствует диапазону.
     * @param msg сообзение.
     */
    public MenuOutExeption(String msg) {
        super(msg);
    }
}


text:
@(logs: Seq[Log], stats: Seq[StatsMsg])
<!doctype html>

    <meta charset="utf-8">
    <title>Modern Web Template</title>

    <link rel="stylesheet" href='@routes.Assets.versioned("lib/bootstrap/css/bootstrap.css")'>
    <link rel="stylesheet" href='@routes.Assets.versioned("lib/bootstrap/css/bootstrap-theme.css")'>
    <link rel="stylesheet" media="screen" href='@routes.Assets.versioned("stylesheets/main.css")'>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                Toggle navigation

            </button>
            Modern Web Template

Insert a log here:

    <form action="/insert/log" method="POST">
        <input name="level" type="text" placeholder="Log level:"/>
        <input name="code" type="text" placeholder="Error code:"/>
        <input type="submit"/>
    </form>

Previously inserted log data:

Level	Code

        @for(c <- logs){

@c.Level	@c.Code

        }

Insert a statistic here:

        <form action="/insert/log?reqtype=Stats" method="POST">
            <input name="Name" type="text" placeholder="Name:"/>
            <input name="Value" type="text" placeholder="Value:"/>
            <input name="Time" type="text" placeholder="Time:"/>
            <input type="submit"/>
        </form>

Previously inserted statistic data:

Name	Value	Time

            @for(c <- stats){

@c.Name	@c.Value	@c.Time

            }

        © YourProjectName.com 2015


text:
.class public Lcom/google/android/gms/drive/CreateFileActivityBuilder;
.super Ljava/lang/Object;

# static fields
.field public static final EXTRA_RESPONSE_DRIVE_ID:Ljava/lang/String; = "response_drive_id"

# instance fields
.field private qJ:Lcom/google/android/gms/drive/MetadataChangeSet;

.field private qK:Lcom/google/android/gms/drive/Contents;

.field private qL:Ljava/lang/String;

.field private qM:Lcom/google/android/gms/drive/DriveId;

# direct methods
.method public constructor <init>()V
    .locals 0

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

    return-void
.end method

# virtual methods
.method public build(Lcom/google/android/gms/common/api/GoogleApiClient;)Landroid/content/IntentSender;
    .locals 5

    iget-object v0, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qK:Lcom/google/android/gms/drive/Contents;

    const-string v1, "Must provide initial contents to CreateFileActivityBuilder."

    invoke-static {v0, v1}, Lcom/google/android/gms/internal/eg;->b(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    :try_start_0
    iget-object v0, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qK:Lcom/google/android/gms/drive/Contents;

    invoke-virtual {v0}, Lcom/google/android/gms/drive/Contents;->getParcelFileDescriptor()Landroid/os/ParcelFileDescriptor;

    move-result-object v0

    invoke-virtual {v0}, Landroid/os/ParcelFileDescriptor;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    nop

    :catch_0
    iget-object v0, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qK:Lcom/google/android/gms/drive/Contents;

    invoke-virtual {v0}, Lcom/google/android/gms/drive/Contents;->close()V

    invoke-virtual {p1}, Lcom/google/android/gms/common/api/GoogleApiClient;->isConnected()Z

    move-result v0

    const-string v1, "Client must be connected"

    invoke-static {v0, v1}, Lcom/google/android/gms/internal/eg;->a(ZLjava/lang/Object;)V

    sget-object v0, Lcom/google/android/gms/drive/Drive;->jO:Lcom/google/android/gms/common/api/Api$b;

    invoke-virtual {p1, v0}, Lcom/google/android/gms/common/api/GoogleApiClient;->a(Lcom/google/android/gms/common/api/Api$b;)Lcom/google/android/gms/common/api/Api$a;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/drive/internal/j;

    invoke-virtual {v0}, Lcom/google/android/gms/drive/internal/j;->cN()Lcom/google/android/gms/drive/internal/o;

    move-result-object p1

    :try_start_1
    new-instance v0, Lcom/google/android/gms/drive/internal/CreateFileIntentSenderRequest;

    iget-object v1, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qJ:Lcom/google/android/gms/drive/MetadataChangeSet;

    invoke-virtual {v1}, Lcom/google/android/gms/drive/MetadataChangeSet;->cM()Lcom/google/android/gms/drive/metadata/internal/MetadataBundle;

    move-result-object v1

    iget-object v2, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qK:Lcom/google/android/gms/drive/Contents;

    invoke-virtual {v2}, Lcom/google/android/gms/drive/Contents;->cJ()I

    move-result v2

    iget-object v3, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qL:Ljava/lang/String;

    iget-object v4, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qM:Lcom/google/android/gms/drive/DriveId;

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/google/android/gms/drive/internal/CreateFileIntentSenderRequest;-><init>(Lcom/google/android/gms/drive/metadata/internal/MetadataBundle;ILjava/lang/String;Lcom/google/android/gms/drive/DriveId;)V

    invoke-interface {p1, v0}, Lcom/google/android/gms/drive/internal/o;->a(Lcom/google/android/gms/drive/internal/CreateFileIntentSenderRequest;)Landroid/content/IntentSender;

    move-result-object v0
    :try_end_1
    .catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_1

    return-object v0

    :catch_1
    move-exception p1

    new-instance v0, Ljava/lang/RuntimeException;

    const-string v1, "Unable to connect Drive Play Service"

    invoke-direct {v0, v1, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v0
.end method

.method public setActivityStartFolder(Lcom/google/android/gms/drive/DriveId;)Lcom/google/android/gms/drive/CreateFileActivityBuilder;
    .locals 1

    invoke-static {p1}, Lcom/google/android/gms/internal/eg;->f(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/drive/DriveId;

    iput-object v0, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qM:Lcom/google/android/gms/drive/DriveId;

    return-object p0
.end method

.method public setActivityTitle(Ljava/lang/String;)Lcom/google/android/gms/drive/CreateFileActivityBuilder;
    .locals 1

    invoke-static {p1}, Lcom/google/android/gms/internal/eg;->f(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    iput-object v0, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qL:Ljava/lang/String;

    return-object p0
.end method

.method public setInitialContents(Lcom/google/android/gms/drive/Contents;)Lcom/google/android/gms/drive/CreateFileActivityBuilder;
    .locals 1

    invoke-static {p1}, Lcom/google/android/gms/internal/eg;->f(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/drive/Contents;

    iput-object v0, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qK:Lcom/google/android/gms/drive/Contents;

    return-object p0
.end method

.method public setInitialMetadata(Lcom/google/android/gms/drive/MetadataChangeSet;)Lcom/google/android/gms/drive/CreateFileActivityBuilder;
    .locals 1

    invoke-static {p1}, Lcom/google/android/gms/internal/eg;->f(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/google/android/gms/drive/MetadataChangeSet;

    iput-object v0, p0, Lcom/google/android/gms/drive/CreateFileActivityBuilder;->qJ:Lcom/google/android/gms/drive/MetadataChangeSet;

    return-object p0
.end method


text:
import {
  applyMiddleware
} from './../src/middleware';

function thunk(original) {
  original.id = 'done';
  return original;
}

describe('Middleware', () => {
  it('wraps dispatch method with middleware once', () => {
    const spy = jest.fn();
    spy(thunk);

    const target = applyMiddleware(thunk)({
      id: 'test'
    });

    expect(spy.mock.calls.length).toEqual(1)
    expect(target.id).toEqual('done')
  })
});


text:
import sys, os
from ginga import GingaPlugin

from ginga.qtw.QtHelp import QtGui, QtCore
from ginga.qtw import QtHelp
from ginga.Control import packageHome

has_webkit = False
try:
    from ginga.qtw.QtHelp import QWebView
    has_webkit = True
except ImportError:
    pass

class WBrowser(GingaPlugin.GlobalPlugin):

    def __init__(self, fv):
        # superclass defines some variables for us, like logger
        super(WBrowser, self).__init__(fv)

        self.browser = None

    def build_gui(self, container):
        if not has_webkit:
            self.browser = QtGui.QLabel("Please install the python-webkit package to enable this plugin")
        else:
            self.browser = QWebView()

        sw = QtGui.QScrollArea()
        sw.setWidgetResizable(True)
        #sw.set_border_width(2)
        sw.setWidget(self.browser)

        cw = container.get_widget()
        cw.layout().addWidget(sw, stretch=1)
        sw.show()

        self.entry = QtGui.QLineEdit()
        cw.layout().addWidget(self.entry, stretch=0)
        self.entry.returnPressed.connect(self.browse_cb)

        btns = QtHelp.HBox()
        layout = btns.layout()
        layout.setSpacing(3)

        btn = QtGui.QPushButton("Close")
        btn.clicked.connect(self.close)
        layout.addWidget(btn, stretch=0, alignment=QtCore.Qt.AlignLeft)
        cw.layout().addWidget(btns, stretch=0, alignment=QtCore.Qt.AlignLeft)

        if has_webkit:
            helpfile = os.path.abspath(os.path.join(packageHome,
                                                    "doc", "help.html"))
            helpurl = "file://%s" % (helpfile)
            self.browse(helpurl)

    def browse(self, url):
        self.logger.debug("Browsing '%s'" % (url))
        try:
            self.browser.load(QtCore.QUrl(url))
            self.entry.setText(url)
            self.browser.show()
        except Exception as e:
            self.fv.show_error("Couldn't load web page: %s" % (str(e)))

    def browse_cb(self):
        url = str(self.entry.text()).strip()
        self.browse(url)

    def close(self):
        self.fv.stop_global_plugin(str(self))
        return True

    def __str__(self):
        return 'wbrowser'

#END