text:
package com.emitrom.ti4j.mobile.client.app;

import com.emitrom.ti4j.mobile.client.core.TiFactory;
import com.emitrom.ti4j.mobile.client.core.TiModule;
import com.emitrom.ti4j.mobile.client.core.handlers.EventHandler;
import com.emitrom.ti4j.mobile.client.platform.Platform;
import com.google.gwt.core.client.JavaScriptObject;

/**
 * The top level App module. The App module is mainly used for accessing
 * information about the application at runtime and for sending or listening for
 * system events.
 *

 * The App module exposes a number of properties set in the tiapp.xml file.
 *

 * Three of these properties, the application name, ID, and URL, must be
 * specified when the application is created.
 *

 * While most values may be changed by editing the tiapp.xml file after creating
 * the project, the GUID is automatically generated and should not be changed.
 *
 */
public class App extends TiModule {

    public static final String APP_EVENT_ACCESSIBILITY_ANNOUNCEMENT = EVENT_ACCESSIBILITY_ANNOUNCEMENT();
    public static final String APP_EVENT_ACCESSIBILITY_CHANGED = EVENT_ACCESSIBILITY_CHANGED();

    private static final App INSTANCE = new App();

    public static App get() {
        return INSTANCE;
    }

    private App() {
        createPeer();
    }

    @Override
    public void createPeer() {
        jsObj = TiFactory.createApp();
    }

    /**
     * Indicates whether Accessibility is enabled by the system.
     */
    public native boolean isAccessibilityEnabled() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.accessibilityEnabled;
    }-*/;

    /**
     * Indicates whether Analytics is enabled, determined by tiapp.xml.
     */
    public native boolean isAnalyticsEnabled() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.analytics;
    }-*/;

    /**
     * Application copyright statement, determined by tiapp.xml.
     */
    public native String getCopyright() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.copyright;
    }-*/;

    /**
     * Build type that reflects how the application was packaged; either test,
     * development or production.
     */
    public native String getDeployType() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.deployType;
    }-*/;

    /**
     * Application description, determined by tiapp.xml.
     */
    public native String getDescription() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.description;
    }-*/;

    /**
     *
     * Prevents network activity indicator from being displayed.
     *

     * Setting this property to true disables display of the network activity
     * indicator when network activity is in progress. If the network activity
     * indicator is currently visible, it is hidden immediately.
     *

     * NOTE: In general, the user should always be made aware of network
     * activity. The network activity indicator should only be disabled for very
     * brief network activity (a few seconds).
     *

     * Default: false
     */
    public native void setDisableNetWorkActivitiyIndicator(boolean value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.disableNetWorkActivitiyIndicator = value;
    }-*/;

    public native boolean isNetworkActivityIndicatorDisabled() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.disableNetWorkActivitiyIndicator;
    }-*/;

    /**
     * Application globally-unique ID, determined by tiapp.xml.
     */
    public native String getGuId() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.guid;
    }-*/;

    /**
     * Application ID, from tiapp.xml.
     */
    public native String getId() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.id;
    }-*/;

    /**
     * @iosOnly Determines whether the screen is locked when the device is idle.
     */
    public native boolean isIdelTimerDisabled() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.idleTimerDisabled;
    }-*/;

    /**
     * @iosOnly Determines whether the screen is locked when the device is idle.
     */
    public native void setIdelTimerDisabled(boolean value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.idleTimerDisabled = value;
    }-*/;

    /**
     * @iosOnly The install ID for this application.
     */
    public native String getInstallId() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.installId;
    }-*/;

    /**
     * Application name, determined by tiapp.xml.
     */
    public native String getName() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.name;
    }-*/;

    /**
     * Indicates whether or not the soft keyboard is visible.
     */
    public native boolean keyboardVisible() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.keyboardVisible;
    }-*/;

    /**
     * @iosOnly Determines whether proximity detection is enabled.
     */
    public native boolean isProxymityDectionEnabled() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.proximityDetection;
    }-*/;

    /**
     * @iosOnly Determines whether the screen is locked when the device is idle.
     *          Set to true to receive proximity events.
     */
    public native void setProximityDetection(boolean value) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.proximityDetection = true;
    }-*/;

    /**
     * @iosOnly Indicates the state of the device's proximity sensor, according
     *          to the proximity event.
     *
     *          This property is true when the proximity sensor is close to the
     *          user. When proximityDetection is disabled, the value of this
     *          property is undefined.
     */
    public native boolean hasProximityState() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.proximityState;
    }-*/;

    /**
     * Application publisher, from tiapp.xml.
     */
    public native String getPublisher() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.publisher;
    }-*/;

    /**
     * Unique session identifier for the current continuous run of the
     * application.
     */
    public native String getSessionId() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.sessionId;
    }-*/;

    /**
     * Application URL, from tiapp.xml.
     */
    public native String getUrl() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.url;
    }-*/;

    /**
     * Application version, from tiapp.xml.
     */
    public native String getVersion() /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		return jso.version;
    }-*/;

    /**
     *
     Fire a system-level event such as APP_EVENT_ACCESSIBILITY_ANNOUNCEMENT.
     */
    public native void fireSystemEvent(String eventName, JavaScriptObject param) /*-{
		var jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();
		jso.fireSystemEvent(eventName, param);
    }-*/;

    /**
     * Get the IOs App module. Return null on other platforms
     */
    public IOs getIOs() {
        if (Platform.get().isIOs3_2Plus()) {
            return IOs.get();
        }
        return null;
    }

    public Properties getProperties() {
        return Properties.get();
    }

    public static native final String EVENT_ACCESSIBILITY_ANNOUNCEMENT() /*-{
		return Titanium.App.EVENT_ACCESSIBILITY_ANNOUNCEMENT;
    }-*/;

    public static native final String EVENT_ACCESSIBILITY_CHANGED() /*-{
		return Titanium.App.EVENT_ACCESSIBILITY_CHANGED;
    }-*/;

    public void addAcceccibilityChangedHandler(EventHandler handler) {
        addEventHandler("accessibilitychanged", handler);
    }

    public void addKeyBoardFrameChangedHandler(EventHandler handler) {
        addEventHandler("keyboardFrameChanged", handler);
    }

    public void addPauseHandler(EventHandler handler) {
        addEventHandler("pause", handler);
    }

    public void addPausedHandler(EventHandler handler) {
        addEventHandler("paused", handler);
    }

    public void addProximityHandler(EventHandler handler) {
        addEventHandler("proximity", handler);
    }

    public void addResumeHandler(EventHandler handler) {
        addEventHandler("resume", handler);
    }

    public void addResumedHandler(EventHandler handler) {
        addEventHandler("resumer", handler);
    }

    public void addSignificantTimeChangeHandler(EventHandler handler) {
        addEventHandler("significanttimechange", handler);
    }

}


text:
package stream.flarebot.flarebot.commands.music;

import com.arsenarsen.lavaplayerbridge.PlayerManager;
import com.arsenarsen.lavaplayerbridge.player.Track;
import net.dv8tion.jda.core.AccountType;
import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.MessageChannel;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.FlareBot;
import stream.flarebot.flarebot.commands.Command;
import stream.flarebot.flarebot.commands.CommandType;
import stream.flarebot.flarebot.music.extractors.YouTubeExtractor;
import stream.flarebot.flarebot.objects.GuildWrapper;
import stream.flarebot.flarebot.util.MessageUtils;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Queue;

public class QueueCommand implements Command {

