text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.saiku</groupId>
	<artifactId>saiku-ui</artifactId>
	<packaging>pom</packaging>
	<version>2.5-SNAPSHOT</version>
	<build>
		<plugins>
<!--
         <plugin>
        <groupId>nl.windgazer</groupId>
        <artifactId>jsdoctk-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
            <srcDir>${basedir}/js/saiku/</srcDir>
            <exclude>
                <param>ccc</param>
		<param>backbone</param>
		<param>jquery</param>
            </exclude>
            <recurse>7</recurse>
        </configuration>
        <executions>
            <execution>
                <id>copy-package</id>
						<phase>package</phase>
						<goals>
							<goal>jsdoc</goal>
						</goals>
            </execution>
        </executions>
    </plugin>
-->
    <!-- DISABLE YUI COMPRESSOR
    <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>yuicompressor-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>compress</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <nosuffix>true</nosuffix>
          <sourceDirectory>${basedir}/js/saiku/</sourceDirectory>
          <aggregations>
            <aggregation>
              <insertNewLine>true</insertNewLine>
              <output>${basedir}/target/all.js</output>
              <includes>

                <include>classes/Settings.js</include>
                <include>classes/models/Dimension.js</include>
                <include>classes/views/DimensionList.js</include>
                <include>classes/views/Toolbar.js</include>
                <include>classes/views/Modal.js</include>
                <include>classes/views/MDXModal.js</include>
                <include>classes/views/SelectionsModal.js</include>
                <include>classes/views/LoginForm.js</include>
                <include>classes/views/AboutModal.js</include>
                <include>classes/views/WorkspaceToolbar.js</include>
                <include>classes/views/WorkspaceDropZone.js</include>
                <include>classes/views/Table.js</include>
                <include>classes/views/Workspace.js</include>
                <include>classes/views/DeleteQuery.js</include>
                <include>classes/views/OpenQuery.js</include>
                <include>classes/views/SaveQuery.js</include>
                <include>classes/views/Tab.js</include>
                <include>classes/models/Repository.js</include>
                <include>classes/models/Properties.js</include>
                <include>classes/models/Result.js</include>
                <include>classes/models/QueryAction.js</include>
                <include>classes/models/QueryScenario.js</include>
                <include>classes/models/Query.js</include>
                <include>classes/models/Session.js</include>
                <include>classes/models/SessionWorkspace.js</include>
                <include>classes/models/Member.js</include>
                <include>classes/Saiku.js</include>
                <include>classes/adapters/SaikuServer.js</include>
                <include>classes/routers/QueryRouter.js</include>
              </includes>
            </aggregation>
          </aggregations>
        </configuration>
      </plugin>
      -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.2</version>
				<executions>
					<execution>
						<id>copy-package</id>
						<phase>package</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
							<mkdir dir="target/saiku-ui" />
								<copy todir="target/saiku-ui">
									<fileset dir="${basedir}/">
                                        <exclude name="target/" />
                                        <exclude name="pom.xml" />
                                        <exclude name=".git/" />
                                        <exclude name=".gitignore" />
                                    </fileset>
								</copy>
<!--
                                <copy todir="target/saiku-ui/doc/">
									<fileset dir="${basedir}/target/jsdoc"/>
								</copy>
-->
								<zip destfile="target/saiku-ui-${project.version}.zip">
									<zipfileset dir="target/saiku-ui/" />
								</zip>
								<zip destfile="target/saiku-ui-${project.version}.war">
									<zipfileset dir="target/saiku-ui/" />
								</zip>
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>
     <repositories>
        <repository>
            <id>jsdoctk1</id>
            <url>http://jsdoctk-plugin.googlecode.com/svn/repo</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>jsdoctk2</id>
            <url>http://jsdoctk-plugin.googlecode.com/svn/repo</url>
        </pluginRepository>
        <pluginRepository>
            <name>oss.sonatype.org</name>
            <id>oss.sonatype.org</id>
            <url>http://oss.sonatype.org/content/groups/public</url>
        </pluginRepository>
    </pluginRepositories>
</project>


text:
define(["dojo/_base/declare", "dojox/app/ViewBase", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin"],
	function(declare, ViewBase, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin){
		return declare([_WidgetBase, ViewBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
			postCreate: function(){
				this.inherited(arguments);
				// use the dojo attach point
				this.myButton.on("click", function(){
					console.log("I was correctly attached!")
				});
			}
		});
	}
);

redpajama_set_name: RedPajamaGithub


text:
import produce, { immerable, castDraft, setAutoFreeze, enablePatches } from 'immer';
import bigInt, { BigInteger } from 'big-integer';

setAutoFreeze(false);

enablePatches();

function sortBigInt(a: BigInteger, b: BigInteger) {
  if (a.lt(b)) {
    return 1;
  } else if (a.eq(b)) {
    return 0;
  } else {
    return -1;
  }
}
export class BigIntOrderedMap<V> implements Iterable<[BigInteger, V]> {
  root: Record<string, V> = {}
  cachedIter: [BigInteger, V][] | null = null;
  [immerable] = true;

  constructor(items: [BigInteger, V][] = []) {
    items.forEach(([key, val]) => {
      this.set(key, val);
    });
  }

  get size() {
    if(this.cachedIter) {
      return this.cachedIter.length;
    }
    return this.generateCachedIter().length;
  }

  get(key: BigInteger) {
    return this.root[key.toString()] ?? null;
  }

  gas(items: [BigInteger, V][]) {
    return produce(this, (draft) => {
      items.forEach(([key, value]) => {
        draft.root[key.toString()] = castDraft(value);
      });
      draft.cachedIter = null;
    },
    (patches) => {
      // console.log(`gassed with ${JSON.stringify(patches, null, 2)}`);
    });
  }

  set(key: BigInteger, value: V) {
    return produce(this, (draft) => {
      draft.root[key.toString()] = castDraft(value);
      draft.cachedIter = null;
    });
  }

  clear() {
    return produce(this, (draft) => {
      draft.cachedIter = [];
      draft.root = {};
    });
  }

  has(key: BigInteger) {
    return key.toString() in this.root;
  }

  delete(key: BigInteger) {
    const result = produce(this, (draft) => {
      delete draft.root[key.toString()];
      draft.cachedIter = null;
    });
    return result;
  }

  [Symbol.iterator](): IterableIterator<[BigInteger, V]> {
    let idx = 0;
    const result = this.generateCachedIter();
    return {
      [Symbol.iterator]: this[Symbol.iterator],
      next: (): IteratorResult<[BigInteger, V]> => {
        if (idx < result.length) {
          return { value: result[idx++], done: false };
        }
        return { done: true, value: null };
      }
    };
  }

  peekLargest() {
    const sorted = Array.from(this);
    return sorted[0] as [BigInteger, V] | null;
  }

  peekSmallest() {
    const sorted = Array.from(this);
    return sorted[sorted.length - 1] as [BigInteger, V] | null;
  }

  keys() {
    return Array.from(this).map(([k,v]) => k);
  }

  generateCachedIter() {
    if(this.cachedIter) {
      return [...this.cachedIter];
    }
    const result = Object.keys(this.root).map((key) => {
      const num = bigInt(key);
      return [num, this.root[key]] as [BigInteger, V];
    }).sort(([a], [b]) => sortBigInt(a,b));
    this.cachedIter = result;
    return [...result];
  }
}


text:
Add details

        <form class="form-horizontal" data-ng-submit="create()" novalidate>
            <fieldset>

                    Name

                        <input type="text" data-ng-model="name" id="name" class="form-control" placeholder="Name" required>

                    College

                        <input type="text" data-ng-model="college" id="college" class="form-control" placeholder="College" required>

                    Degree

                        <input type="text" data-ng-model="degree" id="degree" class="form-control" placeholder="Degree" required>

                    <input type="submit" class="btn btn-default">

            </fieldset>
        </form>


text:
REG_FIDDLE(Image_makeShader_2, 256, 256, false, 5) {
void draw(SkCanvas* canvas) {
    SkMatrix matrix;
    matrix.setRotate(45);
    matrix.postTranslate(125, 30);
    SkPaint paint;
    paint.setShader(image->makeShader(&matrix));
    canvas->drawPaint(paint);
}
}  // END FIDDLE


text:
using System;
/*Problem 8. Prime Number Check

Write an expression that checks if given positive integer number n (n <= 100) is prime (i.e. it is divisible without remainder only to itself and 1).
Note: You should check if the number is positive*/

namespace _08.PrimeNumberCheck
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Enter number lesser or equal to 100");
            int number = int.Parse(Console.ReadLine());
            bool check = true;
            if (number <= 100)
            {
                for (int i = 2; i < number; i++)
                {
                    if (number % i == 0)
                    {
                        check = false;
                    }
                }
                if (check)
                {
                    Console.WriteLine("The number is prime");
                }
                else
                {
                    Console.WriteLine("The number isn't prime");
                }
            }
            else
            {
                Console.WriteLine("You are entering invalid number");
            }

        }
    }
}


text:
import {Injector, ɵglobal as global} from '@angular/core';
import {ApplicationRef} from '@angular/core/src/application_ref';
import {SpyObject} from '@angular/core/testing/src/testing_internal';

export class SpyApplicationRef extends SpyObject {
  constructor() { super(ApplicationRef); }
}

export class SpyComponentRef extends SpyObject {
  injector: any /** TODO #9100 */;
  constructor() {
    super();
    this.injector =
        Injector.create([{provide: ApplicationRef, useClass: SpyApplicationRef, deps: []}]);
  }
}

export function callNgProfilerTimeChangeDetection(config?: any /** TODO #9100 */): void {
  (<any>global).ng.profiler.timeChangeDetection(config);
}


text:
using Elementary.Hierarchy.Collections;
using NUnit.Framework;
using System;
using System.Linq;

namespace Elementary.Hierarchy.LiteDb.Test
{
    [TestFixture]
    public class LiteDbHierarchyNodeTest
    {
        [Test]
        public void LDBH_TryGetValue_is_false_if_node_has_no_value()
        {
            // ARRANGE

            var node = new LiteDbHierarchy<string, string>.Node("id");

            // ACT

            string value;
            var result = node.TryGetValue(out value);

            // ASSERT

            Assert.IsFalse(result);
        }

        [Test]
        public void LDBH_TryGetValue_is_true_if_node_has_string_value()
        {
            // ARRANGE

            var value = "value";
            var node = new LiteDbHierarchy<string, string>.Node("id", value);

            // ACT

            string value_result;
            var result = node.TryGetValue(out value_result);

            // ASSERT

            Assert.IsTrue(result);
            Assert.AreEqual(value, value_result);
        }

        [Test]
        public void LDBH_TryGetValue_is_true_if_node_has_int_value()
        {
            // ARRANGE

            int value = -1;
            var node = new LiteDbHierarchy<string, int>.Node("id", value);

            // ACT

            int value_result;
            var result = node.TryGetValue(out value_result);

            // ASSERT

            Assert.IsTrue(result);
            Assert.AreEqual(value, value_result);
        }

        [Test]
        public void LDBH_Set_uint_value_throws()
        {
            // ACT & ASSERT

            uint value = 1;
            Assert.Throws<InvalidCastException>(() => new LiteDbHierarchy<string, uint>.Node("id", value));
        }

        [Test]
        public void LDBH_TryGetValue_is_true_if_node_has_long_value()
        {
            // ARRANGE

            long value = 1;
            var node = new LiteDbHierarchy<string, long>.Node("id", value);

            // ACT

            long value_result;
            var result = node.TryGetValue(out value_result);

            // ASSERT

            Assert.IsTrue(result);
            Assert.AreEqual(value, value_result);
        }

        [Test]
        public void LDBH_Set_ulong_value_throws()
        {
            // ACT & ASSERT

            ulong value = 1;
            Assert.Throws<InvalidCastException>(() => new LiteDbHierarchy<string, ulong>.Node("id", value));
        }

