text:
package controllers

import (
	"fmt"
	"io"
	"net/http"
	"net/url"

	"github.com/docker/docker/pkg/parsers"
)

const DEFAULTTAG = "latest"

// Images Container.
type ImagesController struct{}

// Query Parameters for list images.
type indexOptions struct {
	All     string `url:"all"`
	Filters string `url:"filters"`
}

// Query Parameters for create an image.
type createOptions struct {
	FromImage string `url:"fromImage"`
	FromSrc   string `url:"fromSrc"`
	Repo      string `url:"repo"`
	Tag       string `url:"tag"`
	Registry  string `url:"registry"`
}

// Query Parameters for remove an images.
type destoryOptions struct {
	Force   string `url:"force"`
	NoPrune string `url:"noprune"`
}

// Query Parameters for Search images on Docker Hub.
type searchOptions struct {
	Term string `url:"term"`
}

// List Images.
// GET /images
func (ic *ImagesController) Index(w http.ResponseWriter, r *http.Request) {
	params := r.URL.Query()
	q, err := NewRequest("GET", "/images/json", params.Get("host"))
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	q.Query(indexOptions{
		All:     params.Get("all"),
		Filters: params.Get("filters"),
	})
	b, err := q.Do()
	if !q.ValidateStatusCode(200, 404, 500) && err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	w.WriteHeader(q.StatusCode)
	w.Header().Set("Content-Type", "application/json;charset=utf-8")
	io.Copy(w, b)
}

// Create an image
// POST /images
// /docker_remote_api_v1.16/#create-an-image
func (ic *ImagesController) Create(w http.ResponseWriter, r *http.Request) {
	params := r.URL.Query()
	endpoint := fmt.Sprintf("/images/create")
	q, err := NewRequest("POST", endpoint, params.Get("host"))
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	auth := r.Header.Get("Authorization")
	if auth != "" {
		q.Set("X-Registry-Auth", auth)
	}

	var (
		image   = params.Get("fromImage")
		repo    = params.Get("repo")
		tag     = params.Get("tag")
		src     = params.Get("fromSrc")
		options = createOptions{Registry: params.Get("registry")}
	)

	if image != "" { // pull
		if tag == "" {
			image, tag = parsers.ParseRepositoryTag(image)
		}
		options.FromImage = image
		options.Tag = defaultTo(tag, DEFAULTTAG)
	} else { // import
		if tag == "" {
			repo, tag = parsers.ParseRepositoryTag(repo)
		}
		options.FromSrc = src
		options.Repo = repo
		options.Tag = defaultTo(tag, DEFAULTTAG)
	}

	q.Query(options)
	q.Timeout(0)
	b, err := q.Do()
	if !q.ValidateStatusCode(200, 500) && err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	w.WriteHeader(q.StatusCode)
	//w.Header().Set("Content-Type", "application/json;charset=utf-8")
	io.Copy(w, b)
}

// Inspect an image.
// GET /images/:id
func (ic *ImagesController) Show(w http.ResponseWriter, r *http.Request) {
	params := r.URL.Query()
	id, _ := url.QueryUnescape(params.Get(":id"))
	endpoint := fmt.Sprintf("/images/%s/json", id)
	q, err := NewRequest("GET", endpoint, params.Get("host"))
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	b, err := q.Do()
	if !q.ValidateStatusCode(200, 404, 500) && err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	w.WriteHeader(q.StatusCode)
	w.Header().Set("Content-Type", "application/json;charset=utf-8")
	io.Copy(w, b)
}

// Remove an image.
// DELETE /images/:id
func (ic *ImagesController) Destroy(w http.ResponseWriter, r *http.Request) {
	params := r.URL.Query()
	endpoint := fmt.Sprintf("/images/%s", params.Get(":id"))
	q, err := NewRequest("DELETE", endpoint, params.Get("host"))
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	q.Query(destoryOptions{
		Force:   params.Get("force"),
		NoPrune: params.Get("noprune"),
	})
	b, err := q.Do()
	if !q.ValidateStatusCode(200, 404, 409, 500) && err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	w.WriteHeader(q.StatusCode)
	io.Copy(w, b)
}

