text:
namespace boost {
namespace serialization {
    class extended_type_info;
} // namespace serialization

// forward declarations
namespace archive {
namespace detail {

class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive;
class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer;

class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer
    : public basic_serializer {
protected:
    explicit basic_pointer_iserializer(
        const boost::serialization::extended_type_info & type_
    );
    // account for bogus gcc warning
    #if defined(__GNUC__)
    virtual
    #endif
    ~basic_pointer_iserializer();
public:
    virtual const basic_iserializer & get_basic_serializer() const = 0;
    virtual void load_object_ptr(
        basic_iarchive & ar,
        void * & x,
        const unsigned int file_version
    ) const = 0;
};

} // namespace detail
} // namespace archive
} // namespace boost

#ifdef BOOST_MSVC
#pragma warning(pop)
#endif

#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas

#endif // BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP


text:
"""
Contains classes and functions that a SAML2.0 Service Provider (SP) may use
to do attribute aggregation.
"""
import logging
#from saml2 import client
from saml2 import BINDING_SOAP

logger = logging.getLogger(__name__)

DEFAULT_BINDING = BINDING_SOAP

class AttributeResolver(object):

    def __init__(self, saml2client, metadata=None, config=None):
        self.metadata = metadata

        self.saml2client = saml2client
        self.metadata = saml2client.config.metadata

    def extend(self, name_id, issuer, vo_members):
        """
        :param name_id: The identifier by which the subject is know
            among all the participents of the VO
        :param issuer: Who am I the poses the query
        :param vo_members: The entity IDs of the IdP who I'm going to ask
            for extra attributes
        :return: A dictionary with all the collected information about the
            subject
        """
        result = []
        for member in vo_members:
            for ass in self.metadata.attribute_consuming_service(member):
                for attr_serv in ass.attribute_service:
                    logger.info(
                        "Send attribute request to %s" % attr_serv.location)
                    if attr_serv.binding != BINDING_SOAP:
                        continue
                    # attribute query assumes SOAP binding
                    session_info = self.saml2client.attribute_query(
                        name_id, attr_serv.location, issuer_id=issuer,
)
                    if session_info:
                        result.append(session_info)
        return result

redpajama_set_name: RedPajamaGithub


text:
/* eslint-env node */
/** @type {import('eslint').Linter.Config */
const config = {
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 2018,
    sourceType: 'module'
  },
  plugins: ['@typescript-eslint', 'jest'],
  extends: [
    'plugin:jest/recommended',
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:react-hooks/recommended',
    'prettier',
    'plugin:prettier/recommended',
    'plugin:import/recommended',
    'plugin:import/typescript'
  ],
  settings: {
    'import/parsers': {
      '@typescript-eslint/parser': ['.ts', '.tsx']
    }
  },
  rules: {
    'import/no-unresolved': 'off',
    'prettier/prettier': 'warn',
    'no-console': 'warn'
  },
  overrides: [
    {
      files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
      env: {
        jest: true
      },
      extends: ['plugin:jest/recommended', 'plugin:testing-library/react'],
      rules: {
        'testing-library/no-render-in-setup': 'off',
        'testing-library/no-node-access': 'off'
      }
    }
  ]
};

module.exports = config;


text:
/**
 * @file
 * @brief Heap implementation based on boundary markers algorithm.
 * @details
 *    Segment structure:
 *    |struct mm_segment| *** space for bm ***|
 *
 *    TODO:
 *    Should be improved by usage of page_alloc when size is divisible by PAGE_SIZE()
 *    Also SLAB allocator can be used when size is 16, 32, 64, 128...
 *
 * @date 04.03.2014
 * @author Alexander Kalmuk
 */

#include <util/err.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>

#include <mem/heap_bm.h>
#include <mem/page.h>

#include <util/dlist.h>
#include <util/array.h>
#include <util/log.h>

#include <kernel/printk.h>
#include <kernel/panic.h>

#include <mem/heap/mspace_malloc.h>

#include <kernel/sched/sched_lock.h>

/* TODO make it per task field */
//static DLIST_DEFINE(task_mem_segments);

//#define DEBUG

extern struct page_allocator *__heap_pgallocator;
extern struct page_allocator *__heap_pgallocator2 __attribute__((weak));
extern struct page_allocator *__heap_fixed_pgallocator __attribute__((weak));

struct mm_heap_allocator {
	struct page_allocator **pg_allocator;
	heap_type_t type;
};

static struct mm_heap_allocator const mm_page_allocs[] = {
	{ &__heap_pgallocator, HEAP_RAM },
	{ &__heap_pgallocator2, HEAP_FAST_RAM },
	{ &__heap_fixed_pgallocator, HEAP_EXTERN_MEM },
};

static struct mm_heap_allocator const *mm_cur_allocator =
	&mm_page_allocs[0];

static void *mm_segment_alloc(int page_cnt) {
	void *ret;
	int i;

	ret = page_alloc(*mm_cur_allocator->pg_allocator, page_cnt);
	if (ret) {
		return ret;
	}

	/* Requsted memory wasn't allocated by mm_cur_allocator->pg_allocator above,
	 * because due to there is no more free memory. Try find new allocator */
	for (i = 0; i < ARRAY_SIZE(mm_page_allocs); i++) {
		if (mm_page_allocs[i].pg_allocator
				&& *mm_page_allocs[i].pg_allocator) {
			ret = page_alloc(*mm_page_allocs[i].pg_allocator, page_cnt);
			if (ret) {
				mm_cur_allocator = &mm_page_allocs[i];
				break;
			}
		}
	}

	return ret;
}

/* XXX This functionality is experimental and currently only used
 * in PISJP (stm32f7-discovery). Please, be careful if you want to use
 * this function. */
int mspace_set_heap(heap_type_t type, heap_type_t *prev_type) {
	if (prev_type) {
		*prev_type = mm_cur_allocator->type;
	}

	switch (type) {
	case HEAP_FAST_RAM:
	case HEAP_RAM:
	case HEAP_EXTERN_MEM:
		if (!mm_page_allocs[type].pg_allocator) {
			return -1;
		}
		mm_cur_allocator = &mm_page_allocs[type];
		break;
	default:
		log_error("Unknown heap type - %d\n", type);
		return -1;
	}

	return 0;
}

static void mm_segment_free(void *segment, int page_cnt) {
	int i;
	for (i = 0; i < ARRAY_SIZE(mm_page_allocs); i++) {
		if (mm_page_allocs[i].pg_allocator &&
				page_belong(*mm_page_allocs[i].pg_allocator, segment)) {
			page_free(*mm_page_allocs[i].pg_allocator, segment, page_cnt);
			break;
		}
	}
}

struct mm_segment {
	struct dlist_head link;
	size_t size;
};

static inline int pointer_inside_segment(void *segment, size_t size, void *pointer) {
	return (pointer > segment && pointer < (segment + size));
}

static inline void *mm_to_segment(struct mm_segment *mm) {
	assert(mm);
	return ((char *) mm + sizeof *mm);
}

static void *pointer_to_mm(void *ptr, struct dlist_head *mspace) {
	struct mm_segment *mm;

	assert(ptr);
	assert(mspace);

	dlist_foreach_entry(mm, mspace, link) {
		if (pointer_inside_segment(mm_to_segment(mm), mm->size, ptr)) {
			return mm;
		}
	}

	return NULL;
}

static void *mspace_do_alloc(size_t boundary, size_t size, struct dlist_head *mspace) {
	struct mm_segment *mm;
	dlist_foreach_entry(mm, mspace, link) {
		void *block = bm_memalign(mm_to_segment(mm), boundary, size);
		if (block != NULL) {
			return block;
		}
	}

	return NULL;
}

/*
 * It's basically required for more efficient memory consuming.
 * It's more efficient to allocate many pages at once rather than
 * many small pieces.
 **/
#if OPTION_GET(BOOLEAN, task_is_greed)
static struct mm_segment *mm_try_alloc_segment(size_t size, size_t boundary) {
	/* Try to allocate as much size as possible starting with 1Mb.
	 * Why 1Mb? Don't know, magical number.. Since it should be maximum size
	 * of all available heaps in Embox, but it's more difficult to implement. */
	const size_t max_size = (0x100000 + PAGE_SIZE()) / PAGE_SIZE();
	const size_t min_size = (size + boundary + PAGE_SIZE()) / PAGE_SIZE();
	size_t i;
	struct mm_segment *mm = NULL;

	for (i = max_size; i > min_size; i--) {
		mm = mm_segment_alloc(i);
		if (mm) {
			break;
		}
	}
	if (mm) {
		mm->size = i * PAGE_SIZE();
	}
	return mm;
}
#else
static struct mm_segment *mm_try_alloc_segment(size_t size, size_t boundary) {
	size_t pages_cnt;
	struct mm_segment *mm = NULL;

	pages_cnt = size / PAGE_SIZE() + boundary / PAGE_SIZE();
	pages_cnt += (size % PAGE_SIZE() + boundary % PAGE_SIZE()
			+ 2 * PAGE_SIZE()) / PAGE_SIZE();
	mm = mm_segment_alloc(pages_cnt);
	if (mm) {
		mm->size = pages_cnt * PAGE_SIZE();
	}
	return mm;
}
#endif

void *mspace_memalign(size_t boundary, size_t size, struct dlist_head *mspace) {
	/* No corresponding heap was found */
	struct mm_segment *mm;
	void *block = NULL;

	if (size == 0) {
		return NULL;
	}

	sched_lock();

	assert(mspace);

	block = mspace_do_alloc(boundary, size, mspace);
	if (block) {
		goto out_unlock;
	}

	mm = mm_try_alloc_segment(size, boundary);
	if (mm == NULL) {
		goto out_unlock;
	}
	dlist_head_init(&mm->link);
	dlist_add_next(&mm->link, mspace);

	bm_init(mm_to_segment(mm), mm->size - sizeof(struct mm_segment));

	block = mspace_do_alloc(boundary, size, mspace);
	if (!block) {
		panic("new memory block is not sufficient to allocate requested size");
	}

out_unlock:
	sched_unlock();

	return block;
}

void *mspace_malloc(size_t size, struct dlist_head *mspace) {
	assert(mspace);
	return mspace_memalign(8, size, mspace);
}

int mspace_free(void *ptr, struct dlist_head *mspace) {
	int res = 0;
	struct mm_segment *mm;

	assert(ptr);
	assert(mspace);

	sched_lock();

	mm = pointer_to_mm(ptr, mspace);

	if (mm != NULL) {
		void *segment;

		segment = mm_to_segment(mm);
		bm_free(segment, ptr);

		if (bm_heap_is_empty(segment)) {
			mm_segment_free(mm, mm->size / PAGE_SIZE());
			dlist_del(&mm->link);
		}
	} else {
		/* No segment containing pointer @c ptr was found. */
		res = -1;
#ifdef DEBUG
		printk("***** free(): incorrect address space\n");
#endif
		goto out;
	}

out:
	sched_unlock();

	return res;
}

void *mspace_realloc(void *ptr, size_t size, struct dlist_head *mspace) {
	void *ret;

	assert(mspace);
	assert(size != 0 || ptr == NULL);

	ret = mspace_memalign(8, size, mspace);

	if (ret == NULL) {
		return NULL; /* error: errno set in malloc */
	}

	if (ptr == NULL) {
		return ret;
	}

	/* The content of new region will be unchanged in the range from the start of the region up to
	 * the minimum of the old and new sizes. So simply copy size bytes (may be with redundant bytes) */
	memcpy(ret, ptr, size);
	if (0 > mspace_free(ptr, mspace)) {
		mspace_free(ret, mspace);
		return err_ptr(EINVAL);
	}

	return ret;
}

