text:
import sys, unittest, logging, re, StringIO, os, cgi, rdflib
from rdflib import URIRef, Namespace, RDF
from os.path import normpath

sys.path.append("..")
sys.path.append("../cgi-bin")

from MiscLib import TestUtils
import SubmitDatasetUtils, ManifestRDFUtils, TestConfig

Logger                    =  logging.getLogger("TestMetadataMerging")
ExpectedDictionary        =  {
                                 "creator"     : "admiral"
                               , "identifier"  : "SubmissionToolTest"
                               , "title"       : "Submission tool test title"
                               , "description" : "Submission tool test description"
                             }

class TestMetadataMerging(unittest.TestCase):

    def setUp(self):
        return

    def tearDown(self):
        return

    # Tests
    def testReadMetadata(self):

        rdfGraphBeforeSerialisation = ManifestRDFUtils.writeToManifestFile(TestConfig.ManifestFilePath,TestConfig.NamespaceDictionary, TestConfig.ElementUriList, TestConfig.ElementValueList)
        rdfGraphAfterSerialisation  = ManifestRDFUtils.readManifestFile(TestConfig.ManifestFilePath)

        # Compare the serialised graph obtained with the graph before serialisation
        self.assertEqual(len(rdfGraphBeforeSerialisation),5,'Graph length %i' %len(rdfGraphAfterSerialisation))

        subject = rdfGraphAfterSerialisation.value(None,RDF.type,URIRef(ManifestRDFUtils.oxds+"Grouping"))
        self.failUnless((subject,RDF.type,URIRef(TestConfig.oxds+"Grouping")) in rdfGraphAfterSerialisation, 'Testing submission type: '+subject+", "+ URIRef(TestConfig.oxds+"Grouping"))
        self.failUnless((subject,TestConfig.ElementCreatorUri,TestConfig.User) in rdfGraphAfterSerialisation, 'dcterms:creator')
        self.failUnless((subject,TestConfig.ElementIdentifierUri,TestConfig.DatasetId) in rdfGraphAfterSerialisation, 'ManifestRDFUtils.dcterms:identifier')
        self.failUnless((subject,TestConfig.ElementTitleUri,TestConfig.Title) in rdfGraphAfterSerialisation, 'dcterms:title')
        self.failUnless((subject,TestConfig.ElementDescriptionUri,TestConfig.Description) in rdfGraphAfterSerialisation, 'dcterms:TestConfig.Description')
        return

    def testUpdateMetadata(self):
        updatedTitle       =  "Submission tool updated test title"
        updatedDescription =  "Submission tool updated test description"

        initialGraph = ManifestRDFUtils.writeToManifestFile(TestConfig.ManifestFilePath, TestConfig.NamespaceDictionary,TestConfig.ElementUriList, TestConfig.ElementValueList)
        updatedGraph = ManifestRDFUtils.updateManifestFile(TestConfig.ManifestFilePath, [TestConfig.ElementTitleUri,TestConfig.ElementDescriptionUri], [updatedTitle, updatedDescription])
        readGraph    = ManifestRDFUtils.readManifestFile(TestConfig.ManifestFilePath)

        # Assert that (initialGraph != updatedGraph)
        self.assertEqual(False, ManifestRDFUtils.compareRDFGraphs(initialGraph, updatedGraph,TestConfig.ElementUriList),"Error updating the manifest file!")

        # Assert that (updatedGraph == readGraph)
        self.assertEqual(True, ManifestRDFUtils.compareRDFGraphs(updatedGraph, readGraph,TestConfig.ElementUriList),"Error updating the manifest file!")
        return

    def testGetElementValuesFromManifest(self):
        rdfGraph = ManifestRDFUtils.writeToManifestFile(TestConfig.ManifestFilePath, TestConfig.NamespaceDictionary, TestConfig.ElementUriList, TestConfig.ElementValueList)
        fields = ManifestRDFUtils.getElementValuesFromManifest(rdfGraph, TestConfig.ElementUriList)
        self.assertEquals(fields,TestConfig.ElementValueList,"Problem reading submit dataset utility Fields!")
        return

    def testGetDictionaryFromManifest(self):
        rdfGraph = ManifestRDFUtils.writeToManifestFile(TestConfig.ManifestFilePath, TestConfig.NamespaceDictionary, TestConfig.ElementUriList, TestConfig.ElementValueList)
        actualDictionary = ManifestRDFUtils.getDictionaryFromManifest(TestConfig.ManifestFilePath, TestConfig.ElementUriList)
        Logger.debug(repr(actualDictionary))
        #print "ExpectedDictionary: "+repr(ExpectedDictionary)
        #print "actualDictionary: "+repr(actualDictionary)
        self.assertEqual(ExpectedDictionary,actualDictionary, "Error fetching dictionary from the metadata!")
        return

def getTestSuite(select="unit"):
    """
    Get test suite

    select  is one of the following:
            "unit"      return suite of unit tests only
            "component" return suite of unit and component tests
            "all"       return suite of unit, component and integration tests
            "pending"   return suite of pending tests
             name       a single named test to be run
    """
    testdict = {
        "unit":
            [
              "testReadMetadata",
              "testUpdateMetadata",
              "testGetElementValuesFromManifest",
              "testGetDictionaryFromManifest"
            ],
        "component":
            [ #"testComponents"
            ],
        "integration":
            [ #"testIntegration"
            ],
        "pending":
            [ #"testPending"
            ]
        }
    return TestUtils.getTestSuite(TestMetadataMerging, testdict, select=select)

if __name__ == "__main__":
    TestConfig.setDatasetsBaseDir(".")
    TestUtils.runTests("TestMetadataMerging.log", getTestSuite, sys.argv)


text:
package utils

import scala.concurrent.Future

import play.api.mvc._

import playground.conf._
import playground.utils.Authorization._

import models._

object API extends ActionBuilder[Request] {
  private val login = Conf("api.login")
  private val password = Conf("api.password")

  def invokeBlock[A](request: Request[A], block: Request[A] => Future[SimpleResult]) = block(request)

  override def composeAction[A](action: Action[A]) = new API(action)
}