// Search images
// GET /images/search
// Search for an image on Docker Hub https://hub.docker.com/.
func (ic *ImagesController) Search(w http.ResponseWriter, r *http.Request) {
	endpoint := "/images/search"
	q, err := NewRequest("GET", endpoint, "")
	if err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	params := r.URL.Query()
	q.Query(searchOptions{
		Term: params.Get("term"),
	})
	b, err := q.Do()
	if !q.ValidateStatusCode(200, 500) && err != nil {
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	w.WriteHeader(q.StatusCode)
	io.Copy(w, b)
}


text:
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true">
        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="292dp"
            android:fitsSystemWindows="true"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/collapsing_toolbar"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:fitsSystemWindows="true"
                app:contentScrim="?attr/colorPrimary"
                app:expandedTitleMarginBottom="32dp"
                app:expandedTitleMarginEnd="64dp"
                app:expandedTitleMarginStart="48dp"
                app:layout_scrollFlags="scroll|exitUntilCollapsed">
                <ImageView
                    android:id="@+id/header"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:background="@drawable/apa"
                    android:fitsSystemWindows="true"
                    android:scaleType="centerCrop"
                    app:layout_collapseMode="parallax" />
                <android.support.v7.widget.Toolbar
                    android:id="@+id/anim_toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:layout_collapseMode="pin"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

            </android.support.design.widget.CollapsingToolbarLayout>
            <View
                android:layout_below="@+id/app_bar"
                android:layout_width="match_parent"
                android:layout_height="5dp"
                android:id="@+id/shadow"
                android:background="@drawable/shadow" />
        </android.support.design.widget.AppBarLayout>
        <android.support.v4.widget.NestedScrollView
            android:id="@+id/scrollableview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:background="@color/black"
                android:gravity="center"
                android:padding="15dp">
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="left"
                        android:id="@+id/rellayout"
                        >
                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="5dp"
                            android:gravity="left"
                            android:background="#000000"
                            android:id="@+id/imgicon">
                            <ImageView
                                android:layout_width="50dp"
                                android:layout_height="50dp"
                                android:background="@drawable/treasurehunt"/>
                        </LinearLayout>
                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_toRightOf="@+id/imgicon"
                            android:orientation="vertical"
                            android:id="@+id/evntl">
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="Treasure Hunt"
                                android:textColor="@color/white"
                                android:textSize="25dp"/>
                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="horizontal">
                                <ImageView
                                    android:layout_width="20dp"
                                    android:layout_height="20dp"
                                    android:paddingRight="5dp"
                                    android:src="@drawable/time"/>
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Sat, 06:00pm"
                                    android:textColor="@color/red"
                                    android:textSize="12dp"/>
                            </LinearLayout>
                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="horizontal">
                                <ImageView
                                    android:layout_width="20dp"
                                    android:layout_height="20dp"
                                    android:paddingRight="5dp"
                                    android:src="@drawable/location"/>
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:textColor="@color/red"
                                    android:text="5001, CC3"
                                    android:textSize="12dp"/>
                            </LinearLayout>

                        </LinearLayout>
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_toRightOf="@+id/evntl"
                            android:gravity="right"
                            android:layout_marginLeft="5dp">
                            <ImageView
                                android:layout_width="25dp"
                                android:layout_height="25dp"
                                android:src="@drawable/book1"
                                android:id="@+id/bfav"
                                />

                        </LinearLayout>
                    </RelativeLayout>
                </LinearLayout>

                <View

                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/redplus"
                    android:layout_marginTop="10dp"
                    />

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:padding="10dp"
                    android:gravity="center_horizontal">
                    <ImageView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        android:src="@drawable/about"
                        android:layout_marginRight="10dp"
                        android:id="@+id/bdesc"/>
                    <ImageView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        android:src="@drawable/rules"
                        android:layout_marginRight="15dp"
                        android:layout_marginLeft="20dp"
                        android:id="@+id/brules"/>
                    <ImageView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        android:src="@drawable/prizes"
                        android:layout_marginRight="20dp"
                        android:layout_marginLeft="15dp"
                        android:id="@+id/bprize"/>
                    <ImageView
                        android:layout_width="40dp"
                        android:layout_height="40dp"
                        android:src="@drawable/organiser"
                        android:layout_marginLeft="10dp"
                        android:id="@+id/borg"/>

                </LinearLayout>
                <View

                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@color/redplus"
                    android:layout_marginTop="5dp"
                    />

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="1330dp"
                    android:padding="20dp"
                    >
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:id="@+id/desc"
                        android:orientation="vertical"
                        android:visibility="invisible">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:textSize="25dp"
                            android:text="Description"
                            android:textColor="@color/red"
                            />
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:paddingTop="10dp"
                            android:textSize="20dp"
                            android:text="@string/desc_treasurehunt"
                            />
                    </LinearLayout>
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:id="@+id/rules"
                        android:orientation="vertical"
                        android:visibility="invisible">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:textSize="25dp"
                            android:textColor="@color/red"
                            android:text="Rules and Guidelines"
                            />
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:paddingTop="10dp"
                            android:textSize="20dp"
                            android:text="@string/rules_treasurehunt"
                            />
                    </LinearLayout>
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:id="@+id/prize"
                        android:orientation="vertical"
                        android:visibility="invisible">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:textSize="25dp"
                            android:textColor="@color/red"
                            android:text="Prizes"
                            />
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:paddingTop="10dp"
                            android:textSize="20dp"
                            android:text="@string/prize_treasurehunt"
                            />
                    </LinearLayout>
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:id="@+id/org"
                        android:orientation="vertical"
                        android:visibility="invisible">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:textSize="25dp"
                            android:text="Organisers"
                            android:textColor="@color/red"
                            />
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"

                            android:orientation="horizontal"
                            android:gravity="center"
                            android:padding="8dp"
                            android:id = "@+id/organiser1">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="vertical"
                                >
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Dikshant Devkota"
                                    android:textSize="17sp"
                                    android:textColor="@color/white"
                                    />
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="8795897995"
                                    android:id="@+id/num1"
                                    android:textColor="@color/blueminus"
                                    />
                            </LinearLayout>
                            <RelativeLayout
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content">

                                <ImageView
                                    android:layout_marginTop="10dp"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:src="@drawable/call"
                                    android:layout_alignParentTop="true"
                                    android:layout_alignParentRight="true"
                                    android:layout_alignParentEnd="true" />
                            </RelativeLayout>
                        </LinearLayout>
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"

                            android:orientation="horizontal"
                            android:gravity="center"
                            android:padding="8dp"
                            android:id = "@+id/organiser2">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="vertical"
                                >
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Sachin Pokharel"
                                    android:textSize="17sp"
                                    android:textColor="@color/white"
                                    />
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="8176027461"
                                    android:id="@+id/number2"
                                    android:textColor="@color/blueminus"
                                    />
                            </LinearLayout>
                            <RelativeLayout
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content">

                                <ImageView
                                    android:layout_marginTop="10dp"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:src="@drawable/call"
                                    android:layout_alignParentTop="true"
                                    android:layout_alignParentRight="true"
                                    android:layout_alignParentEnd="true" />
                            </RelativeLayout>
                        </LinearLayout>
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"

                            android:orientation="horizontal"
                            android:gravity="center"
                            android:padding="8dp"
                            android:id = "@+id/organiser3">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="vertical"
                                >
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Vannepuri Praveen"
                                    android:textSize="17sp"
                                    android:textColor="@color/white"
                                    />
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="7607459468"
                                    android:id="@+id/num3"
                                    android:textColor="@color/blueminus"
                                    />
                            </LinearLayout>
                            <RelativeLayout
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content">

                                <ImageView
                                    android:layout_marginTop="10dp"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:src="@drawable/call"
                                    android:layout_alignParentTop="true"
                                    android:layout_alignParentRight="true"
                                    android:layout_alignParentEnd="true" />
                            </RelativeLayout>
                        </LinearLayout>
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"

                            android:orientation="horizontal"
                            android:gravity="center"
                            android:padding="8dp"
                            android:id = "@+id/organiser4">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="vertical"
                                >
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Pukar Sapkota"
                                    android:textSize="17sp"
                                    android:textColor="@color/white"
                                    />
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="9648466615"
                                    android:id="@+id/num4"
                                    android:textColor="@color/blueminus"
                                    />
                            </LinearLayout>
                            <RelativeLayout
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content">

                                <ImageView
                                    android:layout_marginTop="10dp"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:src="@drawable/call"
                                    android:layout_alignParentTop="true"
                                    android:layout_alignParentRight="true"
                                    android:layout_alignParentEnd="true" />
                            </RelativeLayout>
                        </LinearLayout>
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"

                            android:orientation="horizontal"
                            android:gravity="center"
                            android:padding="8dp"
                            android:id = "@+id/organiser5">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="vertical"
                                >
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Akash Yadav"
                                    android:textSize="17sp"
                                    android:textColor="@color/white"
                                    />
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="7706067001"
                                    android:id="@+id/num5"
                                    android:textColor="@color/blueminus"
                                    />
                            </LinearLayout>
                            <RelativeLayout
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content">

                                <ImageView
                                    android:layout_marginTop="10dp"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:src="@drawable/call"
                                    android:layout_alignParentTop="true"
                                    android:layout_alignParentRight="true"
                                    android:layout_alignParentEnd="true" />
                            </RelativeLayout>
                        </LinearLayout>
                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"

                            android:orientation="horizontal"
                            android:gravity="center"
                            android:padding="8dp"
                            android:id = "@+id/organiser6">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="vertical"
                                >
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="Saurav Jha"
                                    android:textSize="17sp"
                                    android:textColor="@color/white"
                                    />
                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:text="9026566483"
                                    android:id="@+id/num6"
                                    android:textColor="@color/blueminus"
                                    />
                            </LinearLayout>
                            <RelativeLayout
                                android:layout_width="fill_parent"
                                android:layout_height="wrap_content">

                                <ImageView
                                    android:layout_marginTop="10dp"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:src="@drawable/call"
                                    android:layout_alignParentTop="true"
                                    android:layout_alignParentRight="true"
                                    android:layout_alignParentEnd="true" />
                            </RelativeLayout>
                        </LinearLayout>
                    </LinearLayout>

                </RelativeLayout>

            </LinearLayout>
        </android.support.v4.widget.NestedScrollView>
    </android.support.design.widget.CoordinatorLayout>
</RelativeLayout>

redpajama_set_name: RedPajamaGithub


text:
ILconst_string iluErrorStringsFrench[IL_FILE_READ_ERROR - IL_INVALID_ENUM + 1] = {
	IL_TEXT("énumération invalide"),
    IL_TEXT("dépassement de mémoire"),
	IL_TEXT("format non supporté"),
	IL_TEXT("erreur interne"),
	IL_TEXT("valeur illégale"),
    IL_TEXT("opération illégale"),
	IL_TEXT("valeur de fichier illégale"),
	IL_TEXT("en-tête de fichier invalide"),
	IL_TEXT("paramètre invalide"),
	IL_TEXT("ne peut pas ouvrir le fichier"),
	IL_TEXT("extension invalide"),
	IL_TEXT("fichier déjà existant"),
	IL_TEXT("équivalent hors-format"),
	IL_TEXT("stack overflow"),	//often used like this in French, so no need to translate
    IL_TEXT("stack underflow"),
	IL_TEXT("conversion invalide"),
	IL_TEXT("mauvaises dimensions"),
	IL_TEXT("erreur lors de la lecture du fichier")
};

ILconst_string iluLibErrorStringsFrench[IL_LIB_EXR_ERROR - IL_LIB_GIF_ERROR + 1] = {
	IL_TEXT("gif : erreur dans la librairie"),	//or: gif : erreur dans la bibliothèque (but less used)
	IL_TEXT("jpeg : erreur dans la librairie"),
	IL_TEXT("png : erreur dans la librairie"),
	IL_TEXT("tiff : erreur dans la librairie"),
	IL_TEXT("mng : erreur dans la librairie"),
	IL_TEXT("jp2 : erreur dans la librairie"),
	IL_TEXT("exr : erreur dans la librairie")
};

ILconst_string iluMiscErrorStringsFrench[2] = {
	IL_TEXT("pas d'erreur"),
	IL_TEXT("erreur inconnue")
};

#endif//ILU_ERR_FRENCH_H


text:
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2017 MINDORKS NEXTGEN PRIVATE LIMITED
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     https://mindorks.com/license/apache-v2
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License
  -->

<resources>
    <color name="colorPrimary">@color/blue_black_light</color>
    <color name="colorPrimaryDark">@color/blue_black_dark</color>
    <color name="colorAccent">#d34836</color>
    <color name="dark_gray">#696969</color>
    <color name="bg_color">@color/blue_black_light</color>
    <color name="black">#000000</color>
    <color name="white">#ffffff</color>
    <color name="black_effective">#2a2a2a</color>
    <color name="shadow">#d0d8dc</color>
    <color name="transparent">#00000000</color>
    <color name="google">#d34836</color>

    <!--Design colors-->
    <color name="light_blue">#55C8F0</color>
    <color name="blue_black_dark">#13171d</color>
    <color name="blue_black_light">#516179</color>
    <color name="orange">#FFA500</color>
    <color name="yellow">#fff44f</color>

  <color name="black_overlay">#66000000</color>
</resources>


text:
package org.drools.modelcompiler;

import java.io.File;

import org.drools.compiler.compiler.io.memory.MemoryFileSystem;
import org.drools.compiler.kie.builder.impl.InternalKieModule;
import org.drools.compiler.kie.builder.impl.InternalKieModuleProvider;
import org.kie.api.builder.ReleaseId;
import org.kie.api.builder.model.KieModuleModel;

public class CanonicalKieModuleProvider extends InternalKieModuleProvider.DrlBasedKieModuleProvider implements InternalKieModuleProvider {

    @Override
    public InternalKieModule createKieModule( ReleaseId releaseId, KieModuleModel kieProject, File file ) {
        return createCanonicalKieModule( super.createKieModule( releaseId, kieProject, file ) );
    }

    @Override
    public InternalKieModule createKieModule( ReleaseId releaseId, KieModuleModel kieProject, MemoryFileSystem mfs ) {
        return createCanonicalKieModule( super.createKieModule(releaseId, kieProject, mfs) );
    }

    private InternalKieModule createCanonicalKieModule( InternalKieModule internalKieModule ) {
        return internalKieModule.hasResource( CanonicalKieModule.MODEL_FILE ) ? new CanonicalKieModule( internalKieModule ) : internalKieModule;
    }
}


text:
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>
    {% if page.title == "Home" %}
      {{ site.title }} · {{ site.tagline }}
    {% else %}
      {{ page.title }} · {{ site.title }}
    {% endif %}
  </title>

  <link rel="stylesheet" href="{{ site.baseurl }}/styles.css">
  <!-- Icons -->
  <link rel="icon" sizes="228x228" href="{{ site.baseurl }}/favicon/favicon-228.png">
  <link rel="icon" sizes="195x195" href="{{ site.baseurl }}/favicon/favicon-195.png">
  <link rel="apple-touch-icon-precomposed" sizes="180x180" href="{{ site.baseurl }}/favicon/favicon-180.png">
  <link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ site.baseurl }}/favicon/favicon-152.png">
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ site.baseurl }}/favicon/favicon-144.png">
  <link rel="icon" sizes="128x128" href="{{ site.baseurl }}favicon/favicon-128.png">
  <link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{ site.baseurl }}/favicon/favicon-120.png">
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ site.baseurl }}/favicon/favicon-114.png">
  <link rel="icon" sizes="96x96" href="{{ site.baseurl }}/favicon/favicon-96.png">
  <link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{ site.baseurl }}/favicon/favicon-76.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ site.baseurl }}/favicon/favicon-72.png">
  <link rel="apple-touch-icon-precomposed" href="{{ site.baseurl }}/favicon/favicon-57.png">
  <link rel="apple-touch-icon" href="{{ site.baseurl }}/favicon/favicon-57.png">
  <link rel="icon" href="{{ site.baseurl }}favicon/favicon-32.png" sizes="32x32">
  <meta name="msapplication-TileColor" content="#CEA539">
  <meta name="msapplication-TileImage" content="{{ site.baseurl }}/favicon/favicon-144.png">
  <link rel="alternate" type="application/atom+xml" title="{{ site.title }}" href="{{ site.baseurl }}/atom.xml">