void *mspace_calloc(size_t nmemb, size_t size, struct dlist_head *mspace) {
	void *ret;
	size_t total_size;

	total_size = nmemb * size;

	assert(mspace);
	assert(total_size > 0);

	ret = mspace_malloc(total_size, mspace);
	if (ret == NULL) {
		return NULL; /* error: errno set in malloc */
	}

	memset(ret, 0, total_size);
	return ret;
}

int mspace_init(struct dlist_head *mspace) {
	dlist_init(mspace);
	return 0;
}

int mspace_fini(struct dlist_head *mspace) {
	struct mm_segment *mm = NULL;

	dlist_foreach_entry(mm, mspace, link) {
		mm_segment_free(mm, mm->size / PAGE_SIZE());
	}

	return 0;
}

size_t mspace_deep_copy_size(struct dlist_head *mspace) {
	struct mm_segment *mm = NULL;
	size_t ret;

	ret = 0;
	dlist_foreach_entry(mm, mspace, link) {
		ret += mm->size;
	}
	return ret;
}

void mspace_deep_store(struct dlist_head *mspace, struct dlist_head *store_space, void *buf) {
	struct mm_segment *mm = NULL;
	void *p;

	dlist_init(store_space);

	/* if mspace is empty list manipulation is illegal */
	if (dlist_empty(mspace)) {
		return;
	}

	dlist_del(mspace);
	dlist_add_prev(store_space, mspace->next);

	p = buf;
	dlist_foreach_entry(mm, store_space, link) {
		memcpy(p, mm, mm->size);
		p += mm->size;
	}

	dlist_del(store_space);
	dlist_add_prev(mspace, mspace->next);
}

void mspace_deep_restore(struct dlist_head *mspace, struct dlist_head *store_space, void *buf) {
	struct dlist_head *raw_mm;
	void *p;

	assert(mspace);
	assert(store_space);
	assert(buf);

	dlist_init(mspace);

	p = buf;
	raw_mm = store_space->next;

	/* can't use foreach, since it stores next pointer in accumulator */
	while (raw_mm != store_space) {
		struct mm_segment *buf_mm, *mm;

		buf_mm = p;

		mm = member_cast_out(raw_mm, struct mm_segment, link);
		memcpy(mm, buf_mm, buf_mm->size);

		p += buf_mm->size;
		raw_mm = raw_mm->next;
	}

	if (!dlist_empty(store_space)) {
		dlist_del(store_space);
		dlist_add_prev(mspace, store_space->next);
	}
}


text:
<?php

class ClassWithStaticMethod {

    public static function staticMethod() {

    }

}


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="@dimen/nav_header_height"
    android:background="@color/colorPrimaryDark"
    android:gravity="bottom"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:theme="@style/Base.Theme.MTApp"
    android:weightSum="1">

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true">

        <ImageView
            android:id="@+id/imageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginStart="5dp"
            android:layout_marginTop="10dp"
            android:paddingTop="@dimen/nav_header_vertical_spacing"
            app:srcCompat="@mipmap/ic_launcher" />

        <TextView
            android:id="@+id/textView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginStart="5dp"
            android:layout_marginTop="10dp"
            android:layout_toEndOf="@id/imageView"
            android:gravity="center"
            android:paddingTop="@dimen/nav_header_vertical_spacing"
            android:text="@string/moneytrack"
            android:textAppearance="@style/TextAppearance.AppCompat.Body1"
            android:textColor="@color/white"
            android:textSize="25sp"
            android:textStyle="bold" />

    </RelativeLayout>

</LinearLayout>


text:
Allows simple browsing and renaming of FITS images based on header information

Explanation
====================

The header of a FITS image can contain all sorts of useful information about
the time the image was taken, exposure time, filters used, etc. Often the images
are just named sequentially, and it can be very tedious to open up each image
in a program and view its header to determine if it is the one you want.

This program simplifies that procedure, allowing one to sort a large number of files
at once based on any number of FITS header tokens. The files can be renamed based on the
value of token(s) to make the filenames more readable, and can even be moved to a separate
directory by prepending it to the rename mask.

It's a beast with many headers. Right?

Using/Installing FITS Hydra
====================
FITS Hydra can be run using the Python (2.7) interpreter. Required python libraries are:
- wxpython
- pyfits

If the python interpreter is in the path the script can be run from any location.

FITS Hydra has also been compiled into standalone executables for some systems using the
PyInstaller program. These are found in the exec/ folder and can be run on a system
without the necessary libraries or even a python interpreter.

To compile standalone executables for other systems using PyInstaller, obtain
the program from https://github.com/pyinstaller/pyinstaller (additional information
at http://www.pyinstaller.org ), download this repository, and run the command

      pyinstaller fits_hydra.py -F -w -i <icon_file>

where *icon_file* is the appropriate icon file found in icons/, if desired.

MIT License


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class ubah_password extends CI_Controller {

	public function __construct()
	{
		parent::__construct();
		// if (!$this->session->userdata('SESS_MEMBER_IS_LOGIN') || ($this->session->userdata('SESS_MEMBER_IS_LOGIN') && $this->session->userdata('SESS_MEMBER_USER_PRIV') !== 3))
		// {
		// 	redirect(base_url('member/login'));
		// }
		$this->output->set_header('Last-Modified:'.gmdate('D,d M Y H:i:s').'GMT');
		$this->output->set_header('Cache-Control:post-check=0,pre-check=0',false);
		$this->output->set_header('Pragma: no-cache');

		$this->load->model('m_register');
	}

	public function index()
	{

		$this->load->view('global_home/header_global_home');
		$this->load->view('v_ubah_password');
		$this->load->view('global_home/footer_global_home');
	}
}


text:
@interface Object
@end

@interface SomeBaseClass : Object
+ (nullable instancetype)instancetypeFactoryMethod;
+ (nullable SomeBaseClass *)staticFactoryMethod;
@end

@interface SomeSubclass : SomeBaseClass
@end


text:
package acceptance;

import org.junit.Rule;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import utils.TemporaryDigdagServer;

import java.time.Duration;
import java.net.Socket;
import java.net.InetSocketAddress;

import static java.nio.charset.StandardCharsets.UTF_8;

import static utils.TestUtils.expect;

public class ServerHttpTimeoutIT
{
    @Rule
    public TemporaryDigdagServer server = TemporaryDigdagServer.builder()
            .inProcess(false)
            .configuration(
                    "server.http.no-request-timeout=2",
                    "server.http.request-parse-timeout=2",
                    "server.http.io-idle-timeout=11"
                    )
            .build();

    private Socket socket;

    @Before
    public void setUp()
            throws Exception
    {
        socket = new Socket();
        socket.setTcpNoDelay(true);
        socket.setSoTimeout(30*1000);
        socket.connect(new InetSocketAddress(server.host(), server.port()));
    }

    @After
    public void close()
            throws Exception
    {
        socket.close();
    }

    @Test
    public void verifyNoRequestTimeout()
            throws Exception
    {
        expect(Duration.ofSeconds(10), () -> socket.getInputStream().read() == -1);
    }

    @Test
    public void verifyRequestParseTimeout()
            throws Exception
    {
        socket.getOutputStream().write("GET /api/version HTTP/1.1\r\n".getBytes(UTF_8));
        expect(Duration.ofSeconds(10), () -> socket.getInputStream().read() == -1);
    }