    @Override
    public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) {
        if (message.getContentRaw().substring(1).startsWith("playlist")) {
            MessageUtils.sendWarningMessage("This command is deprecated! Please use `{%}queue` instead!", channel);
        }
        PlayerManager manager = FlareBot.getInstance().getMusicManager();
        if (args.length < 1 || args.length > 2) {
            send(member.getUser().openPrivateChannel().complete(), channel, member);
        } else {
            if (args.length == 1) {
                if (args[0].equalsIgnoreCase("clear")) {
                    if (!this.getPermissions(channel).hasPermission(member, "flarebot.queue.clear")) {
                        MessageUtils.sendErrorMessage("You need the `flarebot.queue.clear` permission to do this!", channel, sender);
                        return;
                    }
                    manager.getPlayer(channel.getGuild().getId()).getPlaylist().clear();
                    channel.sendMessage("Cleared the current playlist!").queue();
                } else if (args[0].equalsIgnoreCase("remove")) {
                    MessageUtils.sendUsage(this, channel, sender, args);
                } else if (args[0].equalsIgnoreCase("here")) {
                    send(channel, channel, member);
                } else {
                    MessageUtils.sendUsage(this, channel, sender, args);
                }
            } else {
                if (args[0].equalsIgnoreCase("remove")) {
                    int number;
                    try {
                        number = Integer.parseInt(args[1]);
                    } catch (NumberFormatException e) {
                        MessageUtils.sendErrorMessage("That is an invalid number!", channel);
                        return;
                    }

                    Queue<Track> queue = manager.getPlayer(channel.getGuild().getId()).getPlaylist();

                    if (number < 1 || number > queue.size()) {
                        MessageUtils
                                .sendErrorMessage("There is no song with that index. Make sure your number is at least 1 and either " + queue
                                        .size() + " or below!", channel);
                        return;
                    }

                    List<Track> playlist = new ArrayList<>(queue);
                    playlist.remove(number - 1);
                    queue.clear();
                    queue.addAll(playlist);

                    channel.sendMessage(MessageUtils.getEmbed(sender)
                            .setDescription("Removed number " + number + " from the playlist!")
                            .build()).queue();
                }
            }
        }
    }

    private void send(MessageChannel mchannel, TextChannel channel, Member sender) {
        PlayerManager manager = FlareBot.getInstance().getMusicManager();
        Track currentTrack = manager.getPlayer(channel.getGuild().getId()).getPlayingTrack();
        if (!manager.getPlayer(channel.getGuild().getId()).getPlaylist().isEmpty()
                || currentTrack != null) {
            List<String> songs = new ArrayList<>();
            int i = 1;
            StringBuilder sb = new StringBuilder();
            Iterator<Track> it = manager.getPlayer(channel.getGuild().getId()).getPlaylist().iterator();
            while (it.hasNext() && songs.size() < 24) {
                Track next = it.next();
                String toAppend = String.format("%s. [`%s`](%s) | Requested by <@!%s>\n", i++,
                        next.getTrack().getInfo().title,
                        YouTubeExtractor.WATCH_URL + next.getTrack().getIdentifier(),
                        next.getMeta().get("requester"));
                if (sb.length() + toAppend.length() > 1024) {
                    songs.add(sb.toString());
                    sb = new StringBuilder();
                }
                sb.append(toAppend);
            }
            songs.add(sb.toString());
            EmbedBuilder builder = MessageUtils.getEmbed(sender.getUser());
            builder.addField("Current Song", String.format("[`%s`](%s) | Requested by <@!%s>\n",
                    currentTrack.getTrack().getInfo().title,
                    YouTubeExtractor.WATCH_URL + currentTrack.getTrack().getIdentifier(),
                    currentTrack.getMeta().get("requester")), false);
            i = 1;
            for (String s : songs) {
                int page = i++;
                EmbedBuilder b = new EmbedBuilder(builder.build());
                b.addField("Page " + page, s, false);
                if (!b.isValidLength(AccountType.BOT))
                    break;
                builder.addField("Page " + page, s, false);
            }
            if ((i - 1) == 1)
                channel.sendMessage(builder.build()).queue();
            else
                mchannel.sendMessage(builder.build()).queue();
        } else {
            MessageUtils.sendErrorMessage(MessageUtils.getEmbed().setDescription("No songs in the playlist!"), channel);
        }
    }

    @Override
    public String getCommand() {
        return "queue";
    }

    // TODO: FIX THIS MONSTROSITY
    @Override
    public String getDescription() {
        return "View the songs currently on your playlist. " +
                "NOTE: If too many it shows only the amount that can fit. You can use `queue clear` to remove all songs." +
                " You can use `queue remove #` to remove a song under #.\n" +
                "To make it not send a DM do `queue here`";
    }

    @Override
    public String getUsage() {
        return "`{%}queue` - Lists the current items in the queue.\n" +
                "`{%}queue clear` - Clears the queue\n" +
                "`{%}queue remove <#>` - Removes an item from the queue.";
    }

    @Override
    public String[] getAliases() {
        return new String[]{"playlist", "q"};
    }

    @Override
    public CommandType getType() {
        return CommandType.MUSIC;
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
declare(strict_types=1);
namespace Helmich\Psr7Assert;

use Helmich\JsonAssert\Constraint\JsonValueMatchesMany;
use Helmich\Psr7Assert\Constraint\BodyMatchesConstraint;
use Helmich\Psr7Assert\Constraint\HasHeaderConstraint;
use Helmich\Psr7Assert\Constraint\HasMethodConstraint;
use Helmich\Psr7Assert\Constraint\HasQueryParameterConstraint;
use Helmich\Psr7Assert\Constraint\HasQueryParametersConstraint;
use Helmich\Psr7Assert\Constraint\HasStatusConstraint;
use Helmich\Psr7Assert\Constraint\HasUriConstraint;
use Helmich\Psr7Assert\Constraint\IsAbsoluteUriConstraint;
use Helmich\Psr7Assert\Constraint\UrlEncodedMatchesMany;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\Constraint\Constraint;
use PHPUnit\Framework\Constraint\IsEqual;
use Psr\Http\Message\MessageInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\UriInterface;

trait Psr7Assertions
{

    public static function assertRequestHasUri(RequestInterface $request, string $uri): void
    {
        Assert::assertThat($request, static::hasUri($uri));
    }

    public static function assertMessageHasHeader(MessageInterface $message, string $headerName, $headerValue = null): void
    {
        Assert::assertThat($message, static::hasHeader($headerName, $headerValue));
    }

    public static function assertMessageHasHeaders(MessageInterface $message, array $constraints): void
    {
        Assert::assertThat($message, static::hasHeaders($constraints));
    }

    public static function assertMessageBodyMatches(MessageInterface $message, $constraint): void
    {
        Assert::assertThat($message, static::bodyMatches($constraint));
    }

    public static function assertMessageBodyMatchesJson(MessageInterface $message, array $jsonConstraints): void
    {
        Assert::assertThat($message, static::bodyMatchesJson($jsonConstraints));
    }

    public static function assertMessageBodyMatchesForm(MessageInterface $message, array $formConstraints): void
    {
        Assert::assertThat($message, static::bodyMatchesForm($formConstraints));
    }

    public static function assertResponseHasStatus(ResponseInterface $response, int $status): void
    {
        Assert::assertThat($response, static::hasStatus($status));
    }

    public static function assertResponseIsSuccess(ResponseInterface $response): void
    {
        Assert::assertThat($response, static::isSuccess());
    }

    public static function assertResponseIsRedirect(ResponseInterface $response): void
    {
        Assert::assertThat($response, static::isRedirect());
    }

    public static function assertResponseIsClientError(ResponseInterface $response): void
    {
        Assert::assertThat($response, static::isClientError());
    }

    public static function assertResponseIsServerError(ResponseInterface $response): void
    {
        Assert::assertThat($response, static::isServerError());
    }

    public static function assertRequestHasMethod(RequestInterface $request, string $method): void
    {
        Assert::assertThat($request, static::hasMethod($method));
    }

    public static function assertRequestIsGet(RequestInterface $request): void
    {
        Assert::assertThat($request, static::isGet());
    }

    public static function assertRequestIsPost(RequestInterface $request): void
    {
        Assert::assertThat($request, static::isPost());
    }

    public static function assertRequestIsPut(RequestInterface $request): void
    {
        Assert::assertThat($request, static::isPut());
    }

    public static function assertRequestIsDelete(RequestInterface $request): void
    {
        Assert::assertThat($request, static::isDelete());
    }

    /**
     * @param string $uri
     */
    public static function assertStringIsAbsoluteUri(string $uri): void
    {
        Assert::assertThat($uri, static::isAbsoluteUri());
    }

    /**
     * @param string|UriInterface|RequestInterface $uriOrRequest
     * @param string|Constraint                    $name
     * @param string|Constraint|null               $value
     */
    public static function assertHasQueryParameter($uriOrRequest, $name, $value = null): void
    {
        Assert::assertThat($uriOrRequest, static::hasQueryParameter($name, $value));
    }

    public static function assertHasQueryParameters($uriOrRequest, array $parameters): void
    {
        Assert::assertThat($uriOrRequest, static::hasQueryParameters($parameters));
    }

    public static function hasUri(string $uri): Constraint
    {
        return new HasUriConstraint($uri);
    }

    public static function hasMethod(string $method): Constraint
    {
        return new HasMethodConstraint($method);
    }

    public static function hasStatus($status): Constraint
    {
        return new HasStatusConstraint($status);
    }

    public static function isSuccess(): Constraint
    {
        return new HasStatusConstraint(Assert::logicalAnd(Assert::greaterThanOrEqual(200), Assert::lessThan(300)));
    }

    public static function isRedirect(): Constraint
    {
        return new HasStatusConstraint(Assert::logicalAnd(Assert::greaterThanOrEqual(300), Assert::lessThan(400)));
    }

    public static function isClientError(): Constraint
    {
        return new HasStatusConstraint(Assert::logicalAnd(Assert::greaterThanOrEqual(400), Assert::lessThan(500)));
    }

    public static function isServerError(): Constraint
    {
        return new HasStatusConstraint(Assert::logicalAnd(Assert::greaterThanOrEqual(500), Assert::lessThan(600)));
    }

    public static function isGet(): Constraint
    {
        return static::hasMethod('GET');
    }

    public static function isPost(): Constraint
    {
        return static::hasMethod('POST');
    }

    public static function isPut(): Constraint
    {
        return static::hasMethod('PUT');
    }

    public static function isDelete(): Constraint
    {
        return static::hasMethod('DELETE');
    }

    public static function hasHeader(string $name, $constraint = null): Constraint
    {
        return new HasHeaderConstraint($name, $constraint);
    }

    public static function hasHeaders(array $constraints): Constraint
    {
        $headerConstraints = [];
        foreach ($constraints as $name => $constraint) {
            $headerConstraints[] = new HasHeaderConstraint($name, $constraint);
        }

        $conjunction = Assert::logicalAnd();
        $conjunction->setConstraints($headerConstraints);

        return $conjunction;
    }

    public static function hasHeaderEqualTo(string $name, string $expected): Constraint
    {
        return new HasHeaderConstraint($name, new IsEqual($expected));
    }

    public static function bodyMatches(Constraint $constraint): Constraint
    {
        return new BodyMatchesConstraint($constraint);
    }

    /**
     * @param string|Constraint      $name
     * @param string|Constraint|null $value
     * @return Constraint
     */
    public static function hasQueryParameter($name, $value = null): Constraint
    {
        return new HasQueryParameterConstraint($name, $value);
    }

    public static function hasQueryParameters(array $parameters): Constraint
    {
        return new HasQueryParametersConstraint($parameters);
    }

    public static function bodyMatchesJson(array $constraints): Constraint
    {
        return Assert::logicalAnd(
            self::hasHeader('content-type', Assert::matchesRegularExpression(',^application/json(;.+)?$,')),
            self::bodyMatches(
                Assert::logicalAnd(
                    Assert::isJson(),
                    new JsonValueMatchesMany($constraints)
                )
            )
        );
    }

    public static function bodyMatchesForm(array $constraints): Constraint
    {
        return Assert::logicalAnd(
            self::hasHeader('content-type', Assert::matchesRegularExpression(',^application/x-www-form-urlencoded(;.+)?$,')),
            self::bodyMatches(new UrlEncodedMatchesMany($constraints))
        );
    }

    /**
     * @return Constraint
     */
    public static function isAbsoluteUri(): Constraint
    {
        return new IsAbsoluteUriConstraint();
    }
}


text:
package com.google.cloud.runtimes.tomcat.session;

import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import com.google.cloud.datastore.Cursor;
import com.google.cloud.datastore.Datastore;
import com.google.cloud.datastore.Entity;
import com.google.cloud.datastore.FullEntity;
import com.google.cloud.datastore.Key;
import com.google.cloud.datastore.KeyFactory;
import com.google.cloud.datastore.KeyQuery;
import com.google.cloud.datastore.PathElement;
import com.google.cloud.datastore.QueryResults;
import com.google.common.collect.ImmutableList;
import java.time.Clock;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.apache.catalina.Manager;
import org.apache.catalina.Session;
import org.apache.catalina.core.StandardContext;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

/**
 * Ensures that {@code DatastoreStore} correctly uses the Datastore.
 */
public class DatastoreStoreTest {

  @Mock
  private Datastore datastore;

  @Mock
  private Manager manager;

  @Mock
  private Clock clock;

  private Key key;

  private Key attributeKey;

  private DatastoreStore store;

  private static final String keyId = "123";

  @Before
  public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    store = new DatastoreStore();
    KeyFactory keyFactory = new KeyFactory("project").setKind("kind");
    key = keyFactory.newKey(keyId);
    attributeKey = keyFactory.newKey("attribute");
    QueryResults<Key> keyQueryResults = new IteratorQueryResults<>(ImmutableList.of(key).iterator());

    when(datastore.newKeyFactory()).thenAnswer((invocation) -> new KeyFactory("project"));
    when(datastore.run(any(KeyQuery.class))).thenReturn(keyQueryResults);

    when(manager.getContext()).thenReturn(new StandardContext());
    when(manager.willAttributeDistribute(anyString(), any())).thenReturn(true);
    when(manager.createEmptySession()).thenReturn(new DatastoreSession(manager));

    store.setDatastore(datastore);
    store.setClock(clock);
    store.setSessionKind("kind");
    store.setManager(manager);
  }

  @Test
  public void testGetStoreSize() throws Exception {
    int size = store.getSize();
    verify(datastore).run(any(KeyQuery.class));
    assertEquals(1, size);
  }

  @Test
  public void testClearStore() throws Exception {
    store.clear();
    verify(datastore).delete(any(Key.class));
  }

  @Test
  public void testEnumerateKeys() throws Exception {
    String[] keys = store.keys();
    verify(datastore).run(any(KeyQuery.class));
    assertEquals(1, keys.length);
    assertEquals(keyId, keys[0]);
  }

  @Test
  public void testEmptySessionLoading() throws Exception {
    DatastoreSession session = new DatastoreSession(manager);
    session.setValid(true);
    session.setId(keyId);

    Entity sessionEntity = session.saveMetadataToEntity(key);

    when(datastore.<Entity>run(any())).thenReturn(
        new IteratorQueryResults<>(Collections.singleton(sessionEntity).iterator()));

    Session loadedSession = store.load(keyId);
    verify(datastore).run(any());
    verify(manager).createEmptySession();

    assertEquals(loadedSession.getId(), keyId);
  }

  @Test
  public void testLoadNonExistentSession() throws Exception {
    when(datastore.run(any())).thenReturn(new IteratorQueryResults<>(Collections.emptyIterator()));

    Session session = store.load("456");
    verify(manager, never()).createEmptySession();
    assertNull(session);
  }

  @Test
  public void testSessionRemoval() throws Exception {
    store.remove(keyId);
    verify(datastore).delete(any(Key.class));
  }

  @Test
  public void testSessionExpiration() throws Exception {
    when(datastore.run(any(KeyQuery.class))).thenReturn(
        new IteratorQueryResults<>(Collections.singletonList(key).iterator()),
        new IteratorQueryResults<>(Arrays.asList(key, attributeKey).iterator())
    );

    store.processExpires();
    verify(datastore).delete(Arrays.asList(key, attributeKey).toArray(new Key[0]));
  }

  @Test
  public void testSessionSave() throws Exception {
    DatastoreSession session = spy(new DatastoreSession(manager));
    session.setValid(true);
    session.setId(keyId);
    session.setAttribute("count", 5);

    store.save(session);
    ArgumentCaptor captor = ArgumentCaptor.forClass(Entity.class);
    verify(datastore).put((FullEntity<?>[]) captor.capture());
    verify(session).saveAttributesToEntity(any());

    List<Entity> entities = captor.getAllValues();
    assertEquals(2, entities.size());

    assertTrue(entities.stream()
        .map(e -> e.getKey().getName())
        .collect(Collectors.toList())
        .containsAll(Arrays.asList("count", keyId)));

  }

  @Test
  public void testDecomposedSessionLoad() throws Exception {
    DatastoreSession session = new DatastoreSession(manager);
    session.setValid(true);
    session.setId(keyId);
    session.setAttribute("count", 2);
    session.setAttribute("map", Collections.singletonMap("key", "value"));

    KeyFactory attributeKeyFactory = datastore.newKeyFactory()
        .setKind("kind")
        .addAncestor(PathElement.of("kind", key.getName()));
    List<Entity> entities = session.saveToEntities(key, attributeKeyFactory);

    QueryResults<Entity> queryResults = new IteratorQueryResults<>(entities.iterator());
    when(datastore.<Entity>run(any())).thenReturn(queryResults);

    Session restored = store.load(keyId);

    assertEquals(keyId, restored.getId());
    assertEquals(2, restored.getSession().getAttribute("count"));
    assertEquals("value",
        ((Map<String, String>)session.getSession().getAttribute("map")).get("key"));
  }

  @Test
  public void testSerializationCycleWithAttributeRemoval() throws Exception {
    DatastoreSession initialSession = new DatastoreSession(manager);
    initialSession.setValid(true);
    initialSession.setId(keyId);
    initialSession.setAttribute("count", 5);
    initialSession.setAttribute("map", Collections.singletonMap("key", "value"));
    KeyFactory attributeKeyFactory = datastore.newKeyFactory()
        .setKind("kind")
        .addAncestor(PathElement.of("kind", key.getName()));

    List<Entity> initialSessionEntities = store.serializeSession(initialSession, key,
        attributeKeyFactory);

    // Load the session and remove the map attribute
    when(datastore.<Entity>run(any())).thenReturn(
        new IteratorQueryResults<>(initialSessionEntities.iterator()));
    DatastoreSession session = (DatastoreSession)store.load(keyId);
    session.getSession().setAttribute("map", null);

    // Save and reload the session to ensure that the attribute map is not serialized
    store.save(session);

    ArgumentCaptor<Key> keyCaptors = ArgumentCaptor.forClass(Key.class);
    verify(datastore).delete(keyCaptors.capture());

    assertNotNull(keyCaptors.getValue());
    assertEquals("map", keyCaptors.getValue().getName());
  }

  @Test
  public void testTracerActivation() throws Exception {
    store.setTraceRequest(false);
    assertNull(store.startSpan("span"));

    store.setTraceRequest(true);
    assertNotNull(store.startSpan("span"));
  }

  /**
   * This is an helper class to mock the return of Datastore queries.
   */
  private class IteratorQueryResults<T> implements QueryResults<T> {

    private Iterator<T> iterator;

    IteratorQueryResults(Iterator<T> iterator) {
      this.iterator = iterator;
    }

    @Override
    public Class<?> getResultClass() {
      return null;
    }

    @Override
    public Cursor getCursorAfter() {
      return null;
    }

    @Override
    public boolean hasNext() {
      return iterator.hasNext();
    }

    @Override
    public T next() {
      return iterator.next();
    }
  }

}