</head>


text:
/**
 * @requires SuperMap.Geometry.Point
 * @requires SuperMap.Geometry.GeoPlotting
 */

/**
 *
 * Class: SuperMap.Geometry.GeoPolygonEx
 * 多边形。
 * 使用三个或三个以上控制点直接创建多边形。
 *
 * Inherits from:
 *  - <SuperMap.Geometry.GeoPlotting>
 */
SuperMap.Geometry.GeoPolygonEx = SuperMap.Class(
    SuperMap.Geometry.GeoPlotting, {
        /**
         * Constructor: SuperMap.Geometry.GeoPolygonEx
         * 构造函数
         *
         * Parameters:
         * points - {Array(<SuperMap.Geometry.Point>)} 需要传入的控制点(三个或三个以上),默认为null
         */
        initialize: function(points) {
            SuperMap.Geometry.GeoPlotting.prototype.initialize.apply(this, arguments);
        },

        /**
         * APIMethod: toJSON
         * 将军标符号多边形对象转换为json数据(只解析了控制点)
         *
         * Returns:
         * {String} 返回的字符串。
         */
        toJSON: function(){
            return SuperMap.Geometry.GeoPlotting.prototype.toJSON.apply(this, arguments);
        },

        /**
         * APIMethod: clone
         * 重写clone方法,必须深赋值
         *
         * Returns:
         * {String} 返回几何对象。
         */
        clone: function(){
            var GeoPolygonEx =new SuperMap.Geometry.GeoPolygonEx();
            var controlPoints = [];
            //这里只需要赋值控制点
            for(var i = 0, len = this._controlPoints.length; i<len; i++)
            {
                //这里必须深赋值,不然在编辑时由于引用的问题出现错误
                controlPoints.push(this._controlPoints[i].clone());
            }
            GeoPolygonEx._controlPoints = controlPoints;
            return GeoPolygonEx;
        },
        /**
         * Method: calculateParts
         * 重写了父类的方法
         * 用于通过控制点计算多边形的所有点
         */
        calculateParts: function(){
            var controlPoints = this.cloneControlPoints(this._controlPoints);

            //清空原有的所有点
            this.components = [];
            //两个控制点时,绘制直线
            if(controlPoints.length==2)
            {
                this.components.push(new SuperMap.Geometry.LineString(controlPoints));
            }
            //至少需要三个控制点
            if(controlPoints.length>2)
            {

                this.components.push(new SuperMap.Geometry.LinearRing(controlPoints));
            }
        },

        CLASS_NAME: "SuperMap.Geometry.GeoPolygonEx"
    }
);

/**
 * APIMethod: fromJSON
 * 根据json数据转换为 GeoPolygonEx 对象
 *
 * Parameters:
 * str - {String} json数据
 *
 * Returns:
 * {<SuperMap.Geometry.GeoPolygonEx>} 返回的 GeoPolygonEx 对象。
 */
SuperMap.Geometry.GeoPolygonEx.fromJSON = function(str){
    var GeoPolygonEx = new SuperMap.Geometry.GeoPolygonEx();
    //匹配控制点的数据
    //取第二个代表获取括号内匹配的
    var s = str.match(/"controlPoints":(\[.*?\])/)[1];
    var arr = SuperMap.Geometry.GeoPlotting.getControlPointsFromJSON(s);
    GeoPolygonEx._controlPoints = arr;
    return GeoPolygonEx;
};


text:
package org.wso2.carbon.governance.rest.api.security;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.cxf.configuration.security.AuthorizationPolicy;
import org.apache.cxf.jaxrs.ext.RequestHandler;
import org.apache.cxf.jaxrs.model.ClassResourceInfo;
import org.apache.cxf.message.Message;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.governance.rest.api.RestApiBasicAuthenticationException;
import org.wso2.carbon.registry.core.config.RegistryContext;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.api.UserStoreManager;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.user.core.tenant.TenantManager;
import org.wso2.carbon.user.core.util.UserCoreUtil;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;

import javax.ws.rs.core.Response;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class AuthenticationHandler implements RequestHandler {

    public static final String WWW_AUTHENTICATE = "WWW-Authenticate";
    public static final String AUTHORIZATION_HEADER_NAME = "Authorization";
    protected Log log = LogFactory.getLog(AuthenticationHandler.class);

    private final static String AUTH_TYPE_BASIC = "Basic";
    private final static String AUTH_TYPE_BASIC_REALM_VALUE = " Realm=\"WSO2-Registry\"";
    private final static String AUTH_TYPE_OAuth = "Bearer";
    private final static String METHOD_GET = "GET";

    /**
     * Implementation of RequestHandler.handleRequest method.
     * This method retrieves userName and password from Basic auth header,
     * and tries to authenticate against carbon user store
     * <p/>
     * Upon successful authentication allows process to proceed to retrieve requested REST resource
     * Upon invalid credentials returns a HTTP 401 UNAUTHORIZED response to client
     * Upon receiving a userStoreExceptions or IdentityException returns HTTP 500 internal server error to client
     *
     * @param message
     * @param classResourceInfo
     * @return Response
     */
    public Response handleRequest(Message message, ClassResourceInfo classResourceInfo) {
        AuthorizationPolicy policy = message.get(AuthorizationPolicy.class);

        if (policy != null && AUTH_TYPE_BASIC.equals(policy.getAuthorizationType())) {
            return handleBasicAuth(policy, message);
        } else if (policy != null) {
            return handleOAuth(message);
        } else {
            return handleAnonymousAcess(message);
        }
    }

    private Response handleAnonymousAcess(Message message) {
        String method = (String) message.get(Message.HTTP_REQUEST_METHOD);
        if (method != null && METHOD_GET.equals(method)) {
            String tenantDomain = getTenantDomain(null, message);
            PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();
            carbonContext.setUsername(CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME);
            carbonContext.setTenantId(getTenantId(tenantDomain));
            carbonContext.setTenantDomain(tenantDomain);
            return null;
        }
        return authenticationFail(AUTH_TYPE_BASIC + AUTH_TYPE_BASIC_REALM_VALUE);
    }

    protected Response handleBasicAuth(AuthorizationPolicy policy, Message message) {
        String username = policy.getUserName();
        String password = policy.getPassword();
        String tenantDomain = getTenantDomain(username , message);
        try {
            if (authenticate(username, password, tenantDomain)) {
                return null;
            }
        } catch (RestApiBasicAuthenticationException e) {
            log.error("Could not authenticate user : " + username + "against carbon userStore", e);
        }
        return authenticationFail();
    }

    protected Response handleOAuth(Message message) {
        ArrayList<String> headers = ((Map<String, ArrayList>) message.get(Message.PROTOCOL_HEADERS)).get(AUTHORIZATION_HEADER_NAME);
        if (headers != null) {
            String authHeader = headers.get(0);
            if (authHeader.startsWith(AUTH_TYPE_OAuth)) {
                return authenticationFail(AUTH_TYPE_OAuth);
            }
        }
        return authenticationFail(AUTH_TYPE_BASIC + AUTH_TYPE_BASIC_REALM_VALUE);
    }

    /**
     * Checks whether a given userName:password combination authenticates correctly against carbon userStore
     * Upon successful authentication returns true, false otherwise
     *
     * @param userName
     * @param password
     * @return
     * @throws RestApiBasicAuthenticationException wraps and throws exceptions occur when trying to authenticate
     *                                             the user
     */
    private boolean authenticate(String userName, String password, String tenantDomain) throws RestApiBasicAuthenticationException {
        String tenantAwareUserName = MultitenantUtils.getTenantAwareUsername(userName);
        String userNameWithTenantDomain = tenantAwareUserName + "@" + tenantDomain;

        RealmService realmService = RegistryContext.getBaseInstance().getRealmService();
        int tenantId = getTenantId(tenantDomain);

        // tenantId == -1, means an invalid tenant.
        if (tenantId == -1) {
            if (log.isDebugEnabled()) {
                log.debug("Basic authentication request with an invalid tenant : " + userNameWithTenantDomain);
            }
            return false;
        }

        UserStoreManager userStoreManager = null;
        boolean authStatus = false;

        try {
            userStoreManager = realmService.getTenantUserRealm(tenantId).getUserStoreManager();
            authStatus = userStoreManager.authenticate(tenantAwareUserName, password);
        } catch (UserStoreException e) {
            throw new RestApiBasicAuthenticationException(
                    "User store exception thrown while authenticating user : " + userNameWithTenantDomain, e);
        }

        if (log.isDebugEnabled()) {
            log.debug("Basic authentication request completed. " +
                      "Username : " + userNameWithTenantDomain +
                      ", Authentication State : " + authStatus);
        }

        if (authStatus) {
            /* Upon successful authentication existing thread local carbon context
             * is updated to mimic the authenticated user */

            PrivilegedCarbonContext carbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext();

            // if username doesn't contain a domain, add domain to user
            // name in order to comply with multiple user store feature.
            if (!userName.contains(CarbonConstants.DOMAIN_SEPARATOR)) {
                String domain = UserCoreUtil.getDomainFromThreadLocal();
                if (domain != null) {
                    userName = domain + CarbonConstants.DOMAIN_SEPARATOR + userName;
                }
            }
            carbonContext.setUsername(userName);
            carbonContext.setTenantId(tenantId);
            carbonContext.setTenantDomain(tenantDomain);
        }
        return authStatus;

    }

    private String getTenantDomain(String username, Message message) {
        String tenantDomain = null;
        // 1. Read "tenant" query parameter from the request URI.
        String query = (String) message.get(Message.QUERY_STRING);
        if (query != null && !query.isEmpty()) {
            int index = query.indexOf("tenant=");
            if (index > -1) {
                query = query.substring(index + 7);
                index = query.indexOf(",");
                if (index > 0) {
                    tenantDomain = query.substring(0, index);
                } else {
                    tenantDomain = query;
                }
            }
        }

        // 2. If tenantDomain not found, read "X_TENANT" HTTP header.
        if (tenantDomain == null || tenantDomain.isEmpty()) {
            Map<String, List<String>> headers = (Map<String, List<String>>) message.get(Message.PROTOCOL_HEADERS);
            if (headers != null && !headers.isEmpty()) {
                List<String> headerValues = headers.get("X_TENANT");
                if (headerValues != null && !headerValues.isEmpty()) {
                    tenantDomain = headerValues.get(0);
                }
            }
        }

        // 3. If tenantDomain not found, use "username" to resolve the tenant.
        if ((tenantDomain == null || tenantDomain.isEmpty()) && username != null) {
            tenantDomain = MultitenantUtils.getTenantDomain(username);
        }

        // 4. If tenantDomain still not found use supper tenant as default option.
        if (tenantDomain == null) {
            tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME;
        }

        return tenantDomain;
    }

    private int getTenantId(String tenantDomain) {
        RealmService realmService = RegistryContext.getBaseInstance().getRealmService();
        TenantManager mgr = realmService.getTenantManager();
        try {
            return mgr.getTenantId(tenantDomain);
        } catch (UserStoreException e) {
            log.error("Identity exception thrown while getting tenantID for : " + tenantDomain, e);
        }
        return 0;
    }

    private Response authenticationFail() {
        return authenticationFail(AUTH_TYPE_BASIC + AUTH_TYPE_BASIC_REALM_VALUE);
    }

    private Response authenticationFail(String authType) {
        //authentication failed, request the authetication, add the realm name if needed to the value of WWW-Authenticate
        return Response.status(401).header(WWW_AUTHENTICATE, authType).build();
    }

}