    @Test
    public void verifyRequestBodyTimeout()
            throws Exception
    {
        socket.getOutputStream().write("POST /api/schedules/1/skip HTTP/1.1\r\nContent-Type: application/json\r\nContent-Length: 100\r\n\r\n{\r\n".getBytes(UTF_8));
        expect(Duration.ofSeconds(20), () -> socket.getInputStream().read() == -1);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cassandra.Data.Linq;
using Cassandra.Mapping;
using Cassandra.Tasks;
using Cassandra.Tests.Mapping.Pocos;
using Cassandra.Tests.Mapping.TestData;
using Moq;
using NUnit.Framework;

namespace Cassandra.Tests.Mapping.Linq
{
    public class LinqMappingUnitTests : MappingTestBase
    {
        private ISession GetSession(RowSet result)
        {
            var sessionMock = new Mock<ISession>(MockBehavior.Strict);
            sessionMock
                .Setup(s => s.ExecuteAsync(It.IsAny<IStatement>()))
                .Returns(TestHelper.DelayedTask(result, 200))
                .Verifiable();
            sessionMock.Setup(s => s.PrepareAsync(It.IsAny<string>())).Returns(TaskHelper.ToTask(GetPrepared("Mock query")));
            sessionMock.Setup(s => s.BinaryProtocolVersion).Returns(2);
            return sessionMock.Object;
        }

        [Test]
        public void Linq_CqlQueryBase_Execute_Empty_RowSet()
        {
            var table = GetSession(new RowSet()).GetTable<PlainUser>();
            var entities = table.Where(a => a.UserId == Guid.Empty).Execute();
            Assert.AreEqual(0, entities.Count());
        }

        [Test]
        public void Linq_CqlQueryBase_Execute_Maps_Rows()
        {
            var usersExpected = TestDataHelper.GetUserList();
            var table = new Table<PlainUser>(GetSession(TestDataHelper.GetUsersRowSet(usersExpected)));
            var users = table.Execute().ToList();
            CollectionAssert.AreEqual(usersExpected, users, new TestHelper.PropertyComparer());
        }

        [Test]
        public void Linq_CqlQueryBase_Execute_SingleColumn_Rows()
        {
            var table = new Table<int>(GetSession(TestDataHelper.GetSingleValueRowSet("int_val", 1)));
            var result = table.Execute().ToList();
            CollectionAssert.AreEqual(new[] { 1 }, result.ToArray(), new TestHelper.PropertyComparer());
        }

        [Test]
        public void Linq_CqlQueryBase_Execute_Anonymous_Type()
        {
            var table = GetSession(TestDataHelper.CreateMultipleValuesRowSet(new [] {"age", "long_value"}, new [] {25, 1000})).GetTable<AllTypesEntity>();
            var result = (from e in table select new { user_age = e.IntValue, identifier = e.Int64Value }).Execute().ToList();
            Assert.AreEqual(1000L, result[0].identifier);
            Assert.AreEqual(25, result[0].user_age);
        }

        [Test]
        public void Linq_CqlQueryBase_Execute_Anonymous_Single_Value_Type()
        {
            //It does not have much sense to use an anonymous type with a single value but here it goes!
            var table = GetSession(TestDataHelper.CreateMultipleValuesRowSet(new[] { "age" }, new[] { 25 })).GetTable<AllTypesEntity>();
            var result = (from e in table select new { user_age = e.IntValue }).Execute().ToList();
            Assert.AreEqual(25, result[0].user_age);
        }

        [Test]
        public void Linq_CqlQueryBase_Execute_NoDefaultConstructor()
        {
            var table = GetSession(TestDataHelper.CreateMultipleValuesRowSet(new[] { "age", "long_value" }, new[] { 25, 1000 })).GetTable<AllTypesEntity>();
            var result = (from e in table select new Tuple<int, long>(e.IntValue, e.Int64Value)).Execute().ToList();
            Assert.AreEqual(25, result[0].Item1);
            Assert.AreEqual(1000L, result[0].Item2);
        }

        [Test]
        public void Linq_CqlQuery_ExecutePaged_Maps_Rows()
        {
            var usersExpected = TestDataHelper.GetUserList();
            var rs = TestDataHelper.GetUsersRowSet(usersExpected);
            rs.AutoPage = false;
            rs.PagingState = new byte[] { 1, 2, 3 };
            var table = new Table<PlainUser>(GetSession(rs));
            IPage<PlainUser> users = table.ExecutePaged();
            //It was executed without paging state
            Assert.Null(users.CurrentPagingState);
            Assert.NotNull(users.PagingState);
            CollectionAssert.AreEqual(rs.PagingState, users.PagingState);
            CollectionAssert.AreEqual(usersExpected, users, new TestHelper.PropertyComparer());
        }

        [Test]
        public void Linq_CqlQuery_ExecutePaged_Maps_SingleValues()
        {
            var rs = TestDataHelper.GetSingleColumnRowSet("int_val", new [] {100, 200, 300});
            rs.AutoPage = false;
            rs.PagingState = new byte[] { 2, 2, 2 };
            var table = new Table<int>(GetSession(rs));
            IPage<int> page = table.SetPagingState(new byte[] { 1, 1, 1}).ExecutePaged();
            CollectionAssert.AreEqual(table.PagingState, page.CurrentPagingState);
            CollectionAssert.AreEqual(rs.PagingState, page.PagingState);
            CollectionAssert.AreEqual(new [] { 100, 200, 300}, page.ToArray(), new TestHelper.PropertyComparer());
        }

        [Test]
        public void Linq_CqlQuery_Automatically_Pages()
        {
            const int pageLength = 100;
            var rs = TestDataHelper.GetSingleColumnRowSet("int_val", Enumerable.Repeat(1, pageLength).ToArray());
            BoundStatement stmt = null;
            var sessionMock = new Mock<ISession>(MockBehavior.Strict);
            sessionMock
                .Setup(s => s.ExecuteAsync(It.IsAny<BoundStatement>()))
                .Returns(TestHelper.DelayedTask(rs))
                .Callback<IStatement>(s => stmt = (BoundStatement)s)
                .Verifiable();
            sessionMock.Setup(s => s.PrepareAsync(It.IsAny<string>())).Returns(TaskHelper.ToTask(GetPrepared("Mock query")));
            sessionMock.Setup(s => s.BinaryProtocolVersion).Returns(2);
            rs.AutoPage = true;
            rs.PagingState = new byte[] { 0, 0, 0 };
            var counter = 0;
            rs.FetchNextPage = state =>
            {
                var rs2 = TestDataHelper.GetSingleColumnRowSet("int_val", Enumerable.Repeat(1, pageLength).ToArray());
                if (++counter < 2)
                {
                    rs2.PagingState = new byte[] {0, 0, (byte) counter};
                }
                return rs2;
            };
            var table = new Table<int>(sessionMock.Object);
            IEnumerable<int> results = table.Execute();
            Assert.True(stmt.AutoPage);
            Assert.AreEqual(0, counter);
            Assert.AreEqual(pageLength * 3, results.Count());
            Assert.AreEqual(2, counter);
        }
    }
}


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

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   <title>gsw_geo_strf_Cunningham</title>

gsw_geo_strf_Cunningham

Cunningham geostrophic streamfunction

Contents

USAGE:

DESCRIPTION:

INPUT:

OUTPUT:

EXAMPLE:

AUTHOR:

VERSION NUMBER:

REFERENCES:

USAGE:

geo_strf_Cunningham = gsw_geo_strf_Cunningham(SA,CT,p,p_ref)

DESCRIPTION:

Calculates the Cunningham geostrophic streamfunction (see Eqn. (3.29.2)
of IOC et al. (2010)).  This is the geostrophic streamfunction for the
difference between the horizontal velocity at the pressure concerned,
p, and the horizontal velocity on the pressure surface, p_ref.  This
function calculates specific volume anomaly using the computationally
efficient 48-term expression for specific volume of IOC et al. (2010).

Note that p_ref, is the reference pressure to which the streamfunction
is referenced.  When p_ref is zero, "gsw_geo_strf_Cunningham" returns
the Cunningham geostrophic streamfunction with respect to the sea
surface, otherwise, the function returns the geostrophic streamfunction
with respect to the (deep) reference pressure p_ref.

Note that the 48-term equation has been fitted in a restricted range of
parameter space, and is most accurate inside the "oceanographic funnel"
described in IOC et al. (2010).  The GSW library function
"gsw_infunnel(SA,CT,p)" is avaialble to be used if one wants to test if
some of one's data lies outside this "funnel".

Click for a more detailed description of the Cunningham
streamfunction.

INPUT:

SA   =  Absolute Salinity                                       [ g/kg ]
CT   =  Conservative Temperature                               [ deg C ]
p    =  sea pressure                                            [ dbar ]
        ( i.e. absolute pressure - 10.1325 dbar )
p_ref = reference pressure                                      [ dbar ]
        ( i.e. reference absolute pressure - 10.1325 dbar )

SA & CT need to have the same dimensions.
p may have dimensions Mx1 or 1xN or MxN, where SA & CT are MxN.
p_ref needs to be a single value, it can have dimensions 1x1 or Mx1 or
1xN or MxN.

OUTPUT:

geo_strf_Cunningham = Cunningham geostrophic streamfunction  [ m^2/s^2 ]

EXAMPLE:

SA = [34.7118; 34.8915; 35.0256; 34.8472; 34.7366; 34.7324;]
CT = [28.8099; 28.4392; 22.7862; 10.2262;  6.8272;  4.3236;]
p =  [     10;      50;     125;     250;     600;    1000;]
p_ref = 1000

geo_strf_Cunningham = gsw_geo_strf_Cunningham(SA,CT,p,p_ref)

geo_strf_Cunningham =

  17.893004502475378
  17.819966326875146
  16.224154546318459
  11.382163183421653
   9.576877475752553
   7.122260539475974

AUTHOR:

 Trevor McDougall and Paul Barker                   [ help@teos-10.org ]

VERSION NUMBER:

3.03 (2nd May, 2013)

REFERENCES:

Cunningham, S.A., 2000: Circulation and volume flux of the North
 Atlantic using syoptic hydrographic data in a Bernoulli inverse.
 J. Marine Res., 58, 1-35.

IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
 seawater - 2010: Calculation and use of thermodynamic properties.
 Intergovernmental Oceanographic Commission, Manuals and Guides No. 56,
 UNESCO (English), 196 pp.  Available from the TEOS-10 web site.
  See section 3.29 of this TEOS-10 Manual.

The software is available from http://www.TEOS-10.org


text:
var PopulationGrowth = function () {};

PopulationGrowth.prototype.nbYear = function (p0, percent, aug, p) {
	var n = 0;
	while (p0 < p) {
		p0 += p0 * (percent / 100) + aug;
		n++;
	}
	return n;
};

module.exports = PopulationGrowth;


text:
class OutputStream < StringIO
	def initialize(&block)
		super
		@cb = block;
	end

	def write(data)
		o = ($oldSTDOUT) ? $oldSTDOUT : $stdout;
		o.write(data);

		@cb.call(data);

		super(data);
	end
end


text:
<?php

namespace Catalogue\CatalogueBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Categorie
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Catalogue\CatalogueBundle\Entity\CategorieRepository")
 */
class Categorie
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=45)
     */
    private $nom;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     *
     * @return Categorie
     */
    public function setNom($nom)
    {
        $this->nom = $nom;

        return $this;
    }

    /**
     * Get nom
     *
     * @return string
     */
    public function getNom()
    {
        return $this->nom;
    }

    //function pour rendre le nom de categorie
    public function __toString()
    {
        return $this->getNom();
    }
}


text:
/**
 * init flags.(e.g. arch/platform)
 * @param {Map} flag
 * @return {Map}
 */
export default function initFlag(flag = new Map()) {
  if (this.window && this == this.window) {
    if (typeof process === 'object') {
      flag.set('ARCH', this.process.arch)
      flag.set('PLATFORM', this.process.platform)
      flag.set('NODE_VERSION', this.process.version)
      flag.set('MODULES_VERSION', this.process.versions.modules)
      flag.set('v8_VERSION', this.process.version)
      if (process.versions.nw != void 0) {
        // nwjs
        flag.set('ELECTRON', false)
        flag.set('NWJS', true)
        flag.set('NWJS_VERSION', this.process.versions.nw)
      } else if (process.versions.electron != void 0) {
        // electron
        flag.set('ELECTRON', true)
        flag.set('NWJS', false)
        flag.set('ELECTRON_VERSION', this.process.versions.electron)
      }
    } else {
      // web
      // flag.set('BROWSER', this.navigator.appName)
      // flag.set('BROWSER_VERSION', navigator.appVersion)
      flag.set('LANGUAGE', navigator.language)
    }
  } else {
    // nodejs
    flag.set('ARCH', this.process.arch)
    flag.set('PLATFORM', this.process.platform)
    flag.set('NODE_VERSION', this.process.version)
    flag.set('MODULES_VERSION', this.process.versions.modules)
    flag.set('v8_VERSION', this.process.version)
  }
  return flag
}


text:
package org.innovateuk.ifs.userorganisation.builder;

import org.innovateuk.ifs.BaseBuilder;
import org.innovateuk.ifs.organisation.domain.Organisation;
import org.innovateuk.ifs.user.domain.User;
import org.innovateuk.ifs.userorganisation.domain.UserOrganisation;

import java.util.List;
import java.util.function.BiConsumer;

import static java.util.Collections.emptyList;

/**
 * Builder for UserOrganisation entities.
 */
public class UserOrganisationBuilder extends BaseBuilder<UserOrganisation, UserOrganisationBuilder> {

    private UserOrganisationBuilder(List<BiConsumer<Integer, UserOrganisation>> multiActions) {
        super(multiActions);
    }

    public static UserOrganisationBuilder newUserOrganisation() {
        return new UserOrganisationBuilder(emptyList());
    }

    @Override
    protected UserOrganisationBuilder createNewBuilderWithActions(List<BiConsumer<Integer, UserOrganisation>> actions) {
        return new UserOrganisationBuilder(actions);
    }

    public UserOrganisationBuilder withUser(User... users) {
        return withArraySetFieldByReflection("user", users);
    }

    public UserOrganisationBuilder withOrganisation(Organisation... organisations) {
        return withArraySetFieldByReflection("organisation", organisations);
    }

    @Override
    protected UserOrganisation createInitial() {
        return new UserOrganisation();
    }
}


text:
@interface STAPickerField : STATextField

@property (nonatomic, strong) STAPickerView *pickerView;
@property (nonatomic, strong) NSArray *pickerViewData;

@end


text:
package feeds.acl

import com.typesafe.config.ConfigFactory
import controllers.ArrivalGenerator
import drt.server.feeds.acl.AclFeed
import drt.server.feeds.acl.AclFeed.{arrivalsFromCsvContent, contentFromFileName, latestFileForPort, sftpClient}
import drt.shared
import drt.shared.FlightsApi.Flights
import drt.shared.PaxTypesAndQueues._
import drt.shared.Terminals._
import drt.shared.api.Arrival
import drt.shared.{VoyageNumber, _}
import server.feeds.{ArrivalsFeedFailure, ArrivalsFeedSuccess}
import services.SDate
import services.crunch.{CrunchTestLike, TestConfig}

import scala.collection.immutable.{List, SortedMap}
import scala.concurrent.duration._

class AclFeedSpec extends CrunchTestLike {
  val regularTerminalMapping: Terminal => Terminal = (t: Terminal) => t

  "ACL feed failures" >> {
    val aclFeed = AclFeed("nowhere.nowhere", "badusername", "badpath", PortCode("BAD"), (_: Terminal) => T1, 1000L)

    val result = aclFeed.requestArrivals.getClass

    val expected = classOf[ArrivalsFeedFailure]

    result === expected
  }

