text:
"""Example for aiohttp.web websocket server
"""

import asyncio
import os
from aiohttp.web import Application, Response, MsgType, WebSocketResponse

WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html')

@asyncio.coroutine
def wshandler(request):
    resp = WebSocketResponse()
    ok, protocol = resp.can_start(request)
    if not ok:
        with open(WS_FILE, 'rb') as fp:
            return Response(body=fp.read(), content_type='text/html')

    resp.start(request)
    print('Someone joined.')
    for ws in request.app['sockets']:
        ws.send_str('Someone joined')
    request.app['sockets'].append(resp)

    while True:
        msg = yield from resp.receive()

        if msg.tp == MsgType.text:
            for ws in request.app['sockets']:
                if ws is not resp:
                    ws.send_str(msg.data)
        else:
            break

    request.app['sockets'].remove(resp)
    print('Someone disconnected.')
    for ws in request.app['sockets']:
        ws.send_str('Someone disconnected.')
    return resp

@asyncio.coroutine
def init(loop):
    app = Application(loop=loop)
    app['sockets'] = []
    app.router.add_route('GET', '/', wshandler)

    handler = app.make_handler()
    srv = yield from loop.create_server(handler, '127.0.0.1', 8080)
    print("Server started at http://127.0.0.1:8080")
    return app, srv, handler

@asyncio.coroutine
def finish(app, srv, handler):
    for ws in app['sockets']:
        ws.close()
    app['sockets'].clear()
    yield from asyncio.sleep(0.1)
    srv.close()
    yield from handler.finish_connections()
    yield from srv.wait_closed()

loop = asyncio.get_event_loop()
app, srv, handler = loop.run_until_complete(init(loop))
try:
    loop.run_forever()
except KeyboardInterrupt:
    loop.run_until_complete(finish(app, srv, handler))


text:
'use strict';

module.exports = {
    PeriodicActions: require('./mixins/PeriodicActions')
};

redpajama_set_name: RedPajamaGithub


text:
<RelativeLayout 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="me.cvhc.equationsolver.MainFragment"
    android:orientation="vertical">

    <RelativeLayout
        android:id="@+id/layout_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/keypadMainActivity"
        android:animateLayoutChanges="true"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="Workspace"
            android:id="@+id/textWorkspaceTitle"
            android:layout_marginBottom="4dp"
            android:textStyle="bold" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@+id/textWorkspaceTitle"
            android:descendantFocusability="beforeDescendants"
            android:scrollbars="horizontal"
            android:layout_above="@+id/editInputNewExpression"
            android:background="@drawable/border_ui"
            android:padding="2dp" />

        <ToggleButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/toggleInputType"
            android:minHeight="0dp"
            android:checked="false"
            android:textOn="F(x) ="
            android:textOff="Assign"
            android:typeface="monospace"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_below="@+id/recyclerView"
            android:layout_above="@+id/frameTabHost"/>

        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/editInputNewExpression"
            android:singleLine="true"
            android:imeOptions="actionDone"
            android:inputType="textNoSuggestions"
            android:hint="a = 2.0 sqrt(3)"
            android:layout_toRightOf="@+id/toggleInputType"
            android:layout_toEndOf="@+id/toggleInputType"
            android:layout_above="@+id/frameTabHost"
            android:textColorHint="#AAA"
            android:layout_toLeftOf="@+id/buttonAdd"
            android:layout_toStartOf="@+id/buttonAdd"
            android:paddingRight="24dp" />

        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/buttonHistory"
            android:layout_alignParentRight="false"
            android:layout_alignParentEnd="false"
            android:layout_alignTop="@+id/editInputNewExpression"
            android:src="@android:drawable/arrow_down_float"
            android:background="@color/colorTransparent"
            android:paddingLeft="8dp"
            android:paddingRight="8dp"
            android:layout_alignRight="@+id/editInputNewExpression"
            android:layout_alignBottom="@+id/editInputNewExpression" />

        <Button
            style="@style/Base.Widget.AppCompat.Button.Colored"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="+"
            android:id="@+id/buttonAdd"
            android:layout_alignBottom="@+id/editInputNewExpression"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:minHeight="0dp"
            android:minWidth="48dp"
            android:layout_below="@+id/recyclerView"
            android:typeface="sans"
            android:textStyle="bold"
            android:visibility="gone" />

        <FrameLayout
            android:id="@+id/frameTabHost"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:animateLayoutChanges="true"
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true">

            <TabHost
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/tabHost"
                android:visibility="gone">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">

                    <TabWidget
                        android:id="@android:id/tabs"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:tabStripEnabled="false"
                        android:weightSum="3">
                    </TabWidget>

                    <FrameLayout
                        android:id="@android:id/tabcontent"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:background="@drawable/border_ui"
                        android:padding="8dp">
                    </FrameLayout>
                </LinearLayout>
            </TabHost>
        </FrameLayout>

    </RelativeLayout>

    <me.cvhc.equationsolver.ExpressionKeypad
        android:id="@+id/keypadMainActivity"
        android:visibility="gone"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" />
</RelativeLayout>


text:
<?php

/**
 * @file
 * Contains \Drupal\Tests\Component\Assertion\InspectorTest.
 */

namespace Drupal\Tests\Component\Assertion;

use PHPUnit\Framework\TestCase;
use Drupal\Component\Assertion\Inspector;

/**
 * @coversDefaultClass \Drupal\Component\Assertion\Inspector
 * @group Assertion
 */
class InspectorTest extends TestCase {

  /**
   * Tests asserting argument is an array or traversable object.
   *
   * @covers ::assertTraversable
   */
  public function testAssertTraversable() {
    $this->assertTrue(Inspector::assertTraversable([]));
    $this->assertTrue(Inspector::assertTraversable(new \ArrayObject()));
    $this->assertFalse(Inspector::assertTraversable(new \stdClass()));
    $this->assertFalse(Inspector::assertTraversable('foo'));
  }

  /**
   * Tests asserting all members are strings.
   *
   * @covers ::assertAllStrings
   * @dataProvider providerTestAssertAllStrings
   */
  public function testAssertAllStrings($input, $expected) {
    $this->assertSame($expected, Inspector::assertAllStrings($input));
  }

  public function providerTestAssertAllStrings() {
    $data = [
      'empty-array' => [[], TRUE],
      'array-with-strings' => [['foo', 'bar'], TRUE],
      'string' => ['foo', FALSE],
      'array-with-strings-with-colon' => [['foo', 'bar', 'llama:2001988', 'baz', 'llama:14031991'], TRUE],

      'with-FALSE' => [[FALSE], FALSE],
      'with-TRUE' => [[TRUE], FALSE],
      'with-string-and-boolean' => [['foo', FALSE], FALSE],
      'with-NULL' => [[NULL], FALSE],
      'string-with-NULL' => [['foo', NULL], FALSE],
      'integer' => [[1337], FALSE],
      'string-and-integer' => [['foo', 1337], FALSE],
      'double' => [[3.14], FALSE],
      'string-and-double' => [['foo', 3.14], FALSE],
      'array' => [[[]], FALSE],
      'string-and-array' => [['foo', []], FALSE],
      'string-and-nested-array' => [['foo', ['bar']], FALSE],
      'object' => [[new \stdClass()], FALSE],
      'string-and-object' => [['foo', new StringObject()], FALSE],
    ];

    return $data;
  }

  /**
   * Tests asserting all members are strings or objects with __toString().
   *
   * @covers ::assertAllStringable
   */
  public function testAssertAllStringable() {
    $this->assertTrue(Inspector::assertAllStringable([]));
    $this->assertTrue(Inspector::assertAllStringable(['foo', 'bar']));
    $this->assertFalse(Inspector::assertAllStringable('foo'));
    $this->assertTrue(Inspector::assertAllStringable(['foo', new StringObject()]));
  }

  /**
   * Tests asserting all members are arrays.
   *
   * @covers ::assertAllArrays
   */
  public function testAssertAllArrays() {
    $this->assertTrue(Inspector::assertAllArrays([]));
    $this->assertTrue(Inspector::assertAllArrays([[], []]));
    $this->assertFalse(Inspector::assertAllArrays([[], 'foo']));
  }

  /**
   * Tests asserting array is 0-indexed - the strict definition of array.
   *
   * @covers ::assertStrictArray
   */
  public function testAssertStrictArray() {
    $this->assertTrue(Inspector::assertStrictArray([]));
    $this->assertTrue(Inspector::assertStrictArray(['bar', 'foo']));
    $this->assertFalse(Inspector::assertStrictArray(['foo' => 'bar', 'bar' => 'foo']));
  }

  /**
   * Tests asserting all members are strict arrays.
   *
   * @covers ::assertAllStrictArrays
   */
  public function testAssertAllStrictArrays() {
    $this->assertTrue(Inspector::assertAllStrictArrays([]));
    $this->assertTrue(Inspector::assertAllStrictArrays([[], []]));
    $this->assertFalse(Inspector::assertAllStrictArrays([['foo' => 'bar', 'bar' => 'foo']]));
  }

  /**
   * Tests asserting all members have specified keys.
   *
   * @covers ::assertAllHaveKey
   */
  public function testAssertAllHaveKey() {
    $this->assertTrue(Inspector::assertAllHaveKey([]));
    $this->assertTrue(Inspector::assertAllHaveKey([['foo' => 'bar', 'bar' => 'foo']]));
    $this->assertTrue(Inspector::assertAllHaveKey([['foo' => 'bar', 'bar' => 'foo']], 'foo'));
    $this->assertTrue(Inspector::assertAllHaveKey([['foo' => 'bar', 'bar' => 'foo']], 'bar', 'foo'));
    $this->assertFalse(Inspector::assertAllHaveKey([['foo' => 'bar', 'bar' => 'foo']], 'bar', 'foo', 'moo'));
  }