text:
package org.openqa.selenium.remote.server;

import static java.net.HttpURLConnection.HTTP_INTERNAL_ERROR;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.remote.Dialect.W3C;
import static org.openqa.selenium.remote.ErrorCodes.UNHANDLED_ERROR;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.net.MediaType;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;

import org.junit.Test;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.remote.BeanToJsonConverter;
import org.openqa.selenium.remote.Command;
import org.openqa.selenium.remote.DriverCommand;
import org.openqa.selenium.remote.SessionId;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.remote.http.JsonHttpCommandCodec;
import org.openqa.selenium.remote.http.JsonHttpResponseCodec;
import org.openqa.selenium.remote.http.W3CHttpCommandCodec;
import org.openqa.selenium.remote.http.W3CHttpResponseCodec;
import org.openqa.testing.FakeHttpServletRequest;
import org.openqa.testing.FakeHttpServletResponse;
import org.openqa.testing.UrlInfo;

import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

public class ProtocolConverterTest {

  private final static TypeToken<Map<String, Object>> MAP_TYPE = new TypeToken<Map<String, Object>>() {};
  private final static Gson gson = new GsonBuilder().serializeNulls().create();

  @Test
  public void shouldRoundTripASimpleCommand() throws IOException {
//    SessionId sessionId = new SessionId("1234567");
//
//    SessionCodec handler = new ProtocolConverter(
//        new URL("http://example.com/wd/hub"),
//        new W3CHttpCommandCodec(),
//        new W3CHttpResponseCodec(),
//        new JsonHttpCommandCodec(),
//        new JsonHttpResponseCodec()) {
//      @Override
//      protected HttpResponse makeRequest(HttpRequest request) throws IOException {
//        HttpResponse response = new HttpResponse();
//
//        response.setHeader("Content-Type", MediaType.JSON_UTF_8.toString());
//        response.setHeader("Cache-Control", "none");
//
//        JsonObject obj = new JsonObject();
//        obj.addProperty("sessionId", sessionId.toString());
//        obj.addProperty("status", 0);
//        obj.add("value", JsonNull.INSTANCE);
//        String payload = gson.toJson(obj);
//        response.setContent(payload.getBytes(UTF_8));
//
//        return response;
//      }
//    };
//
//    Command command = new Command(
//        sessionId,
//        DriverCommand.GET,
//        ImmutableMap.of("url", "http://example.com/cheese"));
//
//    HttpRequest w3cRequest = new W3CHttpCommandCodec().encode(command);
//
//    FakeHttpServletResponse resp = new FakeHttpServletResponse();
//    handler.handle(decant(w3cRequest), resp);
//
//    assertEquals(MediaType.JSON_UTF_8, MediaType.parse(resp.getContentType()));
//    assertEquals(HttpURLConnection.HTTP_OK, resp.getStatus());
//
//    Map<String, Object> parsed = new Gson().fromJson(resp.getBody(), MAP_TYPE.getType());
//    assertNull(parsed.toString(), parsed.get("sessionId"));
//    assertTrue(parsed.toString(), parsed.containsKey("value"));
//    assertNull(parsed.toString(), parsed.get("value"));
  }

  @Test
  public void shouldAliasAComplexCommand() throws IOException {
//    SessionId sessionId = new SessionId("1234567");
//
//    // Downstream is JSON, upstream is W3C. This way we can force "isDisplayed" to become JS
//    // execution.
//    SessionCodec handler = new ProtocolConverter(
//        new URL("http://example.com/wd/hub"),
//        new JsonHttpCommandCodec(),
//        new JsonHttpResponseCodec(),
//        new W3CHttpCommandCodec(),
//        new W3CHttpResponseCodec()) {
//      @Override
//      protected HttpResponse makeRequest(HttpRequest request) throws IOException {
//        assertEquals(String.format("/session/%s/execute/sync", sessionId), request.getUri());
//        Map<String, Object> params = gson.fromJson(request.getContentString(), MAP_TYPE.getType());
//
//        assertEquals(
//            ImmutableList.of(
//                ImmutableMap.of(W3C.getEncodedElementKey(), "4567890")),
//            params.get("args"));
//
//        HttpResponse response = new HttpResponse();
//
//        response.setHeader("Content-Type", MediaType.JSON_UTF_8.toString());
//        response.setHeader("Cache-Control", "none");
//
//        JsonObject obj = new JsonObject();
//        obj.addProperty("sessionId", sessionId.toString());
//        obj.addProperty("status", 0);
//        obj.addProperty("value", true);
//        String payload = gson.toJson(obj);
//        response.setContent(payload.getBytes(UTF_8));
//
//        return response;
//      }
//    };
//
//    Command command = new Command(
//        sessionId,
//        DriverCommand.IS_ELEMENT_DISPLAYED,
//        ImmutableMap.of("id", "4567890"));
//
//    HttpRequest w3cRequest = new JsonHttpCommandCodec().encode(command);
//
//    FakeHttpServletResponse resp = new FakeHttpServletResponse();
//    handler.handle(decant(w3cRequest), resp);
//
//    assertEquals(MediaType.JSON_UTF_8, MediaType.parse(resp.getContentType()));
//    assertEquals(HttpURLConnection.HTTP_OK, resp.getStatus());
//
//    Map<String, Object> parsed = new Gson().fromJson(resp.getBody(), MAP_TYPE.getType());
//    assertNull(parsed.get("sessionId"));
//    assertTrue(parsed.containsKey("value"));
//    assertEquals(true, parsed.get("value"));
  }

  @Test
  public void shouldConvertAnException() throws IOException {
//    // Json upstream, w3c downstream
//    SessionId sessionId = new SessionId("1234567");
//
//    SessionCodec handler = new ProtocolConverter(
//        new URL("http://example.com/wd/hub"),
//        new W3CHttpCommandCodec(),
//        new W3CHttpResponseCodec(),
//        new JsonHttpCommandCodec(),
//        new JsonHttpResponseCodec()) {
//      @Override
//      protected HttpResponse makeRequest(HttpRequest request) throws IOException {
//        HttpResponse response = new HttpResponse();
//
//        response.setHeader("Content-Type", MediaType.JSON_UTF_8.toString());
//        response.setHeader("Cache-Control", "none");
//
//       String payload = new BeanToJsonConverter().convert(
//           ImmutableMap.of(
//               "sessionId", sessionId.toString(),
//               "status", UNHANDLED_ERROR,
//               "value", new WebDriverException("I love cheese and peas")));
//        response.setContent(payload.getBytes(UTF_8));
//        response.setStatus(HTTP_INTERNAL_ERROR);
//
//        return response;
//      }
//    };
//
//    Command command = new Command(
//        sessionId,
//        DriverCommand.GET,
//        ImmutableMap.of("url", "http://example.com/cheese"));
//
//    HttpRequest w3cRequest = new W3CHttpCommandCodec().encode(command);
//
//    FakeHttpServletResponse resp = new FakeHttpServletResponse();
//    handler.handle(decant(w3cRequest), resp);
//
//    assertEquals(MediaType.JSON_UTF_8, MediaType.parse(resp.getContentType()));
//    assertEquals(HTTP_INTERNAL_ERROR, resp.getStatus());
//
//    Map<String, Object> parsed = new Gson().fromJson(resp.getBody(), MAP_TYPE.getType());
//    assertNull(parsed.get("sessionId"));
//    assertTrue(parsed.containsKey("value"));
//    @SuppressWarnings("unchecked") Map<String, Object> value =
//        (Map<String, Object>) parsed.get("value");
//    System.out.println("value = " + value.keySet());
//    assertEquals("unknown error", value.get("error"));
//    assertTrue(((String) value.get("message")).startsWith("I love cheese and peas"));
  }

  private HttpServletRequest decant(HttpRequest request) {
    FakeHttpServletRequest req = new FakeHttpServletRequest(
        request.getMethod().toString(),
        new UrlInfo("http://localhost", "/wd/hub", request.getUri()));

    for (String name : request.getHeaderNames()) {
      for (String value : request.getHeaders(name)) {
        req.addHeader(name, value);
      }
    }

    req.setBody(request.getContentString());

    return req;
  }

}


text:
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Physics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp

#pragma once

#ifndef NAZARA_PHYSICS2D_HPP
#define NAZARA_PHYSICS2D_HPP

#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/Core.hpp>
#include <Nazara/Physics2D/Config.hpp>

namespace Nz
{
	class NAZARA_PHYSICS2D_API Physics2D : public ModuleBase<Physics2D>
	{
		friend ModuleBase;