  "ACL feed parsing" >> {

    "Given ACL csv content containing a header line and one arrival line " +
      "When I ask for the arrivals " +
      "Then I should see a list containing the appropriate Arrival" >> {
      val csvContent =
        """A/C,ACReg,Airport,ArrDep,CreDate,Date,DOOP,EditDate,Icao Aircraft Type,Icao Last/Next Station,Icao Orig/Dest Station,LastNext,LastNextCountry,Ope,OpeGroup,OpeName,OrigDest,OrigDestCountry,Res,Season,Seats,ServNo,ST,ove.ind,Term,Time,TurnOpe,TurnServNo,OpeFlightNo,LoadFactor
          |32A,,LHR,A,09SEP2016 0606,2017-10-13,0000500,29SEP2017 0959,A320,EDDK,EDDK,CGN,DE,4U,STAR ALLIANCE,GERMANWINGS GMBH,CGN,DE,T2-Intl & CTA,S17,180,0460,J,,2I,0710,4U,0461,4U0460,0.827777802944183
        """.stripMargin

      val arrivals = arrivalsFromCsvContent(csvContent, regularTerminalMapping)
      val expected = List(Arrival(Operator = Option(Operator("4U")), Status = ArrivalStatus("ACL Forecast"), Estimated = None, Actual = None,
        EstimatedChox = None, ActualChox = None, Gate = None, Stand = None, MaxPax = Option(180), ActPax = Option(149),
        TranPax = None, RunwayID = None, BaggageReclaimId = None, AirportID = PortCode("LHR"), Terminal = T2,
        rawICAO = "4U0460", rawIATA = "4U0460", Origin = PortCode("CGN"), FeedSources = Set(shared.AclFeedSource),
        Scheduled = 1507878600000L, PcpTime = None))

      arrivals === expected
    }

    "Given ACL csv content containing a header line and one departure line " +
      "When I ask for the arrivals " +
      "Then I should see an empty list" >> {
      val csvContent =
        """A/C,ACReg,Airport,ArrDep,CreDate,Date,DOOP,EditDate,Icao Aircraft Type,Icao Last/Next Station,Icao Orig/Dest Station,LastNext,LastNextCountry,Ope,OpeGroup,OpeName,OrigDest,OrigDestCountry,Res,Season,Seats,ServNo,ST,ove.ind,Term,Time,TurnOpe,TurnServNo,OpeFlightNo,LoadFactor
          |32A,,LHR,D,09SEP2016 0606,2017-10-13,0000500,29SEP2017 0959,A320,EDDK,EDDK,CGN,DE,4U,STAR ALLIANCE,GERMANWINGS GMBH,CGN,DE,T2-Intl & CTA,S17,180,0460,J,,2I,0710,4U,0461,4U0460,0.827777802944183
        """.stripMargin

      val arrivals = arrivalsFromCsvContent(csvContent, regularTerminalMapping)
      val expected = List()

      arrivals === expected
    }

    "Given ACL csv content containing a header line and one positioning flight " +
      "When I ask for the arrivals " +
      "Then I should see an empty list" >> {
      val csvContent =
        """A/C,ACReg,Airport,ArrDep,CreDate,Date,DOOP,EditDate,Icao Aircraft Type,Icao Last/Next Station,Icao Orig/Dest Station,LastNext,LastNextCountry,Ope,OpeGroup,OpeName,OrigDest,OrigDestCountry,Res,Season,Seats,ServNo,ST,ove.ind,Term,Time,TurnOpe,TurnServNo,OpeFlightNo,LoadFactor
          |32A,,LHR,D,09SEP2016 0606,2017-10-13,0000500,29SEP2017 0959,A320,EDDK,EDDK,CGN,DE,4U,STAR ALLIANCE,GERMANWINGS GMBH,CGN,DE,T2-Intl & CTA,S17,180,0460,J,,2I,0710,4U,0461,4U0460P,0.827777802944183
        """.stripMargin

      val arrivals = arrivalsFromCsvContent(csvContent, regularTerminalMapping)
      val expected = List()

      arrivals === expected
    }

    "Given ACL csv content containing 0 for MaxPax and 0 for load factor " +
      "When I ask for the arrivals " +
      "Then I should see 0 being used for both Max and Act pax" >> {
      val csvContent =
        """A/C,ACReg,Airport,ArrDep,CreDate,Date,DOOP,EditDate,Icao Aircraft Type,Icao Last/Next Station,Icao Orig/Dest Station,LastNext,LastNextCountry,Ope,OpeGroup,OpeName,OrigDest,OrigDestCountry,Res,Season,Seats,ServNo,ST,ove.ind,Term,Time,TurnOpe,TurnServNo,OpeFlightNo,LoadFactor
          |32A,,LHR,A,09SEP2016 0606,2017-10-13,0000500,29SEP2017 0959,A320,EDDK,EDDK,CGN,DE,4U,STAR ALLIANCE,GERMANWINGS GMBH,CGN,DE,T2-Intl & CTA,S17,0,0460,J,,2I,0710,4U,0461,4U0460,0
        """.stripMargin

      val arrivals = arrivalsFromCsvContent(csvContent, regularTerminalMapping)
      val expected = List(
        Arrival(
          Operator = Option(Operator("4U")),
          Status = ArrivalStatus("ACL Forecast"),
          Estimated = None,
          Actual = None,
          EstimatedChox = None,
          ActualChox = None,
          Gate = None,
          Stand = None,
          MaxPax = Option(0),
          ActPax = Option(0),
          TranPax = None,
          RunwayID = None,
          BaggageReclaimId = None,
          AirportID = PortCode("LHR"),
          Terminal = T2,
          rawICAO = "4U0460",
          rawIATA = "4U0460",
          Origin = PortCode("CGN"),
          FeedSources = Set(shared.AclFeedSource),
          Scheduled = 1507878600000L,
          PcpTime = None))

      arrivals === expected
    }

    "Given ACL csv content containing  200 for MaxPax but 0 for load factor " +
      "When I ask for the arrivals " +
      "Then I should see 0 being used for act pax and 200 for Max Pax" >> {
      val csvContent =
        """A/C,ACReg,Airport,ArrDep,CreDate,Date,DOOP,EditDate,Icao Aircraft Type,Icao Last/Next Station,Icao Orig/Dest Station,LastNext,LastNextCountry,Ope,OpeGroup,OpeName,OrigDest,OrigDestCountry,Res,Season,Seats,ServNo,ST,ove.ind,Term,Time,TurnOpe,TurnServNo,OpeFlightNo,LoadFactor
          |32A,,LHR,A,09SEP2016 0606,2017-10-13,0000500,29SEP2017 0959,A320,EDDK,EDDK,CGN,DE,4U,STAR ALLIANCE,GERMANWINGS GMBH,CGN,DE,T2-Intl & CTA,S17,200,0460,J,,2I,0710,4U,0461,4U0460,0
        """.stripMargin

      val arrivals = arrivalsFromCsvContent(csvContent, regularTerminalMapping)
      val expected = List(
        Arrival(
          Operator = Option(Operator("4U")),
          Status = ArrivalStatus("ACL Forecast"),
          Estimated = None,
          Actual = None,
          EstimatedChox = None,
          ActualChox = None,
          Gate = None,
          Stand = None,
          MaxPax = Option(200),
          ActPax = Option(0),
          TranPax = None,
          RunwayID = None,
          BaggageReclaimId = None,
          AirportID = PortCode("LHR"),
          Terminal = T2,
          rawICAO = "4U0460",
          rawIATA = "4U0460",
          Origin = PortCode("CGN"),
          FeedSources = Set(shared.AclFeedSource),
          Scheduled = 1507878600000L,
          PcpTime = None))

      arrivals === expected
    }

    "ACL Flights " >> {
      "Given an ACL feed with one flight and no live flights" +
        "When I ask for a crunch " +
        "Then I should see that flight in the PortState" >> {
        val scheduled = "2017-01-01T00:00Z"
        val arrival = ArrivalGenerator.arrival(iata = "BA0001", schDt = scheduled, actPax = Option(10))
        val aclFlight = Flights(List(arrival))

        val fiveMinutes = 600d / 60

        val crunch = runCrunchGraph(TestConfig(
          now = () => SDate(scheduled),
          airportConfig = defaultAirportConfig.copy(terminalProcessingTimes = Map(T1 -> Map(eeaMachineReadableToDesk -> fiveMinutes)))))

        offerAndWait(crunch.aclArrivalsInput, ArrivalsFeedSuccess(aclFlight))

        val expected = Set(arrival.copy(FeedSources = Set(AclFeedSource)))

        crunch.portStateTestProbe.fishForMessage(3 seconds) {
          case ps: PortState =>
            val flightsResult = ps.flights.values.map(_.apiFlight).toSet
            flightsResult == expected
        }

        success
      }

      "Given an ACL feed with one flight and the same flight in the live feed" +
        "When I ask for a crunch " +
        "Then I should see the one flight in the PortState with the ACL flightcode and live chox" >> {
        val scheduled = "2017-01-01T00:00Z"
        val aclFlight = ArrivalGenerator.arrival(iata = "BA0001", schDt = scheduled, actPax = Option(10))
        val aclFlights = Flights(List(aclFlight))
        val liveFlight = ArrivalGenerator.arrival(iata = "BAW001", schDt = scheduled, actPax = Option(20), actChoxDt = "2017-01-01T00:30Z")
        val liveFlights = Flights(List(liveFlight))

        val fiveMinutes = 600d / 60

        val crunch = runCrunchGraph(TestConfig(
          now = () => SDate(scheduled),
          airportConfig = defaultAirportConfig.copy(terminalProcessingTimes = Map(T1 -> Map(eeaMachineReadableToDesk -> fiveMinutes)))))

        offerAndWait(crunch.aclArrivalsInput, ArrivalsFeedSuccess(aclFlights))
        offerAndWait(crunch.liveArrivalsInput, ArrivalsFeedSuccess(liveFlights))

        val expected = Set(liveFlight.copy(CarrierCode = aclFlight.CarrierCode, VoyageNumber = aclFlight.VoyageNumber, FeedSources = Set(AclFeedSource, LiveFeedSource)))

        crunch.portStateTestProbe.fishForMessage(3 seconds) {
          case ps: PortState =>
            val flightsResult = ps.flights.values.map(_.apiFlight).toSet
            flightsResult == expected
        }

        success
      }

      "Given some initial ACL & live arrivals, one ACL arrival and no live arrivals " +
        "When I ask for a crunch " +
        "Then I should only see the new ACL arrival with the initial live arrivals" >> {
        val scheduledLive = "2017-01-01T00:00Z"

        val initialAcl = Set(
          ArrivalGenerator.arrival(iata = "BA0001", schDt = "2017-01-01T00:05Z", actPax = Option(150), status = ArrivalStatus("forecast")),
          ArrivalGenerator.arrival(iata = "BA0002", schDt = "2017-01-01T00:15Z", actPax = Option(151), status = ArrivalStatus("forecast")))
        val initialLive = Set(
          ArrivalGenerator.arrival(iata = "BA0003", schDt = "2017-01-01T00:25Z", actPax = Option(99), status = ArrivalStatus("scheduled")))

        val newAcl = Set(
          ArrivalGenerator.arrival(iata = "BA0011", schDt = "2017-01-01T00:10Z", actPax = Option(105), status = ArrivalStatus("forecast")))

        val crunch = runCrunchGraph(TestConfig(now = () => SDate(scheduledLive)))

        offerAndWait(crunch.liveArrivalsInput, ArrivalsFeedSuccess(Flights(initialLive.toList)))
        offerAndWait(crunch.aclArrivalsInput, ArrivalsFeedSuccess(Flights(initialAcl.toList)))
        offerAndWait(crunch.aclArrivalsInput, ArrivalsFeedSuccess(Flights(newAcl.toList)))

        val expected = initialLive.map(_.copy(FeedSources = Set(LiveFeedSource))) ++ newAcl.map(_.copy(FeedSources = Set(AclFeedSource)))

        crunch.portStateTestProbe.fishForMessage(3 seconds) {
          case ps: PortState =>
            val flightsResult = ps.flights.values.map(_.apiFlight).toSet
            flightsResult == expected
        }

        success
      }

      "Given some initial arrivals, no ACL arrivals and one live arrival " +
        "When I ask for a crunch " +
        "Then I should only see the initial arrivals updated with the live arrival" >> {
        val scheduledLive = "2017-01-01T00:00Z"

        val initialAcl1 = ArrivalGenerator.arrival(iata = "BA0001", schDt = "2017-01-01T00:05Z", actPax = Option(150), status = ArrivalStatus("forecast"))
        val initialAcl2 = ArrivalGenerator.arrival(iata = "BA0002", schDt = "2017-01-01T00:15Z", actPax = Option(151), status = ArrivalStatus("forecast"))
        val initialAcl = Set(initialAcl1, initialAcl2)
        val initialLive = SortedMap[UniqueArrival, Arrival]() ++ List(ArrivalGenerator.arrival(iata = "BA0001", schDt = "2017-01-01T00:05Z", actPax = Option(99), status = ArrivalStatus("scheduled"))).map(a => (a.unique, a))

        val newLive = Set(
          ArrivalGenerator.arrival(iata = "BAW0001", schDt = "2017-01-01T00:05Z", actPax = Option(105), status = ArrivalStatus("estimated"), estDt = "2017-01-01T00:06Z"))

        val crunch = runCrunchGraph(TestConfig(
          now = () => SDate(scheduledLive),
          initialLiveArrivals = initialLive
        ))

        offerAndWait(crunch.aclArrivalsInput, ArrivalsFeedSuccess(Flights(initialAcl.toList)))
        offerAndWait(crunch.liveArrivalsInput, ArrivalsFeedSuccess(Flights(newLive.toList)))

        val expected = newLive.map(_.copy(CarrierCode = CarrierCode("BA"), VoyageNumber = VoyageNumber(1), FeedSources = Set(LiveFeedSource, AclFeedSource))) + initialAcl2.copy(FeedSources = Set(AclFeedSource))

        crunch.portStateTestProbe.fishForMessage(3 seconds) {
          case ps: PortState =>
            val flightsResult = ps.flights.values.map(_.apiFlight).toSet
            flightsResult == expected
        }

        success
      }

      "Given one ACL arrival followed by one live arrival and initial arrivals which don't match them " +
        "When I ask for a crunch " +
        "Then I should only see the new ACL & live arrivals plus the initial live arrival" >> {
        val scheduledLive = "2017-01-01T00:00Z"

        val initialAcl1 = ArrivalGenerator.arrival(iata = "BA0001", schDt = "2017-01-01T00:01Z", actPax = Option(150), status = ArrivalStatus("forecast"))
        val initialAcl2 = ArrivalGenerator.arrival(iata = "BA0002", schDt = "2017-01-01T00:02Z", actPax = Option(151), status = ArrivalStatus("forecast"))
        val initialAcl = SortedMap[UniqueArrival, Arrival]() ++ List(initialAcl1, initialAcl2).map(a => (a.unique, a))
        val initialLive = SortedMap[UniqueArrival, Arrival]() ++ List(ArrivalGenerator.arrival(iata = "BA0003", schDt = "2017-01-01T00:03Z", actPax = Option(99), status = ArrivalStatus("scheduled"))).map(a => (a.unique, a))

        val newAcl = Flights(Seq(ArrivalGenerator.arrival(iata = "BA0004", schDt = "2017-01-01T00:04Z", actPax = Option(100))))
        val newLive = Flights(Seq(ArrivalGenerator.arrival(iata = "BAW0005", schDt = "2017-01-01T00:05Z", actPax = Option(101))))

        val crunch = runCrunchGraph(TestConfig(
          now = () => SDate(scheduledLive),
          initialForecastBaseArrivals = initialAcl,
          initialLiveArrivals = initialLive
        ))

        offerAndWait(crunch.aclArrivalsInput, ArrivalsFeedSuccess(newAcl))
        offerAndWait(crunch.liveArrivalsInput, ArrivalsFeedSuccess(newLive))

        val expected = Set(VoyageNumber(3), VoyageNumber(4), VoyageNumber(5))

        crunch.portStateTestProbe.fishForMessage(5 seconds) {
          case ps: PortState =>
            val voyageNos = ps.flights.values.map(_.apiFlight.VoyageNumber).toSet
            voyageNos == expected
        }

        success
      }

      "Given one ACL arrival followed by the same single ACL arrival " +
        "When I ask for a crunch " +
        "Then I should still see the arrival, ie it should not have been removed" >> {
        val scheduledLive = "2017-01-01T00:00Z"

        val aclArrival = ArrivalGenerator.arrival(iata = "BA0001", schDt = "2017-01-01T00:05Z", actPax = Option(150), status = ArrivalStatus("forecast"), feedSources = Set(AclFeedSource))

        val aclInput1 = Flights(Seq(aclArrival))
        val aclInput2 = Flights(Seq(aclArrival))

        val crunch = runCrunchGraph(TestConfig(now = () => SDate(scheduledLive)))

        offerAndWait(crunch.aclArrivalsInput, ArrivalsFeedSuccess(aclInput1))
        offerAndWait(crunch.aclArrivalsInput, ArrivalsFeedSuccess(aclInput2))

        val portStateFlightLists = crunch.portStateTestProbe.receiveWhile(3 seconds) {
          case PortState(f, _, _) => f.values.map(_.apiFlight)
        }

        val nonEmptyFlightsList = List(aclArrival.copy(FeedSources = Set(AclFeedSource)))
        val expected = List(nonEmptyFlightsList)

        portStateFlightLists.distinct === expected
      }
    }

    "Looking at flights" >> {
      skipped("Integration test for ACL - requires SSL certificate to run")
      val ftpServer = ConfigFactory.load.getString("acl.host")
      val username = ConfigFactory.load.getString("acl.username")
      val path = ConfigFactory.load.getString("acl.keypath")

      val sftp = sftpClient(AclFeed.sshClient(ftpServer, username, path))
      val latestFile = latestFileForPort(sftp, PortCode("MAN"), 100000L)
      println(s"latestFile: $latestFile")
      val aclArrivals: List[Arrival] = arrivalsFromCsvContent(contentFromFileName(sftp, latestFile), regularTerminalMapping)

      val todayArrivals = aclArrivals
        .filter(_.Scheduled < SDate("2017-10-05T23:00").millisSinceEpoch)
        .groupBy(_.Terminal)

      todayArrivals.foreach {
        case (tn, _) =>
          val tByUniqueId = todayArrivals(tn).groupBy(_.uniqueId)
          println(s"uniques for $tn: ${tByUniqueId.keys.size} flights")
          tByUniqueId.filter {
            case (_, a) => a.length > 1
          }.foreach {
            case (uid, a) => println(s"non-unique: $uid -> $a")
          }
      }

      todayArrivals.keys.foreach(t => println(s"terminal $t has ${todayArrivals(t).size} flights"))

      success
    }
  }
}