  /**
   * Tests asserting all members are integers.
   *
   * @covers ::assertAllIntegers
   */
  public function testAssertAllIntegers() {
    $this->assertTrue(Inspector::assertAllIntegers([]));
    $this->assertTrue(Inspector::assertAllIntegers([1, 2, 3]));
    $this->assertFalse(Inspector::assertAllIntegers([1, 2, 3.14]));
    $this->assertFalse(Inspector::assertAllIntegers([1, '2', 3]));
  }

  /**
   * Tests asserting all members are floating point variables.
   *
   * @covers ::assertAllFloat
   */
  public function testAssertAllFloat() {
    $this->assertTrue(Inspector::assertAllFloat([]));
    $this->assertTrue(Inspector::assertAllFloat([1.0, 2.1, 3.14]));
    $this->assertFalse(Inspector::assertAllFloat([1, 2.1, 3.14]));
    $this->assertFalse(Inspector::assertAllFloat([1.0, '2', 3]));
    $this->assertFalse(Inspector::assertAllFloat(['Titanic']));
  }

  /**
   * Tests asserting all members are callable.
   *
   * @covers ::assertAllCallable
   */
  public function testAllCallable() {
    $this->assertTrue(Inspector::assertAllCallable([
      'strchr',
      [$this, 'callMe'],
      [__CLASS__, 'callMeStatic'],
      function () {
        return TRUE;
      }
    ]));

    $this->assertFalse(Inspector::assertAllCallable([
      'strchr',
      [$this, 'callMe'],
      [__CLASS__, 'callMeStatic'],
      function () {
        return TRUE;
      },
      "I'm not callable"
    ]));
  }

  /**
   * Tests asserting all members are !empty().
   *
   * @covers ::assertAllNotEmpty
   */
  public function testAllNotEmpty() {
    $this->assertTrue(Inspector::assertAllNotEmpty([1, 'two']));
    $this->assertFalse(Inspector::assertAllNotEmpty(['']));
  }

  /**
   * Tests asserting all arguments are numbers or strings castable to numbers.
   *
   * @covers ::assertAllNumeric
   */
  public function testAssertAllNumeric() {
    $this->assertTrue(Inspector::assertAllNumeric([1, '2', 3.14]));
    $this->assertFalse(Inspector::assertAllNumeric([1, 'two', 3.14]));
  }

  /**
   * Tests asserting strstr() or stristr() match.
   *
   * @covers ::assertAllMatch
   */
  public function testAssertAllMatch() {
    $this->assertTrue(Inspector::assertAllMatch('f', ['fee', 'fi', 'fo']));
    $this->assertTrue(Inspector::assertAllMatch('F', ['fee', 'fi', 'fo']));
    $this->assertTrue(Inspector::assertAllMatch('f', ['fee', 'fi', 'fo'], TRUE));
    $this->assertFalse(Inspector::assertAllMatch('F', ['fee', 'fi', 'fo'], TRUE));
    $this->assertFalse(Inspector::assertAllMatch('e', ['fee', 'fi', 'fo']));
    $this->assertFalse(Inspector::assertAllMatch('1', [12]));
  }

  /**
   * Tests asserting regular expression match.
   *
   * @covers ::assertAllRegularExpressionMatch
   */
  public function testAssertAllRegularExpressionMatch() {
    $this->assertTrue(Inspector::assertAllRegularExpressionMatch('/f/i', ['fee', 'fi', 'fo']));
    $this->assertTrue(Inspector::assertAllRegularExpressionMatch('/F/i', ['fee', 'fi', 'fo']));
    $this->assertTrue(Inspector::assertAllRegularExpressionMatch('/f/', ['fee', 'fi', 'fo']));
    $this->assertFalse(Inspector::assertAllRegularExpressionMatch('/F/', ['fee', 'fi', 'fo']));
    $this->assertFalse(Inspector::assertAllRegularExpressionMatch('/e/', ['fee', 'fi', 'fo']));
    $this->assertFalse(Inspector::assertAllRegularExpressionMatch('/1/', [12]));
  }

  /**
   * Tests asserting all members are objects.
   *
   * @covers ::assertAllObjects
   */
  public function testAssertAllObjects() {
    $this->assertTrue(Inspector::assertAllObjects([new \ArrayObject(), new \ArrayObject()]));
    $this->assertFalse(Inspector::assertAllObjects([new \ArrayObject(), new \ArrayObject(), 'foo']));
    $this->assertTrue(Inspector::assertAllObjects([new \ArrayObject(), new \ArrayObject()], '\\Traversable'));
    $this->assertFalse(Inspector::assertAllObjects([new \ArrayObject(), new \ArrayObject(), 'foo'], '\\Traversable'));
    $this->assertFalse(Inspector::assertAllObjects([new \ArrayObject(), new StringObject()], '\\Traversable'));
    $this->assertTrue(Inspector::assertAllObjects([new \ArrayObject(), new StringObject()], '\\Traversable', '\\Drupal\\Tests\\Component\\Assertion\\StringObject'));
    $this->assertFalse(Inspector::assertAllObjects([new \ArrayObject(), new StringObject(), new \stdClass()], '\\ArrayObject', '\\Drupal\\Tests\\Component\\Assertion\\StringObject'));
  }

  /**
   * Test method referenced by ::testAllCallable().
   */
  public function callMe() {
    return TRUE;
  }

  /**
   * Test method referenced by ::testAllCallable().
   */
  public static function callMeStatic() {
    return TRUE;
  }

}

/**
 * Quick class for testing for objects with __toString.
 */
class StringObject {
  /**
   * {@inheritdoc}
   */
  public function __toString() {
    return 'foo';
  }

}


text:
@interface CHumanDateFormatter : NSDateFormatter {
	BOOL singleLine;
	BOOL relative;
}

@property (readwrite, nonatomic, assign) BOOL singleLine;
@property (readwrite, nonatomic, assign) BOOL relative;

+ (id)humanDateFormatter:(BOOL)inSingleLine;

+ (NSString *)formatDate:(NSDate *)inDate singleLine:(BOOL)inSingleLine;

@end


text:
package org.apache.camel.component.cxf.jaxws;

import java.util.Map;

import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.support.MessageHelper;
import org.apache.cxf.helpers.CastUtils;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class CxfRawMessageRouterTest extends CxfSimpleRouterTest {
    private String routerEndpointURI = "cxf://" + getRouterAddress() + "?" + SERVICE_CLASS + "&dataFormat=RAW";
    private String serviceEndpointURI = "cxf://" + getServiceAddress() + "?" + SERVICE_CLASS + "&dataFormat=RAW";

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                from(routerEndpointURI).to("log:org.apache.camel?level=DEBUG").to(serviceEndpointURI).to("mock:result");
            }
        };
    }

    @Test
    public void testTheContentType() throws Exception {
        MockEndpoint result = getMockEndpoint("mock:result");
        result.reset();
        result.expectedMessageCount(1);
        HelloService client = getCXFClient();
        client.echo("hello world");
        MockEndpoint.assertIsSatisfied(context);
        Map<?, ?> context
                = CastUtils.cast((Map<?, ?>) result.assertExchangeReceived(0).getIn().getHeaders().get("ResponseContext"));
        Map<?, ?> protocalHeaders = CastUtils.cast((Map<?, ?>) context.get("org.apache.cxf.message.Message.PROTOCOL_HEADERS"));
        assertTrue(protocalHeaders.get("content-type").toString().startsWith("[text/xml;"), "Should get a right content type");
        assertTrue(protocalHeaders.get("content-type").toString().indexOf("charset=") > 0,
                "Should get a right context type with a charset");
        assertEquals(200, context.get("org.apache.cxf.message.Message.RESPONSE_CODE"), "Should get the response code");
        assertTrue(result.assertExchangeReceived(0).getIn().getHeaders().get("content-type").toString().startsWith("text/xml;"),
                "Should get the content type");
        assertTrue(result.assertExchangeReceived(0).getIn().getHeaders().get("content-type").toString().indexOf("charset=") > 0,
                "Should get the content type");

    }

    @Test
    public void testTheContentTypeOnTheWire() throws Exception {
        Exchange exchange = template.send(getRouterAddress(), new Processor() {

            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setBody("<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                                         + "<soap:Body><ns1:echo xmlns:ns1=\"http://jaxws.cxf.component.camel.apache.org/\">"
                                         + "<arg0 xmlns=\"http://jaxws.cxf.component.camel.apache.org/\">hello world</arg0>"
                                         + "</ns1:echo></soap:Body></soap:Envelope>");

            }

        });
        assertNotNull(MessageHelper.getContentType(exchange.getMessage()), "We should get the Content-Type here");
        assertTrue(MessageHelper.getContentType(exchange.getMessage()).startsWith("text/xml"), "Get wrong content type");
        assertNotNull(exchange.getMessage().getHeader("content-type"), "We should get the content-type here");
        String response = exchange.getMessage().getBody(String.class);
        assertNotNull(response, "Response should not be null");
        assertTrue(response.indexOf("echo hello world") > 0, "We should get right return result");
    }
}


text:
$(document).ready(function() {
    $('#curve_chart').height('80%');
    $('#curve_chart').width('100%');
    $('#list_streams').hide();
    $.getJSON("/api/following", listFollowing);

    $('#list_streams').change( function() {
        $('#curve_chart').fadeOut(500, function() { drawChart(result);$('#curve_chart').fadeIn(1500);});
        $.getJSON("/api/viewer/" + $('#list_streams option:selected').text(), function(data) {

            var result = [];
            result.push(['Time', 'Viewer']);
            for(var i in data) {
                result.push([new Date(data[i]['Time']), data[i]['Viewer']]);
            }
        });
    });
});


text:
package p

func f() {
	1 = 2 // ERROR "cannot assign to 1|invalid left hand side"
}