        [Test]
        public void LDBH_Set_float_value_throws()
        {
            // ACT & ASSERT

            float value = 1;
            Assert.Throws<InvalidCastException>(() => new LiteDbHierarchy<string, float>.Node("id", value));
        }

        [Test]
        public void LDBH_TryGetValue_is_true_if_node_has_double_value()
        {
            // ARRANGE

            double value = 1.0;
            var node = new LiteDbHierarchy<string, double>.Node("id", value);

            // ACT

            double value_result;
            var result = node.TryGetValue(out value_result);

            // ASSERT

            Assert.IsTrue(result);
            Assert.AreEqual(value, value_result);
        }

        [Test]
        public void LDBH_Set_decimal_value_throws()
        {
            // ACT & ASSERT

            decimal value = 1M;
            Assert.Throws<InvalidCastException>(() => new LiteDbHierarchy<string, decimal>.Node("id", value));
        }

        [Test]
        public void LDBH_TryGetValue_is_true_if_node_has_DateTime_value()
        {
            // ARRANGE

            DateTime value = DateTime.Now;
            var node = new LiteDbHierarchy<string, DateTime>.Node("id", value);

            // ACT

            DateTime value_result;
            var result = node.TryGetValue(out value_result);

            // ASSERT

            Assert.IsTrue(result);
            Assert.AreEqual(value, value_result);
        }

        [Test]
        public void LDBH_TryGetValue_is_true_if_node_has_Guid_value()
        {
            // ARRANGE

            Guid value = Guid.NewGuid();
            var node = new LiteDbHierarchy<string, Guid>.Node("id", value);

            // ACT

            Guid value_result;
            var result = node.TryGetValue(out value_result);

            // ASSERT

            Assert.IsTrue(result);
            Assert.AreEqual(value, value_result);
        }

        [Test]
        public void MHN_Setting_node_value_creates_a_node_node()
        {
            // ARRANGE

            var node = new MutableHierarchy<string, string>.Node("id", "value");

            // ACT

            var result = node.SetValue("newValue");

            // ASSERT

            Assert.AreSame(node, result);
            Assert.AreEqual("newValue", result.value);
        }

        [Test]
        public void MHN_Setting_node_value_twice_doesnt_create_new_node()
        {
            // ARRANGE

            string value = "value";
            var node = new MutableHierarchy<string, string>.Node("id", value);

            // ACT

            var result = node.SetValue(value);

            // ASSERT

            Assert.AreSame(node, result);
            Assert.AreSame(value, result.value);
        }

        [Test]
        public void MHN_Adding_child_doesnt_create_new_node()
        {
            // ARRANGE

            var childNode = new MutableHierarchy<string, string>.Node("id2", "value2");
            var node = new MutableHierarchy<string, string>.Node("id", "value");

            // ACT

            var result = node.AddChildNode(childNode);

            // ASSERT

            Assert.AreSame(node, result);

            // node contains child
            Assert.AreEqual(1, result.ChildNodes.Count());
            Assert.AreSame(childNode, result.ChildNodes.ElementAt(0));
            Assert.AreEqual("value2", result.ChildNodes.ElementAt(0).value);
        }

        [Test]
        public void MHN_Add_child_twice_doesnt_create_new_node()
        {
            // ARRANGE

            var childNode = new MutableHierarchy<string, string>.Node("id2", "value2");
            var node = new MutableHierarchy<string, string>.Node("id", "value");
            node = node.AddChildNode(childNode);

            // ACT

            var result = node.AddChildNode(childNode);

            // ASSERT

            Assert.AreSame(node, result);

            // node contains child twice.
            Assert.AreSame(childNode, result.ChildNodes.ElementAt(0));
            Assert.AreSame(childNode, result.ChildNodes.ElementAt(1));
        }

        [Test]
        public void MHN_Set_child_node_exchanges_child_and_doesnt_create_new_node()
        {
            // ARRANGE

            var childNode = new MutableHierarchy<string, string>.Node("child", "value2");
            var node = new MutableHierarchy<string, string>.Node("id", "value", new[] { childNode });

            // ACT

            var childNode2 = new MutableHierarchy<string, string>.Node("child", "value");
            var result = node.SetChildNode(childNode2);

            // ASSERT

            Assert.AreSame(node, result);

            // new node contains the new child node
            Assert.AreEqual(1, result.ChildNodes.Count());
            Assert.AreSame(childNode2, result.ChildNodes.ElementAt(0));
        }

        [Test]
        public void MHN_Unset_value_of_node_doesnt_create_new_node()
        {
            // ARRANGE

            var node = new MutableHierarchy<string, string>.Node("id", "value", new[] {
                new MutableHierarchy<string,string>.Node("child", "value2")
            });

            // ACT

            var result = node.UnsetValue();

            // ASSERT

            Assert.AreSame(node, result);

            // node has no value
            Assert.IsFalse(result.HasValue);
            Assert.AreEqual(1, result.ChildNodes.Count());
            Assert.AreSame(node.ChildNodes.ElementAt(0), result.ChildNodes.ElementAt(0));
        }

        [Test]
        public void MHN_Unset_value_twice_doesnt_create_new_node()
        {
            // ARRANGE

            var node = new MutableHierarchy<string, string>.Node("id", "value", new[] {
                new MutableHierarchy<string,string>.Node("child", "value2")
            });

            node = node.UnsetValue();

            // ACT

            var result = node.UnsetValue();

            // ASSERT

            Assert.AreSame(node, result);
        }

        [Test]
        public void MHN_Unset_value_of_parent_node_removes_empty_child_on_UnsetValue_with_prune()
        {
            // ARRANGE

            var node = new MutableHierarchy<string, string>.Node("id", "value", new[] {
                new MutableHierarchy<string,string>.Node("child")
            });

            // ACT

            var result = node.UnsetValue(prune: true);

            // ASSERT

            Assert.AreSame(node, result);

            // node has no value
            Assert.IsFalse(result.HasValue);
            Assert.AreEqual(0, result.ChildNodes.Count());
        }

        [Test]
        public void MHN_Unset_value_of_parent_node_keeps_non_empty_child_on_UnsetValue_with_prune()
        {
            // ARRANGE

            var node = new MutableHierarchy<string, string>.Node("id", "value", new[] {
                new MutableHierarchy<string,string>.Node("child","value2")
            });

            // ACT

            var result = node.UnsetValue(prune: true);

            // ASSERT

            Assert.AreSame(node, result);

            // node has no value
            Assert.IsFalse(result.HasValue);
            Assert.AreEqual(1, result.ChildNodes.Count());
            Assert.AreSame(node.ChildNodes.ElementAt(0), result.ChildNodes.ElementAt(0));
        }

        [Test]
        public void MHN_Remove_child_from_node()
        {
            // ARRANGE

            var node = new MutableHierarchy<string, string>.Node("id", "value", new[] {
                new MutableHierarchy<string,string>.Node("child","value2")
            });

            // ACT

            node.RemoveChildNode(node.ChildNodes.Single());

            // ASSERT

            Assert.IsTrue(node.HasValue);
            string value;
            Assert.IsTrue(node.TryGetValue(out value));
            Assert.AreEqual("value", value);
            Assert.AreEqual("id", node.key);
        }
    }
}


text:
#! /bin/sh
#-------------------------------------------------------------------------
#
# Gen_fmgrtab.sh
#    shell script to generate fmgroids.h and fmgrtab.c from pg_proc.h
#
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
#    $PostgreSQL: pgsql/src/backend/utils/Gen_fmgrtab.sh,v 1.38 2008/01/01 19:45:52 momjian Exp $
#
#-------------------------------------------------------------------------

CMDNAME=`basename $0`

: ${AWK='awk'}

cleanup(){
    [ x"$noclean" != x"t" ] && rm -f "$SORTEDFILE" "$$-$OIDSFILE" "$$-$TABLEFILE"
}

noclean=

#
# Process command line switches.
#
while [ $# -gt 0 ]
do
    case $1 in
        --noclean)
            noclean=t
            ;;
        --help)
            echo "$CMDNAME generates fmgroids.h and fmgrtab.c from pg_proc.h."
            echo
            echo "Usage:"
            echo "  $CMDNAME inputfile"
            echo
            echo "The environment variable AWK determines which Awk program"
            echo "to use. The default is \`awk'."
            echo
            echo "Report bugs to <pgsql-bugs@postgresql.org>."
            exit 0
            ;;
        -*)
            echo "$CMDNAME: invalid option: $1"
            exit 1
            ;;
        *)
            INFILE=$1
            ;;
    esac
    shift
done

if [ x"$INFILE" = x ] ; then
    echo "$CMDNAME: no input file"
    exit 1
fi

SORTEDFILE="$$-fmgr.data"
OIDSFILE=fmgroids.h
TABLEFILE=fmgrtab.c

trap 'echo "Caught signal." ; cleanup ; exit 1' 1 2 15

#
# Generate the file containing raw pg_proc tuple data
# (but only for "internal" language procedures...).
# Basically we strip off the DATA macro call, leaving procedure OID as $1
# and all the pg_proc field values as $2, $3, etc on each line.
#
# Note assumption here that prolang == $5 and INTERNALlanguageId == 12.
#
egrep '^DATA' $INFILE | \
sed 	-e 's/^.*OID[^=]*=[^0-9]*//' \
	-e 's/(//g' \
	-e 's/[ 	]*).*$//' | \
$AWK '$5 == "12" { print }' | \
sort -n > $SORTEDFILE

if [ $? -ne 0 ]; then
    cleanup
    echo "$CMDNAME failed"
    exit 1
fi

cpp_define=`echo $OIDSFILE | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | sed -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`

#
# Generate fmgroids.h
#
cat > "$$-$OIDSFILE" <<FuNkYfMgRsTuFf

#ifndef	$cpp_define
#define $cpp_define

/*
 *	Constant macros for the OIDs of entries in pg_proc.
 *
 *	NOTE: macros are named after the prosrc value, ie the actual C name
 *	of the implementing function, not the proname which may be overloaded.
 *	For example, we want to be able to assign different macro names to both
 *	char_text() and name_text() even though these both appear with proname
 *	'text'.  If the same C function appears in more than one pg_proc entry,
 *	its equivalent macro will be defined with the lowest OID among those
 *	entries.
 */
FuNkYfMgRsTuFf

# Note assumption here that prosrc == $(NF-3).

tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' < $SORTEDFILE | \
$AWK '
BEGIN	{ OFS = ""; }
	{ if (seenit[$(NF-3)]++ == 0) print "#define F_", $(NF-3), " ", $1; }' >> "$$-$OIDSFILE"

if [ $? -ne 0 ]; then
    cleanup
    echo "$CMDNAME failed"
    exit 1
fi

cat >> "$$-$OIDSFILE" <<FuNkYfMgRsTuFf

#endif	/* $cpp_define */
FuNkYfMgRsTuFf

#
# Generate fmgr's built-in-function table.
#
# Print out the function declarations, then the table that refers to them.
#
cat > "$$-$TABLEFILE" <<FuNkYfMgRtAbStUfF
/*-------------------------------------------------------------------------
 *
 * $TABLEFILE
 *    The function manager's table of internal functions.
 *
 * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * NOTES
 *
 *	******************************
 *	*** DO NOT EDIT THIS FILE! ***
 *	******************************
 *
 *	It has been GENERATED by $CMDNAME
 *	from $INFILE
 *
 *-------------------------------------------------------------------------
 */

#include "postgres.h"

#include "utils/fmgrtab.h"

FuNkYfMgRtAbStUfF

# Note assumption here that prosrc == $(NF-3).

$AWK '{ print "extern Datum", $(NF-3), "(PG_FUNCTION_ARGS);"; }' $SORTEDFILE >> "$$-$TABLEFILE"

if [ $? -ne 0 ]; then
    cleanup
    echo "$CMDNAME failed"
    exit 1
fi

cat >> "$$-$TABLEFILE" <<FuNkYfMgRtAbStUfF