text:
OmniAuth stratgie to get user profile from Tropo's RestAPI.

## Usage

Install manually, or just use Bundler:

    gem 'omniauth-tropo'

Add :tropo provider to omniauth builder (RAILS_ROOT/config/initializers/omniauth.rb):

    # configuration for Tropo Provisioning API
    Rails.application.config.middleware.use OmniAuth::Builder do
      provider :tropo, "http://api.tropo.com"
      # provider ...
    end

If you want to pull roles from the ProvisioningAPI ( Premise only ) you can do so by adding :role_options hash in the builder:

    Rails.application.config.middleware.use OmniAuth::Builder do
      provider :tropo, "http://yourserver.com:8080/rest", :role_options=>{:admin_username=>'admin',:admin_password=>'admin'}
    end

### Example:

    cd examples
    rackup config.ru
    http://localhost:9292


text:
void settings_init();
void settings_deinit();

bool settings_is_dark_theme();
void settings_set_theme(bool is_dark);

#if MINI_TIMETABLE_IS_ENABLED
bool settings_mini_timetable_is_enabled();
void settings_set_mini_timetable_enable(bool is_enabled);
#endif

void settings_toggle_locale();

GColor curr_fg_color();
GColor curr_bg_color();


text:
package com.fline.hadoop.util;

import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;

public class Utils {
	public static Map transStringToMap(String mapString) {
		Map map = new HashMap();
		java.util.StringTokenizer items;
		for (StringTokenizer entrys = new StringTokenizer(mapString, "^"); entrys
				.hasMoreTokens(); map.put(items.nextToken(),
				items.hasMoreTokens() ? ((Object) (items.nextToken())) : null))
			items = new StringTokenizer(entrys.nextToken(), "'");
		return map;
	}
}


text:
define(['controller'], function(Controller) {
    var MainController = function() {
        Controller.apply(this, arguments);

        this.checkRootVertexId = this.EventSystem.on(
            'verticesResult',
            this.checkRootVertex,
            this
        );
        this.EventSystem.trigger('findVertices', {
            query: {
                type: 'root'
            }
        });
    };

    MainController.prototype = Object.create(Controller.prototype);

    MainController.prototype.checkRootVertex = function(response) {
        if (response.data.length === 0) {
            console.error('No root vertex found!');
        }
        else {
            var vertex = response.data[0];

            this.EventSystem.trigger('walk', {
                eid: vertex.eid,
                query: {
                    depth: 3
                }
            });
            this.EventSystem.off(this.checkRootVertexId);
            this.checkRootVertexId = null;
        }
    };

    return MainController;
});


text:
import os
import sys
sys.path.insert(0, os.path.abspath('../'))

# -- Project information -----------------------------------------------------

project = 'libcloudforensics'
copyright = '2020, Google'
author = 'Google'

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'recommonmark',
    'sphinx.ext.autodoc',
    'sphinx.ext.napoleon',
    'sphinx_autodoc_typehints',
]

# set_type_checking_flag = True

master_doc = 'index'

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

source_suffix = {
    '.rst': 'restructuredtext',
    '.txt': 'markdown',
    '.md': 'markdown',
}

from recommonmark.transform import AutoStructify

github_doc_root = 'https://github.com/google/libcloudforensics/tree/master/doc/'

def setup(app):
  app.add_config_value('recommonmark_config', {
    'enable_auto_doc_ref': False,
  }, True)
  app.add_transform(AutoStructify)


text:
package validation

import (
	"reflect"

	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/unversioned"
	unversionedvalidation "k8s.io/kubernetes/pkg/api/unversioned/validation"
	apivalidation "k8s.io/kubernetes/pkg/api/validation"
	"k8s.io/kubernetes/pkg/apis/apps"
	"k8s.io/kubernetes/pkg/labels"
	"k8s.io/kubernetes/pkg/util/validation/field"
)

// ValidatePetSetName can be used to check whether the given PetSet
// name is valid.
// Prefix indicates this name will be used as part of generation, in which case
// trailing dashes are allowed.
func ValidatePetSetName(name string, prefix bool) (bool, string) {
	// TODO: Validate that there's name for the suffix inserted by the pets.
	// Currently this is just "-index". In the future we may allow a user
	// specified list of suffixes and we need  to validate the longest one.
	return apivalidation.NameIsDNSSubdomain(name, prefix)
}

// Validates the given template and ensures that it is in accordance with the desired selector.
func ValidatePodTemplateSpecForPetSet(template *api.PodTemplateSpec, selector labels.Selector, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if template == nil {
		allErrs = append(allErrs, field.Required(fldPath, ""))
	} else {
		if !selector.Empty() {
			// Verify that the PetSet selector matches the labels in template.
			labels := labels.Set(template.Labels)
			if !selector.Matches(labels) {
				allErrs = append(allErrs, field.Invalid(fldPath.Child("metadata", "labels"), template.Labels, "`selector` does not match template `labels`"))
			}
		}
		// TODO: Add validation for PodSpec, currently this will check volumes, which we know will
		// fail. We should really check that the union of the given volumes and volumeClaims match
		// volume mounts in the containers.
		// allErrs = append(allErrs, apivalidation.ValidatePodTemplateSpec(template, fldPath)...)
		allErrs = append(allErrs, unversionedvalidation.ValidateLabels(template.Labels, fldPath.Child("labels"))...)
		allErrs = append(allErrs, apivalidation.ValidateAnnotations(template.Annotations, fldPath.Child("annotations"))...)
		allErrs = append(allErrs, apivalidation.ValidatePodSpecificAnnotations(template.Annotations, fldPath.Child("annotations"))...)
	}
	return allErrs
}