text:
<?php

namespace Mollie\Api\Resources;

use Mollie\Api\Types\OnboardingStatus;
class Onboarding extends \Mollie\Api\Resources\BaseResource
{
    /**
     * @var string
     */
    public $resource;
    /**
     * @var string
     */
    public $name;
    /**
     * @var string
     */
    public $signedUpAt;
    /**
     * Either "needs-data", "in-review" or "completed".
     * Indicates this current status of the organization's onboarding process.
     *
     * @var string
     */
    public $status;
    /**
     * @var bool
     */
    public $canReceivePayments;
    /**
     * @var bool
     */
    public $canReceiveSettlements;
    /**
     * @var \stdClass
     */
    public $_links;
    /**
     * @return bool
     */
    public function needsData()
    {
        return $this->status === \Mollie\Api\Types\OnboardingStatus::NEEDS_DATA;
    }
    /**
     * @return bool
     */
    public function isInReview()
    {
        return $this->status === \Mollie\Api\Types\OnboardingStatus::IN_REVIEW;
    }
    /**
     * @return bool
     */
    public function isCompleted()
    {
        return $this->status === \Mollie\Api\Types\OnboardingStatus::COMPLETED;
    }
}


text:
package com.github.visgeek.utils.collections.test.testcase.collection.set.enumerableset;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import com.github.visgeek.utils.collections.EnumerableSet;