text:
package org.andengine.entity.modifier;

import org.andengine.entity.IEntity;
import org.andengine.util.modifier.ease.EaseLinear;
import org.andengine.util.modifier.ease.IEaseFunction;

/**
 * (c) Zynga 2012
 *
 * @author Nicolas Gramlich <ngramlich@zynga.com>
 * @since 12:12:55 - 11.01.2012
 */
public class JumpModifier extends MoveModifier {
	// ===========================================================
	// Constants
	// ===========================================================

	private static final int JUMPCOUNT_DEFAULT = 1;

	// ===========================================================
	// Fields
	// ===========================================================

	protected final float mJumpHeight;
	protected final int mJumpCount;

	// ===========================================================
	// Constructors
	// ===========================================================

	public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight) {
		this(pDuration, pFromX, pToX, pFromY, pToY, pJumpHeight, JumpModifier.JUMPCOUNT_DEFAULT, EaseLinear.getInstance());
	}

	public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final IEaseFunction pEaseFunction) {
		this(pDuration, pFromX, pToX, pFromY, pToY, pJumpHeight, JumpModifier.JUMPCOUNT_DEFAULT, pEaseFunction);
	}

	public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final IEntityModifierListener pEntityModifierListener) {
		this(pDuration, pFromX, pToX, pFromY, pToY, pJumpHeight, JumpModifier.JUMPCOUNT_DEFAULT, pEntityModifierListener, EaseLinear.getInstance());
	}

	public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction) {
		this(pDuration, pFromX, pToX, pFromY, pToY, pJumpHeight, JumpModifier.JUMPCOUNT_DEFAULT, pEntityModifierListener, pEaseFunction);
	}

	public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final int pJumpCount) {
		this(pDuration, pFromX, pToX, pFromY, pToY, pJumpHeight, pJumpCount, EaseLinear.getInstance());
	}

	public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final int pJumpCount, final IEaseFunction pEaseFunction) {
		this(pDuration, pFromX, pToX, pFromY, pToY, pJumpHeight, pJumpCount, null, pEaseFunction);
	}

	public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final int pJumpCount, final IEntityModifierListener pEntityModifierListener) {
		this(pDuration, pFromX, pToX, pFromY, pToY, pJumpHeight, pJumpCount, pEntityModifierListener, EaseLinear.getInstance());
	}

	public JumpModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final float pJumpHeight, final int pJumpCount, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction) {
		super(pDuration, pFromX, pToX, pFromY, pToY, pEntityModifierListener, pEaseFunction);

		this.mJumpHeight = pJumpHeight;
		this.mJumpCount = pJumpCount;
	}

	public JumpModifier(final JumpModifier pJumpModifier) {
		super(pJumpModifier);

		this.mJumpHeight = pJumpModifier.mJumpHeight;
		this.mJumpCount = pJumpModifier.mJumpCount;
	}

	@Override
	public JumpModifier deepCopy() throws DeepCopyNotSupportedException {
		return new JumpModifier(this);
	}

	// ===========================================================
	// Getter & Setter
	// ===========================================================

	// ===========================================================
	// Methods for/from SuperClass/Interfaces
	// ===========================================================

	@Override
	protected void onSetValues(final IEntity pEntity, final float pPercentageDone, final float pX, final float pY) {
		final float fraction = (pPercentageDone * this.mJumpCount) % 1.0f;
		final float deltaY = this.mJumpHeight * 4 * fraction * (1 - fraction);

		super.onSetValues(pEntity, pPercentageDone, pX, pY - deltaY);
	}

	// ===========================================================
	// Methods
	// ===========================================================

	// ===========================================================
	// Inner and Anonymous Classes
	// ===========================================================
}


text:
"""Implementation of DPLL algorithm.

Further improvements: eliminate calls to pl_true, implement branching rules,
efficient unit propagation.

References
==========

* https://en.wikipedia.org/wiki/DPLL_algorithm
* https://www.researchgate.net/publication/242384772

"""

from ...utilities import default_sort_key
from ..boolalg import And, _find_predicates, to_cnf, to_int_repr

def dpll_satisfiable(expr):
    """Check satisfiability of a propositional sentence.

    It returns a model rather than True when it succeeds

    >>> dpll_satisfiable(a & ~b)
    {a: True, b: False}
    >>> dpll_satisfiable(a & ~a)
    False

    """
    clauses = And.make_args(to_cnf(expr))
    if False in clauses:
        return False
    symbols = sorted(_find_predicates(expr), key=default_sort_key)
    symbols_int_repr = set(range(1, len(symbols) + 1))
    clauses_int_repr = to_int_repr(clauses, symbols)
    result = dpll(clauses_int_repr, symbols_int_repr, {})
    if not result:
        return result
    output = {}
    for key in result:
        output.update({symbols[key - 1]: result[key]})
    return output

def dpll(clauses, symbols, model):
    """Compute satisfiability in a partial model.

    Clauses is an array of conjuncts.  Arguments are expected to be
    in integer representation

    >>> dpll([{1}, {2}, {3}], {1, 2}, {3: False})
    False

    """
    # compute DP kernel
    P, value = find_unit_clause(clauses, model)
    while P:
        model.update({P: value})
        symbols.remove(P)
        if not value:
            P = -P
        clauses = unit_propagate(clauses, P)
        P, value = find_unit_clause(clauses, model)
    P, value = find_pure_symbol(symbols, clauses)
    while P:
        model.update({P: value})
        symbols.remove(P)
        if not value:
            P = -P
        clauses = unit_propagate(clauses, P)
        P, value = find_pure_symbol(symbols, clauses)
    # end DP kernel
    unknown_clauses = []
    for c in clauses:
        val = pl_true_int_repr(c, model)
        if val is False:
            return False
        if val is not True:
            unknown_clauses.append(c)
    if not unknown_clauses:
        return model
    P = symbols.pop()
    model_copy = model.copy()
    model.update({P: True})
    model_copy.update({P: False})
    symbols_copy = symbols.copy()
    return (dpll(unit_propagate(unknown_clauses, P), symbols, model) or
            dpll(unit_propagate(unknown_clauses, -P), symbols_copy, model_copy))

def pl_true_int_repr(clause, model={}):
    """Lightweight version of pl_true.

    Argument clause represents the set of args of an Or clause. This is used
    inside dpll, it is not meant to be used directly.

    >>> pl_true_int_repr({1, 2}, {1: False})
    >>> pl_true_int_repr({1, 2}, {1: False, 2: False})
    False

    """
    result = False
    for lit in clause:
        if lit < 0:
            p = model.get(-lit)
            if p is not None:
                p = not p
        else:
            p = model.get(lit)
        if p is True:
            return True
        elif p is None:
            result = None
    return result

def unit_propagate(clauses, s):
    """Returns an equivalent set of clauses.

    If a set of clauses contains the unit clause l, the other clauses are
    simplified by the application of the two following rules:

      1. every clause containing l is removed
      2. in every clause that contains ~l this literal is deleted

    Arguments are expected to be in integer representation.

    >>> unit_propagate([{1, 2}, {3, -2}, {2}], 2)
    [{3}]

    """
    negated = {-s}
    return [clause - negated for clause in clauses if s not in clause]

def find_pure_symbol(symbols, unknown_clauses):
    """
    Find a symbol and its value if it appears only as a positive literal
    (or only as a negative) in clauses.

    Arguments are expected to be in integer representation.

    >>> find_pure_symbol({1, 2, 3}, [{1, -2}, {-2, -3}, {3, 1}])
    (1, True)

    """
    all_symbols = set().union(*unknown_clauses)
    found_pos = all_symbols.intersection(symbols)
    found_neg = all_symbols.intersection([-s for s in symbols])
    for p in found_pos:
        if -p not in found_neg:
            return p, True
    for p in found_neg:
        if -p not in found_pos:
            return -p, False
    return None, None

def find_unit_clause(clauses, model):
    """Find a unit clause has only 1 variable that is not bound in the model.

    Arguments are expected to be in integer representation.

    >>> find_unit_clause([{1, 2, 3}, {2, -3}, {1, -2}], {1: True})
    (2, False)

    """
    bound = set(model) | {-sym for sym in model}
    for clause in clauses:
        unbound = clause - bound
        if len(unbound) == 1:
            p = unbound.pop()
            if p < 0:
                return -p, False
            else:
                return p, True
    return None, None


text:
{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}

module Main where

import           Airship
import           Airship.Resource.Static (StaticOptions(..), staticResource)

import           Blaze.ByteString.Builder.Html.Utf8 (fromHtmlEscapedText)

#if __GLASGOW_HASKELL__ < 710
import           Control.Applicative ((<$>))
#endif
import           Control.Concurrent.MVar
import           Control.Monad.Trans (liftIO)

import           Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as HM
import qualified Data.ByteString.Lazy as LB
import           Data.ByteString.Lazy.Char8 (unpack)
import           Data.Maybe (fromMaybe)
import           Data.Monoid ((<>))
import           Data.Text(Text, pack)
import           Data.Time.Clock

import qualified Network.HTTP.Types as HTTP
import           Network.Wai.Handler.Warp ( runSettings
                                          , defaultSettings
                                          , setPort
                                          , setHost
                                          )

-- ***************************************************************************
-- Helpers
-- ***************************************************************************

getBody :: Handler s IO LB.ByteString
getBody = do
    req <- request
    liftIO (entireRequestBody req)

readBody :: Handler s IO Integer
readBody = read . unpack <$> getBody

routingParam :: Text -> Handler s m Text
routingParam t = do
    p <- params
    return (p HM.! t)

newtype State = State { _getState :: MVar (HashMap Text Integer) }

resourceWithBody :: Text -> Resource State IO
resourceWithBody t = defaultResource { contentTypesProvided = return [("text/plain", return (escapedResponse t))]
                                     , lastModified = Just <$> liftIO getCurrentTime
                                     , generateETag = return $ Just $ Strong "abc123"
                                     }