// ValidatePetSetSpec tests if required fields in the PetSet spec are set.
func ValidatePetSetSpec(spec *apps.PetSetSpec, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}

	allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(spec.Replicas), fldPath.Child("replicas"))...)
	if spec.Selector == nil {
		allErrs = append(allErrs, field.Required(fldPath.Child("selector"), ""))
	} else {
		allErrs = append(allErrs, unversionedvalidation.ValidateLabelSelector(spec.Selector, fldPath.Child("selector"))...)
		if len(spec.Selector.MatchLabels)+len(spec.Selector.MatchExpressions) == 0 {
			allErrs = append(allErrs, field.Invalid(fldPath.Child("selector"), spec.Selector, "empty selector is not valid for petset."))
		}
	}

	selector, err := unversioned.LabelSelectorAsSelector(spec.Selector)
	if err != nil {
		allErrs = append(allErrs, field.Invalid(fldPath.Child("selector"), spec.Selector, ""))
	} else {
		allErrs = append(allErrs, ValidatePodTemplateSpecForPetSet(&spec.Template, selector, fldPath.Child("template"))...)
	}

	if spec.Template.Spec.RestartPolicy != api.RestartPolicyAlways {
		allErrs = append(allErrs, field.NotSupported(fldPath.Child("template", "spec", "restartPolicy"), spec.Template.Spec.RestartPolicy, []string{string(api.RestartPolicyAlways)}))
	}

	return allErrs
}

// ValidatePetSet validates a PetSet.
func ValidatePetSet(petSet *apps.PetSet) field.ErrorList {
	allErrs := apivalidation.ValidateObjectMeta(&petSet.ObjectMeta, true, ValidatePetSetName, field.NewPath("metadata"))
	allErrs = append(allErrs, ValidatePetSetSpec(&petSet.Spec, field.NewPath("spec"))...)
	return allErrs
}

// ValidatePetSetUpdate tests if required fields in the PetSet are set.
func ValidatePetSetUpdate(petSet, oldPetSet *apps.PetSet) field.ErrorList {
	allErrs := field.ErrorList{}

	// TODO: For now we're taking the safe route and disallowing all updates to spec except for Spec.Replicas.
	// Enable on a case by case basis.
	restoreReplicas := petSet.Spec.Replicas
	petSet.Spec.Replicas = oldPetSet.Spec.Replicas

	// The generation changes for this update
	restoreGeneration := petSet.Generation
	petSet.Generation = oldPetSet.Generation

	if !reflect.DeepEqual(petSet, oldPetSet) {
		allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "updates to petset spec for fields other than 'replicas' are forbidden."))
	}
	petSet.Spec.Replicas = restoreReplicas
	petSet.Generation = restoreGeneration
	allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(petSet.Spec.Replicas), field.NewPath("spec", "replicas"))...)
	return allErrs
}

// ValidatePetSetStatusUpdate tests if required fields in the PetSet are set.
func ValidatePetSetStatusUpdate(petSet, oldPetSet *apps.PetSet) field.ErrorList {
	allErrs := field.ErrorList{}
	allErrs = append(allErrs, apivalidation.ValidateObjectMetaUpdate(&petSet.ObjectMeta, &oldPetSet.ObjectMeta, field.NewPath("metadata"))...)
	// TODO: Validate status.
	return allErrs
}


text:
package cmd

import (
	goflag "flag"
	"io/ioutil"
	"os"

	"github.com/docker/machine/libmachine/log"
	"github.com/golang/glog"
	"github.com/spf13/cobra"
	"github.com/spf13/pflag"
	"k8s.io/minikube/pkg/minikube/constants"
)

var dirs = [...]string{
	constants.Minipath,
	constants.MakeMiniPath("certs"),
	constants.MakeMiniPath("machines")}

var (
	showLibmachineLogs bool
)

// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
	Use:   "minikube",
	Short: "Minikube is a tool for managing local Kubernetes clusters.",
	Long:  `Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows.`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		for _, path := range dirs {
			if err := os.MkdirAll(path, 0777); err != nil {
				glog.Exitf("Error creating minikube directory: %s", err)
			}
		}

		if !showLibmachineLogs {
			log.SetOutWriter(ioutil.Discard)
			log.SetErrWriter(ioutil.Discard)
		}
	},
}

// Execute adds all child commands to the root command sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
	if err := RootCmd.Execute(); err != nil {
		glog.Exitln(err)
	}
}

func init() {
	RootCmd.PersistentFlags().BoolVarP(&showLibmachineLogs, "show-libmachine-logs", "", false, "Whether or not to show logs from libmachine.")
	pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
	cobra.OnInitialize(initConfig)
}

// initConfig reads in config file and ENV variables if set.
func initConfig() {
}


text:
exports.__esModule = true;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _react = require("react");

var _react2 = _interopRequireDefault(_react);

var _reactSideEffect = require("react-side-effect");

var _reactSideEffect2 = _interopRequireDefault(_reactSideEffect);

var _deepEqual = require("deep-equal");

var _deepEqual2 = _interopRequireDefault(_deepEqual);

var _objectAssign = require("object-assign");

var _objectAssign2 = _interopRequireDefault(_objectAssign);

var _HelmetConstants = require("./HelmetConstants.js");

var _PlainComponent = require("./PlainComponent");

var _PlainComponent2 = _interopRequireDefault(_PlainComponent);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var HELMET_ATTRIBUTE = "data-react-helmet";

var encodeSpecialCharacters = function encodeSpecialCharacters(str) {
    return String(str).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
};

var getInnermostProperty = function getInnermostProperty(propsList, property) {
    for (var i = propsList.length - 1; i >= 0; i--) {
        var props = propsList[i];

        if (props[property]) {
            return props[property];
        }
    }
    return null;
};

var getTitleFromPropsList = function getTitleFromPropsList(propsList) {
    var innermostTitle = getInnermostProperty(propsList, "title");
    var innermostTemplate = getInnermostProperty(propsList, "titleTemplate");

    if (innermostTemplate && innermostTitle) {
        // use function arg to avoid need to escape $ characters
        return innermostTemplate.replace(/%s/g, function () {
            return innermostTitle;
        });
    }

    var innermostDefaultTitle = getInnermostProperty(propsList, "defaultTitle");

    return innermostTitle || innermostDefaultTitle || "";
};

var getOnChangeClientState = function getOnChangeClientState(propsList) {
    return getInnermostProperty(propsList, "onChangeClientState") || function () {};
};

var getHtmlAttributesFromPropsList = function getHtmlAttributesFromPropsList(propsList) {
    return propsList.filter(function (props) {
        return typeof props[_HelmetConstants.TAG_NAMES.HTML] !== "undefined";
    }).map(function (props) {
        return props[_HelmetConstants.TAG_NAMES.HTML];
    }).reduce(function (html, current) {
        return _extends({}, html, current);
    }, {});
};

var getBaseTagFromPropsList = function getBaseTagFromPropsList(primaryAttributes, propsList) {
    return propsList.filter(function (props) {
        return typeof props[_HelmetConstants.TAG_NAMES.BASE] !== "undefined";
    }).map(function (props) {
        return props[_HelmetConstants.TAG_NAMES.BASE];
    }).reverse().reduce(function (innermostBaseTag, tag) {
        if (!innermostBaseTag.length) {
            var keys = Object.keys(tag);

            for (var i = 0; i < keys.length; i++) {
                var attributeKey = keys[i];
                var lowerCaseAttributeKey = attributeKey.toLowerCase();

                if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1) {
                    return innermostBaseTag.concat(tag);
                }
            }
        }

        return innermostBaseTag;
    }, []);
};

var getTagsFromPropsList = function getTagsFromPropsList(tagName, primaryAttributes, propsList) {
    // Calculate list of tags, giving priority innermost component (end of the propslist)
    var approvedSeenTags = {};

    var tagList = propsList.filter(function (props) {
        return typeof props[tagName] !== "undefined";
    }).map(function (props) {
        return props[tagName];
    }).reverse().reduce(function (approvedTags, instanceTags) {
        var instanceSeenTags = {};

        instanceTags.filter(function (tag) {
            var primaryAttributeKey = void 0;
            var keys = Object.keys(tag);
            for (var i = 0; i < keys.length; i++) {
                var attributeKey = keys[i];
                var lowerCaseAttributeKey = attributeKey.toLowerCase();

                // Special rule with link tags, since rel and href are both primary tags, rel takes priority
                if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === _HelmetConstants.TAG_PROPERTIES.REL && tag[primaryAttributeKey].toLowerCase() === "canonical") && !(lowerCaseAttributeKey === _HelmetConstants.TAG_PROPERTIES.REL && tag[lowerCaseAttributeKey].toLowerCase() === "stylesheet")) {
                    primaryAttributeKey = lowerCaseAttributeKey;
                }
                // Special case for innerHTML which doesn't work lowercased
                if (primaryAttributes.indexOf(attributeKey) !== -1 && (attributeKey === _HelmetConstants.TAG_PROPERTIES.INNER_HTML || attributeKey === _HelmetConstants.TAG_PROPERTIES.CSS_TEXT)) {
                    primaryAttributeKey = attributeKey;
                }
            }

            if (!primaryAttributeKey || !tag[primaryAttributeKey]) {
                return false;
            }

            var value = tag[primaryAttributeKey].toLowerCase();

            if (!approvedSeenTags[primaryAttributeKey]) {
                approvedSeenTags[primaryAttributeKey] = {};
            }

            if (!instanceSeenTags[primaryAttributeKey]) {
                instanceSeenTags[primaryAttributeKey] = {};
            }

            if (!approvedSeenTags[primaryAttributeKey][value]) {
                instanceSeenTags[primaryAttributeKey][value] = true;
                return true;
            }

            return false;
        }).reverse().forEach(function (tag) {
            return approvedTags.push(tag);
        });

        // Update seen tags with tags from this instance
        var keys = Object.keys(instanceSeenTags);
        for (var i = 0; i < keys.length; i++) {
            var attributeKey = keys[i];
            var tagUnion = (0, _objectAssign2.default)({}, approvedSeenTags[attributeKey], instanceSeenTags[attributeKey]);

            approvedSeenTags[attributeKey] = tagUnion;
        }

        return approvedTags;
    }, []).reverse();

    return tagList;
};

var updateTitle = function updateTitle(title) {
    document.title = title || document.title;
};

var updateHtmlAttributes = function updateHtmlAttributes(attributes) {
    var htmlTag = document.getElementsByTagName("html")[0];
    var helmetAttributeString = htmlTag.getAttribute(HELMET_ATTRIBUTE);
    var helmetAttributes = helmetAttributeString ? helmetAttributeString.split(",") : [];
    var attributesToRemove = [].concat(helmetAttributes);
    var attributeKeys = Object.keys(attributes);

    for (var i = 0; i < attributeKeys.length; i++) {
        var attribute = attributeKeys[i];
        var value = attributes[attribute] || "";
        htmlTag.setAttribute(attribute, value);

        if (helmetAttributes.indexOf(attribute) === -1) {
            helmetAttributes.push(attribute);
        }

        var indexToSave = attributesToRemove.indexOf(attribute);
        if (indexToSave !== -1) {
            attributesToRemove.splice(indexToSave, 1);
        }
    }

    for (var _i = attributesToRemove.length - 1; _i >= 0; _i--) {
        htmlTag.removeAttribute(attributesToRemove[_i]);
    }

    if (helmetAttributes.length === attributesToRemove.length) {
        htmlTag.removeAttribute(HELMET_ATTRIBUTE);
    } else {
        htmlTag.setAttribute(HELMET_ATTRIBUTE, helmetAttributes.join(","));
    }
};