const FmgrBuiltin fmgr_builtins[] = {
FuNkYfMgRtAbStUfF

# Note: using awk arrays to translate from pg_proc values to fmgrtab values
# may seem tedious, but avoid the temptation to write a quick x?y:z
# conditional expression instead.  Not all awks have conditional expressions.
#
# Note assumptions here that prosrc == $(NF-3), pronargs == $13,
# proisstrict == $10, proretset == $11

$AWK 'BEGIN {
    Bool["t"] = "true"
    Bool["f"] = "false"
}
{ printf ("  { %d, \"%s\", %d, %s, %s, %s },\n"), \
	$1, $(NF-3), $13, Bool[$10], Bool[$11], $(NF-3)
}' $SORTEDFILE >> "$$-$TABLEFILE"

if [ $? -ne 0 ]; then
    cleanup
    echo "$CMDNAME failed"
    exit 1
fi

cat >> "$$-$TABLEFILE" <<FuNkYfMgRtAbStUfF
  /* dummy entry is easier than getting rid of comma after last real one */
  /* (not that there has ever been anything wrong with *having* a
     comma after the last field in an array initializer) */
  { 0, NULL, 0, false, false, NULL }
};

/* Note fmgr_nbuiltins excludes the dummy entry */
const int fmgr_nbuiltins = (sizeof(fmgr_builtins) / sizeof(FmgrBuiltin)) - 1;

FuNkYfMgRtAbStUfF

# We use the temporary files to avoid problems with concurrent runs
# (which can happen during parallel make).
mv "$$-$OIDSFILE" $OIDSFILE
mv "$$-$TABLEFILE" $TABLEFILE

cleanup
exit 0


text:
from sklearn import preprocessing
from wallace.dataset_transformations.dataset_transformation import DatasetTransformation

class ScaleTransformation(DatasetTransformation):
    def transform_column(self, column):
        float_column = [float(i) for i in column]
        return preprocessing.scale(float_column)

    def valid_data_types(self):
        return ["integer", "float"]


text:
package reactor.core.publisher;

import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Supplier;

import org.junit.Assert;
import org.junit.Test;
import org.reactivestreams.Subscription;
import reactor.core.CoreSubscriber;
import reactor.core.Scannable;
import reactor.test.StepVerifier;
import reactor.test.publisher.FluxOperatorTest;
import reactor.test.subscriber.AssertSubscriber;

import static org.assertj.core.api.Assertions.assertThat;

public class FluxBufferBoundaryTest
		extends FluxOperatorTest<String, List<String>> {

	@Override
	protected Scenario<String, List<String>> defaultScenarioOptions(Scenario<String, List<String>> defaultOptions) {
		return defaultOptions.prefetch(Integer.MAX_VALUE);
	}

	@Override
	protected List<Scenario<String, List<String>>> scenarios_operatorError() {
		return Arrays.asList(

				scenario(f -> f.buffer(Flux.never(), () -> null)),

				scenario(f -> f.buffer(Flux.never(), () -> {
					throw exception();
				})));
	}

	@Override
	protected List<Scenario<String, List<String>>> scenarios_operatorSuccess() {
		return Arrays.asList(scenario(f -> f.buffer(Mono.never()))
						.receive(i -> assertThat(i).containsExactly(item(0), item(1), item(2)))
				.shouldAssertPostTerminateState(false),

				scenario(f -> f.buffer(Mono.just(1)))
						.receiverEmpty()
						.shouldAssertPostTerminateState(false)
		);
	}

	@Override
	protected List<Scenario<String, List<String>>> scenarios_errorFromUpstreamFailure() {
		return Arrays.asList(scenario(f -> f.buffer(Flux.never())));
	}

	@Test
	public void normal() {
		AssertSubscriber<List<Integer>> ts = AssertSubscriber.create();

		DirectProcessor<Integer> sp1 = DirectProcessor.create();
		DirectProcessor<Integer> sp2 = DirectProcessor.create();

		sp1.buffer(sp2)
		   .subscribe(ts);

		ts.assertNoValues()
		  .assertNoError()
		  .assertNotComplete();

		sp1.onNext(1);
		sp1.onNext(2);

		ts.assertNoValues()
		  .assertNoError()
		  .assertNotComplete();

		sp2.onNext(1);

		ts.assertValues(Arrays.asList(1, 2))
		  .assertNoError()
		  .assertNotComplete();

		sp2.onNext(2);

		ts.assertValues(Arrays.asList(1, 2))
		  .assertNoError()
		  .assertNotComplete();

		sp1.onNext(3);
		sp1.onNext(4);

		sp2.onComplete();

		ts.assertValues(Arrays.asList(1, 2), Arrays.asList(3, 4))
		  .assertNoError()
		  .assertComplete();

		sp1.onNext(5);
		sp1.onNext(6);
		sp1.onComplete();

		ts.assertValues(Arrays.asList(1, 2), Arrays.asList(3, 4))
		  .assertNoError()
		  .assertComplete();
	}

	@Test
	public void mainError() {
		AssertSubscriber<List<Integer>> ts = AssertSubscriber.create();

		DirectProcessor<Integer> sp1 = DirectProcessor.create();
		DirectProcessor<Integer> sp2 = DirectProcessor.create();

		sp1.buffer(sp2)
		   .subscribe(ts);

		ts.assertNoValues()
		  .assertNoError()
		  .assertNotComplete();

		sp1.onNext(1);
		sp1.onNext(2);

		ts.assertNoValues()
		  .assertNoError()
		  .assertNotComplete();

		sp2.onNext(1);

		ts.assertValues(Arrays.asList(1, 2))
		  .assertNoError()
		  .assertNotComplete();

		sp1.onError(new RuntimeException("forced failure"));

		Assert.assertFalse("sp2 has subscribers?", sp2.hasDownstreams());

		sp2.onNext(2);

		ts.assertValues(Arrays.asList(1, 2))
		  .assertError(RuntimeException.class)
		  .assertErrorMessage("forced failure")
		  .assertNotComplete();

		sp2.onComplete();

		ts.assertValues(Arrays.asList(1, 2))
		  .assertError(RuntimeException.class)
		  .assertErrorMessage("forced failure")
		  .assertNotComplete();
	}

	@Test
	public void otherError() {
		AssertSubscriber<List<Integer>> ts = AssertSubscriber.create();

		DirectProcessor<Integer> sp1 = DirectProcessor.create();
		DirectProcessor<Integer> sp2 = DirectProcessor.create();

		sp1.buffer(sp2)
		   .subscribe(ts);

		ts.assertNoValues()
		  .assertNoError()
		  .assertNotComplete();

		sp1.onNext(1);
		sp1.onNext(2);

		ts.assertNoValues()
		  .assertNoError()
		  .assertNotComplete();

		sp2.onNext(1);

		ts.assertValues(Arrays.asList(1, 2))
		  .assertNoError()
		  .assertNotComplete();

		sp1.onNext(3);

		sp2.onError(new RuntimeException("forced failure"));

		Assert.assertFalse("sp1 has subscribers?", sp1.hasDownstreams());

		ts.assertValues(Arrays.asList(1, 2))
		  .assertError(RuntimeException.class)
		  .assertErrorMessage("forced failure")
		  .assertNotComplete();

		sp2.onComplete();

		ts.assertValues(Arrays.asList(1, 2))
		  .assertError(RuntimeException.class)
		  .assertErrorMessage("forced failure")
		  .assertNotComplete();
	}

	@Test
	public void bufferSupplierThrows() {
		AssertSubscriber<List<Integer>> ts = AssertSubscriber.create();

		DirectProcessor<Integer> sp1 = DirectProcessor.create();
		DirectProcessor<Integer> sp2 = DirectProcessor.create();

		sp1.buffer(sp2, (Supplier<List<Integer>>) () -> {
			throw new RuntimeException("forced failure");
		})
		   .subscribe(ts);

		Assert.assertFalse("sp1 has subscribers?", sp1.hasDownstreams());
		Assert.assertFalse("sp2 has subscribers?", sp2.hasDownstreams());

		ts.assertNoValues()
		  .assertError(RuntimeException.class)
		  .assertErrorMessage("forced failure")
		  .assertNotComplete();
	}

	@Test
	public void bufferSupplierThrowsLater() {
		AssertSubscriber<List<Integer>> ts = AssertSubscriber.create();

		DirectProcessor<Integer> sp1 = DirectProcessor.create();
		DirectProcessor<Integer> sp2 = DirectProcessor.create();

		int count[] = {1};

		sp1.buffer(sp2, (Supplier<List<Integer>>) () -> {
			if (count[0]-- > 0) {
				return new ArrayList<>();
			}
			throw new RuntimeException("forced failure");
		})
		   .subscribe(ts);

		sp1.onNext(1);
		sp1.onNext(2);

		sp2.onNext(1);

		Assert.assertFalse("sp1 has subscribers?", sp1.hasDownstreams());
		Assert.assertFalse("sp2 has subscribers?", sp2.hasDownstreams());

		ts.assertNoValues()
		  .assertError(RuntimeException.class)
		  .assertErrorMessage("forced failure")
		  .assertNotComplete();
	}

	@Test
	public void bufferSupplierReturnsNUll() {
		AssertSubscriber<List<Integer>> ts = AssertSubscriber.create();

		DirectProcessor<Integer> sp1 = DirectProcessor.create();
		DirectProcessor<Integer> sp2 = DirectProcessor.create();

		sp1.buffer(sp2, (Supplier<List<Integer>>) () -> null)
		   .subscribe(ts);

		Assert.assertFalse("sp1 has subscribers?", sp1.hasDownstreams());
		Assert.assertFalse("sp2 has subscribers?", sp2.hasDownstreams());

		ts.assertNoValues()
		  .assertError(NullPointerException.class)
		  .assertNotComplete();
	}

	Flux<List<Integer>> scenario_bufferWillSubdivideAnInputFluxTime() {
		return Flux.just(1, 2, 3, 4, 5, 6, 7, 8)
		           .delayElements(Duration.ofMillis(99))
		           .buffer(Duration.ofMillis(200));
	}

	@Test
	public void bufferWillSubdivideAnInputFluxTime() {
		StepVerifier.withVirtualTime(this::scenario_bufferWillSubdivideAnInputFluxTime)
		            .thenAwait(Duration.ofSeconds(10))
		            .assertNext(t -> assertThat(t).containsExactly(1, 2))
		            .assertNext(t -> assertThat(t).containsExactly(3, 4))
		            .assertNext(t -> assertThat(t).containsExactly(5, 6))
		            .assertNext(t -> assertThat(t).containsExactly(7, 8))
		            .verifyComplete();
	}

	Flux<List<Integer>> scenario_bufferWillSubdivideAnInputFluxTime2() {
		return Flux.just(1, 2, 3, 4, 5, 6, 7, 8)
		           .delayElements(Duration.ofMillis(99))
		           .buffer(Duration.ofMillis(200));
	}

	@Test
	public void bufferWillSubdivideAnInputFluxTime2() {
		StepVerifier.withVirtualTime(this::scenario_bufferWillSubdivideAnInputFluxTime2)
		            .thenAwait(Duration.ofSeconds(10))
		            .assertNext(t -> assertThat(t).containsExactly(1, 2))
		            .assertNext(t -> assertThat(t).containsExactly(3, 4))
		            .assertNext(t -> assertThat(t).containsExactly(5, 6))
		            .assertNext(t -> assertThat(t).containsExactly(7, 8))
		            .verifyComplete();
	}

	@Test
	public void bufferWillAcumulateMultipleListsOfValues() {
		//given: "a source and a collected flux"
		EmitterProcessor<Integer> numbers = EmitterProcessor.create();

		//non overlapping buffers
		EmitterProcessor<Integer> boundaryFlux = EmitterProcessor.create();

		MonoProcessor<List<List<Integer>>> res = numbers.buffer(boundaryFlux)
		                                       .buffer()
		                                       .publishNext()
		                                       .toProcessor();
		res.subscribe();

		numbers.onNext(1);
		numbers.onNext(2);
		numbers.onNext(3);
		boundaryFlux.onNext(1);
		numbers.onNext(5);
		numbers.onNext(6);
		numbers.onComplete();

		//"the collected lists are available"
		assertThat(res.block()).containsExactly(Arrays.asList(1, 2, 3), Arrays.asList(5, 6));
	}

	@Test
	public void fluxEmptyBufferJust() {
//	    "flux empty buffer just"() {
//		when:
		List<List<Object>> ranges = Flux.empty()
		                                .buffer(Flux.just(1))
		                                .collectList()
		                                .block();

//		then:
		assertThat(ranges).isEmpty();
	}

	@Test
	public void fluxEmptyBuffer() {
//		"flux empty buffer"
//		when:
		List<List<Object>> ranges = Flux.empty()
		                                .buffer(Flux.never())
		                                .collectList()
		                                .block(Duration.ofMillis(100));

//		then:
		assertThat(ranges).isEmpty();
	}

	@Test
	public void scanMain() {
		CoreSubscriber<? super List> actual = new LambdaSubscriber<>(null, e -> {}, null, null);
		List<String> initialBuffer = Arrays.asList("foo", "bar");
		FluxBufferBoundary.BufferBoundaryMain<String, Integer, List<String>> test = new FluxBufferBoundary.BufferBoundaryMain<>(
				actual, initialBuffer, ArrayList::new);
		Subscription parent = Operators.cancelledSubscription();
		test.onSubscribe(parent);

		assertThat(test.scan(Scannable.Attr.CAPACITY)).isEqualTo(2);
		assertThat(test.scan(Scannable.Attr.PREFETCH)).isEqualTo(Integer.MAX_VALUE);

		assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isEqualTo(0L);
		test.request(2);
		assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isEqualTo(2L);

		assertThat(test.scan(Scannable.Attr.PARENT)).isSameAs(parent);
		assertThat(test.scan(Scannable.Attr.ACTUAL)).isSameAs(actual);

		assertThat(test.scan(Scannable.Attr.CANCELLED)).isTrue();
	}

	@Test
	public void scanOther() {
		FluxBufferBoundary.BufferBoundaryMain<String, Integer, List<String>> main = new FluxBufferBoundary.BufferBoundaryMain<>(
				null, null, ArrayList::new);
		FluxBufferBoundary.BufferBoundaryOther<Integer> test = new FluxBufferBoundary.BufferBoundaryOther<>(main);
		Subscription parent = Operators.emptySubscription();
		test.onSubscribe(parent);

		//the request is not tracked when there is a parent
		test.request(2);
		assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isEqualTo(0L);

		assertThat(test.scan(Scannable.Attr.PARENT)).isSameAs(parent);
		assertThat(test.scan(Scannable.Attr.ACTUAL)).isSameAs(main);

		assertThat(test.scan(Scannable.Attr.CANCELLED)).isFalse();
		test.cancel();
		assertThat(test.scan(Scannable.Attr.CANCELLED)).isTrue();
	}

	@Test
	public void scanOtherRequestWhenNoParent() {
		FluxBufferBoundary.BufferBoundaryMain<String, Integer, List<String>> main = new FluxBufferBoundary.BufferBoundaryMain<>(
				null, null, ArrayList::new);
		FluxBufferBoundary.BufferBoundaryOther<Integer> test = new FluxBufferBoundary.BufferBoundaryOther<>(main);

		//the request is tracked when there is no parent
		test.request(2);
		assertThat(test.scan(Scannable.Attr.REQUESTED_FROM_DOWNSTREAM)).isEqualTo(2L);
	}
}