public class Constructor {
	@Rule
	public final ExpectedException expectedException = ExpectedException.none();

	@Test
	public void noArgs() {
		HashSet<Integer> hashSet = new HashSet<>();
		EnumerableSet<Integer> enumerableSet = new EnumerableSet<>();

		Assert.assertEquals(Constructor.getThreshold(hashSet), Constructor.getThreshold(enumerableSet));
		Assert.assertEquals(Constructor.getLoadFactor(hashSet), Constructor.getLoadFactor(enumerableSet), 0);
	}

	@Test
	public void collectionNullArg() {
		this.expectedException.expect(NullPointerException.class);
		this.expectedException.expectMessage("collection");

		Collection<Integer> collection = null;
		new EnumerableSet<>(collection);
	}

	@Test
	public void collection() {
		Collection<Integer> collection = Arrays.asList(1, 2, 3);

		HashSet<Integer> hashSet = new HashSet<>(collection);
		EnumerableSet<Integer> enumerableSet = new EnumerableSet<>(collection);

		Assert.assertEquals(Constructor.getThreshold(hashSet), Constructor.getThreshold(enumerableSet));
		Assert.assertEquals(Constructor.getLoadFactor(hashSet), Constructor.getLoadFactor(enumerableSet), 0);
		Assert.assertEquals(hashSet, enumerableSet);
	}

