text:
"""Replay buffers."""

from __future__ import absolute_import
from __future__ import print_function

import random
import numpy as np

class ReplayBuffer():
  """Uniform replay buffer.

  Attributes:
    buffer: buffer where experience is stored
    buffer_size: maximum replay buffer size
  """

  def __init__(self, buffer_size=50000):
    self.buffer = []
    self.buffer_size = buffer_size
    self._delete_frac = 1./buffer_size if buffer_size < 10000 else 0.0001

  def add(self, experience):
    """Store experience in the buffer."""
    self.buffer.append(experience)
    if len(self.buffer) > self.buffer_size:
      self.buffer = self.buffer[int(0.0001 * self.buffer_size):]

  def sample(self, size):
    """Sample a batch of experience with specified batch size."""
    if len(self.buffer) >= size:
      experience_buffer = self.buffer
    else:
      experience_buffer = self.buffer * size
    sample = random.sample(experience_buffer, size)
    sample = np.array(sample)
    return np.copy(sample)


text:
<?php

declare(strict_types=1);

namespace App\Event\Radio;

use App\Entity\Station;
use Symfony\Contracts\EventDispatcher\Event;

class WriteLiquidsoapConfiguration extends Event
{
    protected array $configLines = [];

    public function __construct(
        protected Station $station,
        protected bool $forEditing = false
    ) {
    }

    public function getStation(): Station
    {
        return $this->station;
    }

    public function isForEditing(): bool
    {
        return $this->forEditing;
    }

    /**
     * Append one of more lines to the end of the configuration string.
     *
     * @param array $lines
     */
    public function appendLines(array $lines): void
    {
        $this->configLines = array_merge($this->configLines, [''], $lines);
    }

    public function appendBlock(string $lines): void
    {
        $this->appendLines(explode("\n", $lines));
    }

    /**
     * Prepend one or more lines to the front of the configuration string.
     *
     * @param array $lines
     */
    public function prependLines(array $lines): void
    {
        $this->configLines = array_merge($lines, [''], $this->configLines);
    }

    /**
     * Compile the configuration lines together and return the result.
     */
    public function buildConfiguration(): string
    {
        return implode("\n", $this->configLines);
    }
}

redpajama_set_name: RedPajamaGithub


text:
'use strict';