		public:
			using Dependencies = TypeList<Core>;

			struct Config {};

			Physics2D(Config /*config*/);
			~Physics2D() = default;

		private:
			static Physics2D* s_instance;
	};
}

#endif // NAZARA_PHYSICS2D_HPP


text:
<ViewDataFormTemplateSpec
    xmlns="bb_appfx_viewdataformtemplate"
    xmlns:c="bb_appfx_commontypes"
    ID="E7B0F7B9-CB35-4AF6-B948-566A78D8892E"
    Name="Omatic Deployed Version View Data Form"
    Description="A data form for viewing deployed DLL versions."
    Author="Omatic Software"
    DataFormInstanceID="C949A245-4F01-4FA8-8368-3E7C0B440347"
    c:SecurityUIFolder="Omatic"
    HasID="false"
    >

  <CLRDataForm AssemblyName="OmaticSoftware.Catalog" ClassName="OmaticSoftware.Catalog.Administration.DeployedVersionViewDataForm" />

  <FormMetaData xmlns="bb_appfx_commontypes">
    <FormFields>

      <FormField FieldID="VERSIONS" Caption="Versions" DataType="XML">
        <Collection>
          <Fields>
            <FormField FieldID="NAME" Caption="Filename" DataType="String" />
            <FormField FieldID="VERSION" Caption="Version" DataType="String" />
            <FormField FieldID="DATEMODIFIED" Caption="Date modified" DataType="Date" IncludeTimeOnDate="true" />
          </Fields>
        </Collection>
      </FormField>
    </FormFields>

    <WebUIComponent>
      <UIModel AssemblyName="OmaticSoftware.UiModel.dll" ClassName="OmaticSoftware.UiModel.OmaticDeployedVersionViewDataFormUIModel" />
      <WebUI>
        <ExternalResource Url="browser/htmlforms/custom/omaticsoftware.uimodel/OmaticDeployedVersionViewDataForm.html" />
      </WebUI>
    </WebUIComponent>

    <UIFields>
      <FormField FieldID="SERVERNAME" Caption="Server name" DataType="String" />
    </UIFields>

  </FormMetaData>

</ViewDataFormTemplateSpec>


text:
<?php

namespace Redsys\Tests\Api;

use Redsys\Api\Currency;
use Redsys\Api\Money;

class MoneyTest extends \PHPUnit_Framework_TestCase
{
    public function testGetAmountShouldReturnGivenNumber()
    {
        $money = new Money(123.45, Currency::createEuro());

        $this->assertEquals(123.45, $money->getAmount());
    }

    public function testGetCurrencyShouldReturnGivenCurrency()
    {
        $currency = Currency::createEuro();
        $money = new Money(123, $currency);

        $this->assertEquals($currency, $money->getCurrency());
    }

    public function testToStringEurosShouldReturnSpeciallyFormattedAmount()
    {
        $currency = Currency::createEuro();
        $money = new Money(123, $currency);

        $this->assertEquals("12300", (string)$money);
    }

    public function testToStringNonEurosShouldReturnAmount()
    {
        $money = new Money(123, new Currency(840));

        $this->assertEquals("123", (string)$money);
    }

    /**
     * @expectedException \InvalidArgumentException
     * @dataProvider incorrectValues()
     * @param $value
     */
    public function testIncorrectAmountShouldThrowException($value)
    {
        new Money($value, new Currency(840));
    }

    public function incorrectValues()
    {
        return array(
            array(-1),
            array("test"),
        );
    }
}


text:
from copy import copy
from os.path import join, dirname
import pickle

from cStringIO import StringIO
from nose.tools import assert_raises
from werkzeug.datastructures import FileStorage, MultiDict, \
     ImmutableMultiDict, CombinedMultiDict, ImmutableTypeConversionDict, \
     ImmutableDict, Headers, ImmutableList, EnvironHeaders, \
     OrderedMultiDict, ImmutableOrderedMultiDict, HeaderSet, FileMultiDict

def test_multidict_pickle():
    """MultiDict types are pickle-able"""
    for protocol in xrange(pickle.HIGHEST_PROTOCOL + 1):
        print 'pickling protocol', protocol
        d = MultiDict()
        d.setlist('foo', [1, 2, 3, 4])
        d.setlist('bar', 'foo bar baz'.split())
        s = pickle.dumps(d, protocol)
        ud = pickle.loads(s)
        assert type(ud) is type(d)
        assert ud == d
        assert pickle.loads(s.replace('werkzeug.datastructures', 'werkzeug')) == d
        ud['newkey'] = 'bla'
        assert ud != d

        d2 = OrderedMultiDict(d)
        d2.add('foo', 5)
        s = pickle.dumps(d2, protocol)
        ud = pickle.loads(s)
        assert type(ud) is type(d2)
        assert ud == d2
        ud['newkey'] = 'bla'
        print ud
        print d2
        assert ud != d2

        im = ImmutableMultiDict(d)
        assert im == d
        s = pickle.dumps(im, protocol)
        ud = pickle.loads(s)
        assert ud == im
        assert type(ud) is type(im)

        c = CombinedMultiDict([ud, im])
        cc = pickle.loads(pickle.dumps(c, protocol))
        assert c == cc
        assert type(c) is type(cc)

def test_immutable_dict_pickle():
    """ImmutableDicts are pickle-able"""
    for protocol in xrange(pickle.HIGHEST_PROTOCOL + 1):
        d = dict(foo="bar", blub="blah", meh=42)
        for dtype in ImmutableDict, ImmutableTypeConversionDict:
            nd = dtype(d)
            od = pickle.loads(pickle.dumps(nd, protocol))
            assert od == nd
            assert pickle.loads(pickle.dumps(nd, protocol) \
                .replace('werkzeug.datastructures', 'werkzeug')) == nd
            assert type(od) is type(nd)

def test_immutable_list_pickle():
    """ImmutableLists are pickle-able"""
    for protocol in xrange(pickle.HIGHEST_PROTOCOL + 1):
        l = ImmutableList(range(100))
        ul = pickle.loads(pickle.dumps(l, protocol))
        assert l == ul
        assert pickle.loads(pickle.dumps(l, protocol) \
            .replace('werkzeug.datastructures', 'werkzeug')) == l
        assert type(l) is type(ul)

def test_file_storage_truthiness():
    """Test FileStorage truthiness"""
    fs = FileStorage()
    assert not fs, 'should be False'

    fs = FileStorage(StringIO('Hello World'), filename='foo.txt')
    assert fs, 'should be True because of a provided filename'

def test_multidict():
    """Multidict behavior"""
    md = MultiDict()
    assert isinstance(md, dict)

    mapping = [('a', 1), ('b', 2), ('a', 2), ('d', 3),
               ('a', 1), ('a', 3), ('d', 4), ('c', 3)]
    md = MultiDict(mapping)

    # simple getitem gives the first value
    assert md['a'] == 1
    assert md['c'] == 3
    assert_raises(KeyError, lambda: md['e'])
    assert md.get('a') == 1

    # list getitem
    assert md.getlist('a') == [1, 2, 1, 3]
    assert md.getlist('d') == [3, 4]
    # do not raise if key not found
    assert md.getlist('x') == []

    # simple setitem overwrites all values
    md['a'] = 42
    assert md.getlist('a') == [42]

    # list setitem
    md.setlist('a', [1, 2, 3])
    assert md['a'] == 1
    assert md.getlist('a') == [1, 2, 3]

    # verify that it does not change original lists
    l1 = [1, 2, 3]
    md.setlist('a', l1)
    del l1[:]
    assert md['a'] == 1

    # setdefault, setlistdefault
    assert md.setdefault('u', 23) == 23
    assert md.getlist('u') == [23]
    del md['u']

    assert md.setlistdefault('u', [-1, -2]) == [-1, -2]
    assert md.getlist('u') == [-1, -2]
    assert md['u'] == -1

    # delitem
    del md['u']
    assert_raises(KeyError, lambda: md['u'])
    del md['d']
    assert md.getlist('d') == []

    # keys, values, items, lists
    assert list(sorted(md.keys())) == ['a', 'b', 'c']
    assert list(sorted(md.iterkeys())) == ['a', 'b', 'c']

    assert list(sorted(md.values())) == [1, 2, 3]
    assert list(sorted(md.itervalues())) == [1, 2, 3]

    assert list(sorted(md.items())) == [('a', 1), ('b', 2), ('c', 3)]
    assert list(sorted(md.items(multi=True))) == \
           [('a', 1), ('a', 2), ('a', 3), ('b', 2), ('c', 3)]
    assert list(sorted(md.iteritems())) == [('a', 1), ('b', 2), ('c', 3)]
    assert list(sorted(md.iteritems(multi=True))) == \
           [('a', 1), ('a', 2), ('a', 3), ('b', 2), ('c', 3)]

    assert list(sorted(md.lists())) == [('a', [1, 2, 3]), ('b', [2]), ('c', [3])]
    assert list(sorted(md.iterlists())) == [('a', [1, 2, 3]), ('b', [2]), ('c', [3])]

    # copy method
    copy = md.copy()
    assert copy['a'] == 1
    assert copy.getlist('a') == [1, 2, 3]

    # update with a multidict
    od = MultiDict([('a', 4), ('a', 5), ('y', 0)])
    md.update(od)
    assert md.getlist('a') == [1, 2, 3, 4, 5]
    assert md.getlist('y') == [0]

    # update with a regular dict
    md = copy
    od = {'a': 4, 'y': 0}
    md.update(od)
    assert md.getlist('a') == [1, 2, 3, 4]
    assert md.getlist('y') == [0]

    # pop, poplist, popitem, popitemlist
    assert md.pop('y') == 0
    assert 'y' not in md
    assert md.poplist('a') == [1, 2, 3, 4]
    assert 'a' not in md
    assert md.poplist('missing') == []

    # remaining: b=2, c=3
    popped = md.popitem()
    assert popped in [('b', 2), ('c', 3)]
    popped = md.popitemlist()
    assert popped in [('b', [2]), ('c', [3])]

    # type conversion
    md = MultiDict({'a': '4', 'b': ['2', '3']})
    assert md.get('a', type=int) == 4
    assert md.getlist('b', type=int) == [2, 3]

    # repr
    md = MultiDict([('a', 1), ('a', 2), ('b', 3)])
    assert "('a', 1)" in repr(md)
    assert "('a', 2)" in repr(md)
    assert "('b', 3)" in repr(md)

    # add and getlist
    md.add('c', '42')
    md.add('c', '23')
    assert md.getlist('c') == ['42', '23']
    md.add('c', 'blah')
    assert md.getlist('c', type=int) == [42, 23]

    # iter interfaces
    assert list(zip(md.keys(), md.listvalues())) == list(md.lists())
    assert list(zip(md, md.iterlistvalues())) == list(md.iterlists())
    assert list(zip(md.iterkeys(), md.iterlistvalues())) == list(md.iterlists())

    # setdefault
    md = MultiDict()
    md.setdefault('x', []).append(42)
    md.setdefault('x', []).append(23)
    assert md['x'] == [42, 23]

    # to dict
    md = MultiDict()
    md['foo'] = 42
    md.add('bar', 1)
    md.add('bar', 2)
    assert md.to_dict() == {'foo': 42, 'bar': 1}
    assert md.to_dict(flat=False) == {'foo': [42], 'bar': [1, 2]}

    # popitem from empty dict
    assert_raises(KeyError, MultiDict().popitem)
    assert_raises(KeyError, MultiDict().popitemlist)

    # key errors are of a special type
    assert_raises(MultiDict.KeyError, MultiDict().__getitem__, 42)

    # setlist works
    md = MultiDict()
    md['foo'] = 42
    md.setlist('foo', [1, 2])
    assert md.getlist('foo') == [1, 2]