	@Test
	public void iterableNullArg() {
		this.expectedException.expect(NullPointerException.class);
		this.expectedException.expectMessage("collection");

		Iterable<Integer> collection = null;
		new EnumerableSet<>(collection);
	}

	@Test
	public void iterableAsCollection() {
		Iterable<Integer> collection = Arrays.asList(1, 2, 3);

		HashSet<Integer> hashSet = new HashSet<>((Collection<Integer>) collection);
		EnumerableSet<Integer> enumerableSet = new EnumerableSet<>(collection);

		Assert.assertEquals(Constructor.getThreshold(hashSet), Constructor.getThreshold(enumerableSet));
		Assert.assertEquals(Constructor.getLoadFactor(hashSet), Constructor.getLoadFactor(enumerableSet), 0);
		Assert.assertEquals(hashSet, enumerableSet);
	}

	@Test
	public void iterableAsIterable() {
		HashSet<Integer> hashSet = new HashSet<>();
		hashSet.add(1);
		hashSet.add(2);
		hashSet.add(3);

		Iterable<Integer> collection = () -> Arrays.asList(1, 2, 3).iterator();
		EnumerableSet<Integer> enumerableSet = new EnumerableSet<>(collection);

		Assert.assertEquals(Constructor.getThreshold(hashSet), Constructor.getThreshold(enumerableSet));
		Assert.assertEquals(Constructor.getLoadFactor(hashSet), Constructor.getLoadFactor(enumerableSet), 0);
		Assert.assertEquals(hashSet, enumerableSet);
	}

	@Test
	public void arrayNullArg() {
		this.expectedException.expect(NullPointerException.class);
		this.expectedException.expectMessage("values");

		Integer[] collection = null;
		new EnumerableSet<>(collection);
	}

	@Test
	public void array() {
		HashSet<Integer> hashSet = new HashSet<>();
		hashSet.add(1);
		hashSet.add(2);
		hashSet.add(3);

		EnumerableSet<Integer> enumerableSet = new EnumerableSet<>(1, 2, 3);

		Assert.assertEquals(Constructor.getThreshold(hashSet), Constructor.getThreshold(enumerableSet));
		Assert.assertEquals(Constructor.getLoadFactor(hashSet), Constructor.getLoadFactor(enumerableSet), 0);
		Assert.assertEquals(hashSet, enumerableSet);
	}

	@Test
	public void initialCapacity() {
		HashSet<Integer> hashSet = new HashSet<>(10);
		EnumerableSet<Integer> enumerableSet = new EnumerableSet<>(10);

		Assert.assertEquals(Constructor.getThreshold(hashSet), Constructor.getThreshold(enumerableSet));
		Assert.assertEquals(Constructor.getLoadFactor(hashSet), Constructor.getLoadFactor(enumerableSet), 0);
	}

	@Test
	public void initialCapacityAndLoadFactor() {
		HashSet<Integer> hashSet = new HashSet<>(10, 0.5f);
		EnumerableSet<Integer> enumerableSet = new EnumerableSet<>(10, 0.5f);

		Assert.assertEquals(Constructor.getThreshold(hashSet), Constructor.getThreshold(enumerableSet));
		Assert.assertEquals(Constructor.getLoadFactor(hashSet), Constructor.getLoadFactor(enumerableSet), 0);
	}