accountResource :: Resource State IO
accountResource = defaultResource
    { allowedMethods = return [ HTTP.methodGet
                              , HTTP.methodHead
                              , HTTP.methodPost
                              , HTTP.methodPut
                              ]
    , knownContentType = contentTypeMatches ["text/plain"]

    , contentTypesProvided = do
        let textAction = do
                s <- getState
                m <- liftIO (readMVar (_getState s))
                accountNameM <- HM.lookup "name" <$> params
                let val = fromMaybe 0 (accountNameM >>= flip HM.lookup m)
                return $ ResponseBuilder (fromHtmlEscapedText
                                                (pack (show val) <> "\n"))
        return [("text/plain", textAction)]

    , allowMissingPost = return False

    , lastModified = Just <$> liftIO getCurrentTime

    , resourceExists = do
        accountName <- routingParam "name"
        s <- getState
        m <- liftIO (readMVar (_getState s))
        return $ HM.member accountName m

    -- POST'ing to this resource adds the integer to the current value
    , processPost = return (PostProcess $ do
        (val, accountName, s) <- postPutStates
        liftIO (modifyMVar_ (_getState s) (return . HM.insertWith (+) accountName val))
        return ()
        )

    , contentTypesAccepted = return [("text/plain", do
        (val, accountName, s) <- postPutStates
        liftIO (modifyMVar_ (_getState s) (return . HM.insert accountName val))
        return ()
    )]
    }

postPutStates :: Handler State IO (Integer, Text, State)
postPutStates = do
    val <- readBody
    accountName <- routingParam "name"
    s <- getState
    return (val, accountName, s)

myRoutes :: Resource State IO -> RoutingSpec State IO ()
myRoutes static = do
    root                        #> resourceWithBody "Just the root resource"
    "account" </> var "name"    #> accountResource
    "static"  </> star          #> static

main :: IO ()
main = do
    static <- staticResource Cache "assets"
    let port = 3000
        host = "127.0.0.1"
        settings = setPort port (setHost host defaultSettings)
        routes = myRoutes static
        response404 = escapedResponse "
404 Not Found
"
        resource404 = defaultResource { resourceExists = return False
                                      , contentTypesProvided = return
                                            [ ( "text/html"
                                              , return response404
                                              )
                                            ]
                                      }

    mvar <- newMVar HM.empty
    let s = State mvar
    putStrLn "Listening on port 3000"
    runSettings settings (resourceToWai routes resource404 s)


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

namespace SpeedyMVVM.Utilities
{
    [DataContract]
    public class AppToken
    {
        #region Fields
        [DataMember(Name = nameof(UserName))]
        internal string _UserName;

        [DataMember(Name = nameof(MachineName))]
        internal string _MachineName;

        [DataMember(Name = nameof(OSVersion))]
        internal string _OSVersion;

        [DataMember(Name = nameof(CurrentKey))]
        internal Guid _CurrentKey;

        [DataMember(Name = nameof(IsAuthenticated))]
        internal bool _IsAuthenticated;

        [DataMember(Name = nameof(ProxyName))]
        internal string _ProxyName;
        #endregion

        #region Properties
        public string UserName
        {
            get { return _UserName; }
            private set { _UserName = value; }
        }

        public string MachineName
        {
            get { return _MachineName; }
            private set { _MachineName = value; }
        }

        public string OSVersion
        {
            get { return _OSVersion; }
            private set { _OSVersion = value; }
        }

        public Guid CurrentKey
        {
            get { return _CurrentKey; }
            private set { _CurrentKey = value; }
        }

        public bool IsAuthenticated
        {
            get { return _IsAuthenticated; }
            private set { _IsAuthenticated = value; }
        }

        public string ProxyName
        {
            get { return _ProxyName; }
            private set { _ProxyName = value; }
        }
        #endregion

        #region Methods
        public void ValidateToken(string proxyName, Guid tokenKey)
        {
            _ProxyName = proxyName;
            _CurrentKey = tokenKey;
            _IsAuthenticated = true;
        }
        #endregion

        #region Constructors
        public AppToken(string userName = "", string machineName = "", string osVersion = "")
        {
            UserName = userName;
            MachineName = machineName;
            OSVersion = osVersion;
        }
        #endregion
    }
}


text:
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template import RequestContext
import os

def home(request):
    html_data = open(os.path.abspath("./angular-bootstrap/app/index.html"), "rt").read()
    return HttpResponse(html_data, content_type="text/html")


text:
class Tessera < ActiveRecord::Base
  has_one :character
  has_one :reaping_check
end


text:
require "active_admin_sortable/version"
require 'active_admin_sortable/engine'
require 'active_admin_sortable/dsl'
require 'active_admin_sortable/generator'

::ActiveAdmin::DSL.send(:include, ActiveAdminSortable::DSL)