def test_combined_multidict():
    """Combined multidict behavior"""
    d1 = MultiDict([('foo', '1')])
    d2 = MultiDict([('bar', '2'), ('bar', '3')])
    d = CombinedMultiDict([d1, d2])

    # lookup
    assert d['foo'] == '1'
    assert d['bar'] == '2'
    assert d.getlist('bar') == ['2', '3']

    assert sorted(d.items()) == [('bar', '2'), ('foo', '1')], d.items()
    assert sorted(d.items(multi=True)) == [('bar', '2'), ('bar', '3'), ('foo', '1')]
    assert 'missingkey' not in d
    assert 'foo' in d

    # type lookup
    assert d.get('foo', type=int) == 1
    assert d.getlist('bar', type=int) == [2, 3]

    # get key errors for missing stuff
    assert_raises(KeyError, lambda: d["missing"])

    # make sure that they are immutable
    def test_assign():
        d['foo'] = 'blub'
    assert_raises(TypeError, test_assign)

    # copies are immutable
    d = d.copy()
    assert_raises(TypeError, test_assign)

    # make sure lists merges
    md1 = MultiDict((("foo", "bar"),))
    md2 = MultiDict((("foo", "blafasel"),))
    x = CombinedMultiDict((md1, md2))
    assert x.lists() == [('foo', ['bar', 'blafasel'])]

def test_immutable_dict_copies_are_mutable():
    for cls in ImmutableTypeConversionDict, ImmutableMultiDict, ImmutableDict, \
               ImmutableOrderedMultiDict:
        immutable = cls({'a': 1})
        assert_raises(TypeError, immutable.pop, 'a')

        mutable = immutable.copy()
        mutable.pop('a')
        assert 'a' in immutable
        assert mutable is not immutable

        assert copy(immutable) is immutable

def test_headers():
    # simple header tests
    headers = Headers()
    headers.add('Content-Type', 'text/plain')
    headers.add('X-Foo', 'bar')
    assert 'x-Foo' in headers
    assert 'Content-type' in headers

    headers['Content-Type'] = 'foo/bar'
    assert headers['Content-Type'] == 'foo/bar'
    assert len(headers.getlist('Content-Type')) == 1

    # list conversion
    assert headers.to_list() == [
        ('Content-Type', 'foo/bar'),
        ('X-Foo', 'bar')
    ]
    assert str(headers) == (
        "Content-Type: foo/bar\r\n"
        "X-Foo: bar\r\n"
        "\r\n")
    assert str(Headers()) == "\r\n"

    # extended add
    headers.add('Content-Disposition', 'attachment', filename='foo')
    assert headers['Content-Disposition'] == 'attachment; filename=foo'

    headers.add('x', 'y', z='"')
    assert headers['x'] == r'y; z="\""'

    # defaults
    headers = Headers([
        ('Content-Type', 'text/plain'),
        ('X-Foo',        'bar'),
        ('X-Bar',        '1'),
        ('X-Bar',        '2')
    ])
    assert headers.getlist('x-bar') == ['1', '2']
    assert headers.get('x-Bar') == '1'
    assert headers.get('Content-Type') == 'text/plain'

    assert headers.setdefault('X-Foo', 'nope') == 'bar'
    assert headers.setdefault('X-Bar', 'nope') == '1'
    assert headers.setdefault('X-Baz', 'quux') == 'quux'
    assert headers.setdefault('X-Baz', 'nope') == 'quux'
    headers.pop('X-Baz')

    # type conversion
    assert headers.get('x-bar', type=int) == 1
    assert headers.getlist('x-bar', type=int) == [1, 2]

    # list like operations
    assert headers[0] == ('Content-Type', 'text/plain')
    assert headers[:1] == Headers([('Content-Type', 'text/plain')])
    del headers[:2]
    del headers[-1]
    assert headers == Headers([('X-Bar', '1')])

    # copying
    a = Headers([('foo', 'bar')])
    b = a.copy()
    a.add('foo', 'baz')
    assert a.getlist('foo') == ['bar', 'baz']
    assert b.getlist('foo') == ['bar']

    headers = Headers([('a', 1)])
    assert headers.pop('a') == 1
    assert headers.pop('b', 2) == 2
    assert_raises(KeyError, headers.pop, 'c')

    # set replaces and accepts same arguments as add
    a = Headers()
    a.set('Content-Disposition', 'useless')
    a.set('Content-Disposition', 'attachment', filename='foo')
    assert a['Content-Disposition'] == 'attachment; filename=foo'

def test_header_set():
    """Test the header set"""
    hs = HeaderSet()
    hs.add('foo')
    hs.add('bar')
    assert 'Bar' in hs
    assert hs.find('foo') == 0
    assert hs.find('BAR') == 1
    assert hs.find('baz') < 0
    hs.discard('missing')
    hs.discard('foo')
    assert hs.find('foo') < 0
    assert hs.find('bar') == 0
    assert_raises(IndexError, hs.index, 'missing')
    assert hs.index('bar') == 0
    assert hs
    hs.clear()
    assert not hs

def test_environ_headers_counts():
    """Ensure that the EnvironHeaders count correctly."""
    # this happens in multiple WSGI servers because they
    # use a vary naive way to convert the headers;
    broken_env = {
        'HTTP_CONTENT_TYPE':        'text/html',
        'CONTENT_TYPE':             'text/html',
        'HTTP_CONTENT_LENGTH':      '0',
        'CONTENT_LENGTH':           '0',
        'HTTP_ACCEPT':              '*',
        'wsgi.version':             (1, 0)
    }
    headers = EnvironHeaders(broken_env)
    assert headers
    assert len(headers) == 3
    assert sorted(headers) == [
        ('Accept', '*'),
        ('Content-Length', '0'),
        ('Content-Type', 'text/html')
    ]
    assert not EnvironHeaders({'wsgi.version': (1, 0)})
    assert len(EnvironHeaders({'wsgi.version': (1, 0)})) == 0

def test_multidict_pop():
    """Ensure pop from multidict works like it should"""
    make_d = lambda: MultiDict({'foo': [1, 2, 3, 4]})
    d = make_d()
    assert d.pop('foo') == 1
    assert not d
    d = make_d()
    assert d.pop('foo', 32) == 1
    assert not d
    d = make_d()
    assert d.pop('foos', 32) == 32
    assert d
    assert_raises(KeyError, d.pop, 'foos')

def test_ordered_multidict():
    """Test the OrderedMultiDict"""
    d = OrderedMultiDict()
    assert not d
    d.add('foo', 'bar')
    assert len(d) == 1
    d.add('foo', 'baz')
    assert len(d) == 1
    assert d.items() == [('foo', 'bar')]
    assert list(d) == ['foo']
    assert d.items(multi=True) == [('foo', 'bar'),
                                   ('foo', 'baz')]
    del d['foo']
    assert not d
    assert len(d) == 0
    assert list(d) == []

    d.update([('foo', 1), ('foo', 2), ('bar', 42)])
    d.add('foo', 3)
    assert d.getlist('foo') == [1, 2, 3]
    assert d.getlist('bar') == [42]
    assert d.items() == [('foo', 1), ('bar', 42)]
    assert d.keys() == list(d) == list(d.iterkeys()) == ['foo', 'bar']
    assert d.items(multi=True) == [('foo', 1), ('foo', 2),
                                   ('bar', 42), ('foo', 3)]
    assert len(d) == 2

    assert d.pop('foo') == 1
    assert d.pop('blafasel', None) is None
    assert d.pop('blafasel', 42) == 42
    assert len(d) == 1
    assert d.poplist('bar') == [42]
    assert not d

    d.get('missingkey') is None

    d.add('foo', 42)
    d.add('foo', 23)
    d.add('bar', 2)
    d.add('foo', 42)
    assert d == MultiDict(d)
    id = ImmutableOrderedMultiDict(d)
    assert d == id
    d.add('foo', 2)
    assert d != id

    d.update({'blah': [1, 2, 3]})
    assert d['blah'] == 1
    assert d.getlist('blah') == [1, 2, 3]

    # setlist works
    d = OrderedMultiDict()
    d['foo'] = 42
    d.setlist('foo', [1, 2])
    assert d.getlist('foo') == [1, 2]

    assert_raises(OrderedMultiDict.KeyError, d.pop, 'missing')
    assert_raises(OrderedMultiDict.KeyError, d.__getitem__, 'missing')

    # popping
    d = OrderedMultiDict()
    d.add('foo', 23)
    d.add('foo', 42)
    d.add('foo', 1)
    assert d.popitem() == ('foo', 23)
    assert_raises(OrderedMultiDict.KeyError, d.popitem)
    assert not d

    d.add('foo', 23)
    d.add('foo', 42)
    d.add('foo', 1)
    assert d.popitemlist() == ('foo', [23, 42, 1])
    assert_raises(OrderedMultiDict.KeyError, d.popitemlist)