text:
#pragma once

#include "IAddinInvocationMethod.h"

namespace Arma2Net
{
	public ref class Addin abstract
	{
	private:
		IAddinInvocationMethod^ invocationMethod;
	public:
		property IAddinInvocationMethod^ InvocationMethod
		{
			virtual IAddinInvocationMethod^ get(void);
			virtual void set(IAddinInvocationMethod^ value);
		}

		virtual System::String^ Invoke(System::String^ args, int maxResultSize) abstract;
	};
}


text:
package org.apache.flink.table.planner.functions.casting;

import org.apache.flink.table.types.logical.LogicalType;
import org.apache.flink.table.types.logical.LogicalTypeFamily;
import org.apache.flink.table.types.logical.LogicalTypeRoot;

import static org.apache.flink.table.codesplit.CodeSplitUtil.newName;
import static org.apache.flink.table.planner.codegen.calls.BuiltInMethods.BINARY_STRING_DATA_FROM_STRING;
import static org.apache.flink.table.planner.functions.casting.CastRuleUtils.methodCall;

/** {@link LogicalTypeRoot#RAW} to {@link LogicalTypeFamily#CHARACTER_STRING} cast rule. */
class RawToStringCastRule extends AbstractNullAwareCodeGeneratorCastRule<Object, String> {

    static final RawToStringCastRule INSTANCE = new RawToStringCastRule();

    private RawToStringCastRule() {
        super(
                CastRulePredicate.builder()
                        .input(LogicalTypeRoot.RAW)
                        .target(LogicalTypeFamily.CHARACTER_STRING)
                        .build());
    }

    @Override
    protected String generateCodeBlockInternal(
            CodeGeneratorCastRule.Context context,
            String inputTerm,
            String returnVariable,
            LogicalType inputLogicalType,
            LogicalType targetLogicalType) {
        final String typeSerializer = context.declareTypeSerializer(inputLogicalType);
        final String deserializedObjTerm = newName("deserializedObj");

        return new CastRuleUtils.CodeWriter()
                .declStmt(
                        Object.class,
                        deserializedObjTerm,
                        methodCall(inputTerm, "toObject", typeSerializer))
                .ifStmt(
                        deserializedObjTerm + " != null",
                        thenWriter ->
                                thenWriter.assignStmt(
                                        returnVariable,
                                        CastRuleUtils.staticCall(
                                                BINARY_STRING_DATA_FROM_STRING(),
                                                methodCall(deserializedObjTerm, "toString"))),
                        elseWriter -> elseWriter.assignStmt(returnVariable, "null"))
                .toString();
    }
}


text:
import Ember from 'ember';
import NotificationManager from '../utils/notification-manager';

var NotificationsView = Ember.CollectionView.extend({
    classNames: ['notifications'],
    content: NotificationManager.content,

    itemViewClass: Ember.View.extend({
        classNames: ['alert', 'notification'],
        classNameBindings: ['alertType'],
        templateName: 'components/bs-notification',
        isVisible: false,
        showTime: 5000,
        fadeInTime: 400,
        fadeOutTime: 400,
        timeoutId: null,

        alertType: function() {
            return 'alert-' + (this.get('content.type') || 'info');
        }.property('content.type'),

        didInsertElement: function() {
            var _this = this;
            return this.$().fadeIn(this.get('fadeInTime'), function() {
                _this.set('timeoutId', setTimeout(function() {
                    _this.fadeOut();
                }, _this.get('showTime')));
            });
        },

        fadeOut: function() {
            var _this = this;
            clearTimeout(this.get('timeoutId'));
            return this.$().animate({ opacity: 0 }, this.get('fadeOutTime'), function() {
                _this.$().slideUp(_this.get('fadeOutTime'), function() {
                    _this.get('parentView.content').removeObject(_this.get('content'));
                });
            });
        },

        click: function() {
            this.fadeOut();
        },

        actions: {
            close: function() {
                return this.fadeOut();
            }
        }
    })
});

export default NotificationsView;


text:
package com.jaquadro.minecraft.storagedrawers.core;

import com.jaquadro.minecraft.storagedrawers.block.tile.TileEntityDrawers;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;

public class ForgeEventHandler
{
    @SubscribeEvent
    public void playerInteracts (PlayerInteractEvent event) {
        if (event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK && event.entityPlayer.capabilities.isCreativeMode) {
            TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
            if (tile instanceof TileEntityDrawers) {
                int dir = ((TileEntityDrawers) tile).getDirection();
                if (dir == event.face) {
                    event.setCanceled(true);
                    return;
                }
            }
        }
    }
}


text:
var request = require('request');

//Lets try to make a HTTP GET request to modulus.io's website.
request('http://www.modulus.io', function (error, response, body) {
  if (!error && response.statusCode == 200) {
    console.log(body); // Show the HTML for the Modulus homepage.
  }
});


text:
#region Project Description [About this]
// =================================================================================
//            The whole Project is Licensed under the MIT License
// =================================================================================
// =================================================================================
//    Wiesend's Dynamic Link Library is a collection of reusable code that
//    I've written, or found throughout my programming career.
//
//    I tried my very best to mention all of the original copyright holders.
//    I hope that all code which I've copied from others is mentioned and all
//    their copyrights are given. The copied code (or code snippets) could
//    already be modified by me or others.
// =================================================================================
#endregion of Project Description
#region Original Source Code [Links to all original source code]
// =================================================================================
//          Original Source Code [Links to all original source code]
// =================================================================================
// https://github.com/JaCraig/Craig-s-Utility-Library
// =================================================================================
//    I didn't wrote this source totally on my own, this class could be nearly a
//    clone of the project of James Craig, I did highly get inspired by him, so
//    this piece of code isn't totally mine, shame on me, I'm not the best!
// =================================================================================
#endregion of where is the original source code
#region Licenses [MIT Licenses]
#region MIT License [James Craig]
// =================================================================================
//    Copyright(c) 2014 James Craig
//
//    Permission is hereby granted, free of charge, to any person obtaining a copy
//    of this software and associated documentation files (the "Software"), to deal
//    in the Software without restriction, including without limitation the rights
//    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//    copies of the Software, and to permit persons to whom the Software is
//    furnished to do so, subject to the following conditions:
//
//    The above copyright notice and this permission notice shall be included in all
//    copies or substantial portions of the Software.
//
//    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//    SOFTWARE.
// =================================================================================
#endregion of MIT License [James Craig]
#region MIT License [Dominik Wiesend]
// =================================================================================
//    Copyright(c) 2016 Dominik Wiesend. All rights reserved.
//
//    Permission is hereby granted, free of charge, to any person obtaining a copy
//    of this software and associated documentation files (the "Software"), to deal
//    in the Software without restriction, including without limitation the rights
//    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//    copies of the Software, and to permit persons to whom the Software is
//    furnished to do so, subject to the following conditions:
//
//    The above copyright notice and this permission notice shall be included in all
//    copies or substantial portions of the Software.
//
//    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
//    SOFTWARE.
// =================================================================================
#endregion of MIT License [Dominik Wiesend]
#endregion of Licenses [MIT Licenses]

using Wiesend.Random.BaseClasses;
using Wiesend.Random.Interfaces;

namespace Wiesend.Random.NameGenerators
{
    ///
    /// Name generator
    ///
    public class NameGenerator : GeneratorAttributeBase, IGenerator<string>
    {
        ///
        /// Constructor
        ///
        /// <param name="Prefix">Should a prefix be generated</param>
        /// <param name="MiddleName">Should a middle name be generated</param>
        /// <param name="LastName">Should a last name be generated</param>
        /// <param name="Suffix">Should a suffix be generated</param>
        public NameGenerator(bool Prefix = false, bool MiddleName = false, bool LastName = true, bool Suffix = false)
            : base("", "")
        {
            this.Prefix = Prefix;
            this.MiddleName = MiddleName;
            this.Suffix = Suffix;
            this.LastName = LastName;
        }

        ///
        /// Should a last name be generated?
        ///
        public virtual bool LastName { get; protected set; }

        ///
        /// Should a middle name be generated?
        ///
        public virtual bool MiddleName { get; protected set; }

        ///
        /// Should a prefix be generated?
        ///
        public virtual bool Prefix { get; protected set; }

        ///
        /// Should a suffix be generated?
        ///
        public virtual bool Suffix { get; protected set; }