text:
(function($) {
    function isEmpty(el) {
        el = $(el);
        return !el.text() && !el.children().not('br').length;
    }

    function editor_grid_create() {
        var selectedContent = tinyMCE.activeEditor.selection.getContent();
        var children = $('
' + selectedContent + '
').children('p');
        var contents = [];
        var transColumn = tinyMCE.i18n.translate('Column %num%');

        var units = [6, 6];
        var numChildren = children.length;

        if (!numChildren) {
            contents.push(selectedContent);
        } else {
            contents = children.toArray();

            if (numChildren > 2) {
                switch (numChildren) {
                    case 3:
                        units = [4, 4, 4];
                        break;
                    case 4:
                        units = [3, 3, 3, 3];
                        break;
                    case 5:
                        units = [3, 3, 2, 2, 2];
                        break;
                    case 6:
                        units = [2, 2, 2, 2, 2, 2];
                        break;
                    case 7:
                        units = [2, 2, 2, 2, 2, 1, 1];
                        break;
                    case 8:
                        units = [2, 2, 2, 2, 1, 1, 1, 1];
                        break;
                    case 9:
                        units = [2, 2, 2, 1, 1, 1, 1, 1, 1];
                        break;
                    case 10:
                        units = [2, 2, 1, 1, 1, 1, 1, 1, 1, 1];
                        break;
                    case 11:
                        units = [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
                        break;
                    default:
                        units = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
                        break;
                }
            }
        }

        // Insert
        var content, insert = $('
');

        for (var i = 0, l = units.length - 1; i < l; i++) {
            content = '';

            if (!!contents.length) {
                content = contents[0];
                contents = contents.slice(1);
            }

            if (!content) {
                content = '
' + transColumn.replace('%num%', i + 1) + '
';
            }

            insert.append($('
').append(content));
        }

        content = '
' + transColumn.replace('%num%', i + 1) + '
';

        if (!!contents.length) {
            content = contents;
        }

        // Add last unit
        insert.append($('
').append(content));

        insert = insert.wrap('
').parent();

        tinyMCE.activeEditor.execCommand('mceInsertContent', 0, insert.wrap('
').parent().html());
    }

    tinymce.PluginManager.add('dotsunited_editor_grid', function(editor) {
        var toolbar;

        function editor_grid_style_button(selector) {
            return {
                type: 'listbox',
                text: 'Style',
                classes: 'btn widget fixed-width',
                icon: false,
                onselect: function(e) {},
                values: [
                    {
                        text: 'No background',
                        onclick : function() {
                            $(editor.selection.getNode())
                                .closest(selector)
                                .removeClass('editor-grid-background editor-grid-background-highlight')
                            ;
                        },
                        value: ''
                    },
                    {
                        text: 'Background',
                        onclick : function() {
                            $(editor.selection.getNode())
                                .closest(selector)
                                .removeClass('editor-grid-background-highlight')
                                .addClass('editor-grid-background')
                            ;
                        },
                        value: 'background'
                    },
                    {
                        text: 'Highlight',
                        onclick : function() {
                            $(editor.selection.getNode())
                                .closest(selector)
                                .removeClass('editor-grid-background editor-grid-background-highlight')
                                .removeClass('editor-grid-background')
                                .addClass('editor-grid-background-highlight')
                            ;
                        },
                        value: 'background-highlight'
                    }
                ],
                onPostRender: function() {
                    var self = this;

                    editor.on('NodeChange', function(event) {
                        var el = $(event.element).closest(selector);

                        if (!el.length) {
                            return;
                        }

                        var value = '';

                        if (el.hasClass('editor-grid-background-highlight')) {
                            value = 'background-highlight';
                        } else if (el.hasClass('editor-grid-background')) {
                            value = 'background';
                        }

                        self.value(value);
                    });
                }
            };
        }

        function editor_grid_shadow_button(selector) {
            return {
                tooltip: 'Shadow',
                icon: 'dotsunited-editor-grid-icon dotsunited-editor-grid-icon-shadow',
                onclick: function() {
                    var el = $(editor.selection.getNode()).closest(selector);

                    if (!el.length) {
                        return;
                    }

                    el.toggleClass('editor-grid-shadow');
                    this.active(el.hasClass('editor-grid-shadow'));
                },
                onPostRender: function() {
                    var self = this;

                    editor.on('NodeChange', function(event) {
                        var el = $(event.element).closest(selector);

                        if (!el.length) {
                            return;
                        }

                        self.active(el.hasClass('editor-grid-shadow'));
                    });
                }
            };
        }

        function editor_grid_size_button(selector, sizes) {
            var values = [];
            var transSize = tinyMCE.i18n.translate('%size% of %sizes%');
            var allClasses = [];

            for (var i = 1; i <= sizes; i++) {
                allClasses.push('editor-grid-unit-' + i);

                values.push({
                    text: transSize.replace('%size%', i).replace('%sizes%', sizes),
                    onclick: (function(i) {
                        return function() {
                            $(editor.selection.getNode())
                                .closest(selector)
                                .removeClass(allClasses.join(' '))
                                .addClass('editor-grid-unit-' + i)
                            ;
                        }
                    })(i),
                    value: 'editor-grid-unit-' + i
                });
            }

            return {
                type: 'listbox',
                text: 'Column size',
                classes: 'btn widget fixed-width',
                icon: false,
                onselect: function(e) {},
                values: values,
                onPostRender: function() {
                    var self = this;

                    editor.on('NodeChange', function(event) {
                        var el = $(event.element).closest(selector);

                        if (!el.length) {
                            return;
                        }

                        var value = '';

                        for (var i = 0, l = allClasses.length; i < l; i++) {
                            if (el.hasClass(allClasses[i])) {
                                value = allClasses[i];
                                break;
                            }
                        }

                        self.value(value);
                    });
                }
            };
        }

        editor.addButton('dotsunited_editor_grid_unit_size', editor_grid_size_button('.editor-grid-unit', 12));

        editor.addButton('dotsunited_editor_grid_unit_style', editor_grid_style_button('.editor-grid-unit'));
        editor.addButton('dotsunited_editor_grid_unit_shadow', editor_grid_shadow_button('.editor-grid-unit'));

        editor.addButton('dotsunited_editor_grid_unit_remove', {
            tooltip: 'Remove column',
            icon: 'dashicon dashicons-no',
            onclick: function() {
                var el = $(editor.selection.getNode()).closest('.editor-grid-unit');

                if (!el.length) {
                    return;
                }

                var grid = el.closest('.editor-grid');

                el.remove();

                if (!grid.find('.editor-grid-unit').length) {
                    grid.remove();
                }

                toolbar.hide();
            }
        });

        editor.addButton('dotsunited_editor_grid_remove', {
            tooltip: 'Remove grid',
            icon: 'dashicon dashicons-no',
            onclick: function() {
                var el = $(editor.selection.getNode()).closest('.editor-grid');

                if (!el.length) {
                    return;
                }

                el.find('.editor-grid-unit').each(function() {
                    if (isEmpty(this)) {
                        return;
                    }

                    el.before($(this).html());
                });

                el.remove();
                toolbar.hide();
            }
        });

        editor.addButton('dotsunited_editor_grid_add_unit', {
            tooltip: 'Add column',
            icon: 'dashicon dashicons-plus',
            onclick: function() {
                var el = $(editor.selection.getNode()).closest('.editor-grid-unit');

                if (!el.length) {
                    return;
                }

                var container = el.closest('.editor-grid-container');
                var transColumn = tinyMCE.i18n.translate('Column %num%');
                var content = '
' + transColumn.replace('%num%', container.find('.editor-grid-unit').length + 1) + '
';

                container.append(el.clone().html(content));
            }
        });

        editor.addButton('dotsunited_editor_grid_style', editor_grid_style_button('.editor-grid'));

        editor.addButton('dotsunited_editor_grid_shadow', editor_grid_shadow_button('.editor-grid'));

        editor.addButton('dotsunited_editor_grid_create', {
            title: 'Create grid',
            icon: 'dotsunited-editor-grid-icon dotsunited-editor-grid-icon-create',
            onclick: function() {
                editor_grid_create([6, 6]);
            },
            onPostRender: function() {
                var ctrl = this, selector = '.editor-grid';

                function bindStateListener() {
                    ctrl.disabled(
                        !!editor.dom.getParent(
                            editor.selection.getStart(),
                            selector
                        )
                    );

                    editor.selection.selectorChanged(selector, function(state) {
                        ctrl.disabled(!!state);
                    });
                }

                if (editor.initialized) {
                    bindStateListener();
                } else {
                    editor.on('init', bindStateListener);
                }
            }
        });

        // Add toolbar
        editor.once('preinit', function() {
            toolbar = editor.wp._createToolbar([
                'dotsunited_editor_grid_unit_size',
                'dotsunited_editor_grid_unit_style',
                'dotsunited_editor_grid_unit_shadow',
                'dotsunited_editor_grid_unit_remove',
                '|',
                'dotsunited_editor_grid_add_unit',
                '|',
                'dotsunited_editor_grid_style',
                'dotsunited_editor_grid_shadow',
                'dotsunited_editor_grid_remove'
            ], true);
        });

        editor.on('wptoolbar', function(e) {
            var el = e.element;

            // Do not overwrite existing toolbars/selections
            if (e.toolbar || e.selection) {
                return;
            }

            var unit = $(el).closest('.editor-grid-unit');

            if (!unit.length) {
                return;
            }

            e.toolbar = toolbar;
            e.selection = unit.get(0);
        });

        // When pressing ENTER inside a unit, move the cursor to a new parapraph
        // under it but only if its the last child.
        editor.on('KeyDown', function(event) {
            var node, wrap, P, spacer,
                selection = editor.selection,
                keyCode = event.keyCode,
                dom = editor.dom,
                VK = tinymce.util.VK;

            // When pressing Enter inside a unit move the caret to a new
            // paragraph under it
            if (keyCode === VK.ENTER) {
                node = selection.getNode();

                if (!editor.dom.hasClass(node, 'editor-grid-unit') && !isEmpty(node)) {
                    return;
                }

                dom.events.cancel(event); // Doesn't cancel all :(

                spacer = tinymce.Env.ie && tinymce.Env.ie < 11 ? '' : '
';
                P = dom.create('p', null, spacer);

                dom.add(node, P);

                editor.nodeChanged();
                selection.setCursorLocation(P, 0);
                return;
            }

            // Prevent removing box with Backspace and Delete
            if (keyCode === VK.BACKSPACE || keyCode === VK.DELETE) {
                node = selection.getNode();

                wrap = dom.getParent(node, '.editor-grid-unit');

                if (wrap && (!wrap.children.length || (1 === wrap.children.length && isEmpty(wrap.children[0])))) {
                    dom.events.cancel(event);
                    return false;
                }
            }
        });

        editor.on('NodeChange', function(event) {
            var el = $(event.element).closest('.editor-grid');

            if (!el.find('.editor-grid-unit').length) {
                el.remove();
            }
        });

        // Allow to place the caret behind a box.
        // This fix will force a paragraph element after the table but only when
        // the forced_root_block setting is enabled.
        // Copied from TinyMCE tabel plugin.
        editor.on('KeyDown SetContent VisualAid', function() {
            var last;

            // Skip empty text nodes from the end
            for (last = editor.getBody().lastChild; last; last = last.previousSibling) {
                if (last.nodeType == 3) {
                    if (last.nodeValue.length > 0) {
                        break;
                    }
                } else if (last.nodeType == 1 && (last.tagName == 'BR' || !last.getAttribute('data-mce-bogus'))) {
                    break;
                }
            }

            if (last && last.nodeName == 'DIV') {
                if (editor.settings.forced_root_block) {
                    editor.dom.add(
                        editor.getBody(),
                        editor.settings.forced_root_block,
                        editor.settings.forced_root_block_attrs,
                        tinymce.Env.ie && tinymce.Env.ie < 11 ? ' ' : '
'
                    );
                } else {
                    editor.dom.add(editor.getBody(), 'br', {'data-mce-bogus': '1'});
                }
            }
        });

        editor.on('PreProcess', function(o) {
            var last = o.node.lastChild;

            if (last && (last.nodeName == 'BR' || (last.childNodes.length == 1 &&
                (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) &&
                last.previousSibling && last.previousSibling.nodeName == 'DIV') {
                editor.dom.remove(last);
            }
        });
    });
})(jQuery);


text:
from veidt.rfxas.core import XANES
from veidt.rfxas.prediction import CenvPrediction
import pandas as pd
import os, unittest
import warnings

comp_test_df_path = os.path.join(os.path.dirname(__file__), 'comp_spectra_test.pkl')
comp_test_df = pd.read_pickle(comp_test_df_path)
Fe_tsv = os.path.join(os.path.dirname(__file__), 'xas.XANES.K.Fe.mp-13.tsv')
Fe2O3_xdi = os.path.join(os.path.dirname(__file__), 'fe2o3_rt.xdi')

class RfxasXANESTest(unittest.TestCase):
    def setUp(self):
        self.test_row = comp_test_df.iloc[0]
        self.test_row_formula = self.test_row['formula']
        self.test_row_ele_group = self.test_row['ele_tm_alka_metalloid']
        self.test_row_xas_id = self.test_row['xas_id']
        self.test_row_absorb_specie = self.test_row['absorbing_species']
        self.test_row_energy_e0 = self.test_row['energy_e0']
        self.test_row_structure = self.test_row['structure']
        self.test_row_x = self.test_row['x_axis_energy_55eV']
        self.test_row_spect = self.test_row['interp_spectrum_55eV']
        self.test_row_add_paras = {
            'composition': self.test_row_formula, 'elemental_group': self.test_row_ele_group,
            'xas_id': self.test_row_xas_id
        }

    def test_raise_warning(self):
        with warnings.catch_warnings(record=True) as w:
            xanes_test = XANES(self.test_row_x, self.test_row_spect, self.test_row_absorb_specie, edge='K',
                               **self.test_row_add_paras)
            self.assertTrue('maximum derivative' in str(w[-1].message))
            self.assertEqual(xanes_test.composition, 'NaB(CO2)4')
            self.assertEqual(len(xanes_test.x), 200)
            self.assertEqual(xanes_test.xas_id, 'mp-559618-4-XANES-K')
            self.assertEqual(xanes_test.elemental_group, 'Carbon')

        with warnings.catch_warnings(record=True) as w:
            xanes_test_2 = XANES(self.test_row_x, self.test_row_spect, self.test_row_absorb_specie, edge='K',
                               e0=self.test_row_energy_e0, **self.test_row_add_paras)
            self.assertEqual(len(w), 0)
            self.assertEqual(xanes_test_2.composition, 'NaB(CO2)4')
            self.assertEqual(len(xanes_test_2.x), 200)
            self.assertEqual(xanes_test_2.e0, 274.98)
            self.assertEqual(xanes_test_2.xas_id, 'mp-559618-4-XANES-K')
            self.assertEqual(xanes_test_2.elemental_group, 'Carbon')

    def test_tsv_loading(self):
        self.Fe_xanes = XANES.from_K_XANES_MP_tsv(Fe_tsv, sep='\t', header=3)
        self.Fe_CenvPred = CenvPrediction(self.Fe_xanes, 'lowest', 45)
        self.Fe_CenvPred.cenv_prediction()
        self.assertEqual(self.Fe_CenvPred.pred_cnum_ranklist, 'CN_4')
        self.assertEqual(self.Fe_CenvPred.pred_cenv[0], 'CN_4-tetrahedral-trigonal pyramidal-see-saw-like-square co-planar')

    def test_XDI_loading(self):
        self.Fe2O3_xanes = XANES.from_XDI_file(Fe2O3_xdi)
        self.Fe2O3_CenvPred = CenvPrediction(self.Fe2O3_xanes, 'E0', [-15, 45], self.Fe2O3_xanes.e0)
        self.Fe2O3_CenvPred.cenv_prediction()
        self.assertEqual(self.Fe2O3_CenvPred.pred_cnum_ranklist, 'CN_6')
        self.assertEqual(self.Fe2O3_CenvPred.pred_cenv[0], 'CN_6-octahedral-pentagonal pyramidal-hexagonal planar')


text:
package org.openlayers.ol.control.options;

import jsinterop.annotations.JsConstructor;
import jsinterop.annotations.JsPackage;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
import org.openlayers.ol.Collection;
import org.openlayers.ol.View;
import org.openlayers.ol.layer.Layer;

/**
 * {@link org.openlayers.ol.control.OverviewMapControl} options.
 *
 * @author Serge Silaev aka iSergio <s.serge.b@gmail.com>
 */
@JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class OverviewMapControlOptions extends ControlOptions {
    /**
     * Whether the control should start collapsed or not (expanded). Default to true.
     */
    @JsProperty
    public boolean collapsed;
    /**
     * Text label to use for the expanded overviewmap button. Default is «. Instead of text, also a Node (e.g. a span element) can be used.
     */
    @JsProperty
    public String collapseLabel;
    /**
     * Whether the control can be collapsed or not. Default to true.
     */
    @JsProperty
    public boolean collapsible;
    /**
     * Text label to use for the collapsed overviewmap button. Default is ». Instead of text, also a Node (e.g. a span element) can be used.
     */
    @JsProperty
    public String label;
    /**
     * Layers for the overview map. If not set, then all main map layers are used instead.
     */
    @JsProperty(name = "layers")
    public Layer[] layers;
    /**
     * Layers for the overview map. If not set, then all main map layers are used instead.
     */
    @JsProperty(name = "layers")
    public Collection<Layer> layersCollection;
    /**
     * Text label to use for the button tip. Default is Overview map
     */
    @JsProperty
    public String tipLabel;
    /**
     * Custom view for the overview map. If not provided, a default view with an EPSG:3857 projection will be used.
     */
    @JsProperty
    public View view;

    @JsConstructor
    public OverviewMapControlOptions() {}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ The MIT License
  ~
  ~ Copyright (c) 2013-2014, CloudBees, Inc.
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy
  ~ of this software and associated documentation files (the "Software"), to deal
  ~ in the Software without restriction, including without limitation the rights
  ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  ~ copies of the Software, and to permit persons to whom the Software is
  ~ furnished to do so, subject to the following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in
  ~ all copies or substantial portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  ~ THE SOFTWARE.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jenkins-ci.plugins</groupId>
        <artifactId>plugin</artifactId>
        <version>2.12</version>
        <relativePath />
    </parent>
    <groupId>org.jenkins-ci.plugins.workflow</groupId>
    <artifactId>workflow-cps</artifactId>
    <version>2.10</version>
    <packaging>hpi</packaging>
    <name>Pipeline: Groovy</name>
    <url>https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Groovy+Plugin</url>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://opensource.org/licenses/MIT</url>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
        <url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
      <tag>workflow-cps-2.10</tag>
  </scm>
    <repositories>
        <repository>
            <id>repo.jenkins-ci.org</id>
            <url>http://repo.jenkins-ci.org/public/</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>repo.jenkins-ci.org</id>
            <url>http://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
    </pluginRepositories>
    <properties>
        <jenkins.version>1.642.3</jenkins.version>
        <npm.loglevel>--silent</npm.loglevel>
    </properties>
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>workflow-step-api</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>workflow-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>workflow-support</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>workflow-scm-step</artifactId>
            <version>1.15</version>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>script-security</artifactId>
            <version>1.18</version>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>scm-api</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>structs</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>support-core</artifactId>
            <version>2.32</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>workflow-support</artifactId>
            <version>1.15</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>workflow-basic-steps</artifactId>
            <version>1.15</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.jenkins-ci.plugins</groupId>
                    <artifactId>mailer</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-job</artifactId>
            <version>2.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-durable-task-step</artifactId>
            <version>2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>pipeline-build-step</artifactId>
            <version>2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>pipeline-input-step</artifactId>
            <version>2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>pipeline-stage-step</artifactId>
            <version>2.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>matrix-auth</artifactId>
            <version>1.0.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>junit</artifactId>
            <version>1.15</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.cloudbees</groupId>
            <artifactId>groovy-cps</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.ui</groupId>
            <artifactId>jquery-detached</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.ui</groupId>
            <artifactId>ace-editor</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>com.cloudbees</groupId>
            <artifactId>diff4j</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-scm-step</artifactId>
            <version>2.0</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>git</artifactId>
            <version>2.4.1</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency> <!-- optional dep of workflow-scm-step, have to override 1.54 version that gets pulled in somehow during tests -->
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>subversion</artifactId>
            <version>2.5</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>target/generated-resources/adjuncts</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <!-- why is this necessary!? otherwise compiling src/test/groovy/ fails -->
                <!-- fix attempted at https://github.com/jenkinsci/jenkins/commit/101507f49873de0239ccb7839649ea71187712b2 but apparently failed. -->
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <configuration>
                    <providerSelection>1.8</providerSelection>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>


text:
import Swiper from './components/core/core-class';
export { default as Swiper, default } from './components/core/core-class';
import Virtual from './components/virtual/virtual';
import Keyboard from './components/keyboard/keyboard';
import Mousewheel from './components/mousewheel/mousewheel';
import Navigation from './components/navigation/navigation';
import Pagination from './components/pagination/pagination';
import Scrollbar from './components/scrollbar/scrollbar';
import Parallax from './components/parallax/parallax';
import Zoom from './components/zoom/zoom';
import Lazy from './components/lazy/lazy';
import Controller from './components/controller/controller';
import A11y from './components/a11y/a11y';
import History from './components/history/history';
import HashNavigation from './components/hash-navigation/hash-navigation';
import Autoplay from './components/autoplay/autoplay';
import EffectFade from './components/effect-fade/effect-fade';
import EffectCube from './components/effect-cube/effect-cube';
import EffectFlip from './components/effect-flip/effect-flip';
import EffectCoverflow from './components/effect-coverflow/effect-coverflow';
import Thumbs from './components/thumbs/thumbs';

// Swiper Class
var components = [Virtual, Keyboard, Mousewheel, Navigation, Pagination, Scrollbar, Parallax, Zoom, Lazy, Controller, A11y, History, HashNavigation, Autoplay, EffectFade, EffectCube, EffectFlip, EffectCoverflow, Thumbs];
Swiper.use(components);


text:
package core

type Literal struct {
	data []byte
}

func (l *Literal) Execute(context *Context) ExecutionState {
	context.Writer.Write(l.data)
	return NormalState
}


text:
@interface MCSpriteLayer ()
- (NSUInteger)currentSampleIndex;
@end

@implementation MCSpriteLayer

- (id)init {
    if ((self = [super init])) {
        self.sampleIndex = 1;
        self.frameCount  = 1;
        self.anchorPoint = CGPointZero;
    }

    return self;
}

#pragma mark -
#pragma mark Frame by frame animation

+ (BOOL)needsDisplayForKey:(NSString *)key {
    return [key isEqualToString:@"sampleIndex"] || [key isEqualToString:@"frameCount"];
}

+ (id < CAAction >)defaultActionForKey:(NSString *)aKey; {
    return (id < CAAction >)[NSNull null];
}

- (NSUInteger)currentSampleIndex {
    return ((MCSpriteLayer *)[self presentationLayer]).sampleIndex;
}

// Implement displayLayer: on the delegate to override how sample rectangles are calculated; remember to use currentSampleIndex, ignore sampleIndex == 0, and set the layer's bounds
- (void)display {
    if ([self.delegate respondsToSelector:@selector(displayLayer:)]) {
        [self.delegate displayLayer:self];

        return;
    }

    NSUInteger currentSampleIndex = [self currentSampleIndex];
    if (!currentSampleIndex) {
        return;
    }

    CGSize sampleSize = NSMakeSize(1.0, 1.0 / (self.frameCount ? self.frameCount : 1.0));
    self.contentsRect = CGRectMake(0, (currentSampleIndex - 1) * sampleSize.height, sampleSize.width, sampleSize.height);
}

@end


text:
using Orchard.ContentManagement.Records;

namespace Alexan.PhotoAlbums.Models
{
    public class PhotoAlbumSlideshowPartRecord : ContentPartRecord
    {
        public virtual bool AutoPlay { get; set; }
        public virtual int Interval { get; set; }
    }
}


text:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>br.uff.ic.gems</groupId>
    <artifactId>oceano-util</artifactId>
    <version>3.0.0-SNAPSHOT</version>
    <name>${project.artifactId}</name>
    <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <maven.build.timestamp.format>dd/MM/yyyy - HH:mm</maven.build.timestamp.format>
      <build.timestamp>${maven.build.timestamp}</build.timestamp>
      <maven.compiler.source>1.7</maven.compiler.source>
      <maven.compiler.target>1.7</maven.compiler.target>
    </properties>
    <pluginRepositories>
      <pluginRepository>
        <id>stat-scm-sourceforge</id>
        <url>http://stat-scm.sourceforge.net/maven2</url>
      </pluginRepository>
      <pluginRepository>
        <id>stat-scm-sourceforge-snapshot</id>
        <url>http://stat-scm.sourceforge.net/maven2-snapshots</url>
      </pluginRepository>
    </pluginRepositories>
    <distributionManagement>
      <repository>
        <id>releases</id>
        <name>GEMS Releases</name>
        <url>http://sel.ic.uff.br/nexus/content/repositories/releases</url>
      </repository>
      <snapshotRepository>
        <id>snapshots</id>
        <name>GEMS Snapshots</name>
        <url>http://sel.ic.uff.br/nexus/content/repositories/snapshots</url>
      </snapshotRepository>
    </distributionManagement>
    <repositories>
      <repository>
        <id>public</id>
        <name>GEMs Public</name>
        <url>http://sel.ic.uff.br/nexus/content/groups/public</url>
      </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.5.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.java-diff-utils</groupId>
            <artifactId>diffutils</artifactId>
            <version>1.2.1</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.1</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>net.sf.opencsv</groupId>
            <artifactId>opencsv</artifactId>
            <version>2.0</version>
        </dependency>
    </dependencies>
    <build>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
      </plugins>
    </build>
    <profiles>
        <profile>
            <id>release-profile</id>
            <properties>
                <maven.test.skip>true</maven.test.skip>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <phase>install</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.12.4</version>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>src/test/java/br/uff/ic/oceano/util/tests.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>memory-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.12.4</version>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>src/test/java/br/uff/ic/oceano/util/tests.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>local-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.12.4</version>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>src/test/java/br/uff/ic/oceano/util/tests.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>memory-debug</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.12.4</version>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>src/test/java/br/uff/ic/oceano/util/tests.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>


text:
from django.contrib.contenttypes.models import ContentType

# lfs imports
from lfs.core.utils import import_symbol

class Criteria(object):
    """
    Base class for objects which have criteria.
    """
    def is_valid(self, request, product=None):
        """
        Returns ``True`` if the object is valid, otherwise ``False``.
        """
        for criterion in self.get_criteria():
            criterion.request = request
            criterion.product = product
            if not criterion.is_valid():
                return False
        return True

    def get_criteria(self):
        """
        Returns all criteria of the object.
        """
        content_type = ContentType.objects.get_for_model(self)

        criteria = []
        from lfs.criteria.models import Criterion
        for criterion in Criterion.objects.filter(content_id=self.id, content_type=content_type):
            criteria.append(criterion.get_content_object())
        return criteria

    def save_criteria(self, request):
        """
        Saves all passed criteria (via request.POST) to the object.
        """
        # First we delete all existing criteria objects for the given object.
        for co in self.get_criteria():
            co.delete()

        # Then we add all passed criteria to the object.
        for key, model in request.POST.items():
            if key.startswith("type"):
                try:
                    id = key.split("-")[1]
                except KeyError:
                    continue

                # Get the values for the criterion
                operator = request.POST.get("operator-%s" % id)
                position = request.POST.get("position-%s" % id)

                criterion_class = import_symbol(model)
                criterion = criterion_class.objects.create(content=self, operator=operator, position=position)

                if criterion.get_value_type() == criterion.MULTIPLE_SELECT:
                    value = request.POST.getlist("value-%s" % id)
                else:
                    value = request.POST.get("value-%s" % id)

                criterion.update(value)


text:
package com.headwire.aemsolrsearch.geometrixxmedia.model;

import org.apache.sling.api.resource.Resource;
import org.apache.sling.models.annotations.Default;
import org.apache.sling.models.annotations.Model;
import org.apache.sling.models.annotations.Optional;

import javax.inject.Inject;
import javax.inject.Named;

/**
 * @author Gaston Gonzalez
 */
@Model(adaptables = Resource.class)
public class GeometrixxMediaAuthorSummary {

    @Inject @Named("givenName") @Default(values = "") @Optional
    private String firstName;

    @Inject @Named("familyName") @Default(values = "") @Optional
    private String lastName;

    public String getFirstName() {
        return firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public String displayName() {
        return firstName + " " + lastName;
    }

    @Override public String toString() {
        final StringBuilder sb = new StringBuilder("GeometrixxMediaAuthorSummary{");
        sb.append("firstName='").append(firstName).append('\'');
        sb.append(", lastName='").append(lastName).append('\'');
        sb.append('}');
        return sb.toString();
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>com.phonefactor</groupId>
  <artifactId>PhoneFactorSDK</artifactId>
  <versioning>
    <release>2.13</release>
    <versions>
      <version>2.13</version>
    </versions>
    <lastUpdated>20130401141314</lastUpdated>
  </versioning>
</metadata>


text:
package main

import (
	"errors"
	"flag"
	"os"
	"os/signal"
	"sync"
	"syscall"
	"time"

	"github.com/sirupsen/logrus"
	"k8s.io/test-infra/prow/pjutil"

	v1 "k8s.io/test-infra/prow/apis/prowjobs/v1"
	prowjobinformer "k8s.io/test-infra/prow/client/informers/externalversions"
	"k8s.io/test-infra/prow/config"
	"k8s.io/test-infra/prow/config/secret"
	"k8s.io/test-infra/prow/crier"
	prowflagutil "k8s.io/test-infra/prow/flagutil"
	gerritclient "k8s.io/test-infra/prow/gerrit/client"
	gerritreporter "k8s.io/test-infra/prow/gerrit/reporter"
	githubreporter "k8s.io/test-infra/prow/github/reporter"
	"k8s.io/test-infra/prow/kube"
	"k8s.io/test-infra/prow/logrusutil"
	pubsubreporter "k8s.io/test-infra/prow/pubsub/reporter"
	slackreporter "k8s.io/test-infra/prow/slack/reporter"
)

const (
	resync         = 0 * time.Minute
	controllerName = "prow-crier"
)

type options struct {
	client         prowflagutil.ExperimentalKubernetesOptions
	cookiefilePath string
	gerritProjects gerritclient.ProjectsFlag
	github         prowflagutil.GitHubOptions

	configPath    string
	jobConfigPath string

	gerritWorkers int
	pubsubWorkers int
	githubWorkers int
	slackWorkers  int

	slackTokenFile string

	dryrun      bool
	reportAgent string
}

func (o *options) validate() error {
	if o.configPath == "" {
		return errors.New("required flag --config-path was unset")
	}

	// TODO(krzyzacy): gerrit && github report are actually stateful..
	// Need a better design to re-enable parallel reporting
	if o.gerritWorkers > 1 {
		logrus.Warn("gerrit reporter only supports one worker")
		o.gerritWorkers = 1
	}

	if o.githubWorkers > 1 {
		logrus.Warn("github reporter only supports one worker (https://github.com/kubernetes/test-infra/issues/13306)")
		o.githubWorkers = 1
	}

	if o.gerritWorkers+o.pubsubWorkers+o.githubWorkers+o.slackWorkers <= 0 {
		return errors.New("crier need to have at least one report worker to start")
	}

	if o.gerritWorkers > 0 {
		if len(o.gerritProjects) == 0 {
			return errors.New("--gerrit-projects must be set")
		}

		if o.cookiefilePath == "" {
			logrus.Info("--cookiefile is not set, using anonymous authentication")
		}
	}

	if o.githubWorkers > 0 {
		if err := o.github.Validate(o.dryrun); err != nil {
			return err
		}
	}

	if o.slackWorkers > 0 {
		if o.slackTokenFile == "" {
			return errors.New("--slack-token-file must be set")
		}
	}

	if err := o.client.Validate(o.dryrun); err != nil {
		return err
	}

	return nil
}

func (o *options) parseArgs(fs *flag.FlagSet, args []string) error {

	o.gerritProjects = gerritclient.ProjectsFlag{}

	fs.StringVar(&o.cookiefilePath, "cookiefile", "", "Path to git http.cookiefile, leave empty for anonymous")
	fs.Var(&o.gerritProjects, "gerrit-projects", "Set of gerrit repos to monitor on a host example: --gerrit-host=https://android.googlesource.com=platform/build,toolchain/llvm, repeat flag for each host")
	fs.IntVar(&o.gerritWorkers, "gerrit-workers", 0, "Number of gerrit report workers (0 means disabled)")
	fs.IntVar(&o.pubsubWorkers, "pubsub-workers", 0, "Number of pubsub report workers (0 means disabled)")
	fs.IntVar(&o.githubWorkers, "github-workers", 0, "Number of github report workers (0 means disabled)")
	fs.IntVar(&o.slackWorkers, "slack-workers", 0, "Number of Slack report workers (0 means disabled)")
	fs.StringVar(&o.slackTokenFile, "slack-token-file", "", "Path to a Slack token file")
	fs.StringVar(&o.reportAgent, "report-agent", "", "Only report specified agent - empty means report to all agents (effective for github and Slack only)")

	fs.StringVar(&o.configPath, "config-path", "", "Path to config.yaml.")
	fs.StringVar(&o.jobConfigPath, "job-config-path", "", "Path to prow job configs.")

	// TODO(krzyzacy): implement dryrun for gerrit/pubsub
	fs.BoolVar(&o.dryrun, "dry-run", false, "Run in dry-run mode, not doing actual report (effective for github and Slack only)")

	o.github.AddFlags(fs)
	o.client.AddFlags(fs)

	fs.Parse(args)

	return o.validate()
}

func parseOptions() options {
	var o options

	if err := o.parseArgs(flag.CommandLine, os.Args[1:]); err != nil {
		logrus.WithError(err).Fatal("Invalid flag options")
	}

	return o
}

func main() {
	logrusutil.ComponentInit("crier")

	o := parseOptions()

	pjutil.ServePProf()

	configAgent := &config.Agent{}
	if err := configAgent.Start(o.configPath, o.jobConfigPath); err != nil {
		logrus.WithError(err).Fatal("Error starting config agent.")
	}
	cfg := configAgent.Config

	prowjobClientset, err := o.client.ProwJobClientset(cfg().ProwJobNamespace, o.dryrun)
	if err != nil {
		logrus.WithError(err).Fatal("unable to create prow job client")
	}

	prowjobInformerFactory := prowjobinformer.NewSharedInformerFactory(prowjobClientset, resync)

	var controllers []*crier.Controller

	// track all worker status before shutdown
	wg := &sync.WaitGroup{}

	if o.slackWorkers > 0 {
		if cfg().SlackReporter == nil {
			logrus.Fatal("slackreporter is enabled but has no config")
		}
		slackConfig := func() *config.SlackReporter {
			return cfg().SlackReporter
		}
		slackReporter, err := slackreporter.New(slackConfig, o.dryrun, o.slackTokenFile)
		if err != nil {
			logrus.WithError(err).Fatal("failed to create slackreporter")
		}
		controllers = append(
			controllers,
			crier.NewController(
				prowjobClientset,
				kube.RateLimiter(slackReporter.GetName()),
				prowjobInformerFactory.Prow().V1().ProwJobs(),
				slackReporter,
				o.slackWorkers,
				wg))
	}

	if o.gerritWorkers > 0 {
		informer := prowjobInformerFactory.Prow().V1().ProwJobs()
		gerritReporter, err := gerritreporter.NewReporter(o.cookiefilePath, o.gerritProjects, informer.Lister())
		if err != nil {
			logrus.WithError(err).Fatal("Error starting gerrit reporter")
		}

		controllers = append(
			controllers,
			crier.NewController(
				prowjobClientset,
				kube.RateLimiter(gerritReporter.GetName()),
				informer,
				gerritReporter,
				o.gerritWorkers,
				wg))
	}

	if o.pubsubWorkers > 0 {
		pubsubReporter := pubsubreporter.NewReporter(cfg)
		controllers = append(
			controllers,
			crier.NewController(
				prowjobClientset,
				kube.RateLimiter(pubsubReporter.GetName()),
				prowjobInformerFactory.Prow().V1().ProwJobs(),
				pubsubReporter,
				o.pubsubWorkers,
				wg))
	}

	if o.githubWorkers > 0 {
		secretAgent := &secret.Agent{}
		if o.github.TokenPath != "" {
			if err := secretAgent.Start([]string{o.github.TokenPath}); err != nil {
				logrus.WithError(err).Fatal("Error starting secrets agent")
			}
		}

		githubClient, err := o.github.GitHubClient(secretAgent, o.dryrun)
		if err != nil {
			logrus.WithError(err).Fatal("Error getting GitHub client.")
		}

		githubReporter := githubreporter.NewReporter(githubClient, cfg, v1.ProwJobAgent(o.reportAgent))
		controllers = append(
			controllers,
			crier.NewController(
				prowjobClientset,
				kube.RateLimiter(githubReporter.GetName()),
				prowjobInformerFactory.Prow().V1().ProwJobs(),
				githubReporter,
				o.githubWorkers,
				wg))
	}

	if len(controllers) == 0 {
		logrus.Fatalf("should have at least one controller to start crier.")
	}

	stopCh := make(chan struct{})
	defer close(stopCh)

	// run the controller loop to process items
	prowjobInformerFactory.Start(stopCh)
	for _, controller := range controllers {
		go controller.Run(stopCh)
	}

	sigTerm := make(chan os.Signal, 1)
	signal.Notify(sigTerm, syscall.SIGTERM)
	signal.Notify(sigTerm, syscall.SIGINT)

	<-sigTerm
	logrus.Info("Crier received a termination signal and is shutting down...")
	for range controllers {
		stopCh <- struct{}{}
	}

	// waiting for all crier worker to finish
	c := make(chan struct{})
	go func() {
		defer close(c)
		wg.Wait()
	}()
	select {
	case <-c:
		logrus.Info("All worker finished, exiting crier")
	case <-time.After(10 * time.Second):
		logrus.Info("timed out waiting for all worker to finish")
	}
}


text:
(function(angular) {
  angular.module('ngIsoConstants.config', [])
    .value('ngIsoConstants.config', {
      debug: true
    });

  angular.module('ngIsoConstants.filters', []);
  angular.module('ngIsoConstants.services', []);
  angular.module('ngIsoConstants', [
    'ngIsoConstants.config',
    'ngIsoConstants.filters',
    'ngIsoConstants.services'
  ]);

})(angular);


text:
#if NET35
using System.Security;
using System.Runtime.InteropServices;

namespace System.Runtime.CompilerServices
{
    [StructLayout(LayoutKind.Sequential), ComVisible(false)]
    internal struct DependentHandle
    {
        private WeakReference _primary;
        private object _secondary;

        [SecurityCritical]
        public DependentHandle(object primary, object secondary)
        {
            _primary = new WeakReference(primary);
            _secondary = secondary;
        }

        public bool IsAllocated
        {
            get { return ((_primary != null) && _primary.IsAlive); }
        }

        [SecurityCritical]
        public object GetPrimary() { return _primary.Target; }

        [SecurityCritical]
        public void GetPrimaryAndSecondary(out object primary, out object secondary)
        {
            primary = _primary.Target;
            secondary = _secondary;
        }

        // Forces dependentHandle back to non-allocated state (if not already there) and frees the handle if needed.
        [SecurityCritical]
        public void Free()
        {
            _primary = null;
            _secondary = null;
        }
    }
}

#endif


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lloydella dissita var. griseocerea Rick

### Remarks
null


text:
<?php

class Google_Service_Dialogflow_GoogleCloudDialogflowCxV3beta1TestCaseResult extends Google_Collection
{
  protected $collection_key = 'conversationTurns';
  protected $conversationTurnsType = 'Google_Service_Dialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurn';
  protected $conversationTurnsDataType = 'array';
  public $environment;
  public $name;
  public $testResult;
  public $testTime;

  /**
   * @param Google_Service_Dialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurn[]
   */
  public function setConversationTurns($conversationTurns)
  {
    $this->conversationTurns = $conversationTurns;
  }
  /**
   * @return Google_Service_Dialogflow_GoogleCloudDialogflowCxV3beta1ConversationTurn[]
   */
  public function getConversationTurns()
  {
    return $this->conversationTurns;
  }
  public function setEnvironment($environment)
  {
    $this->environment = $environment;
  }
  public function getEnvironment()
  {
    return $this->environment;
  }
  public function setName($name)
  {
    $this->name = $name;
  }
  public function getName()
  {
    return $this->name;
  }
  public function setTestResult($testResult)
  {
    $this->testResult = $testResult;
  }
  public function getTestResult()
  {
    return $this->testResult;
  }
  public function setTestTime($testTime)
  {
    $this->testTime = $testTime;
  }
  public function getTestTime()
  {
    return $this->testTime;
  }
}


text:
export default (db, { ENUM, INTEGER, STRING }) => {
  return db.define('User', {
    id: {
      type: INTEGER,
      primaryKey: true,
      autoIncrement: true
    },
    uniqId: {
      type: STRING,
      unique: true,
      allowNull: false
    },
    username: {
      type: STRING,
      allowNull: false,
      unique: true
    },
    email: {
      type: STRING,
      allowNull: false,
      unique: true
    },
    password: {
      type: STRING,
      allowNull: false
    },
    fullName: {
      type: STRING
    },
    status: {
      type: ENUM('active', 'banned', 'inactive', 'pending'),
      allowNull: false,
      defaultValue: 'inactive'
    }
  }, {
    name: { singular: 'user', plural: 'users' },
    classMethods: {
      defineRelationship
    }
  })
}

function defineRelationship({ Role, User }) {
  User.belongsTo(Role, {
    foreignKey: { name: 'roleId', allowNull: false },
    onUpdate: 'CASCADE',
    onDelete: 'CASCADE'
  })
}


text:
export * from "./Text";
export * from "./List";
export * from "./Headings";


text:
require 'chef/knife'

class Chef
  class Knife
    class NodeBulkRunListRemove < Knife
      deps do
        require 'chef/knife/node_run_list_remove'
        require 'chef/search/query'
      end

      banner "knife node bulk run_list remove QUERY [ENTRY,[ENTRY]] (options)"

      def run
        node_list = Array.new
        q = Chef::Search::Query.new
        @nodes = q.search(:node, @name_args[0])[0]
        @name_args.shift
        @nodes.each do |n|
          node_list.push n.name
        end
        if node_list.length == 0
          ui.fatal("No nodes returned from search!")
        end

        ui.info("Found nodes: #{node_list.join(',')}")

        node_list.each do |n|
          Chef::Knife::NodeRunListRemove.new([n] + @name_args).run
        end
      end
    end
  end
end


text:
package org.bson.codecs.pojo.entities;

public final class FieldReusingClassTypeParameter<A> {

    private GenericTreeModel<A, A> tree;

    public FieldReusingClassTypeParameter(){
    }

    public FieldReusingClassTypeParameter(final GenericTreeModel<A, A> tree) {
        this.tree = tree;
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        FieldReusingClassTypeParameter<?> that = (FieldReusingClassTypeParameter<?>) o;

        if (tree != null ? !tree.equals(that.tree) : that.tree != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return tree != null ? tree.hashCode() : 0;
    }
}