	public static <T> int getThreshold(Set<T> set) {
		try {
			HashMap<T, Object> map = getMap(set);
			Field field = HashMap.class.getDeclaredField("threshold");
			field.setAccessible(true);
			return field.getInt(map);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	public static <T> float getLoadFactor(Set<T> set) {
		try {
			HashMap<T, Object> map = getMap(set);
			Field field = HashMap.class.getDeclaredField("loadFactor");
			field.setAccessible(true);
			return field.getFloat(map);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	@SuppressWarnings("unchecked")
	private static <T> HashMap<T, Object> getMap(Set<T> set) {
		try {
			Field field = HashSet.class.getDeclaredField("map");
			field.setAccessible(true);
			return (HashMap<T, Object>) field.get(set);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


text:
<?php
namespace App\User\Table;

use App\User\Entity\User;
use Cake\ORM\Table;

class UsersTable extends Table
{

    public function initialize(array $config)
    {
        $this->setEntityClass(User::class);
    }
}


text:
 **Flare**

**School** evocation [light]; **Level** bard 0, druid 0, sorcerer/wizard 0

**Casting Time** 1 standard action

**Components** V

**Range** close (25 ft. + 5 ft./2 levels)

**Effect** burst of light

**Duration** instantaneous

**Saving Throw** [Fortitude](../combat#_fortitude) negates; **[Spell Resistance](../glossary#_spell-resistance)** yes

This cantrip creates a burst of light. If you cause the light to burst in front of a single creature, that creature is [dazzled](../glossary#_dazzled) for 1 minute unless it makes a successful [Fortitude](../combat#_fortitude) save. Sightless creatures, as well as creatures already [dazzled](../glossary#_dazzled), are not affected by _flare_.


text:
<?php

/**
 * Spiral Framework. PHP Data Grid
 *
 * @license MIT
 * @author  Anton Tsitou (Wolfy-J)
 * @author  Valentin Vintsukevich (vvval)
 */

declare(strict_types=1);

namespace Spiral\DataGrid;

use Spiral\DataGrid\Exception\CompilerException;
use Spiral\DataGrid\Exception\GridViewException;
use Spiral\DataGrid\Input\ArrayInput;
use Spiral\DataGrid\Input\NullInput;
use Spiral\DataGrid\Specification\FilterInterface;

/**
 * Generates grid views based on provided inout source and grid specifications.
 */
class GridFactory implements GridFactoryInterface
{
    public const KEY_FILTER      = 'filter';
    public const KEY_SORT        = 'sort';
    public const KEY_PAGINATE    = 'paginate';
    public const KEY_FETCH_COUNT = 'fetchCount';

    /** @var callable */
    private $count = 'count';

    /** @var Compiler */
    private $compiler;

    /** @var InputInterface */
    private $input;

    /** @var InputInterface */
    private $defaults;

    /** @var GridInterface */
    private $view;

    /**
     * @param Compiler            $compiler
     * @param InputInterface|null $input
     * @param GridInterface|null  $view
     */
    public function __construct(Compiler $compiler, InputInterface $input = null, GridInterface $view = null)
    {
        $this->compiler = $compiler;
        $this->input = $input ?? new NullInput();
        $this->defaults = new NullInput();
        $this->view = $view ?? new Grid();
    }

    /**
     * Associate new input source with grid generator.
     *
     * @param InputInterface $input
     * @return GridFactory
     */
    public function withInput(InputInterface $input): self
    {
        $generator = clone $this;
        $generator->input = $input;

        return $generator;
    }

    /**
     * USe default filter values.
     *
     * @param array $data
     * @return $this
     */
    public function withDefaults(array $data): self
    {
        $generator = clone $this;
        $generator->defaults = new ArrayInput($data);

        return $generator;
    }

    /**
     * @param callable $counter
     * @return $this
     */
    public function withCounter(callable $counter): self
    {
        $generator = clone $this;
        $generator->count = $counter;

        return $generator;
    }

    /**
     * @inheritDoc
     */
    public function create($source, GridSchema $schema): GridInterface
    {
        $view = clone $this->view;

        ['view' => $view, 'source' => $source] = $this->applyFilters($view, $source, $schema);
        ['view' => $view, 'source' => $source] = $this->applyCounter($view, $source, $schema);
        ['view' => $view, 'source' => $source] = $this->applySorters($view, $source, $schema);
        ['view' => $view, 'source' => $source] = $this->applyPaginator($view, $source, $schema);

        if (!is_iterable($source)) {
            throw new GridViewException('GridView expects the source to be iterable after all.');
        }

        return $view->withSource($source);
    }

    protected function applyFilters(GridInterface $view, $source, GridSchema $schema): array
    {
        ['source' => $source, 'filters' => $filters] = $this->getFilters($source, $schema);
        $view = $view->withOption(GridInterface::FILTERS, $filters);

        return compact('view', 'source');
    }

    protected function getFilters($source, GridSchema $schema): array
    {
        $filters = [];
        foreach ($this->getOptionArray(static::KEY_FILTER) ?? [] as $name => $value) {
            if ($schema->hasFilter($name)) {
                $filter = $schema->getFilter($name)->withValue($value);

                if ($filter !== null) {
                    $source = $this->compiler->compile($source, $filter);
                    $filters[$name] = $filter->getValue();
                }
            }
        }

        return compact('source', 'filters');
    }

    protected function applyCounter(GridInterface $view, $source, GridSchema $schema): array
    {
        if (is_countable($source) && $this->getOption(static::KEY_FETCH_COUNT)) {
            $view = $view->withOption(GridInterface::COUNT, ($this->count)($source));
        }

        return compact('view', 'source');
    }

    protected function applySorters(GridInterface $view, $source, GridSchema $schema): array
    {
        ['source' => $source, 'sorters' => $sorters] = $this->getSorters($source, $schema);
        $view = $view->withOption(GridInterface::SORTERS, $sorters);

        return compact('view', 'source');
    }

    protected function getSorters($source, GridSchema $schema): array
    {
        $sorters = [];
        foreach ($this->getOptionArray(static::KEY_SORT) ?? [] as $name => $value) {
            if ($schema->hasSorter($name)) {
                $sorter = $schema->getSorter($name)->withDirection($value);

                if ($sorter !== null) {
                    $source = $this->compiler->compile($source, $sorter);
                    $sorters[$name] = $sorter->getValue();
                }
            }
        }

        return compact('source', 'sorters');
    }

    protected function applyPaginator(GridInterface $view, $source, GridSchema $schema): array
    {
        if ($schema->getPaginator() !== null) {
            ['source' => $source, 'paginator' => $paginator] = $this->getPaginator($source, $schema);
            $view = $view->withOption(GridInterface::PAGINATOR, $paginator);
        }

        return compact('view', 'source');
    }

    protected function getPaginator($source, GridSchema $schema): array
    {
        $paginator = $schema->getPaginator();
        if (!$paginator instanceof FilterInterface) {
            throw new CompilerException('Paginator can not be null');
        }

        $withValue = $paginator->withValue($this->getOption(static::KEY_PAGINATE));
        if ($withValue === null) {
            throw new CompilerException('Paginator can not be null');
        }

        return [
            'source'    => $this->compiler->compile($source, $withValue),
            'paginator' => $withValue->getValue(),
        ];
    }

    /**
     * Return array of options for the input. Checks the default input in case of value missing in parent.
     *
     * @param string $option
     * @return array
     */
    protected function getOptionArray(string $option): array
    {
        $result = $this->getOption($option);
        if (!is_array($result)) {
            return [];
        }

        return $result;
    }

    /**
     * Return array of options for the input. Checks the default input in case of value missing in parent.
     *
     * @param string $option
     * @return mixed
     */
    protected function getOption(string $option)
    {
        if ($this->input->hasValue($option)) {
            return $this->input->getValue($option);
        }

        return $this->defaults->getValue($option);
    }
}


text:
namespace PoemFilterContract
{
    public interface CalculateConsonants
    {
        string UserId { get; }
        string CorrId { get; }
        string[] Text { get; }
        int[] VowelCounts { get; }
    }
}


text:
<?php

namespace CMuench\Yubikey\Generator;

interface SignatureGeneratorInterface
{
    /**
     * Generates a signature by given url parameters
     *
     * @param array $data
     * @param string $apiSecret
     * @return string
     */
    public function generate(array $data, $apiSecret);
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>R: Vignettes and other documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/doc/html/R.css" />

 Vignettes and other documentation

Vignettes from package 'lazyeval'

<col style="width: 22%;" />
<col style="width:  2%;" />
<col style="width: 50%;" />
<col style="width:  8%;" />
<col style="width:  8%;" />
<col style="width:  8%;" />

lazyeval::lazyeval-old
	Lazyeval: a new approach to NSE
HTML
source
R code

lazyeval::lazyeval
	Non-standard evaluation
HTML
source
R code


text:
require 'autoprefixer-rails'

on_stylesheet_saved do |file|
  css = File.read(file)
  map = file + '.map'

  if File.exists? map
    result = AutoprefixerRails.process(css,
    from: file,
    to:   file,
    map:  { prev: File.read(map), inline: false })
    File.open(file, 'w') { |io| io << result.css }
    File.open(map,  'w') { |io| io << result.map }
  else
    File.open(file, 'w') { |io| io << AutoprefixerRails.process(css) }
  end
end

# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "assets/css"
sass_dir = "assets/sass"
images_dir = "assets/img"
javascripts_dir = "assets/js"
# fonts_dir = "fonts"

# output_style = :expanded

# To enable relative paths to assets via compass helper functions. Uncomment:
relative_assets = true

# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
color_output = false

# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
preferred_syntax = :scss
# and then run:
# sass-convert -R --from scss --to sass css scss && rm -rf sass && mv scss sass


text:
package org.apache.kafka.streams.kstream.internals;

import org.apache.kafka.common.serialization.IntegerSerializer;
import org.apache.kafka.common.serialization.Serdes;
import org.apache.kafka.common.serialization.StringSerializer;
import org.apache.kafka.streams.KeyValueTimestamp;
import org.apache.kafka.streams.kstream.Consumed;
import org.apache.kafka.streams.KeyValue;
import org.apache.kafka.streams.StreamsBuilder;
import org.apache.kafka.streams.TopologyTestDriver;
import org.apache.kafka.streams.kstream.KStream;
import org.apache.kafka.streams.kstream.KeyValueMapper;
import org.apache.kafka.streams.TestInputTopic;
import org.apache.kafka.test.MockProcessorSupplier;
import org.apache.kafka.test.StreamsTestUtils;
import org.junit.Test;

import java.time.Duration;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Properties;

import static org.junit.Assert.assertEquals;

public class KStreamFlatMapTest {
    private final Properties props = StreamsTestUtils.getStreamsConfig(Serdes.Integer(), Serdes.String());

    @Test
    public void testFlatMap() {
        final StreamsBuilder builder = new StreamsBuilder();
        final String topicName = "topic";

        final KeyValueMapper<Number, Object, Iterable<KeyValue<String, String>>> mapper =
            (key, value) -> {
                final ArrayList<KeyValue<String, String>> result = new ArrayList<>();
                for (int i = 0; i < key.intValue(); i++) {
                    result.add(KeyValue.pair(Integer.toString(key.intValue() * 10 + i), value.toString()));
                }
                return result;
            };

        final int[] expectedKeys = {0, 1, 2, 3};

        final KStream<Integer, String> stream;
        final MockProcessorSupplier<String, String> supplier;

        supplier = new MockProcessorSupplier<>();
        stream = builder.stream(topicName, Consumed.with(Serdes.Integer(), Serdes.String()));
        stream.flatMap(mapper).process(supplier);

        try (final TopologyTestDriver driver = new TopologyTestDriver(builder.build(), props)) {
            final TestInputTopic<Integer, String> inputTopic =
                    driver.createInputTopic(topicName, new IntegerSerializer(), new StringSerializer(), Instant.ofEpochMilli(0), Duration.ZERO);
            for (final int expectedKey : expectedKeys) {
                inputTopic.pipeInput(expectedKey, "V" + expectedKey);
            }
        }

        assertEquals(6, supplier.theCapturedProcessor().processed().size());

        final KeyValueTimestamp[] expected = {new KeyValueTimestamp<>("10", "V1", 0),
            new KeyValueTimestamp<>("20", "V2", 0),
            new KeyValueTimestamp<>("21", "V2", 0),
            new KeyValueTimestamp<>("30", "V3", 0),
            new KeyValueTimestamp<>("31", "V3", 0),
            new KeyValueTimestamp<>("32", "V3", 0)};

        for (int i = 0; i < expected.length; i++) {
            assertEquals(expected[i], supplier.theCapturedProcessor().processed().get(i));
        }
    }
}


text:
package de.machmireinebook.epubeditor.jsoup.select;

import de.machmireinebook.epubeditor.jsoup.nodes.Node;

/**
 * Depth-first node traversor. Use to iterate through all nodes under and including the specified root node.
 * <p/>
 * This implementation does not use recursion, so a deep DOM does not risk blowing the stack.
 */
public class NodeTraversor {
    private NodeVisitor visitor;

    /**
     * Create a new traversor.
     * @param visitor a class implementing the {@link NodeVisitor} interface, to be called when visiting each node.
     */
    public NodeTraversor(NodeVisitor visitor) {
        this.visitor = visitor;
    }

    /**
     * Start a depth-first traverse of the root and all of its descendants.
     * @param root the root node point to traverse.
     */
    public void traverse(Node root) {
        Node node = root;
        int depth = 0;

        while (node != null) {
            visitor.head(node, depth);
            if (node.childNodeSize() > 0) {
                node = node.childNode(0);
                depth++;
            } else {
                while (node.nextSibling() == null && depth > 0) {
                    visitor.tail(node, depth);
                    node = node.parentNode();
                    depth--;
                }
                visitor.tail(node, depth);
                if (node == root)
                    break;
                node = node.nextSibling();
            }
        }
    }
}


text:
cask "mongotron" do
  version "1.0.0-alpha.5"
  sha256 "b20d014ae3a9355a112f84d98d2f81c27d3f99fd2dd7dc3455be465b27ab1e20"

  url "https://github.com/officert/mongotron/releases/download/#{version}/Mongotron-darwin-x64.zip",
      verified: "github.com/officert/mongotron/"
  appcast "https://github.com/officert/mongotron/releases.atom"
  name "Mongotron"
  desc "Mongo DB management"
  homepage "http://mongotron.io/"

  app "Mongotron-darwin-x64/Mongotron.app"

  zap trash: [
    "~/Library/Application Support/Mongotron",
    "~/Library/Caches/Mongotron",
  ]
end


text:
package org.apache.metamodel.data;

/**
 * Wraps another DataSet and enforces a maximum number of rows constraint
 */
public final class MaxRowsDataSet extends AbstractDataSet implements WrappingDataSet {

    private final DataSet _dataSet;
    private volatile int _rowsLeft;

    public MaxRowsDataSet(DataSet dataSet, int maxRows) {
        super(dataSet);
        _dataSet = dataSet;
        _rowsLeft = maxRows;
    }

    @Override
    public DataSet getWrappedDataSet() {
        return _dataSet;
    }

    @Override
    public void close() {
        _dataSet.close();
    }

    @Override
    public Row getRow() {
        return _dataSet.getRow();
    }

    @Override
    public boolean next() {
        if (_rowsLeft > 0) {
            boolean next = _dataSet.next();
            if (next) {
                _rowsLeft--;
            }
            return next;
        }
        return false;
    }
}


text:
var searchData=
[
  ['uniformsampler',['UniformSampler',['../classdensities_1_1UniformSampler.html',1,'densities']]]
];


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Definition.PointcutAndAdvice (AspectJ(tm) weaver API)
</TITLE>

<META NAME="date" CONTENT="2013-02-15">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

org.aspectj.weaver.loadtime.definition

Class Definition.PointcutAndAdvice

java.lang.Object
  org.aspectj.weaver.loadtime.definition.Definition.PointcutAndAdvice

Enclosing class:
Definition

public static class Definition.PointcutAndAdvice
extends java.lang.Object

Field Summary

 java.lang.String
adviceClass

 Definition.AdviceKind
adviceKind

 java.lang.String
adviceMethod

 java.lang.String
pointcut

Constructor Summary

Definition.PointcutAndAdvice(Definition.AdviceKind adviceKind,
                             java.lang.String pointcut,
                             java.lang.String adviceClass,
                             java.lang.String adviceMethod)

Method Summary

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

adviceKind

public final Definition.AdviceKind adviceKind

pointcut

public final java.lang.String pointcut

adviceClass

public final java.lang.String adviceClass

adviceMethod

public final java.lang.String adviceMethod

Constructor Detail

Definition.PointcutAndAdvice

public Definition.PointcutAndAdvice(Definition.AdviceKind adviceKind,
                                    java.lang.String pointcut,
                                    java.lang.String adviceClass,
                                    java.lang.String adviceMethod)

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
namespace Alsolos.Commons.Wpf.Mvvm
{
    public abstract class ViewModel : BackingFieldsHolder
    {
    }
}


text:
**Map Search** lets you save a map search to dynamically see the results of the search in the map when you turn it on.

Options:
--------------

Name
	The name of the Map Search in the map tree.

Description
	The description of the Map Search, seen on hovering in the map tree.

Transparency
	Percentage transparency by default; 100% is fully transparent.  You can control
	transparency later while viewing; this setting is a default.

Folder
	The containing Folder in the map tree.

.. o __BEGIN_LICENSE__
.. o  Copyright (c) 2015, United States Government, as represented by the
.. o  Administrator of the National Aeronautics and Space Administration.
.. o  All rights reserved.
.. o
.. o  The xGDS platform is licensed under the Apache License, Version 2.0
.. o  (the "License"); you may not use this file except in compliance with the License.
.. o  You may obtain a copy of the License at
.. o  http://www.apache.org/licenses/LICENSE-2.0.
.. o
.. o  Unless required by applicable law or agreed to in writing, software distributed
.. o  under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
.. o  CONDITIONS OF ANY KIND, either express or implied. See the License for the
.. o  specific language governing permissions and limitations under the License.
.. o __END_LICENSE__


text:
Titanium.UI.setBackgroundColor('#FD9627');

var Cloud = require('ti.cloud');
Cloud.debug = true;

if (Ti.App.Properties.hasProperty('isLogged') && Ti.App.Properties.getBool('isLogged'))
{
	Ti.include('main.js');

}
else
{
	Ti.include('login.js');
}


text:
package com.epita.veliba;

import android.content.Context;
import android.content.Intent;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.epita.veliba.service.Station;
import com.epita.veliba.service.StationItem;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

public class StationRecyclerViewAdapter extends RecyclerView.Adapter<StationViewHolder> {

    public static List<Station> mValues = new ArrayList<>();
    public static List<Station> sValues = new ArrayList<>();

    public StationRecyclerViewAdapter() {
        mValues = new ArrayList<>();
        sValues = new ArrayList<>();
    }

    public void setData(List<StationItem> data) {
        mValues.clear();
        int index = 0;
        for (StationItem r : data) {
            mValues.add(new Station(index++, r));
        }
        setSearch("");
    }

    public void setSearch(String query) {
        sValues.clear();

        query = query.trim();
        if (query.isEmpty())
            sValues.addAll(mValues);
        else {
            Pattern pattern = Pattern.compile(Pattern.quote(query), Pattern.CASE_INSENSITIVE);
            for (Station s : mValues) {
                if (pattern.matcher(s.getItem().fields.name).find()) {
                    sValues.add(s);
                }
            }
        }

        notifyDataSetChanged();
    }

    @Override
    public StationViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.station_list_content, parent, false);
        return new StationViewHolder(view);
    }

    @Override
    public void onBindViewHolder(final StationViewHolder holder, int position) {
        holder.mItem = sValues.get(position);
        holder.mContentView.setText(holder.mItem.getItem().fields.name);

        boolean isOpen = holder.mItem.getItem().fields.status.value;
        int color = ContextCompat.getColor(holder.mStatusView.getContext(), isOpen ? R.color.success : R.color.error);
        holder.mStatusView.setColorFilter(color);

        holder.mView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Context context = v.getContext();
                Intent i = new Intent(context, StationDetailActivity.class);
                i.putExtra("itemId", holder.mItem.getId());
                context.startActivity(i);
            }
        });
    }

    @Override
    public int getItemCount() {
        return sValues.size();
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StaticClassArrayExtension
{
    public class Configuration
    {
        public char GetReplacingValue()
        {
            var currentTime = DateTime.Now;
            int digitSum = currentTime.Year / 1000
                + currentTime.Year / 100 % 10
                + currentTime.Year / 10 % 10
                + currentTime.Year % 10
                + currentTime.Month / 10
                + currentTime.Month % 10
                + currentTime.Day / 10
                + currentTime.Day % 10
                + currentTime.Hour / 10
                + currentTime.Hour % 10
                + currentTime.Minute / 10
                + currentTime.Minute % 10
                + currentTime.Second / 10
                + currentTime.Second % 10;

            return (char)(digitSum % 25 + 65);
        }
    }
}


text:
package com.jcommerce.migration.sql;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class SchemaExport {

	public static void main(String[] args) {
		SessionFactory sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
		Session session = sessionFactory.openSession();
		System.out.println(session);
	}

}


text:
define( [
    'qunit',
    'tests/mockup/mockup',
    'osg/Light',
    'osgViewer/Viewer',
    'osg/Shape',
    'osg/Node',
    'osg/CullVisitor',
    'osg/RenderStage',
    'osg/StateGraph',
    'osg/Matrix'
], function ( QUnit, mockup, Light, Viewer, Shape, Node, CullVisitor, RenderStage, StateGraph, Matrix ) {

    'use strict';

    return function () {

        QUnit.module( 'osg' );

        QUnit.test( 'Light', function () {

            ( function () {

                var l0 = new Light();
                l0.setLightNumber( 0 );

                l0.setLightAsPoint();
                deepEqual( l0.getPosition(), [ 0, 0, 0, 1 ] );
                equal( l0.getSpotCutoff(), 180 );
                equal( l0.getLightType(), Light.POINT );

                l0.setLightAsDirection();
                deepEqual( l0.getPosition(), [ 0, 0, 1, 0 ] );
                equal( l0.getLightType(), Light.DIRECTION );

                l0.setLightAsSpot();
                deepEqual( l0.getPosition(), [ 0, 0, 0, 1 ] );
                deepEqual( l0.getDirection(), [ 0, 0, -1 ] );
                equal( l0.getSpotCutoff(), 90 );
                equal( l0.getLightType(), Light.SPOT );

                deepEqual( l0.getAmbient(), [ 0.2, 0.2, 0.2, 1 ] );
                deepEqual( l0.getDiffuse(), [ 0.8, 0.8, 0.8, 1 ] );
                deepEqual( l0.getSpecular(), [ 0.2, 0.2, 0.2, 1 ] );

                equal( l0.getConstantAttenuation(), 1 );
                equal( l0.getLinearAttenuation(), 0 );
                equal( l0.getQuadraticAttenuation(), 0 );

            } )();

            ( function () {
                var canvas = mockup.createCanvas();
                var viewer = new Viewer( canvas );
                viewer.init();

                var l0 = new Light();
                l0.setLightNumber( 0 );
                var l1 = new Light();
                l1.setLightNumber( 1 );

                var q = Shape.createTexturedQuadGeometry( -25, -25, 0,
                    50, 0, 0,
                    0, 50, 0 );

                q.getOrCreateStateSet().setAttributeAndModes( l0 );
                q.getOrCreateStateSet().setAttributeAndModes( l1 );

                var state = viewer.getState();

                var fakeRenderer = mockup.createFakeRenderer();
                fakeRenderer.validateProgram = function () {
                    return true;
                };
                fakeRenderer.getProgramParameter = function () {
                    return true;
                };
                fakeRenderer.isContextLost = function () {
                    return false;
                };
                state.setGraphicContext( fakeRenderer );

                viewer.setSceneData( q );
                viewer.frame();

                mockup.removeCanvas( canvas );
            } )();

            ( function () {
                var canvas = mockup.createCanvas();
                var viewer = new Viewer( canvas );
                viewer.init();
                var root = new Node();
                var node0 = new Node();
                var node1 = new Node();

                root.addChild( node0 );
                root.addChild( node1 );

                var l0 = new Light();
                l0.setLightNumber( 0 );
                l0.setName( 'enableLight0' );
                node0.getOrCreateStateSet().setAttributeAndModes( l0 );

                var l1 = new Light();
                l1.setLightNumber( 1 );
                l1.setName( 'enableLight1' );

                node1.getOrCreateStateSet().setAttributeAndModes( l1 );
                var q = Shape.createTexturedQuadGeometry( -25, -25, 0,
                    50, 0, 0,
                    0, 50, 0 );

                var ld0 = new Light();
                ld0.setLightNumber( 0 );
                ld0.setName( 'disableLight0' );

                var ld1 = new Light();
                ld1.setLightNumber( 1 );
                ld1.setName( 'disableLight1' );

                node0.addChild( q );
                node0.getOrCreateStateSet().setAttributeAndModes( ld1 );

                node1.addChild( q );
                node1.getOrCreateStateSet().setAttributeAndModes( ld0 );
                viewer.frame();

                var cull = viewer.getCamera().getRenderer()._cullVisitor;
                var rs = new RenderStage();
                var sg = new StateGraph();
                cull.pushProjectionMatrix( Matrix.create() );
                cull.pushModelViewMatrix( Matrix.create() );
                cull.setRenderStage( rs );
                cull.setStateGraph( sg );

                root.accept( cull );
                mockup.removeCanvas( canvas );
            } )();

            ok( true, 'check no exception' );
        } );
    };
} );


text:
class IDString;
typedef IDString* IDStringPtr;

class FullPathFileName;
typedef FullPathFileName* FullPathFileNamePtr;

#endif