def test_immutable_structures():
    """Test immutable structures"""
    l = ImmutableList([1, 2, 3])
    assert_raises(TypeError, l.__delitem__, 0)
    assert_raises(TypeError, l.__delslice__, 0, 1)
    assert_raises(TypeError, l.__iadd__, [1, 2])
    assert_raises(TypeError, l.__setitem__, 0, 1)
    assert_raises(TypeError, l.__setslice__, 0, 1, [2, 3])
    assert_raises(TypeError, l.append, 42)
    assert_raises(TypeError, l.insert, 0, 32)
    assert_raises(TypeError, l.pop)
    assert_raises(TypeError, l.extend, [2, 3])
    assert_raises(TypeError, l.reverse)
    assert_raises(TypeError, l.sort)
    assert l == [1, 2, 3]

    d = ImmutableDict(foo=23, bar=42)
    assert_raises(TypeError, d.setdefault, 'baz')
    assert_raises(TypeError, d.update, {2: 3})
    assert_raises(TypeError, d.popitem)
    assert_raises(TypeError, d.__delitem__, 'foo')
    assert_raises(TypeError, d.clear)
    assert d == dict(foo=23, bar=42)
    d = ImmutableDict.fromkeys([1, 2])
    assert d[1] == d[2] == None

    d = ImmutableMultiDict(d)
    assert_raises(TypeError, d.add, 'fuss', 44)
    assert_raises(TypeError, d.popitemlist)
    assert_raises(TypeError, d.poplist, 'foo')
    assert_raises(TypeError, d.setlist, 'tadaa', [1, 2])
    assert_raises(TypeError, d.setlistdefault, 'tadaa')
    d = ImmutableMultiDict.fromkeys([1, 2])
    assert d[1] == d[2] == None

    d = EnvironHeaders({'HTTP_X_FOO': 'test'})
    assert_raises(TypeError, d.__delitem__, 0)
    assert_raises(TypeError, d.add, 42)
    assert_raises(TypeError, d.pop, 'x-foo')
    assert_raises(TypeError, d.popitem)
    assert_raises(TypeError, d.setdefault, 'foo', 42)
    assert dict(d.items()) == {'X-Foo': 'test'}
    assert_raises(TypeError, d.copy)

def test_file_multidict():
    """Test FileMultiDict()"""
    fmd = FileMultiDict()
    fmd.add_file("attachment", FileStorage(StringIO('Hello World'), filename='first.txt'))
    fmd.add_file("attachment", join(dirname(__file__), "res/test.txt"), filename='test.txt')
    values = fmd.getlist("attachment")
    assert len(values) == 2
    assert values[0].filename == "first.txt"
    assert values[1].filename == "test.txt"


text:
<?php

namespace ThisPageCannotBeFound\Signals\Tests;

use PHPUnit_Framework_TestCase;
use ThisPageCannotBeFound\Signals\Signal;
use ThisPageCannotBeFound\Signals\Tests\Support\Listeners;

/**
 * @author Abel de Beer <abel@thispagecannotbefound.com>
 */
class SignalTest extends PHPUnit_Framework_TestCase {

    /**
     * @var Signal
     */
    private $signal;

    protected function setUp() {
        $this->signal = new Signal();
    }

    /**
     * @test
     */
    public function addShouldReturnSlot() {
        $interface = 'ThisPageCannotBeFound\Signals\SlotInterface';

        $slot = $this->signal->add('sprintf');

        $this->assertInstanceOf($interface, $slot);
    }

    /**
     * @test
     */
    public function addMultipleShouldExecuteMultiple() {
        $called = 0;

        $this->signal->add(Listeners::_closureIncrementsCalled($called));
        $this->signal->dispatch();
        $this->signal->dispatch();
        $this->signal->dispatch();

        $this->assertEquals(3, $called);
    }

    /**
     * @test
     * @expectedException \ThisPageCannotBeFound\Signals\Exception\CannotAddListenerException
     */
    public function addThenAddOnceSameShouldThrow() {
        $listener = Listeners::_closureIncrementsCalled();

        $this->signal->add($listener);
        $this->signal->addOnce($listener);
    }

}


text:
package org.apache.spark.sql.execution

import org.apache.spark._
import org.apache.spark.rdd.RDD
import org.apache.spark.serializer.Serializer
import org.apache.spark.sql.catalyst.InternalRow

private class ShuffledRowRDDPartition(val idx: Int) extends Partition {
  override val index: Int = idx
  override def hashCode(): Int = idx
}

/**
 * A dummy partitioner for use with records whose partition ids have been pre-computed (i.e. for
 * use on RDDs of (Int, Row) pairs where the Int is a partition id in the expected range).
 */
private class PartitionIdPassthrough(override val numPartitions: Int) extends Partitioner {
  override def getPartition(key: Any): Int = key.asInstanceOf[Int]
}

/**
 * This is a specialized version of [[org.apache.spark.rdd.ShuffledRDD]] that is optimized for
 * shuffling rows instead of Java key-value pairs. Note that something like this should eventually
 * be implemented in Spark core, but that is blocked by some more general refactorings to shuffle
 * interfaces / internals.
 *
 * @param prev the RDD being shuffled. Elements of this RDD are (partitionId, Row) pairs.
 *             Partition ids should be in the range [0, numPartitions - 1].
 * @param serializer the serializer used during the shuffle.
 * @param numPartitions the number of post-shuffle partitions.
 */
class ShuffledRowRDD(
    @transient var prev: RDD[Product2[Int, InternalRow]],
    serializer: Serializer,
    numPartitions: Int)
  extends RDD[InternalRow](prev.context, Nil) {

  private val part: Partitioner = new PartitionIdPassthrough(numPartitions)

  override def getDependencies: Seq[Dependency[_]] = {
    List(new ShuffleDependency[Int, InternalRow, InternalRow](prev, part, Some(serializer)))
  }

  override val partitioner = Some(part)

  override def getPartitions: Array[Partition] = {
    Array.tabulate[Partition](part.numPartitions)(i => new ShuffledRowRDDPartition(i))
  }

  override def getPreferredLocations(partition: Partition): Seq[String] = {
    val tracker = SparkEnv.get.mapOutputTracker.asInstanceOf[MapOutputTrackerMaster]
    val dep = dependencies.head.asInstanceOf[ShuffleDependency[_, _, _]]
    tracker.getPreferredLocationsForShuffle(dep, partition.index)
  }

  override def compute(split: Partition, context: TaskContext): Iterator[InternalRow] = {
    val dep = dependencies.head.asInstanceOf[ShuffleDependency[Int, InternalRow, InternalRow]]
    SparkEnv.get.shuffleManager.getReader(dep.shuffleHandle, split.index, split.index + 1, context)
      .read()
      .asInstanceOf[Iterator[Product2[Int, InternalRow]]]
      .map(_._2)
  }

  override def clearDependencies() {
    super.clearDependencies()
    prev = null
  }
}


text:
//*****************************************************************************
//
// fram.h - Driver for the FRAM Module.
//
//*****************************************************************************

#ifndef __MSP430WARE_FRAM_H__
#define __MSP430WARE_FRAM_H__

#include "inc/hw_memmap.h"

#ifdef __MSP430_HAS_FRAM_FR5XX__