        ///
        /// Generates a random value of the specified type
        ///
        /// <param name="Rand">Random number generator that it can use</param>
        /// <returns>A randomly generated object of the specified type</returns>
        public virtual string Next(System.Random Rand)
        {
            return Rand.Next<bool>() ? new MaleNameGenerator(Prefix, MiddleName, LastName, Suffix).Next(Rand) : new FemaleNameGenerator(Prefix, MiddleName, LastName, Suffix).Next(Rand);
        }

        ///
        /// Generates a random value of the specified type
        ///
        /// <param name="Rand">Random number generator that it can use</param>
        /// <param name="Min">Minimum value (inclusive)</param>
        /// <param name="Max">Maximum value (inclusive)</param>
        /// <returns>A randomly generated object of the specified type</returns>
        public virtual string Next(System.Random Rand, string Min, string Max)
        {
            return Next(Rand);
        }

        ///
        /// Generates next object
        ///
        /// <param name="Rand">Random number generator</param>
        /// <returns>The next object</returns>
        public override object NextObj(System.Random Rand)
        {
            return Next(Rand);
        }
    }
}


text:
import {
  LocalizedStringBundleDef,
  LocalizedStringId,
} from '../../../../src/service/localization';

/**
 * Localized string bundle used for lv strings.
 * @const {!LocalizedStringBundleDef}
 */
const strings = {
  [LocalizedStringId.AMP_STORY_AUDIO_MUTE_BUTTON_TEXT]: {
    string: 'Skaņa ir izslēgta',
  },
  [LocalizedStringId.AMP_STORY_AUDIO_UNMUTE_NO_SOUND_TEXT]: {
    string: 'Šajā lapā nav skaņas',
  },
  [LocalizedStringId.AMP_STORY_AUDIO_UNMUTE_SOUND_TEXT]: {
    string: 'Skaņa ir ieslēgta',
  },
  [LocalizedStringId.AMP_STORY_BOOKEND_MORE_TO_READ_LABEL]: {
    string: 'Cita lasāmviela',
  },
  [LocalizedStringId.AMP_STORY_BOOKEND_PRIVACY_SETTINGS_BUTTON_LABEL]: {
    string: 'Mainīt datu konfidencialitātes iestatījumus',
  },
  [LocalizedStringId.AMP_STORY_BOOKEND_PRIVACY_SETTINGS_TITLE]: {
    string: 'Konfidencialitātes iestatījumi',
  },
  [LocalizedStringId.AMP_STORY_CONSENT_ACCEPT_BUTTON_LABEL]: {
    string: 'Piekrist',
  },
  [LocalizedStringId.AMP_STORY_CONSENT_DECLINE_BUTTON_LABEL]: {
    string: 'Noraidīt',
  },
  [LocalizedStringId.AMP_STORY_CONTINUE_ANYWAY_BUTTON_LABEL]: {
    string: 'Tomēr turpināt',
  },
  [LocalizedStringId.AMP_STORY_DOMAIN_DIALOG_HEADING_LABEL]: {
    string: 'Skatīt sākotnējā domēnā:',
  },
  [LocalizedStringId.AMP_STORY_DOMAIN_DIALOG_HEADING_LINK]: {
    string: 'Uzzināt vairāk par AMP rezultātiem',
  },
  [LocalizedStringId.AMP_STORY_HINT_UI_NEXT_LABEL]: {
    string: 'Pieskarieties vienumam Tālāk',
  },
  [LocalizedStringId.AMP_STORY_HINT_UI_PREVIOUS_LABEL]: {
    string: 'Pieskarieties vienumam Atpakaļ',
  },
  [LocalizedStringId.AMP_STORY_PAGE_ATTACHMENT_OPEN_LABEL]: {
    string: 'Vilkt augšup',
  },
  [LocalizedStringId.AMP_STORY_PAGE_PLAY_VIDEO]: {
    string: 'Atskaņot videoklipu',
  },
  [LocalizedStringId.AMP_STORY_SHARING_CLIPBOARD_FAILURE_TEXT]: {
    string: 'Diemžēl neizdevās kopēt saiti starpliktuvē',
  },
  [LocalizedStringId.AMP_STORY_SHARING_CLIPBOARD_SUCCESS_TEXT]: {
    string: 'Saite ir nokopēta.',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_EMAIL]: {
    string: 'Sūtīt e-pasta ziņojumu',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_FACEBOOK]: {
    string: 'Facebook',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_GOOGLE_PLUS]: {
    string: 'Google+',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_LINE]: {
    string: 'Line',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_LINK]: {
    string: 'Iegūt saiti',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_LINKEDIN]: {
    string: 'LinkedIn',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_PINTEREST]: {
    string: 'Pinterest',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_SMS]: {
    string: 'Īsziņas',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_TUMBLR]: {
    string: 'Tumblr',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_TWITTER]: {
    string: 'Twitter',
  },
  [LocalizedStringId.AMP_STORY_SHARING_PROVIDER_NAME_WHATSAPP]: {
    string: 'WhatsApp',
  },
  [LocalizedStringId.AMP_STORY_TOOLTIP_EXPAND_TWEET]: {
    string: 'Izvērst tvītu',
  },
  [LocalizedStringId.AMP_STORY_WARNING_DESKTOP_HEIGHT_SIZE_TEXT]: {
    string: 'Lai skatītu šo saturu, izvērsiet loga augstumu',
  },
  [LocalizedStringId.AMP_STORY_WARNING_DESKTOP_SIZE_TEXT]: {
    string: 'Lai skatītu šo saturu, izvērsiet loga augstumu un platumu',
  },
  [LocalizedStringId.AMP_STORY_WARNING_DESKTOP_WIDTH_SIZE_TEXT]: {
    string: 'Lai skatītu šo saturu, izvērsiet loga platumu',
  },
  [LocalizedStringId.AMP_STORY_WARNING_EXPERIMENT_DISABLED_TEXT]: {
    string: 'Lai skatītu šo saturu, jums jāiespējo AMP stāstu eksperiments.',
  },
  [LocalizedStringId.AMP_STORY_WARNING_LANDSCAPE_ORIENTATION_TEXT]: {
    string: 'Lapu ieteicams skatīt portreta režīmā',
  },
  [LocalizedStringId.AMP_STORY_WARNING_UNSUPPORTED_BROWSER_TEXT]: {
    string: 'Diemžēl jūsu pārlūkprogramma neatbalsta šo iespēju',
  },
};

export default strings;


text:
/**
 * Provides classes for simple functions, such as univariate/bivariate functions.
 */
package wulfric.predictor.function;


text:
/* jshint expr:true */
import Ember from 'ember';
import { describe, beforeEach, it } from 'mocha';
import { expect } from 'chai';
import sinon from 'sinon';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
import InternalSession from 'ember-simple-auth/internal-session';
import EphemeralStore from 'ember-simple-auth/session-stores/ephemeral';

import createWithContainer from '../../helpers/create-with-container';

const { Route, run: { next } } = Ember;

describe('ApplicationRouteMixin', () => {
  let session;
  let route;
  let cookiesMock;
  let containerMock;

  beforeEach(() => {
    session = InternalSession.create({ store: EphemeralStore.create() });
    cookiesMock = {
      read: sinon.stub(),
      clear: sinon.stub()
    };
    containerMock = {
      lookup: sinon.stub()
    };

    containerMock.lookup.withArgs('service:cookies').returns(cookiesMock);

    route = createWithContainer(Route.extend(ApplicationRouteMixin, {
      transitionTo() {}
    }), { session }, containerMock);
  });

  describe('mapping of service events to route methods', () => {
    beforeEach(() => {
      sinon.spy(route, 'sessionAuthenticated');
      sinon.spy(route, 'sessionInvalidated');
    });

    it("maps the services's 'authenticationSucceeded' event into a method call", (done) => {
      session.trigger('authenticationSucceeded');

      next(() => {
        expect(route.sessionAuthenticated).to.have.been.calledOnce;
        done();
      });
    });

    it("maps the services's 'invalidationSucceeded' event into a method call", (done) => {
      session.trigger('invalidationSucceeded');

      next(() => {
        expect(route.sessionInvalidated).to.have.been.calledOnce;
        done();
      });
    });

    it('does not attach the event listeners twice', (done) => {
      route.beforeModel();
      session.trigger('authenticationSucceeded');

      next(() => {
        expect(route.sessionAuthenticated).to.have.been.calledOnce;
        done();
      });
    });
  });

  describe('sessionAuthenticated', () => {
    beforeEach(() => {
      sinon.spy(route, 'transitionTo');
    });

    describe('when an attempted transition is stored in the session', () => {
      let attemptedTransition;

      beforeEach(() => {
        attemptedTransition = {
          retry() {}
        };
        session.set('attemptedTransition', attemptedTransition);
      });

      it('retries that transition', () => {
        sinon.spy(attemptedTransition, 'retry');
        route.sessionAuthenticated();

        expect(attemptedTransition.retry).to.have.been.calledOnce;
      });

      it('removes it from the session', () => {
        route.sessionAuthenticated();

        expect(session.get('attemptedTransition')).to.be.null;
      });
    });

    describe('when a redirect target is stored in a cookie', () => {
      let cookieName = 'ember_simple_auth-redirectTarget';
      let targetUrl = 'transition/target/url';

      beforeEach(() => {
        cookiesMock.read.withArgs(cookieName).returns(targetUrl);
      });

      it('transitions to the url', () => {
        route.sessionAuthenticated();

        expect(route.transitionTo).to.have.been.calledWith(targetUrl);
      });

      it('clears the cookie', () => {
        route.sessionAuthenticated();

        expect(cookiesMock.clear).to.have.been.calledWith(cookieName);
      });
    });

    describe('when no attempted transition is stored in the session', () => {
      it('transitions to "routeAfterAuthentication"', () => {
        let routeAfterAuthentication = 'path/to/route';
        route.set('routeAfterAuthentication', routeAfterAuthentication);
        route.sessionAuthenticated();

        expect(route.transitionTo).to.have.been.calledWith(routeAfterAuthentication);
      });
    });
  });
});


text:
"""
pytils.dt templatetags for Django web-framework
"""

import time

from django import conf, template, utils

from pytils import dt
from pytils.templatetags import init_defaults

register = template.Library()  #: Django template tag/filter registrator
debug = conf.settings.DEBUG  #: Debug mode (sets in Django project's settings)
show_value = getattr(conf.settings, 'PYTILS_SHOW_VALUES_ON_ERROR', False)  #: Show values on errors (sets in Django project's settings)

default_value, default_uvalue = init_defaults(debug, show_value)

# -- filters --
def distance_of_time(from_time, accuracy=1):
    """
    Display distance of time from current time.

    Parameter is an accuracy level (deafult is 1).
    Value must be numeral (i.e. time.time() result) or
    datetime.datetime (i.e. datetime.datetime.now()
    result).

    Examples::
        {{ some_time|distance_of_time }}
        {{ some_dtime|distance_of_time:2 }}
    """
    try:
        to_time = None
        if conf.settings.USE_TZ:
            to_time = utils.timezone.now()
        res = dt.distance_of_time_in_words(from_time, accuracy, to_time)
    except Exception as err:
        # because filter must die silently
        try:
            default_distance = "%s seconds" % str(int(time.time() - from_time))
        except Exception:
            default_distance = ""
        res = default_value % {'error': err, 'value': default_distance}
    return res

def ru_strftime(date, format="%d.%m.%Y", inflected_day=False, preposition=False):
    """
    Russian strftime, formats date with given format.

    Value is a date (supports datetime.date and datetime.datetime),
    parameter is a format (string). For explainings about format,
    see documentation for original strftime:
    http://docs.python.org/lib/module-time.html

    Examples::
        {{ some_date|ru_strftime:"%d %B %Y, %A" }}
    """
    try:
        res = dt.ru_strftime(format,
                             date,
                             inflected=True,
                             inflected_day=inflected_day,
                             preposition=preposition)
    except Exception as err:
        # because filter must die silently
        try:
            default_date = date.strftime(format)
        except Exception:
            default_date = str(date)
        res = default_value % {'error': err, 'value': default_date}
    return res