case class API[A](action: Action[A]) extends Action[A] with Results {
  def apply(request: Request[A]): Future[SimpleResult] = basicAuth(request) match {
    case Some(_) => action(request)
    case None => Future.successful(Unauthorized)
  }

  lazy val parser = action.parser
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="module-info" content="status=complete">
    <title>对齐</title>

        对齐方式:
        <select id="position" onchange="realign()" onkeyup="realign()">
            <option value="b" selected="selected">b</option>
            <option value="r">r</option>

            <option value="rr-bt">rr-bt</option>
            <option value="ll-tb">ll-tb</option>
            <option value="ll-bt">ll-bt</option>
            <option value="rl-tt">rl-tt</option>
            <option value="lr-tt">lr-tt</option>
            <option value="rl-bb">rl-bb</option>
            <option value="rr-yc">rr-yc</option>
            <option value="xc-bb">xc-bb</option>
            <option value="xc-tt">xc-tt</option>
            <option value="ll-yc">ll-yc</option>
            <option value="xc-yc">xc-yc</option>

            <option value="lr-bt">lr-bt</option>
            <option value="rl-tb">rl-tb</option>
            <option value="rl-bt">rl-bt</option>
            <option value="lr-tb">lr-tb</option>
            <option value="rl-yc">rl-yc</option>
            <option value="xc-bt">xc-bt</option>
            <option value="xc-tb">xc-tb</option>
            <option value="lr-yc">lr-yc</option>

            <option value="ll-bb">ll-bb</option>
            <option value="rr-tt">rr-tt</option>
            <option value="rr-bb">rr-bb</option>
            <option value="ll-tt">ll-tt</option>
        </select>

            拖动这里


text:
package jupyter

import (
	"crypto/hmac"
	"crypto/sha256"
	"encoding/hex"
	"encoding/json"
	"errors"
	"fmt"
)

const (
	currentProtocolVersion = "5.0"

	messageTypeKernelInfoRequest = "kernel_info_request"
	messageTypeKernelInfoReply   = "kernel_info_reply"
	messageTypeExecuteRequest    = "execute_request"
	messageTypeExecuteReply      = "execute_reply"
	messageTypeExecuteResult     = "execute_result"
	messageTypeShutdownRequest   = "shutdown_request"
	messageTypeShutdownReply     = "shutdown_reply"
	messageTypeStatus            = "status"
	messageTypeError             = "error"
	messageTypeIsCompleteRequest = "is_complete_request"
	messageTypeIsCompleteReply   = "is_complete_reply"
	messageTypeCompleteRequest   = "complete_request"
	messageTypeCompleteReply     = "complete_reply"

	statusIdle     kernelStatus = "idle"
	statusBusy     kernelStatus = "busy"
	statusStarting kernelStatus = "starting"
)

type message struct {
	Header       messageHeader          `json:"header"`
	ParentHeader messageHeader          `json:"parent_header"`
	Metadata     map[string]interface{} `json:"metadata"`
	Content      json.RawMessage        `json:"content"`
}

type messageHeader struct {
	Id       string `json:"msg_id"`
	Username string `json:"username"`
	Session  string `json:"session"`
	Type     string `json:"msg_type"`
	Version  string `json:"version,omitempty"`
}

type executeRequest struct {
	// Source code to be executed by the kernel, one or more lines.
	Code string `json:"code"`

	// A boolean flag which, if True, signals the kernel to execute
	// this code as quietly as possible.
	// silent=True forces store_history to be False,
	// and will *not*:
	//   - broadcast output on the IOPUB channel
	//   - have an execute_result
	// The default is False.
	Silent bool `json:"silent"`

	// A boolean flag which, if True, signals the kernel to populate history
	// The default is True if silent is False.  If silent is True, store_history
	// is forced to be False.
	StoreHistory bool `json:"store_history"`

	// A dict mapping names to expressions to be evaluated in the
	// user's dict. The rich display-data representation of each will be
	// evaluated after execution.
	// See the display_data content for the structure of the representation data.
	UserExpressions map[string]string `json:"user_expressions"`

	// Some frontends do not support stdin requests.
	// If raw_input is called from code executed from such a frontend,
	// a StdinNotImplementedError will be raised.
	AllowStdin bool `json:"allow_stdin"`

	// A boolean flag, which, if True, does not abort the execution queue,
	// if an exception is encountered.
	// This allows the queued execution of multiple execute_requests, even
	// if they generate exceptions.
	StopOnError bool `json:"stop_on_error"`
}

type executeReply struct {
	Status         string `json:"status"`
	ExecutionCount int    `json:"execution_count"`

	UserExpressions map[string]interface{} `json:"user_expressions,omitempty"`

	ErrorName  string   `json:"ename,omitempty"`
	ErrorValue string   `json:"evalue,omitempty"`
	Traceback  []string `json:"traceback,omitempty"`
}

type executeResult struct {
	ExecutionCount int                    `json:"execution_count"`
	Source         string                 `json:"source"`
	Data           map[string]interface{} `json:"data"`
	Metadata       map[string]interface{} `json:"metadata"`
}

type executeError struct {
	ExecutionCount int      `json:"execution_count"`
	ErrorName      string   `json:"ename"`
	ErrorValue     string   `json:"evalue"`
	Traceback      []string `json:"traceback"`
}

type kernelStatus string

func (s kernelStatus) MarshalJSON() ([]byte, error) {
	return json.Marshal(struct {
		ExecutionState string `json:"execution_state"`
	}{string(s)})
}

type isCompleteRequest struct {
	Code string `json:"code"`
}

type isCompleteReply struct {
	Status string `json:"status"`
	Indent string `json:"indent,omitempty"`
}

type completeRequest struct {
	Code      string `json:"code"`
	CursorPos int    `json:"cursor_pos"`
}

type completeReply struct {
	Matches     []string               `json:"matches"`
	CursorStart int                    `json:"cursor_start"`
	CursorEnd   int                    `json:"cursor_end"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
	Status      string                 `json:"status"`

	ErrorName  string   `json:"ename,omitempty"`
	ErrorValue string   `json:"evalue,omitempty"`
	Traceback  []string `json:"traceback,omitempty"`
}

// deserializeMessage parses a multipart 0MQ message received from a socket
// into a message struct and a slice of identities. parseMessage will verify
// the message signature with the provided key.
//
// See: http://jupyter-client.readthedocs.org/en/latest/messaging.html
func deserializeMessage(parts []string, key []byte) (_ *message, identities []string, _ error) {
	for {
		if len(parts) == 0 {
			return nil, nil, errors.New("message delimiter not found")
		}
		if parts[0] == "<IDS|MSG>" {
			parts = parts[1:]
			break
		}
		identities = append(identities, parts[0])
		parts = parts[1:]
	}

	if len(parts) < 5 {
		return nil, nil, errors.New("not enough parts to message")
	}

	if parts[0] != "" {
		mac := hmac.New(sha256.New, key)
		for _, part := range parts[1:5] {
			mac.Write([]byte(part))
		}
		signature, err := hex.DecodeString(parts[0])
		if err != nil {
			return nil, nil, fmt.Errorf("signature decoding failed: %v", err)
		}
		if !hmac.Equal(mac.Sum(nil), signature) {
			return nil, nil, errors.New("signature validation failed")
		}
	}

	var msg message
	if err := json.Unmarshal([]byte(parts[1]), &msg.Header); err != nil {
		return nil, nil, fmt.Errorf("unmarshalling message header: %v", err)
	}
	if err := json.Unmarshal([]byte(parts[2]), &msg.ParentHeader); err != nil {
		return nil, nil, fmt.Errorf("unmarshalling message parent header: %v", err)
	}
	if err := json.Unmarshal([]byte(parts[3]), &msg.Metadata); err != nil {
		return nil, nil, fmt.Errorf("unmarshalling message metadata: %v", err)
	}
	msg.Content = []byte(parts[4])
	// TODO(axw) verify that content is in serialized-dict format, but
	// leave its deseralisation to individual message type handlers.
	return &msg, identities, nil
}

// newMessage creates a new message with the given type and parent message.
func newMessage(messageType string, parentMessageHeader *messageHeader) (*message, error) {
	messageId, err := newUUID()
	if err != nil {
		return nil, fmt.Errorf("allocating message ID: %v", err)
	}
	msg := &message{
		Header: messageHeader{
			Id:      messageId,
			Type:    messageType,
			Version: currentProtocolVersion,
		},
		Content: json.RawMessage([]byte("{}")),
	}
	if parentMessageHeader != nil {
		msg.ParentHeader = *parentMessageHeader
		msg.Header.Username = parentMessageHeader.Username
		msg.Header.Session = parentMessageHeader.Session
	}
	return msg, nil
}

// serializeMessage converts a message to the Jupyter wire format, signed with
// the given key, ready to be transmitted via 0MQ.
//
// See: http://jupyter-client.readthedocs.org/en/latest/messaging.html
func serializeMessage(msg *message, identities []string, key []byte) ([]string, error) {
	result := make([]string, len(identities), len(identities)+6)
	copy(result, identities)
	result = append(result, "<IDS|MSG>")

	header, err := json.Marshal(msg.Header)
	if err != nil {
		return nil, fmt.Errorf("marshalling message header")
	}
	parentHeader, err := json.Marshal(msg.ParentHeader)
	if err != nil {
		return nil, fmt.Errorf("marshalling message parent header")
	}
	metadata, err := json.Marshal(msg.Metadata)
	if err != nil {
		return nil, fmt.Errorf("marshalling message metadata")
	}

	var hmacSignature string
	if len(key) != 0 {
		mac := hmac.New(sha256.New, key)
		mac.Write(header)
		mac.Write(parentHeader)
		mac.Write(metadata)
		mac.Write(msg.Content)
		hmacSignature = hex.EncodeToString(mac.Sum(nil))
	}
	result = append(
		result,
		hmacSignature,
		string(header),
		string(parentHeader),
		string(metadata),
		string(msg.Content),
	)
	return result, nil
}


text:
package com.aerofs.baseline.http;

import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.LastHttpContent;

import javax.annotation.concurrent.ThreadSafe;
import java.io.IOException;

@ThreadSafe
final class EmptyEntityOutputStream extends ContentOutputStream {

    private final ChannelHandlerContext ctx;

    private boolean flushed = false;

    EmptyEntityOutputStream(ChannelHandlerContext ctx) {
        this.ctx = ctx;
    }

    @Override
    void markError() {
        // noop
    }

    @Override
    public void write(int b) throws IOException {
        throw new IllegalStateException("cannot write to an empty output stream");
    }

    @Override
    public synchronized void flush() throws IOException {
        flushOnce();
    }

    @Override
    public synchronized void close() throws IOException {
        flushOnce();
    }

    private void flushOnce() {
        if (!flushed) {
            ctx.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT);
            flushed = true;
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <ImageView
        android:id="@+id/item_grid_image"
        android:layout_width="68dp"
        android:layout_height="68dp"
        android:background="@mipmap/icon_addpic_focused"
        android:scaleType="centerCrop" />
</LinearLayout>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>Gestione Messaggi</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

<LINK href="javascript/stylehelp.css" rel=stylesheet type=text/css>

Gestione Messaggi  [ Language/help/file.html">Indice Aiuto ]

Quante e-mail posso salvare su @Mail Webmail?

Per visualizzare lo spazio disponibile del tuo account, clicca sulla pagina di avvio della Webmail

Avvisami quando il cestino raggiunge il limite di spazio disponibile?

Si. I messaggi nel cestino stanno raggiungendo il limite di spazio disponibile. Per svuotare definitivamente il cestino, clicca sull'icona "Svuota Cestino" presente in fondo alla lista dei messaggi. Apparirà la richiesta di conferma. Clicca "Si" per procedere o  "No" per ritornare alla pagina.

NOTA: Una volta che i messaggi sono stati cancellati dal cestino non saranno recuperabili.

Come faccio a spaere quando sto raggiungendo il limite dello spazio disponibile?

@Mail Webmail visualizzerà lo spazio utilizzato nella pagina di avvio. Quando sei oltre il 90% dello spazio, considera di rimuovere alcuni messaggi e-mail o di aumentare lo spazio

Come si svuota il cestino?

Per rimuovere definitivamente il contenuto della cartella cestino, clicca sull'icona "Svuota Cestino" presente in fondo  alla lista dei messaggi. Apparirà una richiesta di conferma dove dovrai cliccare su  "Si" per cancellare o "No" per ritornare alla pagina precedente.

NOTA: Una volta che il cestino viene svuotato i messaggi in esso contenuti saranno definitivamente eliminati e non potranno essere recuperati.

Come si crea una nuova cartella?

Per una migliore organizzazione puoi creare le cartelle che preferisci. Per creare una cartella devi:

Vai alla sezione "Crea una nuova cartella" all'interno della pagina "Gestione Cartelle".

Inserisci il nome della cartella.

Clicca il pulsante "Crea Cartella".

Come si rinominano le cartelle?

Clic tasto destro del mouse per le mailbox selezionate nella finestra delle cartelle:

Potete scrivere un nuovo nome della cartella qui;

Premi Invio da tastiera per confermare i cambiamenti

Come sposto i messaggi in una cartella?

Per spostare un messaggio in un'altra cartella bisogna:

Apri la cartella che contiene il messaggio da inoltrare.

Per il messaggio che vuoi inoltrare, clicca il box di sinistra del messaggio. Più messaggi possono essere selezionati contemporaneamente.

Seleziona la cartella di destinazione.

Clicca sul pulsante "Sposta".

I messaggi saranno trasferiti.

(NOTA:  Il messaggio non può essere inoltrato alla tua Inbox e a tutte le cartelle POP3. Non devi spostare i messaggi nella cartella cestino; basta selezionare i messaggi dall'elenco e cliccare sul pulsante "Cancella". )

Come posso visualizzare il contenuto delle cartelle?

Per visualizzare il contenuto di una cartella basta cliccare sul nome della stessa e si aprirà.

Come posso cancellare le cartelle?

In ordine per cancellare una cartella devi averla prima svuotata (Solo le cartelle vuote possono essere cancellate). Per cancellare la cartella devi:

Clicca "Gestione Cartelle" dal menù principale.

Seleziona la cartella che desideri cancellare e clicca su "Cancella" presente sulla destra della selezione.

La cartella è stata cancellata.

NOTA: Non puoi cancellare le cartelle permanenti del tuo account. Le cartelle permanenti sono Posta in Arrivo, Posta Inviata, Bozze e Cestino.


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="192dp"
    android:background="?attr/colorPrimaryDark"
    android:gravity="center"
    android:orientation="vertical"
    android:padding="16dp"
    android:theme="@style/ThemeOverlay.AppCompat.Dark">

    <TextView
        android:id="@+id/textview_header_user_username"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textAppearance="@style/TextAppearance.AppCompat.Large"
        android:textColor="@android:color/white" />

</LinearLayout>


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE xliff PUBLIC "-//XLIFF//DTD XLIFF//EN" "http://www.oasis-open.org/committees/xliff/documents/xliff.dtd" >
<xliff version="1.0">
  <file original="global" source-language="en" datatype="plaintext">
    <header />
    <body>
      <!-- Actions -->
      <trans-unit>
        <source>New</source>
        <target>Nuevo</target>
      </trans-unit>
      <trans-unit>
        <source>Edit</source>
        <target>Editar</target>
      </trans-unit>
      <trans-unit>
        <source>Delete</source>
        <target>Borrar</target>
      </trans-unit>
      <trans-unit>
        <source>List</source>
        <target>Listado</target>
      </trans-unit>
      <trans-unit>
        <source>Save</source>
        <target>Guardar</target>
      </trans-unit>
      <trans-unit>
        <source>Save and add</source>
        <target>Guardar y crear otro</target>
      </trans-unit>
      <trans-unit>
        <source>Cancel</source>
        <target>Cancelar</target>
      </trans-unit>
      <trans-unit>
        <source>Choose an action</source>
        <target>Selecciona una acción</target>
      </trans-unit>
      <trans-unit>
        <source>go</source>
        <target>ok</target>
      </trans-unit>

      <!-- Filters -->
      <trans-unit>
        <source>Reset</source>
        <target>Restablecer</target>
      </trans-unit>
      <trans-unit>
        <source>Filter</source>
        <target>Filtrar</target>
      </trans-unit>

      <!-- List -->
      <trans-unit>
        <source>No result</source>
        <target>Sin resultados</target>
      </trans-unit>
      <trans-unit>
        <source>Actions</source>
        <target>Acciones</target>
      </trans-unit>
      <trans-unit>
        <source>(page %%page%%/%%nb_pages%%)</source>
        <target>(página %%page%%/%%nb_pages%%)</target>
      </trans-unit>
      <trans-unit>
        <source>asc</source>
        <target>asc</target>
      </trans-unit>
      <trans-unit>
        <source>desc</source>
        <target>desc</target>
      </trans-unit>
      <trans-unit>
        <source>[0] no result|[1] 1 result|(1,+Inf] %1% results</source>
        <target>[0] sin resultados|[1] 1 resultado|(1,+Inf] %1% resultados</target>
      </trans-unit>

      <!-- Pagination -->
      <trans-unit>
        <source>First page</source>
        <target>Primera página</target>
      </trans-unit>
      <trans-unit>
        <source>Previous page</source>
        <target>Página anterior</target>
      </trans-unit>
      <trans-unit>
        <source>Next page</source>
        <target>Página siguiente</target>
      </trans-unit>
      <trans-unit>
        <source>Last page</source>
        <target>Última página</target>
      </trans-unit>

      <!-- Form -->
      <trans-unit>
        <source>The item was created successfully.</source>
        <target>El elemento se ha creado correctamente.</target>
      </trans-unit>
      <trans-unit>
        <source>The item was updated successfully.</source>
        <target>El elemento se ha actualizado correctamente.</target>
      </trans-unit>
      <trans-unit>
        <source>The item was created successfully. You can add another one below.</source>
        <target>El elemento se ha creado correctamente y ahora puedes crear otro elemento.</target>
      </trans-unit>
      <trans-unit>
        <source>The item was updated successfully. You can add another one below.</source>
        <target>El elemento se ha actualizado correctamente y ahora puedes crear otro elemento.</target>
      </trans-unit>
      <trans-unit>
        <source>The item has not been saved due to some errors.</source>
        <target>El elemento no se ha guardado porque se ha producido algún error.</target>
      </trans-unit>
      <trans-unit>
        <source>The item was deleted successfully.</source>
        <target>El elemento se ha borrado correctamente.</target>
      </trans-unit>
      <trans-unit>
        <source>You must at least select one item.</source>
        <target>Debes seleccionar al menos un elemento.</target>
      </trans-unit>
      <trans-unit>
        <source>You must select an action to execute on the selected items.</source>
        <target>Selecciona la acción que quieres ejecutar sobre los elementos seleccionados.</target>
      </trans-unit>
      <trans-unit>
        <source>A problem occurs when deleting the selected items as some items do not exist anymore.</source>
        <target>Se ha producido un error al borrar los elementos seleccionados porque al menos uno de ellos ya no existe.</target>
      </trans-unit>
      <trans-unit>
        <source>The selected items have been deleted successfully.</source>
        <target>Los elementos seleccionados se han borrado correctamente.</target>
      </trans-unit>
      <trans-unit>
        <source>A problem occurs when deleting the selected items.</source>
        <target>Se ha producido un error al borrar los elementos seleccionados.</target>
      </trans-unit>
    </body>
  </file>
</xliff>


text:
import pytest
import json
from awx.main.models import (
    Project,
)
from django.core.exceptions import ValidationError

def test_clean_credential_insights():
    proj = Project(name="myproj", credential=None, scm_type='insights')
    with pytest.raises(ValidationError) as e:
        proj.clean_credential()

    assert json.dumps(str(e.value)) == json.dumps(str([u'Insights Credential is required for an Insights Project.']))


text:
<?php declare(strict_types=1);

require \dirname(__DIR__) . '/vendor/autoload.php';

echo 'Reporting back in 12 seconds', \PHP_EOL;
echo DateTime::createFromFormat('U', \time())->format('r'), \PHP_EOL;
\WyriHaximus\React\timedPromise(12)->then(function (): void {
    echo DateTime::createFromFormat('U', \time())->format('r'), \PHP_EOL;
    echo 'Done', \PHP_EOL;
});


text:
namespace Microsoft.Live.Operations
{
    using System;
    using System.IO;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using System.Threading;
    using System.Threading.Tasks;

    using Windows.Networking.BackgroundTransfer;
    using Windows.Storage;
    using Windows.Storage.Streams;

    /// <summary>
    /// This class implements the download operation on Windows 8 using the
    /// background downloader.
    /// </summary>
    internal class CreateBackgroundDownloadOperation : ApiOperation
    {
        private DownloadOperation downloadOp;
        private TaskCompletionSource<LiveDownloadOperation> taskCompletionSource;

        /// <summary>
        /// Creates a new TailoredDownloadOperation instance.
        /// </summary>
        public CreateBackgroundDownloadOperation(
            LiveConnectClient client,
            Uri url,
            IStorageFile outputFile)
            : base(client, url, ApiMethod.Download, null, null)
        {
            this.OutputFile = outputFile;
        }

        /// <summary>
        /// Gets the IStorageFile object that the downloaded content is to be stored in.
        /// </summary>
        public IStorageFile OutputFile { get; private set; }

        /// <summary>
        /// Execute the operation asynchronously.
        /// </summary>
        /// <returns></returns>
        public Task<LiveDownloadOperation> ExecuteAsync()
        {
            this.taskCompletionSource = new TaskCompletionSource<LiveDownloadOperation>();
            this.Execute();
            return taskCompletionSource.Task;
        }

        /// <summary>
        /// Overrides the base execute logic to use the background downloader to download the file.
        /// </summary>
        protected async override void OnExecute()
        {
            var loginResult = await this.LiveClient.Session.AuthClient.GetLoginStatusAsync();
            if (loginResult.Error != null)
            {
                this.taskCompletionSource.SetException(loginResult.Error);
                return;
            }
            else
            {
                var downloader = new BackgroundDownloader();
                downloader.SetRequestHeader(
                        ApiOperation.AuthorizationHeader,
                        AuthConstants.BearerTokenType + " " + loginResult.Session.AccessToken);
                downloader.SetRequestHeader(ApiOperation.LibraryHeader, Platform.GetLibraryHeaderValue());

                downloader.Group = LiveConnectClient.LiveSDKDownloadGroup;
                this.downloadOp = downloader.CreateDownload(this.Url, this.OutputFile);
                this.taskCompletionSource.SetResult(new LiveDownloadOperation(downloadOp));
            }
        }
    }
}


text:
\
+ (instancetype)sharedInstance { \
    DEFINE_SHARED_INSTANCE_GCD_USING_BLOCK(^{ \
      return [[self alloc] init]; \
    }) \
}
#endif

#ifndef SHARED_INSTANCE_GCD_USING_BLOCK
#define SHARED_INSTANCE_GCD_USING_BLOCK(block) \
\
+ (instancetype)sharedInstance { \
    DEFINE_SHARED_INSTANCE_GCD_USING_BLOCK(block) \
}
#endif

#ifndef SHARED_INSTANCE_GCD_WITH_NAME
#define SHARED_INSTANCE_GCD_WITH_NAME(classname)                        \
\
+ (instancetype)shared##classname { \
    DEFINE_SHARED_INSTANCE_GCD_USING_BLOCK(^{ \
      return [[self alloc] init]; \
    }) \
}
#endif

#ifndef SHARED_INSTANCE_GCD_WITH_NAME_USING_BLOCK
#define SHARED_INSTANCE_GCD_WITH_NAME_USING_BLOCK(classname, block) \
\
+ (instancetype)shared##classname { \
    DEFINE_SHARED_INSTANCE_GCD_USING_BLOCK(block) \
}
#endif

#ifndef DEFINE_SHARED_INSTANCE_GCD_USING_BLOCK
#define DEFINE_SHARED_INSTANCE_GCD_USING_BLOCK(block) \
    static dispatch_once_t pred = 0; \
    __strong static id _sharedObject = nil; \
    dispatch_once(&pred, ^{ \
      _sharedObject = block(); \
    }); \
    return _sharedObject;
#endif


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

    <LinearLayout
        android:id="@+id/pieChartView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:orientation="horizontal"></LinearLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:id="@+id/usagePieLabel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true" />

        <!--<Button-->
        <!--android:layout_width="wrap_content"-->
        <!--android:layout_height="wrap_content"-->
        <!--android:id="@+id/usageButtonLeft"-->
        <!--android:text="L"-->
        <!--android:layout_alignParentLeft="true"/>-->

        <!--<Button-->
        <!--android:layout_width="wrap_content"-->
        <!--android:layout_height="wrap_content"-->
        <!--android:id="@+id/usageButtonRight"-->
        <!--android:text="R"-->
        <!--android:layout_alignParentRight="true"/>-->

    </RelativeLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:id="@+id/pieDetailsName"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="10dp" />

        <TextView
            android:id="@+id/pieDetailsDescription"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="10dp" />

        <TextView
            android:id="@+id/pieDetailsPowerUsage"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="10dp" />
    </LinearLayout>
</LinearLayout>


text:
import { UISref, useCurrentStateAndParams, useRouter } from '@uirouter/react';
import { isEmpty, trim } from 'lodash';
import * as React from 'react';

import { BuildDetailsScrollContainerContext } from './BuildDetailsScrollContainerContext';
import { BuildInfoDetails } from './BuildInfoDetails';
import { BuildInfoSummaryCard } from './BuildInfoSummaryCard';
import type { Application } from '../../application';
import type { ICiBuild } from '../domain';
import { useDataSource } from '../../presentation';
import { Spinner } from '../../widgets';

import './builds.less';

interface IBuildProps {
  app: Application;
}
export function Builds({ app }: IBuildProps) {
  const dataSource = app.getDataSource('builds');
  const { data: builds, status, loaded } = useDataSource<ICiBuild[]>(dataSource);
  const {
    stateService: { go },
  } = useRouter();
  const { params, state } = useCurrentStateAndParams();
  const buildDetailsScrollContainer = React.useRef(null);

  React.useEffect(() => {
    dataSource.activate();
  }, []);

  React.useEffect(() => {
    if (!isEmpty(builds) && !state.name.includes('.build.buildTab')) {
      go('home.applications.application.builds.build.buildTab', { buildId: builds[0].id, tab: 'logs' });
    }
  }, [builds]);

  if (!loaded) {
    return (

        <Spinner size="medium" />

    );
  }

  if (status === 'ERROR') {
    return (

There was an error loading builds.

    );
  }

  const { repoType, repoProjectKey, repoSlug } = app.attributes;
  const hasAllConfig = [repoType, repoProjectKey, repoSlug].every((attr) => trim(attr));
  if (!hasAllConfig) {
    return (

          Welcome! To get started with Builds, you'll need to add a
          <UISref to="home.applications.application.config" className="bold config">
             repository to your app's configuration.
          </UISref>

    );
  }

  if (isEmpty(builds)) {
    return (

          Welcome! To get started with Builds, you'll need to make sure that RocketCI is configured for this app.

          Please visit{' '}

            RocketCI
          {' '}
          for more details.

    );
  }

  const selectedBuild = params.buildId ? builds.find((build) => build.id === params.buildId) : null;

  return (
    <>

        {builds.map((build) => (
          <BuildInfoSummaryCard
            build={build}
            isActive={params.buildId === build.id}
            key={build.id}
            onClick={() =>
              go('home.applications.application.builds.build.buildTab', { buildId: build.id, tab: 'logs' })
            }
          />
        ))}

        {selectedBuild && (
          <BuildDetailsScrollContainerContext.Provider value={buildDetailsScrollContainer.current}>
            <BuildInfoDetails build={selectedBuild} />
          </BuildDetailsScrollContainerContext.Provider>
        )}

    </>
  );
}


text:
package models

type AppFileFields struct {
	Path string
	Sha1 string
	Size int64
	Mode string
}


text:
package io.airlift.bootstrap;

import io.airlift.log.Logger;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;

import static com.google.common.base.Preconditions.checkState;
import static java.lang.String.format;

/**
 * Manages PostConstruct and PreDestroy life cycles
 */
public final class LifeCycleManager
{
    private final Logger log = Logger.get(LifeCycleManager.class);
    private final AtomicReference<State> state = new AtomicReference<>(State.LATENT);
    private final Queue<Object> managedInstances = new ConcurrentLinkedQueue<>();
    private final LifeCycleMethodsMap methodsMap;
    private final AtomicReference<Thread> shutdownHook = new AtomicReference<>();

    /**
     * Provides a mechanism to handle exceptions raised from {@link PreDestroy} methods in
     * whatever way makes the most sense. Implementations should not raise exceptions of
     * their own
     */
    private interface LifeCycleStopFailureHandler
    {
        void handlePreDestroyException(Class<?> klass, Method method, Exception exception);
    }

    private enum State
    {
        LATENT,
        STARTING,
        STARTED,
        STOPPING,
        STOPPED
    }

    /**
     * @param managedInstances list of objects that have life cycle annotations
     * @param methodsMap existing or new methods map
     * @throws LifeCycleStartException exceptions starting instances (depending on mode)
     */
    public LifeCycleManager(List<Object> managedInstances, LifeCycleMethodsMap methodsMap)
            throws LifeCycleStartException
    {
        this.methodsMap = (methodsMap != null) ? methodsMap : new LifeCycleMethodsMap();
        for (Object instance : managedInstances) {
            addInstance(instance);
        }
    }

    /**
     * Returns the number of managed instances
     *
     * @return qty
     */
    public int size()
    {
        return managedInstances.size();
    }

    /**
     * Start the life cycle - all instances will have their {@link PostConstruct} method(s) called
     */
    public void start()
            throws LifeCycleStartException
    {
        if (!state.compareAndSet(State.LATENT, State.STARTING)) {
            throw new LifeCycleStartException("System already starting");
        }
        log.info("Life cycle starting...");

        for (Object obj : managedInstances) {
            LifeCycleMethods methods = methodsMap.get(obj.getClass());
            if (!methods.hasFor(PreDestroy.class)) {
                managedInstances.remove(obj);   // remove reference to instances that aren't needed anymore
            }
        }

        Thread thread = new Thread(() -> {
            try {
                log.info("JVM is shutting down, cleaning up");
                stop();
            }
            catch (Exception e) {
                log.error(e, "Trying to shut down");
            }
        });
        shutdownHook.set(thread);
        Runtime.getRuntime().addShutdownHook(thread);

        state.set(State.STARTED);
        log.info("Life cycle started");
    }

    /**
     * Stop the life cycle - all instances will have their {@link PreDestroy} method(s) called
     * and any exceptions raised will be collected and thrown in a wrapped {@link LifeCycleStopException} as
     * suppressed exceptions. Those failures will not be logged and are the responsibility of the caller to
     * handle appropriately.
     *
     * @throws LifeCycleStopException If any failure occurs during the clean up process
     */
    public void stopWithoutFailureLogging()
            throws LifeCycleStopException
    {
        List<Exception> failures = new ArrayList<>();
        stop((klass, method, exception) -> failures.add(exception));
        if (!failures.isEmpty()) {
            LifeCycleStopException stopException = new LifeCycleStopException();
            for (Exception e : failures) {
                stopException.addSuppressed(e);
            }
            throw stopException;
        }
    }

    /**
     * Stop the life cycle - all instances will have their {@link PreDestroy} method(s) called
     * and any exceptions raised will be immediately logged. If any such exceptions occur, a single
     * {@link LifeCycleStopException} will be raised at the end of processing which will <b>not</b>
     * contain any reference to exceptions already logged.
     *
     * @throws LifeCycleStopException If any failure occurs during the clean up process
     */
    public void stop()
            throws LifeCycleStopException
    {
        AtomicBoolean failure = new AtomicBoolean(false);
        stop((klass, method, exception) -> {
            failure.set(true);
            log.error(exception, "Exception in PreDestroy method %s::%s()", klass.getName(), method.getName());
        });

        if (failure.get()) {
            throw new LifeCycleStopException();
        }
    }

    /**
     * Stop the life cycle - all instances will have their {@link PreDestroy} method(s) called and any
     * exceptions raised will be passed to the provided {@link LifeCycleStopFailureHandler} to collect.
     */
    private void stop(LifeCycleStopFailureHandler handler)
    {
        if (!state.compareAndSet(State.STARTED, State.STOPPING)) {
            return;
        }

        Thread thread = shutdownHook.getAndSet(null);
        if (thread != null) {
            try {
                Runtime.getRuntime().removeShutdownHook(thread);
            }
            catch (IllegalStateException ignored) {
            }
        }

        log.info("Life cycle stopping...");

        List<Object> reversedInstances = new ArrayList<>(managedInstances);
        Collections.reverse(reversedInstances);

        for (Object obj : reversedInstances) {
            stopInstance(obj, handler);
        }

        state.set(State.STOPPED);
        log.info("Life cycle stopped");
    }

    /**
     * Add an additional managed instance
     *
     * @param instance instance to add
     * @throws LifeCycleStartException errors during {@link PostConstruct} method invocation
     * @throws IllegalStateException if the life cycle has been stopped
     */
    public void addInstance(Object instance)
            throws LifeCycleStartException
    {
        State currentState = state.get();
        checkState((currentState != State.STOPPING) && (currentState != State.STOPPED), "life cycle is stopped");
        startInstance(instance);
        if (methodsMap.get(instance.getClass()).hasFor(PreDestroy.class)) {
            managedInstances.add(instance);
        }
    }

    private void stopInstance(Object obj, LifeCycleStopFailureHandler handler)
    {
        log.debug("Stopping %s", obj.getClass().getName());
        LifeCycleMethods methods = methodsMap.get(obj.getClass());
        for (Method preDestroy : methods.methodsFor(PreDestroy.class)) {
            log.debug("- invoke %s::%s()", preDestroy.getDeclaringClass().getName(), preDestroy.getName());
            try {
                preDestroy.invoke(obj);
            }
            catch (Exception e) {
                handler.handlePreDestroyException(obj.getClass(), preDestroy, unwrapInvocationTargetException(e));
            }
        }
    }

    private void startInstance(Object obj)
            throws LifeCycleStartException
    {
        log.debug("Starting %s", obj.getClass().getName());
        LifeCycleMethods methods = methodsMap.get(obj.getClass());
        for (Method postConstruct : methods.methodsFor(PostConstruct.class)) {
            log.debug("- invoke %s::%s()", postConstruct.getDeclaringClass().getName(), postConstruct.getName());
            try {
                postConstruct.invoke(obj);
            }
            catch (Exception e) {
                LifeCycleStartException failure = new LifeCycleStartException(
                        format("Exception in PostConstruct method %s::%s()", obj.getClass().getName(), postConstruct.getName()),
                        unwrapInvocationTargetException(e));
                stopInstance(obj, (Class<?> klass, Method method, Exception exception) -> {
                    String message = format("Exception in PreDestroy method %1$s::%2$s() after PostConstruct failure in %1$s::%3$s()", klass.getName(), method.getName(), postConstruct.getName());
                    failure.addSuppressed(new RuntimeException(message, exception));
                });
                throw failure;
            }
        }
    }

    /**
     * Unwraps {@link InvocationTargetException} instances to their underlying cause, otherwise returns the provided Exception
     */
    private static Exception unwrapInvocationTargetException(Exception e)
    {
        return (e instanceof InvocationTargetException && e.getCause() instanceof Exception) ? (Exception) e.getCause() : e;
    }
}


text:
package com.test.banner.adapter;

import android.content.Context;
import android.graphics.Color;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.recyclerview.widget.RecyclerView;

import com.test.banner.R;
import com.test.banner.bean.DataBean;
import com.test.banner.viewholder.ImageHolder;
import com.test.banner.viewholder.TitleHolder;
import com.test.banner.viewholder.VideoHolder;
import com.youth.banner.adapter.BannerAdapter;
import com.youth.banner.util.BannerUtils;

import java.util.List;

/**
 * 自定义布局,多个不同UI切换
 */
public class MultipleTypesAdapter extends BannerAdapter<DataBean, RecyclerView.ViewHolder> {
    private Context context;
    private SparseArray<RecyclerView.ViewHolder> mVHMap = new SparseArray<>();

    public MultipleTypesAdapter(Context context, List<DataBean> mDatas) {
        super(mDatas);
        this.context = context;
    }

    @Override
    public RecyclerView.ViewHolder onCreateHolder(ViewGroup parent, int viewType) {
        switch (viewType) {
            case 1:
                return new ImageHolder(BannerUtils.getView(parent, R.layout.banner_image));
            case 2:
                return new VideoHolder(BannerUtils.getView(parent, R.layout.banner_video));
            case 3:
                return new TitleHolder(BannerUtils.getView(parent, R.layout.banner_title));
        }
        return new ImageHolder(BannerUtils.getView(parent, R.layout.banner_image));
    }

    @Override
    public int getItemViewType(int position) {
        //先取得真实的position,在获取实体
//        return getData(getRealPosition(position)).viewType;
        //直接获取真实的实体
        return getRealData(position).viewType;
        //或者自己直接去操作集合
//        return mDatas.get(getRealPosition(position)).viewType;
    }

    @Override
    public void onBindView(RecyclerView.ViewHolder holder, DataBean data, int position, int size) {
        int viewType = holder.getItemViewType();
        switch (viewType) {
            case 1:
                ImageHolder imageHolder = (ImageHolder) holder;
                mVHMap.append(position,imageHolder);
                imageHolder.imageView.setImageResource(data.imageRes);
                break;
            case 2:
                VideoHolder videoHolder = (VideoHolder) holder;
                mVHMap.append(position,videoHolder);
                videoHolder.player.setUp(data.imageUrl, true, null);
                videoHolder.player.getBackButton().setVisibility(View.GONE);
                //增加封面
                ImageView imageView = new ImageView(context);
                imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
                imageView.setImageResource(R.drawable.image4);
                videoHolder.player.setThumbImageView(imageView);
//                videoHolder.player.startPlayLogic();
                break;
            case 3:
                TitleHolder titleHolder = (TitleHolder) holder;
                mVHMap.append(position,titleHolder);
                titleHolder.title.setText(data.title);
                titleHolder.title.setBackgroundColor(Color.parseColor(DataBean.getRandColor()));
                break;
        }
    }

    public SparseArray<RecyclerView.ViewHolder> getVHMap() {
        return mVHMap;
    }

}


text:
type TArray<T> = T[];
export type TreeRootIdArray = TArray<string | number>;

// 默认节点渲染key
export const DEFAULT_RENDER_KEY: ITreeRenderKey = {
  id: 'id',
  title: 'title',
  children: 'children',
  parentId: 'parentId',
};

export interface ITreeRenderKey {
  id: string;
  title: string;
  children: string;
  parentId: string;
}

export interface ITreeData {
  // [DEFAULT_RENDER_KEY[id]]?: string | number;
  // [DEFAULT_RENDER_KEY[parentId]]?: string | number;
  // [DEFAULT_RENDER_KEY[title]]?: React.ReactNode;
  // [DEFAULT_RENDER_KEY[children]]?: ITreeData[];
  expand?: boolean;
  isLeaf?: boolean;
  [key: string]: any;
}

export interface ITreeRootInfoMap {
  [key: string]: {
    id: string | number;
    parentId?: string | number;
    root: ITreeData;
    isExpand: boolean;
    isParent: boolean;
    son: TreeRootIdArray;
    rootIncludeIds: TreeRootIdArray;
    // 节点的选择联动集合 { nodeId: id[] }
    // id[]: [nodeId, nodeId.children[1]Id, nodeId.children[2]Id, .... nodeId.children[1][...].childrenn[N]Id]
    // 可以根据当前node的id, 查找它将会影响的子孙节点
  };
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2015 Vikram Kakkar

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

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

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<com.appeaser.sublimenavigationviewlibrary.SublimeNavMenuView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingTop="@dimen/snv_navigation_padding_top_default"
    android:paddingBottom="@dimen/snv_navigation_padding_bottom"
    android:clipToPadding="false" />


text:
@interface NavSearchContainerView : UIView
- (instancetype) initWithSubviews: (WRLDSearchWidgetView*) searchView :(UIView*) resultsView :(UIView*) backButton :(UIView*) searchHintContainer;
@end


text:
package org.apache.accumulo.iteratortest;

import static java.util.Objects.requireNonNull;

import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
import org.apache.accumulo.core.iteratorsImpl.system.ColumnFamilySkippingIterator;
import org.apache.accumulo.core.iteratorsImpl.system.SortedMapIterator;
import org.apache.accumulo.iteratortest.testcases.IteratorTestCase;

/**
 * A collection of methods that are helpful to the development of {@link IteratorTestCase}s.
 */
public class IteratorTestUtil {

  public static SortedKeyValueIterator<Key,Value> instantiateIterator(IteratorTestInput input) {
    try {
      return requireNonNull(input.getIteratorClass()).getDeclaredConstructor().newInstance();
    } catch (ReflectiveOperationException e) {
      throw new RuntimeException(e);
    }
  }

  public static SortedKeyValueIterator<Key,Value> createSource(IteratorTestInput input) {
    return new SimpleKVReusingIterator(
        new ColumnFamilySkippingIterator(new SortedMapIterator(requireNonNull(input).getInput())));
  }
}


text:
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.Framework;
using ESRI.ArcGIS.esriSystem;

namespace Events
{
    public class EditorEventsDialogCommand : ESRI.ArcGIS.Desktop.AddIns.Button
    {
        private IDockableWindow m_dockableWindow;

        public EditorEventsDialogCommand()
        {
           // SetupDockableWindow();
            UID windowID = new UIDClass();
            windowID.Value = @"ESRI_Employee_Events_EditorEventsDialog";
            m_dockableWindow = ArcMap.DockableWindowManager.GetDockableWindow(windowID);
        }

        #region Overriden Class Methods
        protected override void OnClick()
        {
            if (m_dockableWindow == null)
                return;

            m_dockableWindow.Show(!m_dockableWindow.IsVisible());
            Checked = m_dockableWindow.IsVisible();
        }

        protected override void OnUpdate()
        {
            this.Enabled = (m_dockableWindow != null);
            Checked = m_dockableWindow != null && m_dockableWindow.IsVisible();
        }
        #endregion
    }
}


text:
<!DOCTYPE html>

  {% include head.html %}

    {% include header.html %}

Learn once, write anywhere

Build polished mobile apps with MvvmCross

Get started

Get the most out of Xamarin using MvvmCross

Build clean, pixel perfect, native UIs. Share behavior and business logic in a single codebase
 across supported platforms, using the Model-View-ViewModel (MVVM) design pattern.
MvvmCross is a framework specifically developed for Xamarin and the mobile ecosystem.
It supports Xamarin.iOS, Xamarin.Android, Xamarin.Mac, Xamarin.Forms, Universal Windows Platform (UWP) and Windows Presentation Framework (WPF)

Over 5000 companies rely on MvvmCross

    {% include footer.html %}


text:
[CmdletBinding()]
Param(
  [string]$BuildToolsInstallerPath,
  [string]$ExtraBuildToolsParameters,
  [string]$PythonInstaller,
  [string]$VisualStudioVersion,
  [switch]$InstallPython,
  [switch]$InstallBuildTools
)

# Returns whether or not the current user has administrative privileges
function IsAdministrator {
  $Identity = [System.Security.Principal.WindowsIdentity]::GetCurrent()
  $Principal = New-Object System.Security.Principal.WindowsPrincipal($Identity)
  $Principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)
}

# Returns whether or not UAC is enabled on Windows
function IsUacEnabled {
  (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System).EnableLua -ne 0
}

# Runs the installer
function runInstaller {
  if (Test-Path $BuildToolsInstallerPath) {
    $extraParams = $ExtraBuildToolsParameters -split "%_; "

    if ($extraParams.count -gt 0) {
      foreach ($element in $extraParams) {
        $params += $element
      }
    }

    cd $BuildToolsInstallerPath

    if ($VisualStudioVersion -eq "2017") {
      $params = "--norestart", "--quiet", "--includeRecommended", "--add", "Microsoft.VisualStudio.Workload.VCTools"
      ./vs_BuildTools.exe $params
    } else {
      $params = "/NoRestart", "/S", "/L", "`"$BuildToolsInstallerPath\build-tools-log.txt`""
      ./BuildTools_Full.exe $params
    }
  } else {
    Write-Output "Tried to start Build Tools installer, but couldn't find $BuildToolsInstallerPath."
  }
}