var updateTags = function updateTags(type, tags) {
    var headElement = document.head || document.querySelector("head");
    var tagNodes = headElement.querySelectorAll(type + "[" + HELMET_ATTRIBUTE + "]");
    var oldTags = Array.prototype.slice.call(tagNodes);
    var newTags = [];
    var indexToDelete = void 0;

    if (tags && tags.length) {
        tags.forEach(function (tag) {
            var newElement = document.createElement(type);

            for (var attribute in tag) {
                if (tag.hasOwnProperty(attribute)) {
                    if (attribute === "innerHTML") {
                        newElement.innerHTML = tag.innerHTML;
                    } else if (attribute === "cssText") {
                        if (newElement.styleSheet) {
                            newElement.styleSheet.cssText = tag.cssText;
                        } else {
                            newElement.appendChild(document.createTextNode(tag.cssText));
                        }
                    } else {
                        var value = typeof tag[attribute] === "undefined" ? "" : tag[attribute];
                        newElement.setAttribute(attribute, value);
                    }
                }
            }

            newElement.setAttribute(HELMET_ATTRIBUTE, "true");

            // Remove a duplicate tag from domTagstoRemove, so it isn't cleared.
            if (oldTags.some(function (existingTag, index) {
                indexToDelete = index;
                return newElement.isEqualNode(existingTag);
            })) {
                oldTags.splice(indexToDelete, 1);
            } else {
                newTags.push(newElement);
            }
        });
    }

    oldTags.forEach(function (tag) {
        return tag.parentNode.removeChild(tag);
    });
    newTags.forEach(function (tag) {
        return headElement.appendChild(tag);
    });

    return {
        oldTags: oldTags,
        newTags: newTags
    };
};

var generateHtmlAttributesAsString = function generateHtmlAttributesAsString(attributes) {
    var keys = Object.keys(attributes);
    var attributeString = "";

    for (var i = 0; i < keys.length; i++) {
        var attribute = keys[i];
        var attr = typeof attributes[attribute] !== "undefined" ? attribute + "=\"" + attributes[attribute] + "\"" : "" + attribute;
        attributeString += attr + " ";
    }

    return attributeString.trim();
};

var generateTitleAsString = function generateTitleAsString(type, title) {
    var stringifiedMarkup = "<" + type + " " + HELMET_ATTRIBUTE + "=\"true\">" + encodeSpecialCharacters(title) + "</" + type + ">";

    return stringifiedMarkup;
};

var generateTagsAsString = function generateTagsAsString(type, tags) {
    var stringifiedMarkup = tags.map(function (tag) {
        var attributeHtml = Object.keys(tag).filter(function (attribute) {
            return !(attribute === "innerHTML" || attribute === "cssText");
        }).map(function (attribute) {
            if (typeof tag[attribute] === "undefined") {
                return attribute;
            }

            var encodedValue = encodeSpecialCharacters(tag[attribute]);
            return attribute + "=\"" + encodedValue + "\"";
        }).join(" ").trim();

        var tagContent = tag.innerHTML || tag.cssText || "";

        var isSelfClosing = [_HelmetConstants.TAG_NAMES.NOSCRIPT, _HelmetConstants.TAG_NAMES.SCRIPT, _HelmetConstants.TAG_NAMES.STYLE].indexOf(type) === -1;

        return "<" + type + " " + HELMET_ATTRIBUTE + "=\"true\" " + attributeHtml + (isSelfClosing ? "/>" : ">" + tagContent + "</" + type + ">");
    }).join("");

    return stringifiedMarkup;
};

var generateTitleAsReactComponent = function generateTitleAsReactComponent(type, title) {
    // assigning into an array to define toString function on it
    var component = [_react2.default.createElement(_HelmetConstants.TAG_NAMES.TITLE, _defineProperty({
        key: title
    }, HELMET_ATTRIBUTE, true), title)];

    return component;
};

var generateTagsAsReactComponent = function generateTagsAsReactComponent(type, tags) {
    /* eslint-disable react/display-name */
    var component = tags.map(function (tag, i) {
        var mappedTag = _defineProperty({
            key: i
        }, HELMET_ATTRIBUTE, true);

        Object.keys(tag).forEach(function (attribute) {
            var mappedAttribute = _HelmetConstants.REACT_TAG_MAP[attribute] || attribute;

            if (mappedAttribute === "innerHTML" || mappedAttribute === "cssText") {
                var content = tag.innerHTML || tag.cssText;
                mappedTag.dangerouslySetInnerHTML = { __html: content };
            } else {
                mappedTag[mappedAttribute] = tag[attribute];
            }
        });

        return _react2.default.createElement(type, mappedTag);
    });

    return component;
    /* eslint-enable react/display-name */
};

var getMethodsForTag = function getMethodsForTag(type, tags) {
    switch (type) {
        case _HelmetConstants.TAG_NAMES.TITLE:
            return {
                toComponent: function toComponent() {
                    return generateTitleAsReactComponent(type, tags);
                },
                toString: function toString() {
                    return generateTitleAsString(type, tags);
                }
            };
        case _HelmetConstants.TAG_NAMES.HTML:
            return {
                toComponent: function toComponent() {
                    return tags;
                },
                toString: function toString() {
                    return generateHtmlAttributesAsString(tags);
                }
            };
        default:
            return {
                toComponent: function toComponent() {
                    return generateTagsAsReactComponent(type, tags);
                },
                toString: function toString() {
                    return generateTagsAsString(type, tags);
                }
            };
    }
};

var mapStateOnServer = function mapStateOnServer(_ref) {
    var htmlAttributes = _ref.htmlAttributes,
        title = _ref.title,
        baseTag = _ref.baseTag,
        metaTags = _ref.metaTags,
        linkTags = _ref.linkTags,
        scriptTags = _ref.scriptTags,
        noscriptTags = _ref.noscriptTags,
        styleTags = _ref.styleTags;
    return {
        htmlAttributes: getMethodsForTag(_HelmetConstants.TAG_NAMES.HTML, htmlAttributes),
        title: getMethodsForTag(_HelmetConstants.TAG_NAMES.TITLE, title),
        base: getMethodsForTag(_HelmetConstants.TAG_NAMES.BASE, baseTag),
        meta: getMethodsForTag(_HelmetConstants.TAG_NAMES.META, metaTags),
        link: getMethodsForTag(_HelmetConstants.TAG_NAMES.LINK, linkTags),
        script: getMethodsForTag(_HelmetConstants.TAG_NAMES.SCRIPT, scriptTags),
        noscript: getMethodsForTag(_HelmetConstants.TAG_NAMES.NOSCRIPT, noscriptTags),
        style: getMethodsForTag(_HelmetConstants.TAG_NAMES.STYLE, styleTags)
    };
};

var Helmet = function Helmet(Component) {
    /* eslint-disable react/no-multi-comp */
    var HelmetWrapper = function (_React$Component) {
        _inherits(HelmetWrapper, _React$Component);

        function HelmetWrapper() {
            _classCallCheck(this, HelmetWrapper);

            return _possibleConstructorReturn(this, (HelmetWrapper.__proto__ || Object.getPrototypeOf(HelmetWrapper)).apply(this, arguments));
        }

        _createClass(HelmetWrapper, [{
            key: "shouldComponentUpdate",
            value: function shouldComponentUpdate(nextProps) {
                return !(0, _deepEqual2.default)(this.props, nextProps);
            }
        }, {
            key: "render",
            value: function render() {
                return _react2.default.createElement(Component, this.props);
            }
        }], [{
            key: "canUseDOM",

            // Component.peek comes from react-side-effect:
            // For testing, you may use a static peek() method available on the returned component.
            // It lets you get the current state without resetting the mounted instance stack.
            // Don't use it for anything other than testing.
            set: function set(canUseDOM) {
                Component.canUseDOM = canUseDOM;
            }
            /**
             * @param {Object} htmlAttributes: {"lang": "en", "amp": undefined}
             * @param {String} title: "Title"
             * @param {String} defaultTitle: "Default Title"
             * @param {String} titleTemplate: "MySite.com - %s"
             * @param {Object} base: {"target": "_blank", "href": "http://mysite.com/"}
             * @param {Array} meta: [{"name": "description", "content": "Test description"}]
             * @param {Array} link: [{"rel": "canonical", "href": "http://mysite.com/example"}]
             * @param {Array} script: [{"type": "text/javascript", "src": "http://mysite.com/js/test.js"}]
             * @param {Array} noscript: [{"innerHTML": "<img src='http://mysite.com/js/test.js'"}]
             * @param {Array} style: [{"type": "text/css", "cssText": "div{ display: block; color: blue; }"}]
             * @param {Function} onChangeClientState: "(newState) => console.log(newState)"
             */

        }]);

        return HelmetWrapper;
    }(_react2.default.Component);
    /* eslint-enable react/no-multi-comp */

    HelmetWrapper.propTypes = {
        htmlAttributes: _react2.default.PropTypes.object,
        title: _react2.default.PropTypes.string,
        defaultTitle: _react2.default.PropTypes.string,
        titleTemplate: _react2.default.PropTypes.string,
        base: _react2.default.PropTypes.object,
        meta: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.object),
        link: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.object),
        script: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.object),
        noscript: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.object),
        style: _react2.default.PropTypes.arrayOf(_react2.default.PropTypes.object),
        onChangeClientState: _react2.default.PropTypes.func
    };
    HelmetWrapper.peek = Component.peek;

    HelmetWrapper.rewind = function () {
        var mappedState = Component.rewind();
        if (!mappedState) {
            // provide fallback if mappedState is undefined
            mappedState = mapStateOnServer({
                htmlAttributes: [],
                title: "",
                baseTag: [],
                metaTags: [],
                linkTags: [],
                scriptTags: [],
                noscriptTags: [],
                styleTags: []
            });
        }

        return mappedState;
    };

    return HelmetWrapper;
};

var reducePropsToState = function reducePropsToState(propsList) {
    return {
        htmlAttributes: getHtmlAttributesFromPropsList(propsList),
        title: getTitleFromPropsList(propsList),
        baseTag: getBaseTagFromPropsList([_HelmetConstants.TAG_PROPERTIES.HREF], propsList),
        metaTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.META, [_HelmetConstants.TAG_PROPERTIES.NAME, _HelmetConstants.TAG_PROPERTIES.CHARSET, _HelmetConstants.TAG_PROPERTIES.HTTPEQUIV, _HelmetConstants.TAG_PROPERTIES.PROPERTY], propsList),
        linkTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.LINK, [_HelmetConstants.TAG_PROPERTIES.REL, _HelmetConstants.TAG_PROPERTIES.HREF], propsList),
        scriptTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.SCRIPT, [_HelmetConstants.TAG_PROPERTIES.SRC, _HelmetConstants.TAG_PROPERTIES.INNER_HTML], propsList),
        noscriptTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.NOSCRIPT, [_HelmetConstants.TAG_PROPERTIES.INNER_HTML], propsList),
        styleTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.STYLE, [_HelmetConstants.TAG_PROPERTIES.CSS_TEXT], propsList),
        onChangeClientState: getOnChangeClientState(propsList)
    };
};