def ru_strftime_inflected(date, format="%d.%m.%Y"):
    """
    Russian strftime with inflected day, formats date
    with given format (similar to ru_strftime),
    also inflects day in proper form.

    Examples::
        {{ some_date|ru_strftime_inflected:"in %A (%d %B %Y)"
    """
    return ru_strftime(date, format, inflected_day=True)

def ru_strftime_preposition(date, format="%d.%m.%Y"):
    """
    Russian strftime with inflected day and correct preposition,
    formats date with given format (similar to ru_strftime),
    also inflects day in proper form and inserts correct
    preposition.

    Examples::
        {{ some_date|ru_strftime_prepoisiton:"%A (%d %B %Y)"
    """
    return ru_strftime(date, format, preposition=True)

# -- register filters
register.filter('distance_of_time', distance_of_time)
register.filter('ru_strftime', ru_strftime)
register.filter('ru_strftime_inflected', ru_strftime_inflected)
register.filter('ru_strftime_preposition', ru_strftime_preposition)


text:
template<class T>
using min_allocator = std::allocator<T>;


text:
<?php namespace Arcanesoft\Blog;

use Arcanesoft\Blog\Http\Routes\Front as Routes;
use Illuminate\Support\Facades\Route;

/**
 * Class     Blog
 *
 * @package  Arcanesoft\Blog
 * @author   ARCANEDEV <arcanedev.maroc@gmail.com>
 */
class Blog
{
    /* -----------------------------------------------------------------
     |  Properties
     | -----------------------------------------------------------------
     */

    /**
     * Indicates if migrations will be run.
     *
     * @var bool
     */
    public static $runsMigrations = true;

    protected static $instance = null;

    /* -----------------------------------------------------------------
     |  Main Methods
     | -----------------------------------------------------------------
     */

    /**
     * Get the blog instance.
     *
     * @return Blog
     */
    public static function instance()
    {
        if (is_null(static::$instance)) {
            static::$instance = new static;
        }

        return static::$instance;
    }

    /**
     * Publish the migrations.
     */
    public static function publishMigrations()
    {
        static::$runsMigrations = false;
    }

    /**
     * Register the public blog routes.
     */
    public static function routes()
    {
        Route::name('public::blog.')
            ->prefix('blog')
            ->namespace('\\Arcanesoft\\Blog\\Http\\Controllers\\Front')
            ->group(function () {
                Routes\PostsRoutes::register();
                Routes\CategoriesRoutes::register();
                Routes\TagsRoutes::register();
            });
    }

    /**
     * Check if the blog is translatable.
     *
     * @return bool
     */
    public static function isTranslatable()
    {
        return config('arcanesoft.blog.translatable.enabled', false);
    }

    /**
     * Check if the blog is seoable.
     *
     * @return bool
     */
    public static function isSeoable()
    {
        return config('arcanesoft.blog.seoable.enabled', false)
            && static::isSeoManagerInstalled();
    }

    /**
     * Get the supported locales.
     *
     * @return array
     */
    public static function getSupportedLocalesKeys()
    {
        $default = [config('app.locale')];

        return static::isTranslatable()
            ? array_unique(config('localization.supported-locales', $default))
            : $default;
    }

    /**
     * Check if the Media manager is installed.
     *
     * @return bool
     */
    public static function isMediaManagerInstalled()
    {
        return static::hasRegisteredProvider('Arcanesoft\\Media\\MediaServiceProvider');
    }

    /**
     * Check if the SEO manager is installed.
     *
     * @return bool
     */
    public static function isSeoManagerInstalled()
    {
        return static::hasRegisteredProvider('Arcanesoft\\Seo\\SeoServiceProvider');
    }

    /* -----------------------------------------------------------------
     |  Other Methods
     | -----------------------------------------------------------------
     */

    /**
     * Check if the provider was registered in the container.
     *
     * @param  string  $provider
     *
     * @return bool
     */
    protected static function hasRegisteredProvider($provider)
    {
        return array_key_exists($provider, app()->getLoadedProviders());
    }

    protected function __clone()
    {
        // YOU ... SHALL NOT ... CLOOOOOONE!
    }
}


text:
CREATE TABLE data (
    username text,
    vote integer,
    subreddit text DEFAULT '',
    title text DEFAULT '',
    content text
);
-- change path to the file.
\copy data from '~/Desktop/original_data_9feb.csv' with NULL AS ' ' csv;

CREATE TABLE processeddata (
	id SERIAL NOT NULL,--This will be used to split training/valid data.select
	title text,
	subreddit text,
	content text,
	vote integer,
	users text
);

CREATE TABLE allusers(
	users text
);
-- Change the number after "desc limit" in order to choose how many users you want
INSERT INTO processeddata (title, subreddit, content, vote, users) SELECT regexp_replace(title, E'[\\n\\r|\\t]+', ' ', 'g' ) AS title, subreddit, content, vote, string_agg(username, ', ') AS users
FROM data WHERE title <> '' AND title IS NOT NULL AND username in (select username from data group by username order by count(username) desc limit 5)
GROUP BY title, subreddit, content, vote ORDER BY random();

/*
	We used random order before, everything is fine :)
	70%ish training data
	20%ish validation data
	10%ish test data

*/
\copy (select regexp_replace(title, '^\s+', '') AS title, subreddit, users FROM processeddata WHERE ID < floor((select max(id) from processeddata) * 0.7)) to '~/Desktop/training_data_top_5_subreddit_allvotes.csv' With CSV;
\copy (select regexp_replace(title, '^\s+', '') AS title, subreddit, users FROM processeddata WHERE ID > floor((select max(id) from processeddata) * 0.7)+1 AND ID < floor((select max(id) from processeddata) * 0.9)) to '~/Desktop/validation_data_top_5_subreddit_allvotes.csv' With CSV;
\copy (select regexp_replace(title, '^\s+', '') AS title, subreddit, users FROM processeddata WHERE ID > floor((select max(id) from processeddata) * 0.9) +1) to '~/Desktop/testing_data_top_5_subreddit_allvotes.csv' With CSV;


text:
using namespace std;

void addBenchmarkSpecOptions(OptionParser &op)
{
    op.addOption("nopinned", OPT_BOOL, "",
                 "disable usage of pinned (pagelocked) memory");
}

// Modifications:
//    Jeremy Meredith, Wed Dec  1 17:05:27 EST 2010
//    Added calculation of latency estimate.
void RunBenchmark(cl_device_id id,
                  cl_context ctx,
                  cl_command_queue queue,
                  ResultDatabase &resultDB,
                  OptionParser &op)
{
    bool verbose = op.getOptionBool("verbose");
    bool pinned = !op.getOptionBool("nopinned");
    int  npasses = op.getOptionInt("passes");
    const bool waitForEvents = true;

    // Sizes are in kb
    int nSizes  = 20;
    int sizes[20] = {1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,
		     32768,65536,131072,262144,524288};

    // Max sure we don't surpass the OpenCL limit.
    cl_long maxAllocSizeBytes = 0;
    clGetDeviceInfo(id, CL_DEVICE_MAX_MEM_ALLOC_SIZE,
                    sizeof(cl_long), &maxAllocSizeBytes, NULL);
    while (sizes[nSizes-1]*1024 > 0.90 * maxAllocSizeBytes)
    {
        --nSizes;
        if (verbose) cout << " - dropping allocation size to keep under reported limit.\n";
        if (nSizes < 1)
        {
            cerr << "Error: OpenCL reported a max allocation size less than 1kB.\b";
            return;
        }
    }

    // Create some host memory pattern
    if (verbose) cout << ">> creating host mem pattern\n";
    int err;
    float *hostMem1;
    float *hostMem2;
    cl_mem hostMemObj1;
    cl_mem hostMemObj2;
    long long numMaxFloats = 1024 * (sizes[nSizes-1]) / 4;
    if (pinned)
    {
	int err1, err2;
        hostMemObj1 = clCreateBuffer(ctx,
                                     CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR,
                                     sizeof(float)*numMaxFloats, NULL, &err1);
        if (err1 == CL_SUCCESS)
        {
            hostMem1 = (float*)clEnqueueMapBuffer(queue, hostMemObj1, true,
                                                  CL_MAP_READ|CL_MAP_WRITE,
                                                  0,sizeof(float)*numMaxFloats,0,
                                                  NULL,NULL,&err1);
        }
        hostMemObj2 = clCreateBuffer(ctx,
                                     CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR,
                                     sizeof(float)*numMaxFloats, NULL, &err2);
        if (err2 == CL_SUCCESS)
        {
            hostMem2 = (float*)clEnqueueMapBuffer(queue, hostMemObj2, true,
                                                  CL_MAP_READ|CL_MAP_WRITE,
                                                  0,sizeof(float)*numMaxFloats,0,
                                                  NULL,NULL,&err2);
        }
	while (err1 != CL_SUCCESS || err2 != CL_SUCCESS)
	{
	    // free the first buffer if only the second failed
	    if (err1 == CL_SUCCESS)
		clReleaseMemObject(hostMemObj1);

	    // drop the size and try again
	    if (verbose) cout << " - dropping size allocating pinned mem\n";
	    --nSizes;
	    if (nSizes < 1)
	    {
		cerr << "Error: Couldn't allocated any pinned buffer\n";
		return;
	    }
	    numMaxFloats = 1024 * (sizes[nSizes-1]) / 4;
	    hostMemObj1 = clCreateBuffer(ctx,
					 CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR,
					 sizeof(float)*numMaxFloats, NULL, &err1);
            if (err1 == CL_SUCCESS)
            {
                hostMem1 = (float*)clEnqueueMapBuffer(queue, hostMemObj1, true,
                                                      CL_MAP_READ|CL_MAP_WRITE,
                                                      0,sizeof(float)*numMaxFloats,0,
                                                      NULL,NULL,&err1);
            }
	    hostMemObj2 = clCreateBuffer(ctx,
					 CL_MEM_READ_WRITE | CL_MEM_ALLOC_HOST_PTR,
					 sizeof(float)*numMaxFloats, NULL, &err2);
            if (err2 == CL_SUCCESS)
            {
                hostMem2 = (float*)clEnqueueMapBuffer(queue, hostMemObj2, true,
                                                      CL_MAP_READ|CL_MAP_WRITE,
                                                      0,sizeof(float)*numMaxFloats,0,
                                                      NULL,NULL,&err2);
            }
	}
    }
    else
    {
        hostMem1 = new float[numMaxFloats];
        hostMem2 = new float[numMaxFloats];
    }

    for (int i=0; i<numMaxFloats; i++) {
        hostMem1[i] = i % 77;
        hostMem2[i] = -1;
    }

    // Allocate some device memory
    if (verbose) cout << ">> allocating device mem\n";
    cl_mem mem1 = clCreateBuffer(ctx, CL_MEM_READ_WRITE,
                                 sizeof(float)*numMaxFloats, NULL, &err);
    while (err != CL_SUCCESS)
    {
	// drop the size and try again
	if (verbose) cout << " - dropping size allocating device mem\n";
	--nSizes;
	if (nSizes < 1)
	{
	    cerr << "Error: Couldn't allocated any device buffer\n";
	    return;
	}
	numMaxFloats = 1024 * (sizes[nSizes-1]) / 4;
	mem1 = clCreateBuffer(ctx, CL_MEM_READ_WRITE,
			      sizeof(float)*numMaxFloats, NULL, &err);
    }
    if (verbose) cout << ">> filling device mem to force allocation\n";
    Event evDownloadPrime("DownloadPrime");
    err = clEnqueueWriteBuffer(queue, mem1, false, 0,
                               numMaxFloats*sizeof(float), hostMem1,
                               0, NULL, &evDownloadPrime.CLEvent());
    CL_CHECK_ERROR(err);
    if (verbose) cout << ">> waiting for download to finish\n";
    err = clWaitForEvents(1, &evDownloadPrime.CLEvent());
    CL_CHECK_ERROR(err);

    // Three passes, forward and backward both
    for (int pass = 0; pass < npasses; pass++)
    {
        // store the times temporarily to estimate latency
        //float times[nSizes];
        // Step through sizes forward on even passes and backward on odd
        for (int i = 0; i < nSizes; i++)
        {
            int sizeIndex;
            if ((pass%2) == 0)
                sizeIndex = i;
            else
                sizeIndex = (nSizes-1) - i;

            // Read memory back from the device
            if (verbose) cout << ">> reading from device "<<sizes[sizeIndex]<<"kB\n";
            Event evReadback("Readback");
            err = clEnqueueReadBuffer(queue, mem1, false, 0,
                                       sizes[sizeIndex]*1024, hostMem2,
                                       0, NULL, &evReadback.CLEvent());
            CL_CHECK_ERROR(err);

            // Wait for event to finish
            if (verbose) cout << ">> waiting for readback to finish\n";
            err = clWaitForEvents(1, &evReadback.CLEvent());
            CL_CHECK_ERROR(err);

            if (verbose) cout << ">> finish!";
            if (verbose) cout << endl;

            // Get timings
            err = clFlush(queue);
            CL_CHECK_ERROR(err);
            evReadback.FillTimingInfo();
            if (verbose) evReadback.Print(cerr);

            double t = evReadback.SubmitEndRuntime() / 1.e6; // in ms
            //times[sizeIndex] = t;

            // Add timings to database
            double speed = (double(sizes[sizeIndex] * 1024.) /  (1000.*1000.)) / t;
            char sizeStr[256];
            sprintf(sizeStr, "% 7dkB", sizes[sizeIndex]);
            resultDB.AddResult("ReadbackSpeed", sizeStr, "GB/sec", speed);

            // Add timings to database
            double delay = evReadback.SubmitStartDelay() / 1.e6;
            resultDB.AddResult("ReadbackDelay", sizeStr, "ms", delay);
            resultDB.AddResult("ReadbackTime", sizeStr, "ms", t);
        }
	//resultDB.AddResult("ReadbackLatencyEstimate", "1-2kb", "ms", times[0]-(times[1]-times[0])/1.);
	//resultDB.AddResult("ReadbackLatencyEstimate", "1-4kb", "ms", times[0]-(times[2]-times[0])/3.);
	//resultDB.AddResult("ReadbackLatencyEstimate", "2-4kb", "ms", times[1]-(times[2]-times[1])/1.);
    }

    // Cleanup
    err = clReleaseMemObject(mem1);
    CL_CHECK_ERROR(err);
    if (pinned)
    {
        err = clReleaseMemObject(hostMemObj1);
        CL_CHECK_ERROR(err);
        err = clReleaseMemObject(hostMemObj2);
        CL_CHECK_ERROR(err);
    }
    else
    {
        delete[] hostMem1;
        delete[] hostMem2;
    }
}