function runPythonInstaller {
  if (Test-Path $BuildToolsInstallerPath) {
    cd $BuildToolsInstallerPath
    $pyParams = "/i", $PythonInstaller, "TARGETDIR=```"$BuildToolsInstallerPath\python38```"", "ALLUSERS=0", "/qn", "/L*P", "`"$BuildToolsInstallerPath\python-log.txt`""
    Invoke-Expression "msiexec.exe $pyParams"
  } else {
    Write-Output "Tried to start Python installer, but couldn't find $BuildToolsInstallerPath."
  }
}

# Check Elevation
if (!(IsAdministrator)) {
  "Please restart this script from an administrative PowerShell!"
  "We cannot install the build tools without administrative rights."
  return
}

# Print Arguments
Write-Output "Passed arguments: $args"

if ($InstallBuildTools.IsPresent) {
  runInstaller;
}

if ($InstallPython.IsPresent) {
  runPythonInstaller;
}


text:
from unittest2 import TestCase

import mock

from akanda.router.drivers import hostname, ip

CONFIG = mock.Mock()
CONFIG.hostname = 'akanda'

class HostnameTestCase(TestCase):
    """
    """
    def setUp(self):
        self.mock_execute = mock.patch('akanda.router.utils.execute').start()
        self.mock_replace_file = mock.patch(
            'akanda.router.utils.replace_file'
        ).start()
        self.addCleanup(mock.patch.stopall)

        self.mgr = hostname.HostnameManager()

    def test_update_hostname(self):
        self.mgr.update_hostname(CONFIG)
        self.mock_execute.assert_has_calls([
            mock.call(['/bin/hostname', 'akanda'], 'sudo'),
            mock.call(['mv', '/tmp/hostname', '/etc/hostname'], 'sudo')
        ])

    @mock.patch.object(ip.IPManager, 'get_management_address')
    def test_update_hosts(self, addr):
        expected = [
            '127.0.0.1  localhost',
            '::1  localhost ip6-localhost ip6-loopback',
            'fdca:3ba5:a17a:acda:f816:3eff:fe66:33b6  akanda'
        ]
        addr.return_value = 'fdca:3ba5:a17a:acda:f816:3eff:fe66:33b6'
        self.mgr.update_hosts(CONFIG)
        self.mock_execute.assert_has_calls([
            mock.call(['mv', '/tmp/hosts', '/etc/hosts'], 'sudo')
        ])
        self.mock_replace_file.assert_has_calls([mock.call(
            '/tmp/hosts',
            '\n'.join(expected))
        ])