var handleClientStateChange = function handleClientStateChange(newState) {
    var htmlAttributes = newState.htmlAttributes,
        title = newState.title,
        baseTag = newState.baseTag,
        metaTags = newState.metaTags,
        linkTags = newState.linkTags,
        scriptTags = newState.scriptTags,
        noscriptTags = newState.noscriptTags,
        styleTags = newState.styleTags,
        onChangeClientState = newState.onChangeClientState;

    updateHtmlAttributes(htmlAttributes);

    updateTitle(title);

    var tagUpdates = {
        baseTag: updateTags(_HelmetConstants.TAG_NAMES.BASE, baseTag),
        metaTags: updateTags(_HelmetConstants.TAG_NAMES.META, metaTags),
        linkTags: updateTags(_HelmetConstants.TAG_NAMES.LINK, linkTags),
        scriptTags: updateTags(_HelmetConstants.TAG_NAMES.SCRIPT, scriptTags),
        noscriptTags: updateTags(_HelmetConstants.TAG_NAMES.NOSCRIPT, noscriptTags),
        styleTags: updateTags(_HelmetConstants.TAG_NAMES.STYLE, styleTags)
    };

    var addedTags = {};
    var removedTags = {};

    Object.keys(tagUpdates).forEach(function (tagType) {
        var _tagUpdates$tagType = tagUpdates[tagType],
            newTags = _tagUpdates$tagType.newTags,
            oldTags = _tagUpdates$tagType.oldTags;

        if (newTags.length) {
            addedTags[tagType] = newTags;
        }
        if (oldTags.length) {
            removedTags[tagType] = tagUpdates[tagType].oldTags;
        }
    });

    onChangeClientState(newState, addedTags, removedTags);
};

var SideEffect = (0, _reactSideEffect2.default)(reducePropsToState, handleClientStateChange, mapStateOnServer);

// PlainComponent is used to be a blank component decorated by react-side-effect
exports.default = Helmet(SideEffect(_PlainComponent2.default));
module.exports = exports["default"];


text:
<?php

use PHPUnit\Framework\TestCase;
use Cs\Router\Util\Assert;

class AssertTest extends TestCase {
    public function testStringIsNumberException() {
        $this->expectException(Exception::class);
        Assert::isNumber('{test', 'invalid.input');
    }

    public function testEmptyIsNumberException() {
        $this->expectException(Exception::class);
        Assert::isNumber('', 'invalid.input');
    }

    public function testArrayIsNumberException() {
        $this->expectException(Exception::class);
        Assert::isNumber([], 'invalid.input');
    }

    public function testNumberIsNumber() {
        Assert::isNumber('123', 'invalid.input');
        $this->assertTrue(TRUE);
    }

    public function testStringIsArrayException() {
        $this->expectException(Exception::class);
        Assert::isArray('{test', 'invalid.input');
    }

    public function testEmptyIsArrayException() {
        $this->expectException(Exception::class);
        Assert::isArray('', 'invalid.input');
    }

    public function testArrayIsArray() {
        Assert::isArray([], 'invalid.input');
        $this->assertTrue(TRUE);
    }

    public function testNumberIsArrayException() {
        $this->expectException(Exception::class);
        Assert::isArray('123', 'invalid.input');
    }

    public function testStringIsHashArrayException() {
        $this->expectException(Exception::class);
        Assert::isHashArray('test', 'invalid.input');
    }

    public function testArrayIsHashArrayException() {
        $this->expectException(Exception::class);
        Assert::isHashArray(['test'], 'invalid.input');
    }

    public function testHashArrayIsHashArray() {
        Assert::isHashArray(['test'=>['test']], 'invalid.input');
        $this->assertTrue(TRUE);
    }

    public function testStringIsString() {
        Assert::isString('test', 'invalid.input');
        $this->assertTrue(TRUE);
    }

    public function testNumberIsString() {
        $this->expectException(Exception::class);
        Assert::isString(10, 'invalid.input');
    }

    public function testArrayIsString() {
        $this->expectException(Exception::class);
        Assert::isString([], 'invalid.input');
    }

    public function testEmptyArrayNotEmpty() {
        $this->expectException(Exception::class);
        Assert::arrayNotEmpty([], 'invalid.input');
    }

    public function testStringArrayNotEmpty() {
        $this->expectException(Exception::class);
        Assert::arrayNotEmpty('test', 'invalid.input');
    }

    public function testNotEmptyArrayNotEmpty() {
        Assert::arrayNotEmpty(['test'], 'invalid.input');
        $this->assertTrue(TRUE);
    }

    public function testKeyExistArrayKeyExists() {
        Assert::arrayKeyExists('test', ['test' => 'test'], 'invalid.input');
        $this->assertTrue(TRUE);
    }

    public function testKeyExistsSuccess() {
        $this->expectException(Exception::class);
        Assert::arrayKeyExists('tests', ['test' => 'test'], 'invalid.input');
    }

    public function testKeyExistsWithString() {
        $this->expectException(Exception::class);
        Assert::arrayKeyExists('tests', 'test', 'invalid.input');
    }

    public function testArrayIsEmptyWithString() {
        $this->expectException(Exception::class);
        Assert::arrayIsEmpty('tests', 'invalid.input');
    }

    public function testIsEmptyWithString() {
        Assert::isEmpty('tests', 'invalid.input');
        $this->assertTrue(TRUE);
    }

    public function testIsEmptyWithNumber() {
        $this->expectException(Exception::class);
        Assert::isEmpty(123, 'invalid.input');
    }

    public function testIsJsonWithString() {
        $this->expectException(Exception::class);
        Assert::isJson('tests', 'invalid.input');
    }

    public function testIsJsonWithJson() {
        Assert::isJson('{"test":"test"}', 'invalid.input');
        $this->assertTrue(TRUE);
    }
}


text:
from django.contrib import admin
from hello.testapp.models import *

admin.site.register(Animal)


text:
package pt.psantos.phd.polarity.propagation.examples;

import java.util.ArrayList;
import java.util.List;
import org.jgrapht.graph.ClassBasedEdgeFactory;
import org.jgrapht.graph.DirectedPseudograph;
import pt.psantos.phd.polarity.propagation.algorithm.LexicalRelation;
import pt.psantos.phd.polarity.propagation.algorithm.PolarityPropagation;
import pt.psantos.phd.polarity.propagation.algorithm.PolarityStats;
import pt.psantos.phd.polarity.propagation.algorithm.PolarityUtils;
import pt.psantos.phd.polarity.propagation.algorithm.Word;

/**
 * This example shows how to propagateNew the positive and negative polarity of
 words, from two seed words to the reaming words, over a directed graph.

In this tiny graph each node represents a word (in fact each word is
 * represented by a characher from A to I), and each edge represents either a
 * synonym or an antonym between two words.
 *
 *
The Graph represented as an adjacency list:
 *

 * {@code
 * A: C D
 * B: D E
 * C: F
 * D: F
 * E: G H
 * F: I G
 * G:
 * H: E
 * I:
 * }
 *

 *
 * In this graph, A and B are seed words. A is positive word and B is negative
 * word. A visual representation of this graph can be seen on figure 3, of the
 * following paper.
 *
 *
REFERENCES:
 *
This example was taken from Figure 3, section 2.3 of the paper:
 *

 *

 * {@code
 * Santos, A. P., Ramos, C., & Marques, N. C. (2011). Determining the Polarity of
 * Words through a Common Online Dictionary. In Proceedings of 15th Portuguese
 * Conference on Artificial on Artificial intelligence (EPIA 2011), volume 7026
 * of LNCS, pp. 649-663. Lisbon, Portugal. Springer.
 * }
 *

 *
 * @since 0.6.0
 * @version 0.6.0
 * @author PSantos
 */
public class ExampleTinyDirectedGraph {

    /**
     * Words that will make part of graph. They will be graph nodes.
     */
    private List<Word> words;
    private DirectedPseudograph<Word, LexicalRelation> directedPseudoGraph;

    public DirectedPseudograph<Word, LexicalRelation> createDirectedGraph() {
        if (this.directedPseudoGraph == null) {
            createGraph();
        }
        return this.directedPseudoGraph;
    }

    /**
     * Returns the dictionary words.
     *
     * @return a list of the dictionary words.
     */
    private List<Word> getWords() {
        return words;
    }

    /**
     * Returns a list of seed words. This is an initial list of words classified
     * as positive, negative and eventually with the neutral polarity.
     *
     * @return a list of seed words
     */
    public List<Word> getSeedWords() {
        List<Word> seedWords = new ArrayList<Word>();
        for (Word w : words) {
            if (w.isSeed()) {
                seedWords.add(w);
            }
        }
        return (seedWords.size() > 0 ? seedWords : null);
    }

    private void createGraph() {

        // Words that will be used as graph nodes
        Word A = new Word("A");
        Word B = new Word("B");
        Word C = new Word("C");
        Word D = new Word("D");
        Word E = new Word("E");
        Word F = new Word("F");
        Word G = new Word("G");
        Word H = new Word("H");
        Word I = new Word("I");

        words = new ArrayList<Word>();
        words.add(A);
        words.add(B);
        words.add(C);
        words.add(D);
        words.add(E);
        words.add(F);
        words.add(G);
        words.add(H);
        words.add(I);

        // Set "A" and "B" as seed words.
        A.setAsPositiveSeed();
        B.setAsNegativeSeed();

            // I changed from DirectedMultigraph to DirectedPseudograph. This was
            // required because the former does not support loops. This means does not
            // support a vertex from a edge to itself.
            this.directedPseudoGraph
                    = new DirectedPseudograph<Word, LexicalRelation>(
                            new ClassBasedEdgeFactory<Word, LexicalRelation>(LexicalRelation.class));

            for (Word w : words) {
                directedPseudoGraph.addVertex(w);
            }

            directedPseudoGraph.addEdge(A, C, new LexicalRelation(A, C, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(A, D, new LexicalRelation(A, D, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(B, D, new LexicalRelation(B, D, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(B, E, new LexicalRelation(B, E, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(C, F, new LexicalRelation(C, F, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(D, F, new LexicalRelation(D, F, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(E, G, new LexicalRelation(E, G, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(E, H, new LexicalRelation(E, H, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(F, I, new LexicalRelation(F, I, LexicalRelation.Type.ANTONYM));
            directedPseudoGraph.addEdge(F, G, new LexicalRelation(F, G, LexicalRelation.Type.SYNONYM));
            directedPseudoGraph.addEdge(H, E, new LexicalRelation(H, E, LexicalRelation.Type.SYNONYM));

    }

    public static void main(String args[]) {

        // Loads the example data
        ExampleTinyDirectedGraph exampleData = new ExampleTinyDirectedGraph();
        DirectedPseudograph<Word, LexicalRelation> initialGraph = exampleData.createDirectedGraph();
        List<Word> seedWords = exampleData.getSeedWords();

        // Applies the propagation algorithm over the directed graph
        DirectedPseudograph<Word, LexicalRelation> finalGraph
                = PolarityPropagation.propagate(initialGraph, seedWords);

        // Print the list of "words" to the screen
        PolarityUtils.printGraphNodes(finalGraph);

       // Compute and show a few statistics about the final graph
        PolarityStats stats = new PolarityStats(finalGraph);
        System.out.println(stats);
    }
}


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

        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <TITLE>
            FreeformConnectionFactory (Encog Core 3.2.0-SNAPSHOT API)
        </TITLE>

        <META NAME="date" CONTENT="2013-04-17">

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

                            Overview
                            Package
                          Class
                            Use
                            Tree
                            Deprecated
                            Index
                            Help

                     PREV CLASS
                     NEXT CLASS

                    FRAMES
                     NO FRAMES

                        All Classes

                    SUMMARY: NESTED | FIELD | CONSTR | METHOD

                    DETAIL: FIELD | CONSTR | METHOD

            org.encog.neural.freeform.factory

        Interface FreeformConnectionFactory

All Known Implementing Classes:
BasicFreeformConnectionFactory

public interface FreeformConnectionFactory

A factory that creates connections.

Method Summary

 FreeformConnection
factor(FreeformNeuron sourceNeuron,
       FreeformNeuron targetNeuron)

          Create a connection.

Method Detail

factor

FreeformConnection factor(FreeformNeuron sourceNeuron,
                          FreeformNeuron targetNeuron)

Create a connection.

Parameters:
sourceNeuron - The source neuron.
targetNeuron - The target neuron.

Returns:
The newly created connection.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013. All Rights Reserved.