describeComponent('component/ui/todo-list', function () {

  var trigger, $node;
  var thr = function(msg){
    throw new Error(msg);
  };
  var events = {};
  var event = function(id) { return events[id] || thr('spy for event ' + id + ' has not been registered'); };

  // Initialize the component and attach it to the DOM
  beforeEach(function () {
    this.setupComponent(
        '
'
        + '
'
          + '<input type="text"/>'
          + 'Add'
        + '
'
      + '
');

    events['ui-new-todo-item'] = spyOnEvent(document, 'ui-new-todo-item');
    trigger = this.component.trigger.bind(this.component);
    $node = this.component.$node;
  });

  it('should be defined', function () {
    expect(this.component).toBeDefined();
  });

  it('should list todo items', function(){

    // when:
    trigger('data-todo-items', { items: [
      {description: 'Buy some milk', completed: false},
      {description: 'Walk the dog', completed: true}
    ]});

    // then:
    var items = $node.find('li');
    expect(items[0]).toHaveText('Buy some milk');
    expect(items[0]).not.toHaveClass('completed');
    expect(items[1]).toHaveText('Walk the dog');
    expect(items[1]).toHaveClass('completed');
  });

  it('should update todo items after add', function(){

    // when:
    trigger('data-todo-item-added',
      {description: 'Buy some milk', completed: false}
    );

    // then:
    var items = $node.find('li');
    expect(items[0]).toHaveText('Buy some milk');
    expect(items[0]).not.toHaveClass('completed');
  });

  it('should emit add todo item event', function(){

    // when:
    $node.find('input').val('Buy some milk');
    $node.find('a.js-add-todo-item').click();

    // then:
    expect(event('ui-new-todo-item'))
      .toHaveBeenTriggeredOnAndWith(document, {description: 'Buy some milk'});
  });

});


text:
package com.google.common.collect;

import static com.google.common.truth.Truth.assertThat;
import static java.util.Arrays.asList;

import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Function;
import com.google.common.base.Functions;
import com.google.common.base.Joiner;
import com.google.common.base.Optional;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.testing.IteratorFeature;
import com.google.common.collect.testing.IteratorTester;
import com.google.common.testing.NullPointerTester;

import junit.framework.AssertionFailedError;
import junit.framework.TestCase;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.SortedSet;

import javax.annotation.Nullable;

/**
 * Unit test for {@link FluentIterable}.
 *
 * @author Marcin Mikosik
 */
@GwtCompatible(emulated = true)
public class FluentIterableTest extends TestCase {

  @GwtIncompatible("NullPointerTester")
  public void testNullPointerExceptions() {
    NullPointerTester tester = new NullPointerTester();
    tester.testAllPublicStaticMethods(FluentIterable.class);
  }

  public void testFrom() {
    assertEquals(ImmutableList.of(1, 2, 3, 4),
        Lists.newArrayList(FluentIterable.from(ImmutableList.of(1, 2, 3, 4))));
  }

  @SuppressWarnings("deprecation") // test of deprecated method
  public void testFrom_alreadyFluentIterable() {
    FluentIterable<Integer> iterable = FluentIterable.from(asList(1));
    assertSame(iterable, FluentIterable.from(iterable));
  }

  public void testOfArray() {
    assertEquals(ImmutableList.of("1", "2", "3", "4"),
        Lists.newArrayList(FluentIterable.of(new Object[] {"1", "2", "3", "4"})));
  }

  public void testSize1Collection() {
    assertEquals(1, FluentIterable.from(asList("a")).size());
  }

  public void testSize2NonCollection() {
    Iterable<Integer> iterable = new Iterable<Integer>() {
      @Override
      public Iterator<Integer> iterator() {
        return asList(0, 1).iterator();
      }
    };
    assertEquals(2, FluentIterable.from(iterable).size());
  }

  public void testSize_collectionDoesntIterate() {
    List<Integer> nums = asList(1, 2, 3, 4, 5);
    List<Integer> collection = new ArrayList<Integer>(nums) {
      @Override public Iterator<Integer> iterator() {
        throw new AssertionFailedError("Don't iterate me!");
      }
    };
    assertEquals(5, FluentIterable.from(collection).size());
  }

  public void testContains_nullSetYes() {
    Iterable<String> set = Sets.newHashSet("a", null, "b");
    assertTrue(FluentIterable.from(set).contains(null));
  }

  public void testContains_nullSetNo() {
    Iterable<String> set = ImmutableSortedSet.of("a", "b");
    assertFalse(FluentIterable.from(set).contains(null));
  }

  public void testContains_nullIterableYes() {
    Iterable<String> iterable = iterable("a", null, "b");
    assertTrue(FluentIterable.from(iterable).contains(null));
  }

  public void testContains_nullIterableNo() {
    Iterable<String> iterable = iterable("a", "b");
    assertFalse(FluentIterable.from(iterable).contains(null));
  }

  public void testContains_nonNullSetYes() {
    Iterable<String> set = Sets.newHashSet("a", null, "b");
    assertTrue(FluentIterable.from(set).contains("b"));
  }

  public void testContains_nonNullSetNo() {
    Iterable<String> set = Sets.newHashSet("a", "b");
    assertFalse(FluentIterable.from(set).contains("c"));
  }

  public void testContains_nonNullIterableYes() {
    Iterable<String> set = iterable("a", null, "b");
    assertTrue(FluentIterable.from(set).contains("b"));
  }

  public void testContains_nonNullIterableNo() {
    Iterable<String> iterable = iterable("a", "b");
    assertFalse(FluentIterable.from(iterable).contains("c"));
  }

  public void testCycle() {
    FluentIterable<String> cycle = FluentIterable.from(asList("a", "b")).cycle();

    int howManyChecked = 0;
    for (String string : cycle) {
      String expected = (howManyChecked % 2 == 0) ? "a" : "b";
      assertEquals(expected, string);
      if (howManyChecked++ == 5) {
        break;
      }
    }

    // We left the last iterator pointing to "b". But a new iterator should
    // always point to "a".
    assertEquals("a", cycle.iterator().next());
  }

  public void testCycle_removingAllElementsStopsCycle() {
    FluentIterable<Integer> cycle = fluent(1, 2).cycle();
    Iterator<Integer> iterator = cycle.iterator();
    iterator.next();
    iterator.remove();
    iterator.next();
    iterator.remove();
    assertFalse(iterator.hasNext());
    assertFalse(cycle.iterator().hasNext());
  }

  public void testAppend() {
    FluentIterable<Integer> result =
        FluentIterable.<Integer>from(asList(1, 2, 3)).append(Lists.newArrayList(4, 5, 6));
    assertEquals(asList(1, 2, 3, 4, 5, 6), Lists.newArrayList(result));
    assertEquals("[1, 2, 3, 4, 5, 6]", result.toString());

    result = FluentIterable.<Integer>from(asList(1, 2, 3)).append(4, 5, 6);
    assertEquals(asList(1, 2, 3, 4, 5, 6), Lists.newArrayList(result));
    assertEquals("[1, 2, 3, 4, 5, 6]", result.toString());
  }

  public void testAppend_emptyList() {
    FluentIterable<Integer> result =
        FluentIterable.<Integer>from(asList(1, 2, 3)).append(Lists.<Integer>newArrayList());
    assertEquals(asList(1, 2, 3), Lists.newArrayList(result));
  }

  @SuppressWarnings("ReturnValueIgnored")
  public void testAppend_nullPointerException() {
    try {
      FluentIterable.<Integer>from(asList(1, 2)).append((List<Integer>) null);
      fail("Appending null iterable should throw NPE.");
    } catch (NullPointerException expected) {
    }
  }

  /*
   * Tests for partition(int size) method.
   */

  /*
   * Tests for partitionWithPadding(int size) method.
   */

  public void testFilter() {
    FluentIterable<String> filtered =
        FluentIterable.from(asList("foo", "bar")).filter(Predicates.equalTo("foo"));

    List<String> expected = Collections.singletonList("foo");
    List<String> actual = Lists.newArrayList(filtered);
    assertEquals(expected, actual);
    assertCanIterateAgain(filtered);
    assertEquals("[foo]", filtered.toString());
  }

  private static class TypeA {}
  private interface TypeB {}
  private static class HasBoth extends TypeA implements TypeB {}

  @GwtIncompatible("Iterables.filter(Iterable, Class)")
  public void testFilterByType() throws Exception {
    HasBoth hasBoth = new HasBoth();
    FluentIterable<TypeA> alist =
        FluentIterable.from(asList(new TypeA(), new TypeA(), hasBoth, new TypeA()));
    Iterable<TypeB> blist = alist.filter(TypeB.class);
    assertThat(blist).containsExactly(hasBoth).inOrder();
  }

  public void testAnyMatch() {
    ArrayList<String> list = Lists.newArrayList();
    FluentIterable<String> iterable = FluentIterable.<String>from(list);
    Predicate<String> predicate = Predicates.equalTo("pants");

    assertFalse(iterable.anyMatch(predicate));
    list.add("cool");
    assertFalse(iterable.anyMatch(predicate));
    list.add("pants");
    assertTrue(iterable.anyMatch(predicate));
  }

  public void testAllMatch() {
    List<String> list = Lists.newArrayList();
    FluentIterable<String> iterable = FluentIterable.<String>from(list);
    Predicate<String> predicate = Predicates.equalTo("cool");

    assertTrue(iterable.allMatch(predicate));
    list.add("cool");
    assertTrue(iterable.allMatch(predicate));
    list.add("pants");
    assertFalse(iterable.allMatch(predicate));
  }

  public void testFirstMatch() {
    FluentIterable<String> iterable = FluentIterable.from(Lists.newArrayList("cool", "pants"));
    assertEquals(Optional.of("cool"), iterable.firstMatch(Predicates.equalTo("cool")));
    assertEquals(Optional.of("pants"), iterable.firstMatch(Predicates.equalTo("pants")));
    assertEquals(Optional.absent(), iterable.firstMatch(Predicates.alwaysFalse()));
    assertEquals(Optional.of("cool"), iterable.firstMatch(Predicates.alwaysTrue()));
  }

  private static final class IntegerValueOfFunction implements Function<String, Integer> {
    @Override
    public Integer apply(String from) {
      return Integer.valueOf(from);
    }
  }

  public void testTransformWith() {
    List<String> input = asList("1", "2", "3");
    Iterable<Integer> iterable =
        FluentIterable.from(input).transform(new IntegerValueOfFunction());

    assertEquals(asList(1, 2, 3), Lists.newArrayList(iterable));
    assertCanIterateAgain(iterable);
    assertEquals("[1, 2, 3]", iterable.toString());
  }

  public void testTransformWith_poorlyBehavedTransform() {
    List<String> input = asList("1", null, "3");
    Iterable<Integer> iterable =
        FluentIterable.from(input).transform(new IntegerValueOfFunction());

    Iterator<Integer> resultIterator = iterable.iterator();
    resultIterator.next();

    try {
      resultIterator.next();
      fail("Transforming null to int should throw NumberFormatException");
    } catch (NumberFormatException expected) {
    }
  }

  private static final class StringValueOfFunction implements Function<Integer, String> {
    @Override
    public String apply(Integer from) {
      return String.valueOf(from);
    }
  }

  public void testTransformWith_nullFriendlyTransform() {
    List<Integer> input = asList(1, 2, null, 3);
    Iterable<String> result = FluentIterable.from(input).transform(new StringValueOfFunction());

    assertEquals(asList("1", "2", "null", "3"), Lists.newArrayList(result));
  }

  private static final class RepeatedStringValueOfFunction
      implements Function<Integer, List<String>> {
    @Override
    public List<String> apply(Integer from) {
      String value = String.valueOf(from);
      return ImmutableList.of(value, value);
    }
  }

  public void testTransformAndConcat() {
    List<Integer> input = asList(1, 2, 3);
    Iterable<String> result =
        FluentIterable.from(input).transformAndConcat(new RepeatedStringValueOfFunction());
    assertEquals(asList("1", "1", "2", "2", "3", "3"), Lists.newArrayList(result));
  }

  private static final class RepeatedStringValueOfWildcardFunction
      implements Function<Integer, List<? extends String>> {
    @Override
    public List<String> apply(Integer from) {
      String value = String.valueOf(from);
      return ImmutableList.of(value, value);
    }
  }

  public void testTransformAndConcat_wildcardFunctionGenerics() {
    List<Integer> input = asList(1, 2, 3);
    FluentIterable.from(input).transformAndConcat(new RepeatedStringValueOfWildcardFunction());
  }

  public void testFirst_list() {
    List<String> list = Lists.newArrayList("a", "b", "c");
    assertEquals("a", FluentIterable.from(list).first().get());
  }

  public void testFirst_null() {
    List<String> list = Lists.newArrayList(null, "a", "b");
    try {
      FluentIterable.from(list).first();
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testFirst_emptyList() {
    List<String> list = Collections.emptyList();
    assertEquals(Optional.absent(), FluentIterable.from(list).first());
  }

  public void testFirst_sortedSet() {
    SortedSet<String> sortedSet = ImmutableSortedSet.of("b", "c", "a");
    assertEquals("a", FluentIterable.from(sortedSet).first().get());
  }

  public void testFirst_emptySortedSet() {
    SortedSet<String> sortedSet = ImmutableSortedSet.of();
    assertEquals(Optional.absent(), FluentIterable.from(sortedSet).first());
  }

  public void testFirst_iterable() {
    Set<String> set = ImmutableSet.of("a", "b", "c");
    assertEquals("a", FluentIterable.from(set).first().get());
  }

  public void testFirst_emptyIterable() {
    Set<String> set = Sets.newHashSet();
    assertEquals(Optional.absent(), FluentIterable.from(set).first());
  }

  public void testLast_list() {
    List<String> list = Lists.newArrayList("a", "b", "c");
    assertEquals("c", FluentIterable.from(list).last().get());
  }

  public void testLast_null() {
    List<String> list = Lists.newArrayList("a", "b", null);
    try {
      FluentIterable.from(list).last();
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testLast_emptyList() {
    List<String> list = Collections.emptyList();
    assertEquals(Optional.absent(), FluentIterable.from(list).last());
  }

  public void testLast_sortedSet() {
    SortedSet<String> sortedSet = ImmutableSortedSet.of("b", "c", "a");
    assertEquals("c", FluentIterable.from(sortedSet).last().get());
  }

  public void testLast_emptySortedSet() {
    SortedSet<String> sortedSet = ImmutableSortedSet.of();
    assertEquals(Optional.absent(), FluentIterable.from(sortedSet).last());
  }

  public void testLast_iterable() {
    Set<String> set = ImmutableSet.of("a", "b", "c");
    assertEquals("c", FluentIterable.from(set).last().get());
  }

  public void testLast_emptyIterable() {
    Set<String> set = Sets.newHashSet();
    assertEquals(Optional.absent(), FluentIterable.from(set).last());
  }

  public void testSkip_simple() {
    Collection<String> set = ImmutableSet.of("a", "b", "c", "d", "e");
    assertEquals(Lists.newArrayList("c", "d", "e"),
        Lists.newArrayList(FluentIterable.from(set).skip(2)));
    assertEquals("[c, d, e]", FluentIterable.from(set).skip(2).toString());
  }

  public void testSkip_simpleList() {
    Collection<String> list = Lists.newArrayList("a", "b", "c", "d", "e");
    assertEquals(Lists.newArrayList("c", "d", "e"),
        Lists.newArrayList(FluentIterable.from(list).skip(2)));
    assertEquals("[c, d, e]", FluentIterable.from(list).skip(2).toString());
  }

  public void testSkip_pastEnd() {
    Collection<String> set = ImmutableSet.of("a", "b");
    assertEquals(Collections.emptyList(), Lists.newArrayList(FluentIterable.from(set).skip(20)));
  }

  public void testSkip_pastEndList() {
    Collection<String> list = Lists.newArrayList("a", "b");
    assertEquals(Collections.emptyList(), Lists.newArrayList(FluentIterable.from(list).skip(20)));
  }

  public void testSkip_skipNone() {
    Collection<String> set = ImmutableSet.of("a", "b");
    assertEquals(Lists.newArrayList("a", "b"),
        Lists.newArrayList(FluentIterable.from(set).skip(0)));
  }

  public void testSkip_skipNoneList() {
    Collection<String> list = Lists.newArrayList("a", "b");
    assertEquals(Lists.newArrayList("a", "b"),
        Lists.newArrayList(FluentIterable.from(list).skip(0)));
  }

  public void testSkip_iterator() throws Exception {
    new IteratorTester<Integer>(5, IteratorFeature.MODIFIABLE, Lists.newArrayList(2, 3),
        IteratorTester.KnownOrder.KNOWN_ORDER) {
      @Override protected Iterator<Integer> newTargetIterator() {
        Collection<Integer> collection = Sets.newLinkedHashSet();
        Collections.addAll(collection, 1, 2, 3);
        return FluentIterable.from(collection).skip(1).iterator();
      }
    }.test();
  }

  public void testSkip_iteratorList() throws Exception {
    new IteratorTester<Integer>(5, IteratorFeature.MODIFIABLE, Lists.newArrayList(2, 3),
        IteratorTester.KnownOrder.KNOWN_ORDER) {
      @Override protected Iterator<Integer> newTargetIterator() {
        return FluentIterable.from(Lists.newArrayList(1, 2, 3)).skip(1).iterator();
      }
    }.test();
  }

  public void testSkip_nonStructurallyModifiedList() throws Exception {
    List<String> list = Lists.newArrayList("a", "b", "c");
    FluentIterable<String> tail = FluentIterable.from(list).skip(1);
    Iterator<String> tailIterator = tail.iterator();
    list.set(2, "c2");
    assertEquals("b", tailIterator.next());
    assertEquals("c2", tailIterator.next());
    assertFalse(tailIterator.hasNext());
  }

  public void testSkip_structurallyModifiedSkipSome() throws Exception {
    Collection<String> set = Sets.newLinkedHashSet();
    Collections.addAll(set, "a", "b", "c");
    FluentIterable<String> tail = FluentIterable.from(set).skip(1);
    set.remove("b");
    set.addAll(Lists.newArrayList("X", "Y", "Z"));
    assertThat(tail).containsExactly("c", "X", "Y", "Z").inOrder();
  }

  public void testSkip_structurallyModifiedSkipSomeList() throws Exception {
    List<String> list = Lists.newArrayList("a", "b", "c");
    FluentIterable<String> tail = FluentIterable.from(list).skip(1);
    list.subList(1, 3).clear();
    list.addAll(0, Lists.newArrayList("X", "Y", "Z"));
    assertThat(tail).containsExactly("Y", "Z", "a").inOrder();
  }

  public void testSkip_structurallyModifiedSkipAll() throws Exception {
    Collection<String> set = Sets.newLinkedHashSet();
    Collections.addAll(set, "a", "b", "c");
    FluentIterable<String> tail = FluentIterable.from(set).skip(2);
    set.remove("a");
    set.remove("b");
    assertFalse(tail.iterator().hasNext());
  }

  public void testSkip_structurallyModifiedSkipAllList() throws Exception {
    List<String> list = Lists.newArrayList("a", "b", "c");
    FluentIterable<String> tail = FluentIterable.from(list).skip(2);
    list.subList(0, 2).clear();
    assertThat(tail).isEmpty();
  }

  @SuppressWarnings("ReturnValueIgnored")
  public void testSkip_illegalArgument() {
    try {
      FluentIterable.from(asList("a", "b", "c")).skip(-1);
      fail("Skipping negative number of elements should throw IllegalArgumentException.");
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testLimit() {
    Iterable<String> iterable = Lists.newArrayList("foo", "bar", "baz");
    FluentIterable<String> limited = FluentIterable.from(iterable).limit(2);

    assertEquals(ImmutableList.of("foo", "bar"), Lists.newArrayList(limited));
    assertCanIterateAgain(limited);
    assertEquals("[foo, bar]", limited.toString());
  }

  @SuppressWarnings("ReturnValueIgnored")
  public void testLimit_illegalArgument() {
    try {
      FluentIterable.from(Lists.newArrayList("a", "b", "c")).limit(-1);
      fail("Passing negative number to limit(...) method should throw IllegalArgumentException");
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testIsEmpty() {
    assertTrue(FluentIterable.<String>from(Collections.<String>emptyList()).isEmpty());
    assertFalse(FluentIterable.<String>from(Lists.newArrayList("foo")).isEmpty());
  }

  public void testToList() {
    assertEquals(Lists.newArrayList(1, 2, 3, 4), fluent(1, 2, 3, 4).toList());
  }

  public void testToList_empty() {
    assertTrue(fluent().toList().isEmpty());
  }

  public void testToSortedList_withComparator() {
    assertEquals(Lists.newArrayList(4, 3, 2, 1),
        fluent(4, 1, 3, 2).toSortedList(Ordering.<Integer>natural().reverse()));
  }

  public void testToSortedList_withDuplicates() {
    assertEquals(Lists.newArrayList(4, 3, 1, 1),
        fluent(1, 4, 1, 3).toSortedList(Ordering.<Integer>natural().reverse()));
  }

  public void testToSet() {
    assertThat(fluent(1, 2, 3, 4).toSet()).containsExactly(1, 2, 3, 4).inOrder();
  }

  public void testToSet_removeDuplicates() {
    assertThat(fluent(1, 2, 1, 2).toSet()).containsExactly(1, 2).inOrder();
  }

  public void testToSet_empty() {
    assertTrue(fluent().toSet().isEmpty());
  }

  public void testToSortedSet() {
    assertThat(fluent(1, 4, 2, 3).toSortedSet(Ordering.<Integer>natural().reverse()))
        .containsExactly(4, 3, 2, 1).inOrder();
  }

  public void testToSortedSet_removeDuplicates() {
    assertThat(fluent(1, 4, 1, 3).toSortedSet(Ordering.<Integer>natural().reverse()))
        .containsExactly(4, 3, 1).inOrder();
  }

  public void testToMap() {
    assertThat(fluent(1, 2, 3).toMap(Functions.toStringFunction()).entrySet())
        .containsExactly(
            Maps.immutableEntry(1, "1"),
            Maps.immutableEntry(2, "2"),
            Maps.immutableEntry(3, "3")).inOrder();
  }

  public void testToMap_nullKey() {
    try {
      fluent(1, null, 2).toMap(Functions.constant("foo"));
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testToMap_nullValue() {
    try {
      fluent(1, 2, 3).toMap(Functions.constant(null));
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testIndex() {
    ImmutableListMultimap<Integer, String> expected =
        ImmutableListMultimap.<Integer, String>builder()
            .putAll(3, "one", "two")
            .put(5, "three")
            .put(4, "four")
            .build();
    ImmutableListMultimap<Integer, String> index =
        FluentIterable.from(asList("one", "two", "three", "four")).index(
            new Function<String, Integer>() {
              @Override
              public Integer apply(String input) {
                return input.length();
              }
            });
    assertEquals(expected, index);
  }

  public void testIndex_nullKey() {
    try {
      fluent(1, 2, 3).index(Functions.constant(null));
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testIndex_nullValue() {
    try {
      fluent(1, null, 2).index(Functions.constant("foo"));
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testUniqueIndex() {
    ImmutableMap<Integer, String> expected =
        ImmutableMap.of(3, "two", 5, "three", 4, "four");
    ImmutableMap<Integer, String> index =
        FluentIterable.from(asList("two", "three", "four")).uniqueIndex(
            new Function<String, Integer>() {
              @Override
              public Integer apply(String input) {
                return input.length();
              }
            });
    assertEquals(expected, index);
  }

  public void testUniqueIndex_duplicateKey() {
    try {
      FluentIterable.from(asList("one", "two", "three", "four")).uniqueIndex(
          new Function<String, Integer>() {
            @Override
            public Integer apply(String input) {
              return input.length();
            }
          });
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }

  public void testUniqueIndex_nullKey() {
    try {
      fluent(1, 2, 3).uniqueIndex(Functions.constant(null));
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testUniqueIndex_nullValue() {
    try {
      fluent(1, null, 2).uniqueIndex(new Function<Integer, Object>() {
        @Override
        public Object apply(@Nullable Integer input) {
          return String.valueOf(input);
        }
      });
      fail();
    } catch (NullPointerException expected) {
    }
  }

  public void testCopyInto_List() {
    assertThat(fluent(1, 3, 5).copyInto(Lists.newArrayList(1, 2)))
        .containsExactly(1, 2, 1, 3, 5).inOrder();
  }

  public void testCopyInto_Set() {
    assertThat(fluent(1, 3, 5).copyInto(Sets.newHashSet(1, 2)))
        .containsExactly(1, 2, 3, 5);
  }

  public void testCopyInto_SetAllDuplicates() {
    assertThat(fluent(1, 3, 5).copyInto(Sets.newHashSet(1, 2, 3, 5)))
        .containsExactly(1, 2, 3, 5);
  }

  public void testCopyInto_NonCollection() {
    final ArrayList<Integer> list = Lists.newArrayList(1, 2, 3);

    final ArrayList<Integer> iterList = Lists.newArrayList(9, 8, 7);
    Iterable<Integer> iterable = new Iterable<Integer>() {
      @Override
      public Iterator<Integer> iterator() {
        return iterList.iterator();
      }
    };

    assertThat(FluentIterable.from(iterable).copyInto(list))
        .containsExactly(1, 2, 3, 9, 8, 7).inOrder();
  }

  public void testJoin() {
    assertEquals("2,1,3,4", fluent(2, 1, 3, 4).join(Joiner.on(",")));
  }

  public void testJoin_empty() {
    assertEquals("", fluent().join(Joiner.on(",")));
  }

  public void testGet() {
    assertEquals("a", FluentIterable
        .from(Lists.newArrayList("a", "b", "c")).get(0));
    assertEquals("b", FluentIterable
        .from(Lists.newArrayList("a", "b", "c")).get(1));
    assertEquals("c", FluentIterable
        .from(Lists.newArrayList("a", "b", "c")).get(2));
  }

  public void testGet_outOfBounds() {
    try {
      FluentIterable.from(Lists.newArrayList("a", "b", "c")).get(-1);
      fail();
    } catch (IndexOutOfBoundsException expected) {
    }

    try {
      FluentIterable.from(Lists.newArrayList("a", "b", "c")).get(3);
      fail();
    } catch (IndexOutOfBoundsException expected) {
    }
  }

  private static void assertCanIterateAgain(Iterable<?> iterable) {
    for (@SuppressWarnings("unused") Object obj : iterable) {
    }
  }

  private static FluentIterable<Integer> fluent(Integer... elements) {
    return FluentIterable.from(Lists.newArrayList(elements));
  }

  private static Iterable<String> iterable(String... elements) {
    final List<String> list = asList(elements);
    return new Iterable<String>() {
      @Override
      public Iterator<String> iterator() {
        return list.iterator();
      }
    };
  }
}


text:
<?php

namespace ERede\Acquiring\Mapper;

class CancelRequestMapperTest extends \ERede\Acquiring\TestCase {

  public function testTIDMap() {

    $expected         = "123456";

    $mapper           = new CancelRequestMapper("123", "456");
    $data             = array("tid" => "123456");
    $request          = $mapper->map($data);

    $this->assertEquals($expected, $request->Tid);

  }

}


text:
package ch.demo.dom;

import org.junit.Assert;
import org.junit.Test;

public class AddressTest {

	@Test
	public void shouldToStringHaveTheRightform() throws Exception {
		Address a = new Address();
		a.setCity("Mulhouse");
		a.setNumber("10");
		a.setPostalCode("68100");
		a.setStreet("Large");

		Assert.assertEquals("a.toString()", "Address [number=10, street=Large, postalCode=68100, city=Mulhouse]",
				a.toString());
	}
}


text:
//  -*- C++ -*-

/*
 * Copyright (C) 1990,91,92   Silicon Graphics, Inc.
 *
 _______________________________________________________________________
 ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
 |
 |   $Revision: 1.1.1.1 $
 |
 |   Description:
 |	This file #includes ALL sensor classes.  It is provided as a
 |	convenience (but you will get faster compiles if you avoid
 |	using it!)
 |
 |   Author(s)		: Gabin Bell
 |
 ______________  S I L I C O N   G R A P H I C S   I N C .  ____________
 _______________________________________________________________________
 */

#ifndef  _SO_SENSORS_
#define  _SO_SENSORS_

#include <Inventor/sensors/SoAlarmSensor.h>
#include <Inventor/sensors/SoDataSensor.h>
#include <Inventor/sensors/SoDelayQueueSensor.h>
#include <Inventor/sensors/SoFieldSensor.h>
#include <Inventor/sensors/SoIdleSensor.h>
#include <Inventor/sensors/SoNodeSensor.h>
#include <Inventor/sensors/SoOneShotSensor.h>
#include <Inventor/sensors/SoPathSensor.h>
#include <Inventor/sensors/SoSensor.h>
#include <Inventor/sensors/SoSensorManager.h>
#include <Inventor/sensors/SoTimerQueueSensor.h>
#include <Inventor/sensors/SoTimerSensor.h>

#endif  /* _SO_SENSORS_ */


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AspNetMVCTaskBoard.ViewModels;

namespace AspNetMVCTaskBoard.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            var model = new TaskBoardViewModel();

            return View(model);
        }

        public ActionResult About()
        {
            ViewBag.Message = "Your application description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult TaskModal()
        {
            return PartialView("TaskModal");
        }
    }
}


text:
package multibot

import (
	"fmt"
	"time"

	"github.com/tb0hdan/torpedo_registry"
)

func (tb *TorpedoBot) StoreMessageHistory(api *TorpedoBotAPI, channel interface{}, incoming_message string) {
	session, collection, err := tb.Database.GetCollection("chatHistory")
	defer session.Close()
	if err != nil {
		tb.logger.Fatal("Could not connect to database: %+v\n", err)
	}
	err = collection.Insert(&torpedo_registry.MessageHistoryItem{Timestamp: int64(time.Now().Unix()), Channel: fmt.Sprintf("%v", channel),
		Sender: api.UserProfile.ID, Message: incoming_message, Nick: api.UserProfile.Nick})
	if err != nil {
		tb.logger.Fatal(err)
	}
	tb.logger.Printf("%v - %s - %s\n", channel, api.UserProfile.ID, incoming_message)
	return
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>JSDoc: Index</title>

    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">

Index

Index

Classes

Board

Character

Game

Renderer

Global

examine

flipSwitch

isComplete

isDangerous

isSwitchOn

isWall

move

pickUp

    Documentation generated by JSDoc 3.3.0-dev on Sun Jun 22 2014 18:20:39 GMT-0400 (EDT)


text:
cask 'discord' do
  version '0.0.250'
  sha256 '85a0a722ceba54e368bab9d231f9ac92977fa1c7319339f4ac80596c6e8a2bac'

  url "https://cdn.discordapp.com/apps/osx/#{version}/Discord.dmg"
  appcast 'https://discordapp.com/api/stable/updates?platform=osx',
          checkpoint: '0bca6e26a844f761d56ba49d709170a02930f24942809728452e6a8179a94c07'
  name 'Discord'
  homepage 'https://discordapp.com/'

  auto_updates true

  app 'Discord.app'

  zap trash: [
               '~/Library/Application Support/discord',
               '~/Library/Caches/com.hnc.Discord',
               '~/Library/Caches/com.hnc.Discord.ShipIt',
               '~/Library/Cookies/com.hnc.Discord.binarycookies',
               '~/Library/Preferences/com.hnc.Discord.helper.plist',
               '~/Library/Preferences/com.hnc.Discord.plist',
               '~/Library/Saved Application State/com.hnc.Discord.savedState',
             ]
end


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="edu.gcc.whiletrue.pingit.RegisterFragment"
    tools:showIn="@id/startup_fragment_container"
    android:id="@+id/fragment_login"
    android:orientation="vertical">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/scrollView2">

        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="50dp">

            <ImageView
                android:layout_width="80dp"
                android:layout_height="80dp"
                android:id="@+id/imageView"
                android:layout_gravity="center_horizontal"
                android:src="@mipmap/ic_launcher"
                android:layout_marginBottom="10dp" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textEmailAddress"
                android:singleLine="true"
                android:ems="10"
                android:id="@+id/loginEmailTxt"
                android:layout_gravity="center_horizontal"
                android:layout_marginBottom="10dp"
                android:hint="@string/registerEmailPlaceholder" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textPassword"
                android:singleLine="true"
                android:ems="10"
                android:id="@+id/loginPasswordTxt"
                android:layout_gravity="center_horizontal"
                android:layout_marginBottom="10dp"
                android:hint="@string/registerPasswordPlaceholder" />

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:weightSum="3">

                <Button
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/loginBtn"
                    android:id="@+id/loginBtn"
                    android:layout_weight="1"
                    android:layout_marginLeft="20dp"
                    android:layout_marginRight="20dp"
                    android:background="@color/colorPrimary"
                    android:textColor="@android:color/white" />

            </LinearLayout>

        </LinearLayout>
    </ScrollView>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/loginSwitchToRegisterBtn"
            android:id="@+id/switchToRegisterBtn"
            android:layout_gravity="bottom|center_horizontal"
            android:background="@color/colorDarkGray"
            android:textColor="@android:color/white" />
    </FrameLayout>

</LinearLayout>


text:
function  CBIG_IndCBM_check_example_results(output_dir)

% CBIG_IndCBM_check_example_results(output_dir)
%
% This function checks if the generated example results are identical with
% the reference files.
%
% Input:
%   - output_dir: The output directory with generated example results.
%
% Written by XUE Aihuiping and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md

CBIG_CODE_DIR = getenv('CBIG_CODE_DIR');

ref_dir = fullfile(CBIG_CODE_DIR, 'stable_projects', ...
    'brain_parcellation', 'Xue2021_IndCerebellum', 'examples', 'ref_output');

ref_sub1 = ft_read_cifti(fullfile(ref_dir, 'sub1', 'IndCBM_parcellation_top100.dlabel.nii'));
ref_sub2 = ft_read_cifti(fullfile(ref_dir, 'sub2', 'IndCBM_parcellation_top100.dlabel.nii'));

new_sub1 = ft_read_cifti(fullfile(output_dir, 'parcellation', 'sub1', 'IndCBM_parcellation_top100.dlabel.nii'));
new_sub2 = ft_read_cifti(fullfile(output_dir, 'parcellation', 'sub2', 'IndCBM_parcellation_top100.dlabel.nii'));

diff_sub1 = sum(ref_sub1.dscalar ~= new_sub1.dscalar);
diff_sub2 = sum(ref_sub2.dscalar ~= new_sub2.dscalar);

assert(diff_sub1 == 0, sprintf('%d labels are different for subject 1 ', diff_sub1));
assert(diff_sub2 == 0, sprintf('%d labels are different for subject 1 ', diff_sub2));
fprintf('Your example results are correct!\n')
fclose('all');

end


text:
import os
from setuptools import find_packages, setup

with open(os.path.join(os.path.dirname(__file__), 'README.md')) as README:
    README = README.read()

os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

CLASSIFIERS = [
    'Environment :: Web Environment',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: BSD License',
    'Operating System :: OS Independent',
    'Programming Language :: Python',
    'Programming Language :: Python :: 3.6',
    'Framework :: Django',
    'Framework :: Django :: 1.10.5',
]

INSTALL_REQUIREMENTS = [
    'Django>=1.10.5',
    'django-webpack-loader>=0.4.1',
    'easy_thumbnails>=2.3',
    'django-filer>=1.2.6',
    'django-mptt>=0.8.7',
    'django-crispy-forms>=1.6.1',
    'django-storages>=1.5.2',
    'djangorestframework>=3.6.3'
]

setup(
    name='django-simplestore',
    version='0.0.1',
    packages=find_packages(),
    include_package_data=True,
    license='MIT',
    description='Simple and tested app that can be taken as a starting point for extending and building custom '
                'ecommerce site with Python / Django.',
    long_description=README,
    url='https://github.com/martinstastny/django-simple-ecommerce',
    author='Martin Stastny',
    author_email='me@martinstastny.cz',
    classifiers=CLASSIFIERS,
    install_requires=INSTALL_REQUIREMENTS
)


text:
package com.google.cloud.networkconnectivity.v1.samples;

// [START networkconnectivity_v1_generated_HubService_DeleteSpoke_LRO_async]
import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.networkconnectivity.v1.DeleteSpokeRequest;
import com.google.cloud.networkconnectivity.v1.HubServiceClient;
import com.google.cloud.networkconnectivity.v1.OperationMetadata;
import com.google.cloud.networkconnectivity.v1.SpokeName;
import com.google.protobuf.Empty;

public class AsyncDeleteSpokeLRO {

  public static void main(String[] args) throws Exception {
    asyncDeleteSpokeLRO();
  }

  public static void asyncDeleteSpokeLRO() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (HubServiceClient hubServiceClient = HubServiceClient.create()) {
      DeleteSpokeRequest request =
          DeleteSpokeRequest.newBuilder()
              .setName(SpokeName.of("[PROJECT]", "[LOCATION]", "[SPOKE]").toString())
              .setRequestId("requestId693933066")
              .build();
      OperationFuture<Empty, OperationMetadata> future =
          hubServiceClient.deleteSpokeOperationCallable().futureCall(request);
      // Do something.
      future.get();
    }
  }
}
// [END networkconnectivity_v1_generated_HubService_DeleteSpoke_LRO_async]


text:
System.register(["angular2/src/facade/lang", "angular2/src/facade/collection", "angular2/src/dom/dom_adapter", "./xhr/xhr", "angular2/src/core/annotations/template", "./url_resolver"], function($__export) {
  "use strict";
  var isBlank,
      isPresent,
      BaseException,
      stringify,
      Map,
      MapWrapper,
      StringMapWrapper,
      StringMap,
      DOM,
      XHR,
      Template,
      UrlResolver,
      TemplateLoader;
  return {
    setters: [function($__m) {
      isBlank = $__m.isBlank;
      isPresent = $__m.isPresent;
      BaseException = $__m.BaseException;
      stringify = $__m.stringify;
    }, function($__m) {
      Map = $__m.Map;
      MapWrapper = $__m.MapWrapper;
      StringMapWrapper = $__m.StringMapWrapper;
      StringMap = $__m.StringMap;
    }, function($__m) {
      DOM = $__m.DOM;
    }, function($__m) {
      XHR = $__m.XHR;
    }, function($__m) {
      Template = $__m.Template;
    }, function($__m) {
      UrlResolver = $__m.UrlResolver;
    }],
    execute: function() {
      TemplateLoader = $__export("TemplateLoader", (function() {
        var TemplateLoader = function TemplateLoader(xhr, urlResolver) {
          this._xhr = xhr;
          this._urlResolver = urlResolver;
          this._htmlCache = StringMapWrapper.create();
          this._baseUrls = MapWrapper.create();
          this._urlCache = MapWrapper.create();
        };
        return ($traceurRuntime.createClass)(TemplateLoader, {
          load: function(template) {
            if (isPresent(template.inline)) {
              return DOM.createTemplate(template.inline);
            }
            if (isPresent(template.url)) {
              var url = this.getTemplateUrl(template);
              var promise = StringMapWrapper.get(this._htmlCache, url);
              if (isBlank(promise)) {
                promise = this._xhr.get(url).then(function(html) {
                  var template = DOM.createTemplate(html);
                  return template;
                });
                StringMapWrapper.set(this._htmlCache, url, promise);
              }
              return promise;
            }
            throw new BaseException('Templates should have either their url or inline property set');
          },
          setBaseUrl: function(template, baseUrl) {
            MapWrapper.set(this._baseUrls, template, baseUrl);
            MapWrapper.delete(this._urlCache, template);
          },
          getTemplateUrl: function(template) {
            if (!MapWrapper.contains(this._urlCache, template)) {
              var baseUrl = MapWrapper.get(this._baseUrls, template);
              if (isBlank(baseUrl)) {
                throw new BaseException('The template base URL is not set');
              }
              var templateUrl;
              if (isPresent(template.url)) {
                templateUrl = this._urlResolver.resolve(baseUrl, template.url);
              } else {
                templateUrl = baseUrl;
              }
              MapWrapper.set(this._urlCache, template, templateUrl);
            }
            return MapWrapper.get(this._urlCache, template);
          }
        }, {});
      }()));
      Object.defineProperty(TemplateLoader, "parameters", {get: function() {
          return [[XHR], [UrlResolver]];
        }});
      Object.defineProperty(TemplateLoader.prototype.load, "parameters", {get: function() {
          return [[Template]];
        }});
      Object.defineProperty(TemplateLoader.prototype.setBaseUrl, "parameters", {get: function() {
          return [[Template], [assert.type.string]];
        }});
      Object.defineProperty(TemplateLoader.prototype.getTemplateUrl, "parameters", {get: function() {
          return [[Template]];
        }});
    }
  };
});

//# sourceMappingURL=src/core/compiler/template_loader.map

//# sourceMappingURL=../../../src/core/compiler/template_loader.js.map


text:
import { LiveDocSuite } from "./LiveDocSuite";
import { Background } from "./Background";
import { Scenario } from "./Scenario";
import { FeatureContext } from "./FeatureContext";
import { BackgroundContext } from "./BackgroundContext";
import { RuleViolations } from "./RuleViolations";

export class Feature extends LiveDocSuite {
    public filename: string;
    public background: Background;
    public scenarios: Scenario[] = [];

    public executionTime: number;

    constructor() {
        super();
    }

    public addScenario(scenario: Scenario) {
        // validate we have a description!
        if (!scenario.title) {
            scenario.addViolation(RuleViolations.enforceTitle, `${scenario.type} seems to be missing a title. Titles are important to convey the meaning of the Spec.`, scenario.title);
        }

        scenario.sequence = scenario.parent.scenarios.length;

        // Assign unique ids
        this.generateId(scenario);
        this.validateIdUniqueness(scenario.id, this.scenarios);

        this.scenarios.push(scenario);
    }

    public getFeatureContext(): FeatureContext {
        return ({
            filename: this.filename,
            title: this.title,
            description: this.description,
            tags: this.tags
        });
    }

    public getBackgroundContext(): BackgroundContext {
        const context = this.background.getScenarioContext();
        return ({
            title: context.title,
            description: context.description,
            given: context.given,
            and: context.and,
            tags: context.tags
        });
    }
}


text:
// Generated by xsd compiler for android/java
// DO NOT CHANGE!
package ebay.apis.eblbasecomponents;

import java.io.Serializable;
import com.leansoft.nano.annotation.*;
import java.util.List;

/**
 *
 * Type defining the SellerAccount container returned in the
 * GetSellerDashboard response.
 *
 */
public class SellerAccountDashboardType implements Serializable {

    private static final long serialVersionUID = -1L;

	@Element(name = "Status")
	private SellerAccountStatusCodeType status;

	@Element(name = "Alert")
	private List<SellerDashboardAlertType> alert;

	/**
     * public getter
     *
     *
     * This field indicates the status of your seller's account. Specifically, you'll find out if your
     * account is current and active, or if your account has a past due balance or is on
     * hold. For more details about your account, you can go to your Seller Account page
     * on the eBay site (login to My eBay), or you can call GetAccount.
     *
     *
     * @returns ebay.apis.eblbasecomponents.SellerAccountStatusCodeType
	 */
	public SellerAccountStatusCodeType getStatus() {
	    return this.status;
	}

	/**
	 * public setter
	 *
     *
     * This field indicates the status of your seller's account. Specifically, you'll find out if your
     * account is current and active, or if your account has a past due balance or is on
     * hold. For more details about your account, you can go to your Seller Account page
     * on the eBay site (login to My eBay), or you can call GetAccount.
     *
     *
     * @param ebay.apis.eblbasecomponents.SellerAccountStatusCodeType
	 */
	public void setStatus(SellerAccountStatusCodeType status) {
	    this.status = status;
	}
	/**
     * public getter
     *
     *
     * The SellerAccount.Alert container is only returned if eBay has
     * posted one or more informational or warning messages to the seller's account.
     *
     *
     * @returns java.util.List<ebay.apis.eblbasecomponents.SellerDashboardAlertType>
	 */
	public List<SellerDashboardAlertType> getAlert() {
	    return this.alert;
	}

	/**
	 * public setter
	 *
     *
     * The SellerAccount.Alert container is only returned if eBay has
     * posted one or more informational or warning messages to the seller's account.
     *
     *
     * @param java.util.List<ebay.apis.eblbasecomponents.SellerDashboardAlertType>
	 */
	public void setAlert(List<SellerDashboardAlertType> alert) {
	    this.alert = alert;
	}

}


text:
<?php
namespace TYPO3\CMS\Belog\Domain\Repository;

/**
 * Sys log entry repository
 */
class LogEntryRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
{
    /**
     * Backend users, with UID as key
     *
     * @var array
     */
    protected $beUserList = [];

    /**
     * Initialize some local variables to be used during creation of objects
     *
     * @return void
     */
    public function initializeObject()
    {
        $this->beUserList = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
        /** @var $defaultQuerySettings \TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface */
        $defaultQuerySettings = $this->objectManager->get(\TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface::class);
        $defaultQuerySettings->setRespectStoragePage(false);
        $this->setDefaultQuerySettings($defaultQuerySettings);
    }

    /**
     * Finds all log entries that match all given constraints.
     *
     * @param \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint
     * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface<\TYPO3\CMS\Belog\Domain\Model\LogEntry>
     */
    public function findByConstraint(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint)
    {
        $query = $this->createQuery();
        $queryConstraints = $this->createQueryConstraints($query, $constraint);
        if (!empty($queryConstraints)) {
            $query->matching($query->logicalAnd($queryConstraints));
        }
        $query->setOrderings(['uid' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING]);
        $query->setLimit($constraint->getNumber());
        return $query->execute();
    }

    /**
     * Create an array of query constraints from constraint object
     *
     * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
     * @param \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint
     * @return array<\TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface>
     */
    protected function createQueryConstraints(\TYPO3\CMS\Extbase\Persistence\QueryInterface $query, \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint)
    {
        $queryConstraints = [];
        // User / group handling
        $this->addUsersAndGroupsToQueryConstraints($constraint, $query, $queryConstraints);
        // Workspace
        if ($constraint->getWorkspaceUid() != \TYPO3\CMS\Belog\Domain\Model\Workspace::UID_ANY_WORKSPACE) {
            $queryConstraints[] = $query->equals('workspace', $constraint->getWorkspaceUid());
        }
        // Action (type):
        if ($constraint->getAction() > 0) {
            $queryConstraints[] = $query->equals('type', $constraint->getAction());
        } elseif ($constraint->getAction() == -1) {
            $queryConstraints[] = $query->in('error', [-1, 1, 2, 3]);
        }
        // Start / endtime handling: The timestamp calculation was already done
        // in the controller, since we need those calculated values in the view as well.
        $queryConstraints[] = $query->greaterThanOrEqual('tstamp', $constraint->getStartTimestamp());
        $queryConstraints[] = $query->lessThan('tstamp', $constraint->getEndTimestamp());
        // Page and level constraint if in page context
        $this->addPageTreeConstraintsToQuery($constraint, $query, $queryConstraints);
        return $queryConstraints;
    }

    /**
     * Adds constraints for the page(s) to the query; this could be one single page or a whole subtree beneath a given
     * page.
     *
     * @param \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint
     * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
     * @param array &$queryConstraints the query constraints to add to, will be modified
     * @return void
     */
    protected function addPageTreeConstraintsToQuery(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint, \TYPO3\CMS\Extbase\Persistence\QueryInterface $query, array &$queryConstraints)
    {
        if (!$constraint->getIsInPageContext()) {
            return;
        }
        $pageIds = [];
        // Check if we should get a whole tree of pages and not only a single page
        if ($constraint->getDepth() > 0) {
            /** @var $pageTree \TYPO3\CMS\Backend\Tree\View\PageTreeView */
            $pageTree = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Tree\View\PageTreeView::class);
            $pageTree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));
            $pageTree->makeHTML = 0;
            $pageTree->fieldArray = ['uid'];
            $pageTree->getTree($constraint->getPageId(), $constraint->getDepth());
            $pageIds = $pageTree->ids;
        }
        $pageIds[] = $constraint->getPageId();
        $queryConstraints[] = $query->in('eventPid', $pageIds);
    }

    /**
     * Adds users and groups to the query constraints.
     *
     * @param \TYPO3\CMS\Belog\Domain\Model\Constraint $constraint
     * @param \TYPO3\CMS\Extbase\Persistence\QueryInterface $query
     * @param array &$queryConstraints the query constraints to add to, will be modified
     * @return void
     */
    protected function addUsersAndGroupsToQueryConstraints(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint, \TYPO3\CMS\Extbase\Persistence\QueryInterface $query, array &$queryConstraints)
    {
        $userOrGroup = $constraint->getUserOrGroup();
        if ($userOrGroup === '') {
            return;
        }
        // Constraint for a group
        if (substr($userOrGroup, 0, 3) === 'gr-') {
            $groupId = (int)substr($userOrGroup, 3);
            $userIds = [];
            foreach ($this->beUserList as $userId => $userData) {
                if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($userData['usergroup_cached_list'], $groupId)) {
                    $userIds[] = $userId;
                }
            }
            if (!empty($userIds)) {
                $queryConstraints[] = $query->in('userid', $userIds);
            } else {
                // If there are no group members -> use -1 as constraint to not find anything
                $queryConstraints[] = $query->in('userid', [-1]);
            }
        } elseif (substr($userOrGroup, 0, 3) === 'us-') {
            $queryConstraints[] = $query->equals('userid', (int)substr($userOrGroup, 3));
        } elseif ($userOrGroup === '-1') {
            $queryConstraints[] = $query->equals('userid', (int)$GLOBALS['BE_USER']->user['uid']);
        }
    }
}


text:
         <?php
          define('DB_HOST','localhost');

          define('DB_USER','root');

          define('DB_PASSWORD','');

          define('DB_DATABASE','kursova_cms');

          ?>


text:
package org.belldj.rehydra.criteria.criterion;

import org.belldj.rehydra.criteria.Criteria;
import org.belldj.rehydra.criteria.impl.CriteriaQueryBuilder;

/**
 *
 * Class representing a "not" restriction.
 * It is recommended to use the static factory methods of
 * {@link Restrictions} to created instances of this class.
 *
 * @see Restrictions#not(Criterion)
 *
 * @author Christian Kaltepoth
 *
 */
public class NotExpression implements Criterion {

  private final Criterion criterion;

  /**
   * Creates a "not" expression
   *
   * @param criterion the restriction to negate
   */
  public NotExpression(Criterion criterion) {
    this.criterion = criterion;
  }

  /*
   * @see org.criteria4jpa.criterion.Criterion#toQueryString(org.criteria4jpa.Criteria, org.criteria4jpa.impl.CriteriaQueryBuilder)
   */
  public String toQueryString(Criteria criteria, CriteriaQueryBuilder queryBuilder) {
    return "NOT "+criterion.toQueryString(criteria, queryBuilder);
  }

  /*
   * @see org.criteria4jpa.criterion.Criterion#getParameterValues()
   */
  public Object[] getParameterValues() {
    return criterion.getParameterValues();
  }

}


text:
#ifndef DISABLE_DEBUGDRAW

#include "DebugDraw.h"
#include "StringConv.h"

DebugDraw::DebugDraw()
{
	_native = new DebugDrawWrapper(this, true);
	_native->setDebugMode(0);
}

DebugDraw::DebugDraw(DebugDrawWrapper* debugDraw)
{
	_native = debugDraw;
}

DebugDraw::~DebugDraw()
{
	this->!DebugDraw();
}

DebugDraw::!DebugDraw()
{
	if (this->IsDisposed)
		return;

	OnDisposing(this, nullptr);

	delete _native;
	_native = NULL;

	OnDisposed(this, nullptr);
}

void DebugDraw::DrawAabb(Vector3% from, Vector3% to, BtColor color)
{
	VECTOR3_CONV(from);
	VECTOR3_CONV(to);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawAabb(VECTOR3_USE(from), VECTOR3_USE(to), *colorTemp);

	VECTOR3_DEL(from);
	VECTOR3_DEL(to);
	delete colorTemp;
}

void DebugDraw::DrawArc(Vector3% center, Vector3% normal, Vector3% axis, btScalar radiusA, btScalar radiusB,
	btScalar minAngle, btScalar maxAngle, BtColor color, bool drawSect, btScalar stepDegrees)
{
	VECTOR3_CONV(center);
	VECTOR3_CONV(normal);
	VECTOR3_CONV(axis);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawArc(VECTOR3_USE(center), VECTOR3_USE(normal), VECTOR3_USE(axis), radiusA, radiusB, minAngle, maxAngle, *colorTemp, drawSect, stepDegrees);

	VECTOR3_DEL(center);
	VECTOR3_DEL(normal);
	VECTOR3_DEL(axis);
	delete colorTemp;
}

void DebugDraw::DrawArc(Vector3% center, Vector3% normal, Vector3% axis, btScalar radiusA, btScalar radiusB,
	btScalar minAngle, btScalar maxAngle, BtColor color, bool drawSect)
{
	VECTOR3_CONV(center);
	VECTOR3_CONV(normal);
	VECTOR3_CONV(axis);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawArc(VECTOR3_USE(center), VECTOR3_USE(normal), VECTOR3_USE(axis), radiusA, radiusB, minAngle, maxAngle, *colorTemp, drawSect);

	VECTOR3_DEL(center);
	VECTOR3_DEL(normal);
	VECTOR3_DEL(axis);
	delete colorTemp;
}

void DebugDraw::DrawBox(Vector3% bbMin, Vector3% bbMax, Matrix% trans, BtColor color)
{
	VECTOR3_CONV(bbMin);
	VECTOR3_CONV(bbMax);
	btTransform* transTemp = Math::MatrixToBtTransform(trans);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawBox(VECTOR3_USE(bbMin), VECTOR3_USE(bbMax), *transTemp, *colorTemp);

	VECTOR3_DEL(bbMin);
	VECTOR3_DEL(bbMax);
	ALIGNED_FREE(transTemp);
	delete colorTemp;
};

void DebugDraw::DrawBox(Vector3% bbMin, Vector3% bbMax, BtColor color)
{
	VECTOR3_CONV(bbMin);
	VECTOR3_CONV(bbMax);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawBox(VECTOR3_USE(bbMin), VECTOR3_USE(bbMax), *colorTemp);

	VECTOR3_DEL(bbMin);
	VECTOR3_DEL(bbMax);
	delete colorTemp;
};

void DebugDraw::DrawCapsule(btScalar radius, btScalar halfHeight, int upAxis, Matrix% transform, BtColor color)
{
	btTransform* transformTemp = Math::MatrixToBtTransform(transform);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawCapsule(radius, halfHeight, upAxis, *transformTemp, *colorTemp);

	ALIGNED_FREE(transformTemp);
	delete colorTemp;
}

void DebugDraw::DrawCone(btScalar radius, btScalar height, int upAxis, Matrix% transform, BtColor color)
{
	btTransform* transformTemp = Math::MatrixToBtTransform(transform);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawCone(radius, height, upAxis, *transformTemp, *colorTemp);

	ALIGNED_FREE(transformTemp);
	delete colorTemp;
}

void DebugDraw::DrawCylinder(btScalar radius, btScalar halfHeight, int upAxis, Matrix% transform, BtColor color)
{
	btTransform* transformTemp = Math::MatrixToBtTransform(transform);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawCylinder(radius, halfHeight, upAxis, *transformTemp, *colorTemp);

	ALIGNED_FREE(transformTemp);
	delete colorTemp;
}

void DebugDraw::DrawLine(Vector3% from, Vector3% to, BtColor fromColor, BtColor toColor)
{
	VECTOR3_CONV(from);
	VECTOR3_CONV(to);
	btVector3* fromColorTemp = BtColorToBtVector(fromColor);
	btVector3* toColorTemp = BtColorToBtVector(toColor);

	_native->baseDrawLine(VECTOR3_USE(from), VECTOR3_USE(to), *fromColorTemp, *toColorTemp);

	VECTOR3_DEL(from);
	VECTOR3_DEL(to);
	delete fromColorTemp;
	delete toColorTemp;
};

void DebugDraw::DrawPlane(Vector3% planeNormal, btScalar planeConst, Matrix% transform, BtColor color)
{
	VECTOR3_CONV(planeNormal);
	btTransform* transformTemp = Math::MatrixToBtTransform(transform);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawPlane(VECTOR3_USE(planeNormal), planeConst, *transformTemp, *colorTemp);

	VECTOR3_DEL(planeNormal);
	ALIGNED_FREE(transformTemp);
	delete colorTemp;
}

void DebugDraw::DrawSphere(Vector3% p, btScalar radius, BtColor color)
{
	VECTOR3_CONV(p);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawSphere(VECTOR3_USE(p), radius, *colorTemp);

	VECTOR3_DEL(p);
	delete colorTemp;
}

void DebugDraw::DrawSphere(btScalar radius, Matrix% transform, BtColor color)
{
	btTransform* transformTemp = Math::MatrixToBtTransform(transform);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawSphere(radius, *transformTemp, *colorTemp);

	ALIGNED_FREE(transformTemp);
	delete colorTemp;
}

void DebugDraw::DrawSpherePatch(Vector3% center, Vector3% up, Vector3% axis, btScalar radius, btScalar minTh, btScalar maxTh,
	btScalar minPs, btScalar maxPs, BtColor color, btScalar stepDegrees, bool drawCenter)
{
	VECTOR3_CONV(center);
	VECTOR3_CONV(up);
	VECTOR3_CONV(axis);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawSpherePatch(VECTOR3_USE(center), VECTOR3_USE(up), VECTOR3_USE(axis), radius, minTh, maxTh, minPs, maxPs, *colorTemp, stepDegrees, drawCenter);

	VECTOR3_DEL(center);
	VECTOR3_DEL(up);
	VECTOR3_DEL(axis);
	delete colorTemp;
}

void DebugDraw::DrawSpherePatch(Vector3% center, Vector3% up, Vector3% axis, btScalar radius, btScalar minTh, btScalar maxTh,
	btScalar minPs, btScalar maxPs, BtColor color, btScalar stepDegrees)
{
	VECTOR3_CONV(center);
	VECTOR3_CONV(up);
	VECTOR3_CONV(axis);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawSpherePatch(VECTOR3_USE(center), VECTOR3_USE(up), VECTOR3_USE(axis), radius, minTh, maxTh, minPs, maxPs, *colorTemp, stepDegrees);

	VECTOR3_DEL(center);
	VECTOR3_DEL(up);
	VECTOR3_DEL(axis);
	delete colorTemp;
}

void DebugDraw::DrawSpherePatch(Vector3% center, Vector3% up, Vector3% axis, btScalar radius, btScalar minTh, btScalar maxTh,
	btScalar minPs, btScalar maxPs, BtColor color)
{
	VECTOR3_CONV(center);
	VECTOR3_CONV(up);
	VECTOR3_CONV(axis);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawSpherePatch(VECTOR3_USE(center), VECTOR3_USE(up), VECTOR3_USE(axis), radius, minTh, maxTh, minPs, maxPs, *colorTemp);

	VECTOR3_DEL(center);
	VECTOR3_DEL(up);
	VECTOR3_DEL(axis);
	delete colorTemp;
}

void DebugDraw::DrawTransform(Matrix% transform, btScalar orthoLen)
{
	btTransform* transformTemp = Math::MatrixToBtTransform(transform);
	_native->baseDrawTransform(*transformTemp, orthoLen);
	ALIGNED_FREE(transformTemp);
}

void DebugDraw::DrawTriangle(Vector3% v0, Vector3% v1, Vector3% v2, BtColor color, btScalar)
{
	VECTOR3_CONV(v0);
	VECTOR3_CONV(v1);
	VECTOR3_CONV(v2);
	btVector3* colorTemp = BtColorToBtVector(color);

	_native->baseDrawTriangle(VECTOR3_USE(v0), VECTOR3_USE(v1), VECTOR3_USE(v2), *colorTemp, 0);

	VECTOR3_DEL(v0);
	VECTOR3_DEL(v1);
	VECTOR3_DEL(v2);
	delete colorTemp;
}

void DebugDraw::DrawTriangle(Vector3% v0, Vector3% v1, Vector3% v2, Vector3%, Vector3%, Vector3%, BtColor color, btScalar alpha)
{
	VECTOR3_CONV(v0);
	VECTOR3_CONV(v1);
	VECTOR3_CONV(v2);
	btVector3* colorTemp = BtColorToBtVector(color);
	btVector3* none = new btVector3();

	_native->baseDrawTriangle(VECTOR3_USE(v0), VECTOR3_USE(v1), VECTOR3_USE(v2), *none, *none, *none, *colorTemp, alpha);

	VECTOR3_DEL(v0);
	VECTOR3_DEL(v1);
	VECTOR3_DEL(v2);
	delete colorTemp;
	delete none;
}

void DebugDraw::FlushLines()
{
}

bool DebugDraw::IsDisposed::get()
{
	return ( _native == NULL );
}

#define Managed static_cast<IDebugDraw^>(_debugDraw.Target)

DebugDrawWrapper::DebugDrawWrapper(IDebugDraw^ debugDraw, bool weakReference)
{
	_debugDraw = GCHandle::Alloc(debugDraw, weakReference ? GCHandleType::Weak : GCHandleType::Normal);
}

DebugDrawWrapper::~DebugDrawWrapper()
{
	_debugDraw.Free();
}

void DebugDrawWrapper::draw3dText(const btVector3& location, const char* textString)
{
	Managed->Draw3dText(Math::BtVector3ToVector3(&location), StringConv::UnmanagedToManaged(textString));
}

void DebugDrawWrapper::drawAabb(const btVector3& from, const btVector3& to, const btVector3& color)
{
	Managed->DrawAabb(
		Math::BtVector3ToVector3(&from), Math::BtVector3ToVector3(&to), BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawArc(const btVector3& center, const btVector3& normal, const btVector3& axis,
	btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle,
	const btVector3& color, bool drawSect, btScalar stepDegrees)
{
	Managed->DrawArc(Math::BtVector3ToVector3(&center), Math::BtVector3ToVector3(&normal), Math::BtVector3ToVector3(&axis),
		radiusA, radiusB, minAngle, maxAngle, BtVectorToBtColor(color), drawSect, stepDegrees);
}

void DebugDrawWrapper::drawArc(const btVector3& center, const btVector3& normal, const btVector3& axis,
	btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle,
	const btVector3& color, bool drawSect)
{
	Managed->DrawArc(Math::BtVector3ToVector3(&center), Math::BtVector3ToVector3(&normal), Math::BtVector3ToVector3(&axis),
		radiusA, radiusB, minAngle, maxAngle, BtVectorToBtColor(color), drawSect);
}

void DebugDrawWrapper::drawBox(const btVector3& bbMin, const btVector3& bbMax, const btTransform& trans, const btVector3& color)
{
	Managed->DrawBox(
		Math::BtVector3ToVector3(&bbMin), Math::BtVector3ToVector3(&bbMax),	Math::BtTransformToMatrix(&trans), BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawBox(const btVector3& bbMin, const btVector3& bbMax, const btVector3& color)
{
	Managed->DrawBox(
		Math::BtVector3ToVector3(&bbMin), Math::BtVector3ToVector3(&bbMax),	BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
{
	Managed->DrawCapsule(radius, halfHeight, upAxis, Math::BtTransformToMatrix(&transform), BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color)
{
	Managed->DrawCone(radius, height, upAxis, Math::BtTransformToMatrix(&transform), BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawContactPoint(const btVector3& PointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color)
{
	Managed->DrawContactPoint(Math::BtVector3ToVector3(&PointOnB), Math::BtVector3ToVector3(&normalOnB),
		distance, lifeTime, BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
{
	Managed->DrawCylinder(radius, halfHeight, upAxis, Math::BtTransformToMatrix(&transform), BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawLine(const btVector3& from, const btVector3& to, const btVector3& color)
{
	Managed->DrawLine(
		Math::BtVector3ToVector3(&from), Math::BtVector3ToVector3(&to), BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor)
{
	Managed->DrawLine(
		Math::BtVector3ToVector3(&from), Math::BtVector3ToVector3(&to), BtVectorToBtColor(fromColor), BtVectorToBtColor(toColor));
}

void DebugDrawWrapper::drawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color)
{
	Managed->DrawPlane(Math::BtVector3ToVector3(&planeNormal), planeConst, Math::BtTransformToMatrix(&transform), BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawSphere(const btVector3& p, btScalar radius, const btVector3& color)
{
	Managed->DrawSphere(Math::BtVector3ToVector3(&p), radius, BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawSphere(btScalar radius, const btTransform& transform, const btVector3& color)
{
	Managed->DrawSphere(radius, Math::BtTransformToMatrix(&transform), BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius,
	btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color, btScalar stepDegrees, bool drawCenter)
{
	Managed->DrawSpherePatch(Math::BtVector3ToVector3(&center), Math::BtVector3ToVector3(&up), Math::BtVector3ToVector3(&axis),
		radius, minTh, maxTh, minPs, maxPs, BtVectorToBtColor(color), stepDegrees, drawCenter);
}

void DebugDrawWrapper::drawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius,
	btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color, btScalar stepDegrees)
{
	Managed->DrawSpherePatch(Math::BtVector3ToVector3(&center), Math::BtVector3ToVector3(&up), Math::BtVector3ToVector3(&axis),
		radius, minTh, maxTh, minPs, maxPs, BtVectorToBtColor(color), stepDegrees);
}

void DebugDrawWrapper::drawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius,
	btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color)
{
	Managed->DrawSpherePatch(Math::BtVector3ToVector3(&center), Math::BtVector3ToVector3(&up), Math::BtVector3ToVector3(&axis),
		radius, minTh, maxTh, minPs, maxPs, BtVectorToBtColor(color));
}

void DebugDrawWrapper::drawTransform(const btTransform& transform, btScalar orthoLen)
{
	Managed->DrawTransform(Math::BtTransformToMatrix(&transform), orthoLen);
}

void DebugDrawWrapper::drawTriangle(const btVector3& v0, const btVector3& v1, const btVector3& v2, const btVector3& color, btScalar)
{
	Managed->DrawTriangle(Math::BtVector3ToVector3(&v0), Math::BtVector3ToVector3(&v1), Math::BtVector3ToVector3(&v2),
		BtVectorToBtColor(color), 0);
}

void DebugDrawWrapper::drawTriangle(const btVector3& v0, const btVector3& v1, const btVector3& v2,
	const btVector3& n0, const btVector3& n1, const btVector3& n2, const btVector3& color, btScalar alpha)
{
	Managed->DrawTriangle(Math::BtVector3ToVector3(&v0), Math::BtVector3ToVector3(&v1), Math::BtVector3ToVector3(&v2),
		Math::BtVector3ToVector3(&n0), Math::BtVector3ToVector3(&n1), Math::BtVector3ToVector3(&n2), BtVectorToBtColor(color), alpha);
}

void DebugDrawWrapper::baseDrawAabb(const btVector3& from, const btVector3& to, const btVector3& color)
{
	btIDebugDraw::drawAabb(from, to, color);
}

void DebugDrawWrapper::baseDrawArc(const btVector3& center, const btVector3& normal, const btVector3& axis,
	btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle,
	const btVector3& color, bool drawSect, btScalar stepDegrees)
{
	btIDebugDraw::drawArc(center, normal, axis, radiusA, radiusB, minAngle, maxAngle, color, drawSect, stepDegrees);
}

void DebugDrawWrapper::baseDrawArc(const btVector3& center, const btVector3& normal, const btVector3& axis,
	btScalar radiusA, btScalar radiusB, btScalar minAngle, btScalar maxAngle,
	const btVector3& color, bool drawSect)
{
	btIDebugDraw::drawArc(center, normal, axis, radiusA, radiusB, minAngle, maxAngle, color, drawSect);
}

void DebugDrawWrapper::baseDrawBox(const btVector3& bbMin, const btVector3& bbMax, const btTransform& trans, const btVector3& color)
{
	btIDebugDraw::drawBox(bbMin, bbMax, trans, color);
}

void DebugDrawWrapper::baseDrawBox(const btVector3& bbMin, const btVector3& bbMax, const btVector3& color)
{
	btIDebugDraw::drawBox(bbMin, bbMax, color);
}

void DebugDrawWrapper::baseDrawCapsule(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
{
	btIDebugDraw::drawCapsule(radius, halfHeight, upAxis, transform, color);
}

void DebugDrawWrapper::baseDrawCone(btScalar radius, btScalar height, int upAxis, const btTransform& transform, const btVector3& color)
{
	btIDebugDraw::drawCone(radius, height, upAxis, transform, color);
}

void DebugDrawWrapper::baseDrawCylinder(btScalar radius, btScalar halfHeight, int upAxis, const btTransform& transform, const btVector3& color)
{
	btIDebugDraw::drawCylinder(radius, halfHeight, upAxis, transform, color);
}

void DebugDrawWrapper::baseDrawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor)
{
	btIDebugDraw::drawLine(from, to, fromColor, toColor);
}

void DebugDrawWrapper::baseDrawPlane(const btVector3& planeNormal, btScalar planeConst, const btTransform& transform, const btVector3& color)
{
	btIDebugDraw::drawPlane(planeNormal, planeConst, transform, color);
}

void DebugDrawWrapper::baseDrawSphere(const btVector3& p, btScalar radius, const btVector3& color)
{
	btIDebugDraw::drawSphere(p, radius, color);
}

void DebugDrawWrapper::baseDrawSphere(btScalar radius, const btTransform& transform, const btVector3& color)
{
	btIDebugDraw::drawSphere(radius, transform, color);
}

void DebugDrawWrapper::baseDrawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius,
	btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color, btScalar stepDegrees, bool drawCenter)
{
	btIDebugDraw::drawSpherePatch(center, up, axis, radius, minTh, maxTh, minPs, maxPs, color, stepDegrees, drawCenter);
}

void DebugDrawWrapper::baseDrawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius,
	btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color, btScalar stepDegrees)
{
	btIDebugDraw::drawSpherePatch(center, up, axis, radius, minTh, maxTh, minPs, maxPs, color, stepDegrees);
}

void DebugDrawWrapper::baseDrawSpherePatch(const btVector3& center, const btVector3& up, const btVector3& axis, btScalar radius,
	btScalar minTh, btScalar maxTh, btScalar minPs, btScalar maxPs, const btVector3& color)
{
	btIDebugDraw::drawSpherePatch(center, up, axis, radius, minTh, maxTh, minPs, maxPs, color);
}

void DebugDrawWrapper::baseDrawTransform(const btTransform& transform, btScalar orthoLen)
{
	btIDebugDraw::drawTransform(transform, orthoLen);
}

void DebugDrawWrapper::baseDrawTriangle(const btVector3& v0, const btVector3& v1, const btVector3& v2, const btVector3& color, btScalar)
{
	btIDebugDraw::drawTriangle(v0, v1, v2, color, 0);
}

void DebugDrawWrapper::baseDrawTriangle(const btVector3& v0, const btVector3& v1, const btVector3& v2,
	const btVector3& n0, const btVector3& n1, const btVector3& n2, const btVector3& color, btScalar alpha)
{
	btIDebugDraw::drawTriangle(v0, v1, v2, n0, n1, n2, color, alpha);
}

void DebugDrawWrapper::flushLines()
{
	Managed->FlushLines();
}

void DebugDrawWrapper::reportErrorWarning(const char* warningString)
{
	Managed->ReportErrorWarning(StringConv::UnmanagedToManaged(warningString));
}

void DebugDrawWrapper::setDebugMode(int debugMode)
{
	Managed->DebugMode = (BulletSharp::DebugDrawModes)debugMode;
}
int	DebugDrawWrapper::getDebugMode() const
{
	DebugDrawWrapper* wrapper = (DebugDrawWrapper*)this;
	return (int)(static_cast<IDebugDraw^>(wrapper->_debugDraw.Target)->DebugMode);
}

#endif


text:
<?xml version="1.0"?>

<document>
  <properties>
    <title>Commons JEXL Examples</title>
  </properties>

        In this reference you will find the following topics to help with your use of JEXL.

Evaluating Expressions

Custom Contexts

Example Expressions

        You can find two sample programs in JEXL's CVS repository:

Using arrays

Accessing Properties and invoking methods

        As well, JEXL's Unit Tests
        provide handy examples of expressions. The test code also contains a
        simple class
        that evaluates its command line arguments as JEXL expressions when run.

          The
          package javadoc also contains useful information.

        To evaluate expressions using JEXL, you need three things:

An engine to create expressions,

A context containing any variables, and

An expression

        The common way of using a JEXL engine is to allocate it as a singleton and use this opportunity to tailor its
        behavior and cache.
        <source>
            private static final JexlEngine jexl = new JexlEngine();
            static {
               jexl.setCache(512);
               jexl.setLenient(false);
               jexl.setSilent(false);
            }
        </source>

        The easiest way of obtaining a a context is to use the
        new MapContext()
        statement. This creates a context implemented using an underlying
        HashMap

        Expressions are
        created using the JexlEngine.createExpression(String)
        method.

        Once you have your expression, you can then use use the
        evaluate
        to execute it and obtain a result.

        Here's a typical scenario:

      <source>
    // Assuming we have a JexlEngine instance initialized in our class named 'jexl':
    // Create an expression object for our calculation
    String calculateTax = taxManager.getTaxCalc(); //e.g. "((G1 + G2 + G3) * 0.1) + G4";
    Expression e = jexl.createExpression( calculateTax );

    // populate the context
    JexlContext context = new MapContext();
    context.set("G1", businessObject.getTotalSales());
    context.set("G2", taxManager.getTaxCredit(businessObject.getYear()));
    context.set("G3", businessObject.getIntercompanyPayments());
    context.set("G4", -taxManager.getAllowances());
    // ...

    // work it out
    Float result = (Float)e.evaluate(context);
      </source>

        Often you have the objects and values that are needed in the context available
        elsewhere. If those are already in a Map, instead of creating the default context and populating it
        manually in the code, you can wrap a MapContext around your own map using
        new MapContext(yourOwnMap)

        In edge cases, it may be simpler to create a context implementation of your
        own.
        The JexlContext
        interface is very simple with only three methods, to set, get and check the existence of variables.

      <subsection name="Arithmetic">

Most valid arithmetic expressions in Java are also valid in Jexl.

        <source>
1 + 2
12.0 - 5.2
6 * 12 + 5 / 2.6
12 % 2
6 / 4
-12 + 77.2
x * 1.1 + y
        </source>

Arithmetic expressions can use variables. null can be treated as a zero for arithmetic;
        if you need stricter semantics and consider null as an erroneous operand for arithmetic and
        comparisons operations, you should initialize your JEXL engine using
        JexlEngine.setLenient(false).

      </subsection>
      <subsection name="Calling methods">

          JEXL allows you to call any method on a Java object using the same syntax.
          If you have a string in the context under the name aString,
          you could call it's length
          method like this:
          <source>
aString.length()
aString.substring(6)
          </source>

          Often the values you want to pass to a method are other variables or expressions.
          If you have a number in the context, named i, you could use it
          in a method call:
          <source>aString.substring(i)</source>

      </subsection>
      <subsection name="Accessing properties">

          JEXL provides a shorthand syntax to access methods that
          follow the JavaBean naming convention for properties, i.e.
          setters and getters.

          If you have some object foo in the context and it has a
          method getBar(), you can call that method using
          the following syntax:
          <source>foo.bar</source>

          Since java.lang.Object has a getClass() method
          that returns a java.lang.Class object, and the
          class has a getName() method, the following is a shorthand
          for obtaining the class name of an object foo in the context:
          <source>foo.class.name</source>

      </subsection>
      <subsection name="Arrays, Lists and Maps">

          Array elements can be accessed using either square brackets or a dotted
          index notation, e.g. the following are equivalent
          <source>arr[0]
arr.0</source>
          The same holds true for lists.

          For a map, the syntax is very similar, except the 'index' is an object, e.g.
          the following are equivalent.
          <source>aMap['key']
aMap.get('key')</source>
          Please note that the index does not have to be a string, and
          that the string usage above is just one possible option.

      </subsection>

</document>


text:
//go:build !linux
// +build !linux

package app

import "errors"

func watchForLockfileContention(path string, done chan struct{}) error {
	return errors.New("kubelet unsupported in this build")
}

func isCgroup2UnifiedMode() bool {
	return false
}


text:
package git4idea.remote;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import jakarta.inject.Singleton;

import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.components.StoragePathMacros;

/**
 * @author Kirill Likhodedov
 */
@Singleton
@State(
		name = "GitRememberedInputs",
		storages = @Storage(file = StoragePathMacros.APP_CONFIG + "/vcs.xml")
)
public class GitRememberedInputs implements PersistentStateComponent<GitRememberedInputs.State>
{

	private State myState = new State();

	public static class State
	{
		public List<UrlAndUserName> visitedUrls = new ArrayList<UrlAndUserName>();
		public String cloneParentDir = "";
		public String puttyKey = "";
	}

	public static class UrlAndUserName
	{
		public String url;
		public String userName;
	}

	public static GitRememberedInputs getInstance()
	{
		return ServiceManager.getService(GitRememberedInputs.class);
	}

	@Override
	public State getState()
	{
		return myState;
	}

	@Override
	public void loadState(State state)
	{
		myState = state;
	}

	public void addUrl(@Nonnull String url)
	{
		addUrl(url, "");
	}

	public void addUrl(@Nonnull String url, @Nonnull String userName)
	{
		for(UrlAndUserName visitedUrl : myState.visitedUrls)
		{
			if(visitedUrl.url.equalsIgnoreCase(url))
			{  // don't add multiple entries for a single url
				if(!userName.isEmpty())
				{                 // rewrite username, unless no username is specified
					visitedUrl.userName = userName;
				}
				return;
			}
		}

		UrlAndUserName urlAndUserName = new UrlAndUserName();
		urlAndUserName.url = url;
		urlAndUserName.userName = userName;
		myState.visitedUrls.add(urlAndUserName);
	}

	@Nullable
	public String getUserNameForUrl(String url)
	{
		for(UrlAndUserName urlAndUserName : myState.visitedUrls)
		{
			if(urlAndUserName.url.equalsIgnoreCase(url))
			{
				return urlAndUserName.userName;
			}
		}
		return null;
	}

	@Nonnull
	public List<String> getVisitedUrls()
	{
		List<String> urls = new ArrayList<String>(myState.visitedUrls.size());
		for(UrlAndUserName urlAndUserName : myState.visitedUrls)
		{
			urls.add(urlAndUserName.url);
		}
		return urls;
	}

	public void setPuttyKey(String puttyKey)
	{
		myState.puttyKey = puttyKey;
	}

	public String getPuttyKey()
	{
		return myState.puttyKey;
	}

	public String getCloneParentDir()
	{
		return myState.cloneParentDir;
	}

	public void setCloneParentDir(String cloneParentDir)
	{
		myState.cloneParentDir = cloneParentDir;
	}

}