text:
import React from 'react';
import styled from 'styled-components';

import H1 from 'containers/ProfileText/h1';

import {
    SECTION_EDUCATION,
    PROFILE_NOW
} from 'containers/HomePage/constants';

import {about_me} from 'data';

import {renderEducation} from './utils';

const hidden = `
  display: none;
`;

const show = `
  display: block;
`;

const Style = styled.div`
    ${(props) => (props.current_section === SECTION_EDUCATION)? show : hidden}
`;

const Education = ({current_profile, current_section}) => (

);

export default Education;


text:
// Copyright (c) Microsoft Open Technologies, Inc.  All rights reserved.
// Licensed under the BSD 2-Clause License.
// See License.txt in the project root for license information.

#include "pch.h"

#include <concrt.h>
#include "ErrorCodes.h"
#include "DmapSupport.h"

#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)  // If building a UWP app
using namespace Windows::Devices::Enumeration;
using namespace Windows::Devices::Custom;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Storage::Streams;
using namespace Windows::System::Threading;
using namespace Concurrency;

#define WAIT_TIME_MILLIS 10000 // wait up to 10 seconds
#define LEGACY_BUF_SIZE 8  // Required for legacy driver support

#endif  // !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

/**
Get the base address of a memory mapped controller in the SOC.  Exclusive, non-shared
access to the controller is requested.
\param[in] deviceName The name of the PCI device used to map the controller in question.
\param[out] handle Handle opened to the device specified by deviceName.
\param[out] baseAddress Base address of the controller in question.
\return HRESULT success or error code.
*/
HRESULT GetControllerBaseAddress(PWCHAR deviceName, HANDLE & handle, PVOID & baseAddress)
{
    return GetControllerBaseAddress(deviceName, handle, baseAddress, 0);
}