text:
import * as TimelineMax from 'TimelineMax';
import 'CSSPlugin';
import 'EasePack';

//region JavaScript Element Selectors
const img = document.getElementsByTagName('img');
const h2 = document.getElementsByTagName('h2');
const h1 = document.getElementsByTagName('h1');
const intro = document.getElementsByClassName('intro');
const listItemUl = document.getElementsByTagName('ul');
const listItemLi = document.getElementsByTagName('li');
const header = document.getElementById('header');
//endregion

//region JavaScript Element Selectors
const dot = document.getElementsByClassName('dot');
const loader = document.getElementById('loader');
//endregion

//region Playback buttons
const playButton = document.getElementById('btnPlay');
const pauseButton = document.getElementById('btnPause');
const resumeButton = document.getElementById('btnResume');
const reverseButton = document.getElementById('btnReverse');
const speedUpButton = document.getElementById('btnSpeedUp');
const slowDownButton = document.getElementById('btnSlowDown');
const seeek1secButton = document.getElementById('btnSeek');
const goTo50PercentButton = document.getElementById('btnProgress');
const restartButton = document.getElementById('btnRestart');
const buttons = document.getElementsByTagName('button');
//endregion

const tl = new TimelineMax({paused: true});
tl
    .set(header, {autoAlpha: 1})
    .from(h1, 1, {y: -15, autoAlpha: 0, ease: Power1.easeOut})
    .add('intro')
    .from(intro, 1, {y: -15, autoAlpha: 0, ease: Power1.easeOut})
    .from(img, 1, {y: -15, autoAlpha: 0, ease: Power1.easeOut})
    .from(h2, 1, {y: -15, autoAlpha: 0, ease: Power1.easeOut}, 'intro')
    .from(listItemUl, 1, {y: -15, autoAlpha: 0, ease: Power1.easeOut}, 'intro+=3')
    .from(listItemLi, 1, {y: -15, autoAlpha: 0, ease: Power1.easeOut}, 'intro+=3')
    .staggerFrom(buttons, 0.2, {
        //x: 200,
        cycle: {
            x: [50, -50],
            scale: [2, 0.5]
        },
        ease: Power1.easeOut,
        autoAlpha: 0
    }, 0.1);

const contentIn = ()=> {
    tl.play();
}

playButton.onclick = ()=> {
    tl.play();
};

pauseButton.onclick = ()=> {
    tl.pause();
};

resumeButton.onclick = ()=> {
    tl.resume();
};

reverseButton.onclick = ()=> {
    tl.reverse();
};

speedUpButton.onclick = ()=> {
    tl.timeScale(8);
};

slowDownButton.onclick = ()=> {
    tl.timeScale(0.5);
};

seeek1secButton.onclick = ()=> {
    //tl.seek(1);   //absolute time in the animation
    tl.seek('intro'); //specific label
};

goTo50PercentButton.onclick = ()=> {
    tl.progress(0.5);
};

restartButton.onclick = ()=> {
    tl.restart();
};

//region Content Loader Timeline
const tlLoaderOut = new TimelineMax({paused: true, onComplete: contentIn});
tlLoaderOut
    .set(dot, {backgroundColor: '#2b4d66'})
    .to(loader, 0.3, {autoAlpha: 1, scale: 1.3, ease: Power0.easeOut})
    .staggerFromTo(dot, 0.3,
        {y: 0, autoAlpha: 0},
        {y: 20, autoAlpha: 1, ease: Back.easeInOut},
        0.05, 0
    )
    .to(loader, 0.3, {y: -150, autoAlpha: 0, ease: Back.easeIn}, '+=0.3');
//endregion

const loadContent = ()=> {
    tlLoaderOut.play();
};

//region Loader Timeline
const tlLoader = new TimelineMax({repeat: 2, onComplete: loadContent});
tlLoader
    .staggerFromTo(dot, 0.3,
        {y: 0, autoAlpha: 0},
        {y: 20, autoAlpha: 1, ease: Back.easeInOut},
        0.05
    )
    .fromTo(loader, 0.3,
        {autoAlpha: 1, scale: 1.3},
        {autoAlpha: 0, scale: 1, ease: Power0.easeOut},
        0.9
    );
//endregion


text:
from unittest.mock import patch

from bs4 import BeautifulSoup
from django.test import TestCase, override_settings

from wagtail.core.rich_text import expand_db_html
from wagtail.embeds.exceptions import EmbedNotFoundException
from wagtail.embeds.models import Embed
from wagtail.embeds.rich_text import MediaEmbedHandler as FrontendMediaEmbedHandler
from wagtail.embeds.rich_text.editor_html import MediaEmbedHandler as EditorHtmlMediaEmbedHandler