//*****************************************************************************
//
// If building with a C++ compiler, make all of the definitions in this header
// have a C binding.
//
//*****************************************************************************
#ifdef __cplusplus
extern "C"
{
#endif

//*****************************************************************************
//
// The following are values that can be passed to the interruptMask parameter
// for functions: FRAM_enableInterrupt(), and FRAM_disableInterrupt().
//
//*****************************************************************************
#define FRAM_PUC_ON_UNCORRECTABLE_BIT                                  UBDRSTEN
#define FRAM_UNCORRECTABLE_BIT_INTERRUPT                                 UBDIEN
#define FRAM_CORRECTABLE_BIT_INTERRUPT                                   CBDIEN
#define FRAM_ACCESS_VIOLATION_INTERRUPT                                  ACCVIE
#define FRAM_ACCESS_TIME_ERROR_INTERRUPT                                ACCTEIE

//*****************************************************************************
//
// The following are values that can be passed to the interruptFlagMask
// parameter for functions: FRAM_getInterruptStatus() as well as returned by
// the FRAM_getInterruptStatus() function.
//
//*****************************************************************************
#define FRAM_ACCESS_TIME_ERROR_FLAG                                    ACCTEIFG
#define FRAM_UNCORRECTABLE_BIT_FLAG                                      UBDIFG
#define FRAM_CORRECTABLE_BIT_FLAG                                        CBDIFG
#define FRAM_ACCESS_VIOLATION_FLAG                                      ACCVIFG

//*****************************************************************************
//
// The following are values that can be passed to the accessTime parameter for
// functions: FRAM_configureWaitStateControl().
//
//*****************************************************************************
#define FRAM_ACCESS_TIME_CYCLES_0                                     NACCESS_0
#define FRAM_ACCESS_TIME_CYCLES_1                                     NACCESS_1
#define FRAM_ACCESS_TIME_CYCLES_2                                     NACCESS_2
#define FRAM_ACCESS_TIME_CYCLES_3                                     NACCESS_3
#define FRAM_ACCESS_TIME_CYCLES_4                                     NACCESS_4
#define FRAM_ACCESS_TIME_CYCLES_5                                     NACCESS_5
#define FRAM_ACCESS_TIME_CYCLES_6                                     NACCESS_6
#define FRAM_ACCESS_TIME_CYCLES_7                                     NACCESS_7

//*****************************************************************************
//
// The following are values that can be passed to the accessTime parameter for
// functions: FRAM_configureWaitStateControl().
//
//*****************************************************************************
#define FRAM_PRECHARGE_TIME_CYCLES_0                                  NPRECHG_0
#define FRAM_PRECHARGE_TIME_CYCLES_1                                  NPRECHG_1
#define FRAM_PRECHARGE_TIME_CYCLES_2                                  NPRECHG_2
#define FRAM_PRECHARGE_TIME_CYCLES_3                                  NPRECHG_3
#define FRAM_PRECHARGE_TIME_CYCLES_4                                  NPRECHG_4
#define FRAM_PRECHARGE_TIME_CYCLES_5                                  NPRECHG_5
#define FRAM_PRECHARGE_TIME_CYCLES_6                                  NPRECHG_6
#define FRAM_PRECHARGE_TIME_CYCLES_7                                  NPRECHG_7

//*****************************************************************************
//
// The following are values that can be passed to the manualWaitState parameter
// for functions: FRAM_configureWaitStateControl().
//
//*****************************************************************************
#define FRAM_AUTO_MODE                                                    NAUTO
#define FRAM_MANUAL_MODE                                                   0x00

//*****************************************************************************
//
// Prototypes for the APIs.
//
//*****************************************************************************
extern void FRAM_write8(uint16_t baseAddress,
                        uint8_t *dataPtr,
                        uint8_t *framPtr,
                        uint16_t numberOfBytes);

extern void FRAM_write16(uint16_t baseAddress,
                         uint16_t *dataPtr,
                         uint16_t *framPtr,
                         uint16_t numberOfWords);

extern void FRAM_write32(uint16_t baseAddress,
                         uint32_t *dataPtr,
                         uint32_t *framPtr,
                         uint16_t count);

extern void FRAM_memoryFill32(uint16_t baseAddress,
                              uint32_t value,
                              uint32_t *framPtr,
                              uint16_t count);

extern void FRAM_enableInterrupt(uint16_t baseAddress,
                                 uint8_t interruptMask);

extern uint8_t FRAM_getInterruptStatus(uint16_t baseAddress,
                                       uint16_t interruptFlagMask);

extern void FRAM_disableInterrupt(uint16_t baseAddress,
                                  uint16_t interruptMask);

extern void FRAM_configureWaitStateControl(uint16_t baseAddress,
                                           uint8_t manualWaitState,
                                           uint8_t accessTime,
                                           uint8_t prechargeTime);

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

#endif
#endif // __MSP430WARE_FRAM_H__


text:
import unittest
import json

from collections import namedtuple
from datetime import datetime
from unittest import mock

from bcycle import app

MockTrip = namedtuple('trip', ['id', 'bike_id', 'duration', 'checkout_kiosk', 'checkout_datetime',
                               'return_kiosk', 'return_datetime'])

MockRider = namedtuple('rider', ['id', 'program', 'zip_code', 'membership_type', 'trips'])

DictContainer = namedtuple('container', 'to_dict')
ItemContainer = namedtuple('item_container', 'items')

class ApiTestCase(unittest.TestCase):
    def setUp(self):
        self.app = app.test_client()

    def test_404_not_found(self):
        rv = self.app.get('/this_route_doesnt_exists')
        json_rv = json.loads(rv.data.decode('UTF-8'))
        self.assertEqual(json_rv['status'], 404)
        self.assertEqual(json_rv['error'], 'not found')
        self.assertEqual(json_rv['message'], 'invalid resource URI')

class TripTestCase(unittest.TestCase):

    def setUp(self):
        self.app = app.test_client()

    def _verify_trip(self, actual, expected):
        self.assertEqual(actual['id'], expected.id)
        self.assertEqual(actual['bike_id'], expected.bike_id)
        self.assertEqual(actual['duration'], expected.duration)
        self.assertEqual(actual['checkout_kiosk'], expected.checkout_kiosk)
        self.assertEqual(actual['checkout_datetime'], expected.checkout_datetime)
        self.assertEqual(actual['return_kiosk'], expected.return_kiosk)
        self.assertEqual(actual['return_datetime'], expected.return_datetime)

    @mock.patch('bcycle.v1.endpoints.Trip')
    def test_get_trips_endpoint(self, mock_trip):
        test_time = datetime.now().isoformat()
        trip = MockTrip(0, 1, 30, 'Main Street', test_time, '1st Ave', test_time)
        mock_trip.query.paginate.return_value = ItemContainer(
            [DictContainer(lambda: trip._asdict())]
        )
        mock_trip.query.count.return_value = 1

        rv = self.app.get('/v1/trip')
        response_data = json.loads(rv.data.decode('UTF-8'))
        self.assertEqual(len(response_data['trips']), 1)

        response_trip = response_data['trips'][0]
        self._verify_trip(response_trip, trip)

    @mock.patch('bcycle.v1.endpoints.Trip')
    def test_no_such_trip_endpoint(self, mock_trip):
        mock_trip.query.get.return_value = None

        rv = self.app.get('/v1/trip/0')
        response_data = json.loads(rv.data.decode('UTF-8'))

        self.assertEqual(response_data['error'], 'resource does not exist')

    @mock.patch('bcycle.v1.endpoints.Trip')
    def test_trip_endpoint(self, mock_trip):
        test_time = datetime.now().isoformat()
        trip = MockTrip(0, 1, 30, 'Main Street', test_time, '1st Ave', test_time)

        mock_trip.query.get.return_value = DictContainer(lambda: trip._asdict())
        rv = self.app.get('/v1/trip/0')
        response_trip = json.loads(rv.data.decode('UTF-8'))

        self._verify_trip(response_trip, trip)

class RiderTestCase(unittest.TestCase):
    def setUp(self):
        self.app = app.test_client()

    def _verify_rider(self, actual, expected):
        self.assertEqual(actual['id'], expected.id)
        self.assertEqual(actual['program'], expected.program)
        self.assertEqual(actual['zip_code'], expected.zip_code)
        self.assertEqual(actual['membership_type'], expected.membership_type)
        self.assertEqual(actual['trips'], expected.trips)

    @mock.patch('bcycle.v1.endpoints.Rider')
    def test_get_riders(self, mock_rider):
        rider = MockRider(0, 'Denver B Cycle', 80202, 'annual', [])
        mock_rider.query.paginate.return_value = ItemContainer(
            [DictContainer(lambda: rider._asdict())]
        )
        mock_rider.query.count.return_value = 1

        rv = self.app.get('/v1/rider')
        response_data = json.loads(rv.data.decode('UTF-8'))
        self.assertEqual(len(response_data['riders']), 1)

        response_rider = response_data['riders'][0]
        self._verify_rider(response_rider, rider)

    @mock.patch('bcycle.v1.endpoints.Rider')
    def test_no_such_trip_endpoint(self, mock_rider):
        mock_rider.query.get.return_value = None

        rv = self.app.get('/v1/rider/0')
        response_data = json.loads(rv.data.decode('UTF-8'))

        self.assertEqual(response_data['error'], 'resource does not exist')

    @mock.patch('bcycle.v1.endpoints.Rider')
    def test_trip_endpoint(self, mock_rider):
        rider = MockRider(0, 'Denver B Cycle', 80202, 'annual', [])
        mock_rider.query.get.return_value = DictContainer(lambda: rider._asdict())

        rv = self.app.get('/v1/rider/0')
        response_data = json.loads(rv.data.decode('UTF-8'))

        self._verify_rider(response_data, rider)


text:
import './index.html'
import dva from 'dva'

// 1. Initialize
const app = dva()

// 2. Model

app.model(require('./models/app'))
app.model(require('./models/dashboard'))
app.model(require('./models/users'))

// 3. Router
app.router(require('./router'))

// 4. Start
app.start('#root')


text:
/*

Zenburn style from voldmar.ru (c) Vladimir Epifanov <voldmar@voldmar.ru>
based on dark.css by Ivan Sagalaev

*/

.hljs {
  display: block;
  overflow-x: auto;
  padding: 0.5em;
  background: #3f3f3f;
  color: #dcdcdc;
  -webkit-text-size-adjust: none;
}

.hljs-keyword,
.hljs-tag,
.css .hljs-class,
.css .hljs-id,
.lisp .hljs-title,
.nginx .hljs-title,
.hljs-request,
.hljs-status,
.clojure .hljs-attribute {
  color: #e3ceab;
}

.django .hljs-template_tag,
.django .hljs-variable,
.django .hljs-filter .hljs-argument {
  color: #dcdcdc;
}

.hljs-number,
.hljs-date {
  color: #8cd0d3;
}

.dos .hljs-envvar,
.dos .hljs-stream,
.hljs-variable,
.apache .hljs-sqbracket,
.hljs-name {
  color: #efdcbc;
}

.dos .hljs-flow,
.diff .hljs-change,
.python .exception,
.python .hljs-built_in,
.hljs-literal,
.tex .hljs-special {
  color: #efefaf;
}

.diff .hljs-chunk,
.hljs-subst {
  color: #8f8f8f;
}

.dos .hljs-keyword,
.hljs-decorator,
.hljs-title,
.hljs-type,
.diff .hljs-header,
.ruby .hljs-class .hljs-parent,
.apache .hljs-tag,
.nginx .hljs-built_in,
.tex .hljs-command,
.hljs-prompt {
  color: #efef8f;
}

.dos .hljs-winutils,
.ruby .hljs-symbol,
.ruby .hljs-symbol .hljs-string,
.ruby .hljs-string {
  color: #dca3a3;
}

.diff .hljs-deletion,
.hljs-string,
.hljs-tag .hljs-value,
.hljs-preprocessor,
.hljs-pragma,
.hljs-built_in,
.smalltalk .hljs-class,
.smalltalk .hljs-localvars,
.smalltalk .hljs-array,
.css .hljs-rule .hljs-value,
.hljs-attr_selector,
.hljs-pseudo,
.apache .hljs-cbracket,
.tex .hljs-formula,
.coffeescript .hljs-attribute {
  color: #cc9393;
}

.hljs-shebang,
.diff .hljs-addition,
.hljs-comment,
.hljs-annotation,
.hljs-pi,
.hljs-doctype {
  color: #7f9f7f;
}

.coffeescript .javascript,
.javascript .xml,
.tex .hljs-formula,
.xml .javascript,
.xml .vbscript,
.xml .css,
.xml .hljs-cdata {
  opacity: 0.5;
}