#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)  // If building a UWP app
/// Array of CustomDevice references.
/**
This array is used to store persistent references to the CustomDevice references
created for open devices that are exposed by DMap.  This array is only used for
UWP builds.  Holding a reference on the CustomDevices keep them open.  The maximum
number of devices in the array is best kept in agreement with the similar limit
in the DMap driver (16, as of the first release of this software.)
*/
#define MAX_OPEN_DEVICES 16
CustomDevice^ g_devices[MAX_OPEN_DEVICES];
UINT32 g_openDeviceMask = 0;
#endif  // !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TOP)

/**
Get the base address of a memory mapped controller in the SOC.
\param[in] deviceName The name of the PCI device used to map the controller in question.
\param[out] handle Handle opened to the device specified by deviceName (zero for UWP build).
\param[out] baseAddress Base address of the controller in question.
\param[in] shareMode Sharing specifier as specified to CreateFile().
\return HRESULT success or error code.
*/
HRESULT GetControllerBaseAddress(PWCHAR deviceName, HANDLE & handle, PVOID & baseAddress, DWORD shareMode)
{
    void* controllerAddress = 0;
    HRESULT hr = S_OK;

#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)  // If building a UWP app

    // If we don't already have the device controller mapped:
    if (baseAddress != nullptr)
    {
        return S_OK; // Initialized already
    }

    Platform::Guid myGuid = Platform::Guid(DMAP_INTERFACE);
    Platform::String^ myAqs = CustomDevice::GetDeviceSelector(myGuid);

    std::wstring inputDeviceString(deviceName);
    size_t subStrLen = inputDeviceString.find(L"{") - 5;
    if (subStrLen < 1)
    {
        return DMAP_E_DMAP_INTERNAL_ERROR;
    }

    // Get substring from after the leading "\\.\" up to the "#{" at start of GUID.
    std::wstring inputDeviceSubstr = inputDeviceString.substr(4, subStrLen);

    // Replace each "#" in the substring with a "\".
    size_t poundPosition;
    while ((poundPosition = inputDeviceSubstr.find(L"#")) != std::wstring::npos)
    {
        inputDeviceSubstr.replace(poundPosition, 1, L"\\");
    }
    // At this point an input device instance name string of:
    //  "\\.\ACPI#INT33FC#1#{109b86ad-f53d-4b76-aa5f-821e2ddf2141}\0"
    // Would be converted to this device instance name string:
    //  "ACPI\INT33FC\1"

    HANDLE findCompleted = CreateEventEx(nullptr, nullptr, 0 /* auto reset */, EVENT_ALL_ACCESS);
    if (findCompleted == nullptr)
    {
        return HRESULT_FROM_WIN32(GetLastError());
    }

    auto workItem = ref new WorkItemHandler(
        [&myAqs, &controllerAddress, &inputDeviceSubstr, &handle, &findCompleted, &hr]
    (IAsyncAction^ workItem)
    {
        create_task(DeviceInformation::FindAllAsync(myAqs))
            .then([&controllerAddress, &inputDeviceSubstr, &handle, &findCompleted, &hr]
                (DeviceInformationCollection^ Devices)
        {
            UINT32 mySize = Devices->Size;
            IIterator<DeviceInformation^>^ devIter = Devices->First();
            DeviceInformation^ devInfo;
            bool foundDevice = false;
            Platform::String^ deviceId;
            while (devIter->HasCurrent && !foundDevice)
            {
                UINT32 i;
                devInfo = devIter->Current;
                Platform::String^ devName = devInfo->Name;
                if (devInfo->IsEnabled)
                {
                    IMapView<Platform::String^, Platform::Object^>^ properties = devInfo->Properties;
                    IIterator<IKeyValuePair<Platform::String^, Platform::Object^>^>^ propIter = properties->First();
                    for (i = 0; (i < properties->Size) && !foundDevice; i++)
                    {
                        IKeyValuePair<Platform::String^, Platform::Object^>^ valuePair = propIter->Current;

                        Platform::String^ propKey = valuePair->Key;
                        std::wstring keyStr = propKey->Data();
                        if (_wcsicmp(keyStr.c_str(), L"System.Devices.DeviceInstanceId") == 0)
                        {
                            Platform::Object^ propObj = valuePair->Value;
                            Platform::String^ propStr = propObj->ToString();
                            std::wstring propertiesStr = propStr->Data();

                            if (propertiesStr.compare(inputDeviceSubstr) == 0)
                            {
                                foundDevice = true;
                            }
                        }

                        propIter->MoveNext();
                    }
                }

                devIter->MoveNext();
            } // end - while (devIter->HaveCurrent && !foundDevice)

            if (!foundDevice)
            {
                hr = DMAP_E_DEVICE_NOT_FOUND_ON_SYSTEM;
                SetEvent(findCompleted);
                return;
            }

            if (SUCCEEDED(hr))
            {
                std::wstring devIdStr(devInfo->Id->Data());
                devIdStr.append(L"\\0");
                Platform::String^ devId = ref new Platform::String(devIdStr.c_str());

                create_task(CustomDevice::FromIdAsync(devId, DeviceAccessMode::ReadWrite, DeviceSharingMode::Shared))
                    .then([&controllerAddress, &handle, &findCompleted, &hr]
                        (CustomDevice^ device)
                {
                    // Find the first available open device slot.
                    int i = 0;
                    while ((i < MAX_OPEN_DEVICES) && ((g_openDeviceMask & (1 << i)) != 0))
                    {
                        i++;
                    }

                    if (i == MAX_OPEN_DEVICES)
                    {
                        hr = DMAP_E_TOO_MANY_DEVICES_MAPPED;
                        SetEvent(findCompleted);
                        return;
                    }

                    if (SUCCEEDED(hr))
                    {
                        g_devices[i] = device;
                        handle = &g_devices[i];
                        g_openDeviceMask |= 1 << i;

                        IOControlCode^ IOCTL = ref new IOControlCode(0x423, 0x100, IOControlAccessMode::Any, IOControlBufferingMethod::Buffered);
                        Buffer^ addressBuffer = ref new Buffer(sizeof(DMAP_MAPMEMORY_OUTPUT_BUFFER) + LEGACY_BUF_SIZE);

                        create_task(device->SendIOControlAsync(IOCTL, nullptr, addressBuffer))
                            .then([addressBuffer, &controllerAddress, &findCompleted, &hr](UINT32 result)
                        {
                            // We expect a pointer and a 4-byte length to have been transferred
                            // into the address buffer by the I/O operation. On x86 and ARM,
                            // we should get a 4-byte address + 4-byte length. On AMD64, it's 12 bytes.

                            if (result < sizeof(DMAP_MAPMEMORY_OUTPUT_BUFFER))
                            {
                                hr = E_UNEXPECTED;
                            }
                            else
                            {
                                auto reader = DataReader::FromBuffer(addressBuffer);

                                // The address can be up to 64-bit
                                uint64_t address = 0;

                                for (size_t i = 0; i < sizeof(void*); i++)
                                {
                                    address = address | (((uint64_t)reader->ReadByte()) << (8 * i));
                                }

                                controllerAddress = (void*)address;

                            }

                            SetEvent(findCompleted);

                        }); // device->SendIOControlAsync()

                    } // End - if (SUCCEEDED(hr))

                }); // CustomDevice::FromIdAsync()

            } // End - if (SUCCEEDED(hr))

        });  // DeviceInformation::FindAllAsync()

    }); // workItem

    auto asyncAction = ThreadPool::RunAsync(workItem);

    DWORD dwError = WaitForSingleObjectEx(findCompleted, WAIT_TIME_MILLIS, FALSE);
    if (dwError == WAIT_OBJECT_0)
    {
        baseAddress = controllerAddress;
    }
    else if (dwError == WAIT_TIMEOUT ||
        dwError == WAIT_ABANDONED ||
        dwError == WAIT_IO_COMPLETION)
    {
        hr = HRESULT_FROM_WIN32(dwError);
    }
    else
    {
        hr = HRESULT_FROM_WIN32(GetLastError());
    }

    CloseHandle(findCompleted);
#endif  // !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)   // If building a Win32 app
    DMAP_MAPMEMORY_OUTPUT_BUFFER buf = { 0 };
    DWORD bytesReturned = 0;

    hr = OpenControllerDevice(deviceName, handle, shareMode);

    if (SUCCEEDED(hr) && (baseAddress == nullptr))
    {
        // Retrieve the base address of controller registers.
        if (!DeviceIoControl(
            handle,
            IOCTL_DMAP_MAPMEMORY,
            nullptr,
            0,
            &buf,
            sizeof(buf),
            &bytesReturned,
            nullptr))
        {
            hr = HRESULT_FROM_WIN32(GetLastError());
            CloseHandle(handle);
            handle = INVALID_HANDLE_VALUE;
            baseAddress = nullptr;
        }
        else
        {
            // Pass back the base address of the controller registers to the caller.
            baseAddress = buf.Address;
        }
    }
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

    return hr;
}