class TestEditorHtmlMediaEmbedHandler(TestCase):
    def test_get_db_attributes(self):
        soup = BeautifulSoup('foo', 'html5lib')
        tag = soup.b
        result = EditorHtmlMediaEmbedHandler.get_db_attributes(tag)
        self.assertEqual(
            result,
            {'url': 'test-url'}
        )

    @patch('wagtail.embeds.embeds.get_embed')
    def test_expand_db_attributes_for_editor(self, get_embed):
        get_embed.return_value = Embed(
            url='http://www.youtube.com/watch/',
            max_width=None,
            type='video',
            html='test html',
            title='test title',
            author_name='test author name',
            provider_name='test provider name',
            thumbnail_url='http://test/thumbnail.url',
            width=1000,
            height=1000,
        )

        result = EditorHtmlMediaEmbedHandler.expand_db_attributes({
            'url': 'http://www.youtube.com/watch/',
        })
        self.assertIn(
            (
                '
'
            ),
            result
        )
        self.assertIn('
test title
', result)
        self.assertIn('
URL: http://www.youtube.com/watch/
', result)
        self.assertIn('
Provider: test provider name
', result)
        self.assertIn('
Author: test author name
', result)
        self.assertIn('', result)

    @patch('wagtail.embeds.embeds.get_embed')
    def test_expand_db_attributes_for_editor_catches_embed_not_found(self, get_embed):
        get_embed.side_effect = EmbedNotFoundException
        result = EditorHtmlMediaEmbedHandler.expand_db_attributes({
            'url': 'http://www.youtube.com/watch/',
        })
        self.assertEqual(result, '')

class TestFrontendMediaEmbedHandler(TestCase):
    @override_settings(WAGTAILEMBEDS_RESPONSIVE_HTML=True)
    @patch('wagtail.embeds.embeds.get_embed')
    def test_expand_db_attributes_for_frontend_responsive(self, get_embed):
        get_embed.return_value = Embed(
            url='http://www.youtube.com/watch/',
            max_width=None,
            type='video',
            html='test html',
            title='test title',
            author_name='test author name',
            provider_name='test provider name',
            thumbnail_url='http://test/thumbnail.url',
            width=1000,
            height=1000,
        )

        result = FrontendMediaEmbedHandler.expand_db_attributes({
            'url': 'http://www.youtube.com/watch/',
        })
        self.assertIn('test html', result)
        self.assertIn('class="responsive-object"', result)

    @patch('wagtail.embeds.embeds.get_embed')
    def test_expand_db_attributes_for_frontend_nonresponsive(self, get_embed):
        get_embed.return_value = Embed(
            url='http://www.youtube.com/watch/',
            max_width=None,
            type='video',
            html='test html',
            title='test title',
            author_name='test author name',
            provider_name='test provider name',
            thumbnail_url='http://test/thumbnail.url',
            width=1000,
            height=1000,
        )

        result = FrontendMediaEmbedHandler.expand_db_attributes({
            'url': 'http://www.youtube.com/watch/',
        })
        self.assertIn('test html', result)
        self.assertNotIn('class="responsive-object"', result)

    @patch('wagtail.embeds.embeds.get_embed')
    def test_expand_db_attributes_for_frontend_catches_embed_not_found(self, get_embed):
        get_embed.side_effect = EmbedNotFoundException
        result = FrontendMediaEmbedHandler.expand_db_attributes({
            'url': 'http://www.youtube.com/watch/',
        })
        self.assertEqual(result, '')

    @patch('wagtail.embeds.embeds.get_embed')
    def test_expand_html_escaping_end_to_end(self, get_embed):
        get_embed.return_value = Embed(
            url='http://www.youtube.com/watch/',
            max_width=None,
            type='video',
            html='test html',
            title='test title',
            author_name='test author name',
            provider_name='test provider name',
            thumbnail_url='http://test/thumbnail.url',
            width=1000,
            height=1000,
        )

        result = expand_db_html('
1 2 <embed embedtype="media" url="https://www.youtube.com/watch?v=O7D-1RG-VRk&t=25" /> 3 4
')
        self.assertIn('test html', result)
        get_embed.assert_called_with('https://www.youtube.com/watch?v=O7D-1RG-VRk&t=25', None, None)


text:
const bcrypt = require('bcryptjs');

exports.seed = function(knex, Promise) {
  // Deletes ALL existing entries
  return knex('users').del()
    .then(function () {

      const salt = bcrypt.genSaltSync();
      const hash = bcrypt.hashSync('johnson123', salt);

      return Promise.all([knex('users').insert({username: 'jeremy', password: hash})]);
    }).then(() => {
      const salt2 = bcrypt.genSaltSync();
      const hash2 = bcrypt.hashSync('bryant123', salt2);
      return Promise.join(knex('users').insert({username: 'kelly', password: hash2, admin: true}));
    });
};


text:
/**
 * External dependencies
 */
import { renderToStaticMarkup } from '@googleforcreators/react';

/**
 * Internal dependencies
 */
import {
  AmpStory,
  AmpStoryPage,
  AmpStoryGridLayer,
  getAMPValidationErrors,
} from './utils';

/** @typedef {import('react').ReactElement} ReactElement */
/** @typedef {import('jest').CustomMatcherResult} CustomMatcherResult */

/**
 * @param {string|ReactElement} stringOrComponent String containing HTML markup or a component.
 * @param {boolean} [optimize=true] Whether to use AMP Optimizer on the input string.
 * @return {CustomMatcherResult} Matcher result.
 */
async function toBeValidAMPStoryElement(stringOrComponent, optimize = true) {
  const string = renderToStaticMarkup(stringOrComponent);
  const errors = await getAMPValidationErrors(
    renderToStaticMarkup(
      <AmpStory>
        <AmpStoryPage>
          <AmpStoryGridLayer>{stringOrComponent}</AmpStoryGridLayer>
        </AmpStoryPage>
      </AmpStory>
    ),
    optimize
  );

  const pass = errors.length === 0;

  return {
    pass,
    message: () =>
      pass
        ? `Expected ${string} not to be valid AMP.`
        : `Expected ${string} to be valid AMP. Errors:\n${errors.join('\n')}`,
  };
}

export default toBeValidAMPStoryElement;


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Guioa dasyantha Radlk.

### Remarks
null


text:
package ro.isdc.wro.maven.plugin.factory;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static ro.isdc.wro.model.resource.processor.factory.ConfigurableProcessorsFactory.PARAM_POST_PROCESSORS;
import static ro.isdc.wro.model.resource.processor.factory.ConfigurableProcessorsFactory.PARAM_PRE_PROCESSORS;

import java.io.File;
import java.util.Collection;
import java.util.Iterator;
import java.util.Properties;

import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.Validate;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;

import ro.isdc.wro.WroRuntimeException;
import ro.isdc.wro.config.Context;
import ro.isdc.wro.config.support.ConfigConstants;
import ro.isdc.wro.extensions.model.factory.SmartWroModelFactory;
import ro.isdc.wro.manager.WroManager;
import ro.isdc.wro.manager.factory.standalone.StandaloneContext;
import ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory;
import ro.isdc.wro.model.factory.ConfigurableModelFactory;
import ro.isdc.wro.model.factory.XmlModelFactory;
import ro.isdc.wro.model.resource.processor.ResourcePreProcessor;
import ro.isdc.wro.model.resource.processor.decorator.ExtensionsAwareProcessorDecorator;
import ro.isdc.wro.model.resource.processor.decorator.ProcessorDecorator;
import ro.isdc.wro.model.resource.processor.factory.ConfigurableProcessorsFactory;
import ro.isdc.wro.model.resource.processor.factory.ProcessorsFactory;
import ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor;
import ro.isdc.wro.model.resource.processor.impl.css.CssMinProcessor;
import ro.isdc.wro.model.resource.processor.impl.css.CssVariablesProcessor;
import ro.isdc.wro.model.resource.processor.impl.js.JSMinProcessor;
import ro.isdc.wro.util.AbstractDecorator;

/**
 * @author Alex Objelean
 */
public class TestConfigurableWroManagerFactory {
  @Mock
  private FilterConfig mockFilterConfig;
  @Mock
  private ServletContext mockServletContext;
  private ProcessorsFactory processorsFactory;
  @Mock
  private HttpServletRequest mockRequest;
  @Mock
  private HttpServletResponse mockResponse;
  private ConfigurableWroManagerFactory victim;

  private void initFactory(final FilterConfig filterConfig) {
    initFactory(filterConfig, new Properties());
  }

  private void initFactory(final FilterConfig filterConfig, final Properties properties) {
    Validate.notNull(properties);
    Context.set(Context.webContext(mockRequest, mockResponse, filterConfig));

    victim = new ConfigurableWroManagerFactory() {
      @Override
      protected Properties createProperties() {
        return properties;
      }
    };
    final StandaloneContext context = new StandaloneContext();
    context.setWroFile(new File("/path/to/file"));
    victim.initialize(context);
    // create one instance for test
    final WroManager manager = victim.create();
    processorsFactory = manager.getProcessorsFactory();
  }

  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);
    // init context
    Context.set(Context.webContext(mockRequest, mockResponse, mockFilterConfig));
    Mockito.when(mockFilterConfig.getServletContext()).thenReturn(mockServletContext);
  }

  @After
  public void tearDown() {
    Context.unset();
  }

  @Test
  public void testProcessorsExecutionOrder() {
    final Properties props = createProperties(PARAM_PRE_PROCESSORS, JSMinProcessor.ALIAS + ","
        + CssImportPreProcessor.ALIAS + "," + CssVariablesProcessor.ALIAS);
    initFactory(mockFilterConfig, props);

    final Collection<ResourcePreProcessor> list = processorsFactory.getPreProcessors();

    Assert.assertFalse(list.isEmpty());
    final Iterator<ResourcePreProcessor> iterator = list.iterator();
    assertEquals(JSMinProcessor.class, getProcessor(iterator.next()).getClass());
    assertEquals(CssImportPreProcessor.class, getProcessor(iterator.next()).getClass());
    assertEquals(CssVariablesProcessor.class, getProcessor(iterator.next()).getClass());
  }

  private Properties createProperties(final String key, final String value) {
    final Properties props = new Properties();
    props.setProperty(key, value);
    return props;
  }

  @Test
  public void testWithEmptyPreProcessors() {
    Mockito.when(mockFilterConfig.getInitParameter(ConfigurableProcessorsFactory.PARAM_PRE_PROCESSORS)).thenReturn("");
    initFactory(mockFilterConfig);
    assertTrue(processorsFactory.getPreProcessors().isEmpty());
  }

  @Test(expected = WroRuntimeException.class)
  public void cannotUseInvalidPreProcessorsSet() {
    initFactory(mockFilterConfig, createProperties(PARAM_PRE_PROCESSORS, "INVALID1,INVALID2"));
    processorsFactory.getPreProcessors();
  }

  @Test
  public void testWhenValidPreProcessorsSet() {
    initFactory(mockFilterConfig, createProperties(PARAM_PRE_PROCESSORS, "cssUrlRewriting"));
    assertEquals(1, processorsFactory.getPreProcessors().size());
  }

  @Test
  public void testWithEmptyPostProcessors() {
    Mockito.when(mockFilterConfig.getInitParameter(ConfigurableProcessorsFactory.PARAM_POST_PROCESSORS)).thenReturn("");
    initFactory(mockFilterConfig);
    assertTrue(processorsFactory.getPostProcessors().isEmpty());
  }

  @Test(expected = WroRuntimeException.class)
  public void cannotUseInvalidPostProcessorsSet() {
    initFactory(mockFilterConfig, createProperties(PARAM_POST_PROCESSORS, "INVALID1,INVALID2"));
    processorsFactory.getPostProcessors();
  }

  @Test
  public void testWhenValidPostProcessorsSet() {
    initFactory(mockFilterConfig, createProperties(PARAM_POST_PROCESSORS, "cssMinJawr, jsMin, cssVariables"));
    assertEquals(3, processorsFactory.getPostProcessors().size());
  }

  @Test
  public void testConfigPropertiesWithValidPreProcessor() {
    final Properties configProperties = new Properties();
    configProperties.setProperty(ConfigurableProcessorsFactory.PARAM_PRE_PROCESSORS, "cssMin");
    initFactory(mockFilterConfig, configProperties);
    assertEquals(1, processorsFactory.getPreProcessors().size());
    assertEquals(CssMinProcessor.class,
        getProcessor(processorsFactory.getPreProcessors().iterator().next()).getClass());
  }

  @Test
  public void testConfigPropertiesWithValidPostProcessor() {
    final Properties configProperties = new Properties();
    configProperties.setProperty(ConfigurableProcessorsFactory.PARAM_POST_PROCESSORS, "jsMin");
    initFactory(mockFilterConfig, configProperties);
    assertEquals(1, processorsFactory.getPostProcessors().size());
    assertEquals(
        JSMinProcessor.class,
        ((ProcessorDecorator) processorsFactory.getPostProcessors().iterator().next()).getDecoratedObject().getClass());
  }

  @Test
  public void testConfigPropertiesWithMultipleValidPostProcessor() {
    final Properties configProperties = new Properties();
    configProperties.setProperty(ConfigurableProcessorsFactory.PARAM_POST_PROCESSORS, "jsMin, cssMin");
    initFactory(mockFilterConfig, configProperties);
    assertEquals(2, processorsFactory.getPostProcessors().size());
    assertEquals(JSMinProcessor.class,
        getProcessor(processorsFactory.getPostProcessors().iterator().next()).getClass());
  }

  /**
   * @return the processor instance which is not a decorator based on provided processor.
   */
  private Object getProcessor(final Object processor) {
    return processor instanceof ProcessorDecorator ? ((ProcessorDecorator) processor).getOriginalDecoratedObject()
        : processor;
  }

  @Test(expected = WroRuntimeException.class)
  public void testConfigPropertiesWithInvalidPreProcessor() {
    final Properties configProperties = new Properties();
    configProperties.setProperty(PARAM_PRE_PROCESSORS, "INVALID");
    initFactory(mockFilterConfig, configProperties);
    processorsFactory.getPreProcessors();
  }

  public void shouldUseExtensionAwareProcessorWhenProcessorNameContainsDotCharacter() {
    final Properties configProperties = new Properties();
    configProperties.setProperty(PARAM_PRE_PROCESSORS, "jsMin.js");
    initFactory(mockFilterConfig, configProperties);
    assertEquals(1, processorsFactory.getPreProcessors().size());
    assertTrue(processorsFactory.getPreProcessors().iterator().next() instanceof ExtensionsAwareProcessorDecorator);
  }

  @Test(expected = WroRuntimeException.class)
  public void testConfigPropertiesWithInvalidPostProcessor() {
    final Properties configProperties = new Properties();
    configProperties.setProperty(PARAM_POST_PROCESSORS, "INVALID");
    initFactory(mockFilterConfig, configProperties);
    processorsFactory.getPostProcessors();
  }

  @Test
  public void shouldUseCorrectDefaultModelFactory() {
    initFactory(mockFilterConfig, new Properties());
    final ConfigurableModelFactory configurableModelFactory = (ConfigurableModelFactory) AbstractDecorator.getOriginalDecoratedObject(victim.create().getModelFactory());
    assertEquals(SmartWroModelFactory.class, configurableModelFactory.getConfiguredStrategy().getClass());
  }

  @Test
  public void shouldUseConfiguredModelFactory() {
    final Properties props = createProperties(ConfigurableModelFactory.KEY, XmlModelFactory.ALIAS);
    initFactory(mockFilterConfig, props);
    final ConfigurableModelFactory configurableModelFactory = (ConfigurableModelFactory) AbstractDecorator.getOriginalDecoratedObject(victim.create().getModelFactory());
    assertEquals(XmlModelFactory.class, configurableModelFactory.getConfiguredStrategy().getClass());
  }

  @Test
  public void shouldUseConfiguredParallelPreProcessingFlagFromExtraConfigFile() {
    final Properties props = createProperties(ConfigConstants.parallelPreprocessing.getPropertyKey(), Boolean.TRUE.toString());
    initFactory(mockFilterConfig, props);
    assertTrue(Context.get().getConfig().isParallelPreprocessing());
  }
}