/**
Close an open controller device using a method appropriate to how it was opened.
\param[inout] handle Handle to the open controller device.
*/
void DmapCloseController(HANDLE & handle)
{
    if (handle != INVALID_HANDLE_VALUE)
    {

#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
        CloseHandle(handle);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
        if ((handle >= &g_devices[0]) && (handle < &g_devices[MAX_OPEN_DEVICES]))
        {
            *(CustomDevice^*)handle = nullptr;                  // Close device handle
            UINT32 i = (UINT32)((CustomDevice^*)handle - g_devices);    // Get index of device in array
            g_openDeviceMask &= ~(1 << i);                      // Indicate device slot is free
        }
#endif // !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

        handle = INVALID_HANDLE_VALUE;
    }
}

/**
Open a controller device in the SOC.  This is used for both memory mapped and
IO mapped controllers.
\param[in] deviceName The name of the PCI device used to map the controller in question.
\param[out] handle Handle opened to the device specified by deviceName.
\param[in] shareMode Sharing specifier as specified to CreateFile().
\return HRESULT success or error code.
*/
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)   // If building a Win32 app
HRESULT OpenControllerDevice(PWCHAR deviceName, HANDLE & handle, DWORD shareMode)
{
    HRESULT hr = S_OK;

    if (handle == INVALID_HANDLE_VALUE)
    {
        // Open the specified device.
        handle = CreateFile(
            deviceName,
            GENERIC_READ | GENERIC_WRITE,
            shareMode,
            nullptr,
            OPEN_EXISTING,
            FILE_ATTRIBUTE_NORMAL,
            NULL);

        if (handle == INVALID_HANDLE_VALUE)
        {
            hr = HRESULT_FROM_WIN32(GetLastError());
            if (SUCCEEDED(hr))
            {
                hr = E_HANDLE;
            }
        }
    }

    return hr;
}
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)

#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)  // If building a UWP app

/**
Send an IO control code to the controller device driver
\param[in] handle Handle opened to the device
\param[in] iOControlCode The IOControl code to send to the driver
\param[in] bufferToDriver The buffer to send to the driver (nullptr if none)
\param[in] bufferFromDriver The buffer for data from the driver (nullptr if none)
\param[in] timeOutMillis The number of milliseconds to wait for I/O completion (can be INFINITE)
\return HRESULT success or error code.
*/
HRESULT SendIOControlCodeToController(
    HANDLE handle,
    IOControlCode^ iOControlCode,
    IBuffer^ bufferToDriver,
    IBuffer^ bufferFromDriver,
    uint32_t timeOutMillis)
{
    HRESULT hr = S_OK;
    CustomDevice^ device;

    if ((handle < &g_devices[0]) || (handle >= &g_devices[MAX_OPEN_DEVICES]))
    {
        return DMAP_E_INVALID_LOCK_HANDLE_SPECIFIED;
    }

    device = *(CustomDevice^*)handle;

    HANDLE ioControlCompleted = CreateEventEx(nullptr, nullptr, 0 /* auto reset */, EVENT_ALL_ACCESS);
    if (ioControlCompleted == nullptr)
    {
        return HRESULT_FROM_WIN32(GetLastError());
    }

    auto workItem = ref new WorkItemHandler(
        [device, iOControlCode, ioControlCompleted, &hr, &bufferToDriver, &bufferFromDriver]
    (IAsyncAction^ workItem)
    {
        create_task(device->SendIOControlAsync(iOControlCode, bufferToDriver, bufferFromDriver)).then([&hr, ioControlCompleted](task<unsigned int> t)
        {
            try
            {
                hr = t.get();
            }
            catch (Platform::Exception^ e)
            {
                hr = ERROR_OPERATION_ABORTED;
            }
            catch (...)
            {
                hr = ERROR_OPERATION_ABORTED;
            }
            SetEvent(ioControlCompleted);
        });
    });

    auto asyncAction = ThreadPool::RunAsync(workItem);

    DWORD dwError = WaitForSingleObjectEx(ioControlCompleted, timeOutMillis, FALSE);
    if (dwError == WAIT_OBJECT_0)
    {
        // success
    }
    else if (dwError == WAIT_TIMEOUT ||
        dwError == WAIT_ABANDONED ||
        dwError == WAIT_IO_COMPLETION)
    {
        hr = HRESULT_FROM_WIN32(dwError);
    }
    else
    {
        hr = HRESULT_FROM_WIN32(GetLastError());
    }

    CloseHandle(ioControlCompleted);
    return hr;
}

/**
Acquire an exclusive access lock on a controller.
\param[in] handle Handle opened to the device to be locked.
\return HRESULT success or error code.
*/
HRESULT GetControllerLock(HANDLE & handle)
{
    static IOControlCode^ LockCode = ref new IOControlCode(0x423, 0x103, IOControlAccessMode::Any, IOControlBufferingMethod::Neither);

    // return SendIOControlCodeToController(handle, LockCode, nullptr, nullptr, WAIT_TIME_MILLIS);
    return S_OK;
}

/**
Release an exclusive access lock on a controller.
\param[in] handle Handle opened to the locked device.
\return HRESULT success or error code.
*/
HRESULT ReleaseControllerLock(HANDLE & handle)
{
    static IOControlCode^ UnlockCode = ref new IOControlCode(0x423, 0x104, IOControlAccessMode::Any, IOControlBufferingMethod::Neither);

    // return SendIOControlCodeToController(handle, UnlockCode, nullptr, nullptr, WAIT_TIME_MILLIS);
    return S_OK;
}
#endif  // !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)


text:
<?php

namespace Drupal\Tests\user\Functional\Views;

use Drupal\views\Views;

/**
 * Tests the representative node relationship for users.
 *
 * @group user
 */
class RelationshipRepresentativeNodeTest extends UserTestBase {

  /**
   * Views used by this test.
   *
   * @var array
   */
  public static $testViews = ['test_groupwise_user'];

  /**
   * Tests the relationship.
   */
  public function testRelationship() {
    $view = Views::getView('test_groupwise_user');
    $this->executeView($view);
    $map = ['node_field_data_users_field_data_nid' => 'nid', 'uid' => 'uid'];
    $expected_result = [
      [
        'uid' => $this->users[1]->id(),
        'nid' => $this->nodes[1]->id(),
      ],
      [
        'uid' => $this->users[0]->id(),
        'nid' => $this->nodes[0]->id(),
      ],
    ];
    $this->assertIdenticalResultset($view, $expected_result, $map);
  }

}


text:
using Light.Domain.Entities;
using Light.ModelConfiguration;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Light.SQLite
{
    public class AgeRangerDbContextBase :DbContext
    {
        public AgeRangerDbContextBase(string nameOrConnectionString) : base(nameOrConnectionString)
        { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            //Overwrite initializer with SQLite initializer
            Database.SetInitializer(new AgeRangerDbInitializer(modelBuilder));

            //Config entity
            modelBuilder.Configurations.Add(new PersonEntityConfiguration<Person>());
            modelBuilder.Configurations.Add(new AgeGroupConfiguration());
        }
    }
}