text:
import highland from "highland";

import angular from "../../../angular-mock-setup.js";

describe("Host Cpu Ram chart", () => {
  let mockChartCompiler,
    mockGetHostCpuRamStream,
    selectStoreCount,
    submitHandler,
    config1$,
    config2$,
    getHostCpuRamChart,
    mockGetStore,
    standardConfig,
    mockDurationPayload,
    data$Fn,
    initStream,
    mockDurationSubmitHandler,
    localApply,
    mod,
    mockGetConf;

  beforeEach(async () => {
    mockGetHostCpuRamStream = {};

    standardConfig = {
      configType: "duration",
      size: 10,
      unit: "minutes",
      startDate: 1464812942650,
      endDate: 1464812997102
    };

    config1$ = highland([
      {
        hostCpuRamChart: { ...standardConfig }
      }
    ]);
    jest.spyOn(config1$, "destroy");
    config2$ = highland([
      {
        hostCpuRamChart: { ...standardConfig }
      }
    ]);
    jest.spyOn(config2$, "destroy");
    selectStoreCount = 0;

    mockGetStore = {
      dispatch: jest.fn(),
      select: jest.fn(() => {
        switch (selectStoreCount) {
          case 0:
            selectStoreCount++;
            return config1$;
          default:
            return config2$;
        }
      })
    };

    mockDurationPayload = jest.fn(x => {
      return { ...standardConfig, ...x };
    });

    submitHandler = jest.fn();
    mockDurationSubmitHandler = jest.fn(() => submitHandler);

    mockGetConf = jest.fn(page => {
      return s => {
        return s.map(x => {
          return x[page];
        });
      };
    });

    mockChartCompiler = jest.fn();

    jest.mock("../../../../source/iml/host-cpu-ram-chart/get-host-cpu-ram-stream.js", () => mockGetHostCpuRamStream);

    jest.mock("../../../../source/iml/chart-compiler/chart-compiler.js", () => mockChartCompiler);

    jest.mock("../../../../source/iml/store/get-store.js", () => mockGetStore);

    jest.mock("../../../../source/iml/duration-picker/duration-payload.js", () => mockDurationPayload);

    jest.mock("../../../../source/iml/duration-picker/duration-submit-handler.js", () => mockDurationSubmitHandler);

    jest.mock("../../../../source/iml/chart-transformers/chart-transformers.js", () => ({
      getConf: mockGetConf
    }));

    mod = require("../../../../source/iml/host-cpu-ram-chart/get-host-cpu-ram-chart.js").default;
  });

  beforeEach(() => {
    initStream = highland();
    jest.spyOn(initStream, "destroy");

    data$Fn = jest.fn(() => initStream);

    localApply = jest.fn();

    getHostCpuRamChart = mod(data$Fn, localApply);
  });

  it("should return a factory function", () => {
    expect(getHostCpuRamChart).toEqual(expect.any(Function));
  });

  describe("for page hostCpuRamChart", () => {
    beforeEach(() => {
      getHostCpuRamChart(
        "Object Storage Server",
        {
          qs: {
            host_id: "1"
          }
        },
        "hostCpuRamChart"
      );

      const s = mockChartCompiler.mock.calls[0][1];
      s.each(() => {});
    });

    it("should dispatch hostCpuRamChart to the store", () => {
      expect(mockGetStore.dispatch).toHaveBeenCalledOnceWith({
        type: "DEFAULT_HOST_CPU_RAM_CHART_ITEMS",
        payload: {
          page: "hostCpuRamChart",
          configType: "duration",
          size: 10,
          unit: "minutes",
          startDate: 1464812942650,
          endDate: 1464812997102
        }
      });
    });

    it("should select the hostCpuRamChart store", () => {
      expect(mockGetStore.select).toHaveBeenCalledOnceWith("hostCpuRamCharts");
    });

    it("should call getConf", () => {
      expect(mockGetConf).toHaveBeenCalledOnceWith("hostCpuRamChart");
    });

    it("should call data$Fn", () => {
      expect(data$Fn).toHaveBeenCalledOnceWith(
        {
          qs: {
            host_id: "1"
          }
        },
        expect.any(Function),
        standardConfig
      );
    });

    it("should call the chart compiler", () => {
      expect(mockChartCompiler).toHaveBeenCalledOnceWith(
        `

{{ chart.title }}

    <button class="btn btn-xs btn-primary" ng-click="configToggle.setActive()">Configure </button>

    Drag

      <form name="hostCpuRamForm">
        <resettable-group>
          <duration-picker type="chart.configType" size="chart.size" unit="chart.unit" start-date="chart.startDate | toDate" end-date="chart.endDate | toDate"></duration-picker>
          <button type="submit" ng-click="::configToggle.setInactive(chart.onSubmit({}, hostCpuRamForm))" class="btn btn-success btn-block" ng-disabled="hostCpuRamForm.$invalid">Update</button>
          <button ng-click="::configToggle.setInactive()" class="btn btn-cancel btn-block" resetter>Cancel</button>
        </resettable-group>
      </form>

  <line-chart options="::chart.options" stream="::chart.stream"></line-chart>

`,
        expect.any(Object),
        expect.any(Function)
      );
    });
  });

  describe("setup", () => {
    let handler, $scope, config;

    beforeEach(
      angular.mock.inject($rootScope => {
        getHostCpuRamChart(
          "Object Storage Server",
          {
            qs: {
              host_id: "1"
            }
          },
          "hostCpuRamChart"
        );

        handler = mockChartCompiler.mock.calls[0][2];
        $scope = $rootScope.$new();

        config = handler($scope, initStream);
      })
    );

    it("should return a config", () => {
      expect(config).toEqual({
        title: "Object Storage Server",
        stream: initStream,
        configType: "duration",
        page: "",
        startDate: 1464812942650,
        endDate: 1464812997102,
        size: 10,
        unit: "minutes",
        onSubmit: submitHandler,
        options: {
          setup: expect.any(Function)
        }
      });
    });

    it("should select the hostCpuRamChart store", () => {
      expect(mockGetStore.select).toHaveBeenCalledTwiceWith("hostCpuRamCharts");
    });

    it("should call getConf", () => {
      expect(mockGetConf).toHaveBeenCalledTwiceWith("hostCpuRamChart");
    });

    it("should call localApply", () => {
      expect(localApply).toHaveBeenCalledOnceWith($scope);
    });

    it("should destroy the stream when the chart is destroyed", () => {
      $scope.$destroy();

      expect(initStream.destroy).toHaveBeenCalled();
      expect(config1$.destroy).toHaveBeenCalled();
      expect(config2$.destroy).toHaveBeenCalled();
    });

    describe("chart", () => {
      let chart, d3, formatter;

      beforeEach(() => {
        formatter = {};

        d3 = {
          format: jest.fn(() => formatter)
        };

        chart = {
          useInteractiveGuideline: jest.fn(),
          forceY: jest.fn(),
          yAxis: {
            tickFormat: jest.fn()
          },
          color: jest.fn()
        };

        config.options.setup(chart, d3);
      });

      it("should use interactive guideline", () => {
        expect(chart.useInteractiveGuideline).toHaveBeenCalledOnceWith(true);
      });

      it("should should force y", () => {
        expect(chart.forceY).toHaveBeenCalledOnceWith([0, 1]);
      });

      it("should set y tick format", () => {
        expect(chart.yAxis.tickFormat).toHaveBeenCalledOnceWith(formatter);
      });

      it("should should create a tick formatter", () => {
        expect(d3.format).toHaveBeenCalledOnceWith(".1%");
      });

      it("should set colors", () => {
        expect(chart.color).toHaveBeenCalledOnceWith(["#F3B600", "#0067B4"]);
      });
    });
  });

  describe("on submit", () => {
    let handler, $scope, config;

    beforeEach(
      angular.mock.inject($rootScope => {
        getHostCpuRamChart(
          "Object Storage Server",
          {
            qs: {
              host_id: "1"
            }
          },
          "hostCpuRamChart"
        );

        handler = mockChartCompiler.mock.calls[0][2];
        $scope = $rootScope.$new();

        config = handler($scope, initStream);

        config.onSubmit();
      })
    );

    it("should call durationSubmitHandler", () => {
      expect(mockDurationSubmitHandler).toHaveBeenCalledOnceWith("UPDATE_HOST_CPU_RAM_CHART_ITEMS", {
        page: "hostCpuRamChart"
      });
    });

    it("should invoke the submit handler", () => {
      expect(submitHandler).toHaveBeenCalledTimes(1);
    });
  });
});


text:
CREATE OR REPLACE FUNCTION bot.tango()
  RETURNS json AS
$BODY$import json
return json.dumps({"dance": "tango"})$BODY$
  LANGUAGE plpythonu VOLATILE
  COST 100;
ALTER FUNCTION bot.tango()
  OWNER TO tardis;

redpajama_set_name: RedPajamaGithub


text:
<?php

/**
 * Gettext parser filters interface
 * @author Karel Klíma
 */
interface iFilter
{
	/**
	 * Extracts gettext phrases from a file
	 * @param string $file
	 */
    public function extract($file);
}


text:
package org.xmlbeam.tests.bugs.bug58;

import java.util.List;

import org.xmlbeam.annotation.XBRead;

public interface KfwKonditionsDokument {

    @XBRead("/konditionen/bankengruppe/programmgruppe/programm/variante/preiskategorie")
    public List<KfwPreiskategorie> getEintraege();
}


text:
#include "config.h"
#include "core/platform/graphics/transforms/SkewTransformOperation.h"

#include "core/platform/animation/AnimationUtilities.h"

namespace WebCore {

PassRefPtr<TransformOperation> SkewTransformOperation::blend(const TransformOperation* from, double progress, bool blendToIdentity)
{
    if (from && !from->isSameType(*this))
        return this;

    if (blendToIdentity)
        return SkewTransformOperation::create(WebCore::blend(m_angleX, 0.0, progress), WebCore::blend(m_angleY, 0.0, progress), m_type);

    const SkewTransformOperation* fromOp = static_cast<const SkewTransformOperation*>(from);
    double fromAngleX = fromOp ? fromOp->m_angleX : 0;
    double fromAngleY = fromOp ? fromOp->m_angleY : 0;
    return SkewTransformOperation::create(WebCore::blend(fromAngleX, m_angleX, progress), WebCore::blend(fromAngleY, m_angleY, progress), m_type);
}

} // namespace WebCore


text:
package technology.mainthread.apps.isitup.view.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;

import technology.mainthread.apps.isitup.R;
import technology.mainthread.apps.isitup.view.fragment.ResultFragment;

public class ResultActivity extends BaseActivity {

    private static final String PARAM_DOMAIN = "param_domain";

    public static Intent getResultActivityIntent(Context context, String domain) {
        Intent intent = new Intent(context, ResultActivity.class);
        intent.putExtra(PARAM_DOMAIN, domain);
        return intent;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_default);

        // set up toolbar
        Toolbar toolbar = getToolbar();
        setSupportActionBar(toolbar);
        toolbar.inflateMenu(R.menu.menu_result);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        if (getFragmentManager().findFragmentById(R.id.container) == null) {
            String domain = getIntent().getStringExtra(PARAM_DOMAIN);
            getFragmentManager().beginTransaction()
                    .replace(R.id.container, ResultFragment.newInstance(domain))
                    .commit();
        }
    }

}


text:
<!DOCTYPE html>
<htm lang="en"l>

    <title>Nom Nom  |  Blah Blah Blogs</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="blog-stylesheet.css">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

Home

Inside My Mind

Nam's Project Portfolio

Skills

Contact

Nom Nom

Blah Blah Blogs

"#1 World's Worst Code Blogs"

Written by: Nam Hoang Nguyen

Thomas A. Edison: 'I have not failed. I've just found 10000

ways that won't work."

Arrays vs. Hashes FIGHT!

Simply put, arrays and hashes are part of the Ruby Computer Language. However, there are key differences. Arrays are ordered lists of things. Easy enough? These "things" are known as "objects" in ruby. Like a noun. Hashes are a group of key-value pair. It is also a list of things. The main difference between arrays and hashes is that arrays is a list for integers and hashes is a list for any arbitrary objects or nouns :). If it is integers it is best to use arrays.

This is an example of hash. Hashes point object to another object.

This is an example of arrays. Beautifully ran indices of integers. Arrays store all of these unknown numbers of objects. It is an ordered list that starts at 0. NOTE! It does NOT start at 1.

Nam Hoang Nguyen

Github Website: https://github.com/nguyennam9696

LinkedIn Website: https://www.linkedin.com/in/namnguyen1991entrepreneur.en


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

    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=9"/>
    <meta name="generator" content="Doxygen 1.8.8"/>
    <title>My Project: /Users/Shea/Documents/school/cmps/facebooklet/src/Database.h File Reference</title>
    <link href="tabs.css" rel="stylesheet" type="text/css"/>

    <link href="search/search.css" rel="stylesheet" type="text/css"/>

    <link href="doxygen.css" rel="stylesheet" type="text/css"/>

My Project

Main Page

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
                 onfocus="searchBox.OnSearchFieldFocus(true)"
                 onblur="searchBox.OnSearchFieldFocus(false)"
                 onkeyup="searchBox.OnSearchFieldChange(event)"/>

File List

         All Classes Files Functions Friends

src

        Classes |
        Functions

Database.h File Reference

FaceBookletDatabase class.
        More...

#include "INode.h"

        #include <map>

        #include <vector>

        #include "Date.h"

Go to the source code of this file.

                Classes

            class
            fb::Database

                Functions

                map< id_t, NodeUptr >
            fb::copy_nodemap (std::map< id_t, NodeUptr > const
                &m)

Detailed Description

FaceBookletDatabase class.

Created by Steven on 4/9/15.

<address class="footer">

        Generated on Tue Apr 21 2015 09:56:04 for My Project by

     1.8.8

</address>


text:
from lxml import etree

from tests.share.metadata_formats.base import BaseMetadataFormatterTest

def xml_elements_equal(element_1, element_2):
    return (
        element_1.tag == element_2.tag
        and element_1.text == element_2.text
        and element_1.tail == element_2.tail
        and element_1.attrib == element_2.attrib
        and len(element_1) == len(element_2)
        and all(
            xml_elements_equal(child_1, child_2)
            for child_1, child_2 in zip(element_1, element_2)
        )
    )

class TestOaiDcFormatter(BaseMetadataFormatterTest):
    formatter_key = 'oai_dc'

    def assert_formatter_outputs_equal(self, actual_output, expected_output):
        if expected_output is None:
            assert actual_output is None
        else:
            xml_parser = etree.XMLParser(remove_blank_text=True)
            actual_xml = etree.fromstring(actual_output, parser=xml_parser)
            expected_xml = etree.fromstring(expected_output, parser=xml_parser)
            assert xml_elements_equal(actual_xml, expected_xml), f"actual: {etree.tostring(actual_xml, encoding='unicode', pretty_print=True)}\nexpected: {etree.tostring(expected_xml, encoding='unicode', pretty_print=True)}"

    expected_outputs = {
        'mycorrhizas': '''
        <oai_dc:dc
            xmlns:dc="http://purl.org/dc/elements/1.1/"
            xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"
        >
            <dc:title>The Role of Mycorrhizas in Forest Soil Stability with Climate Change</dc:title>
            <dc:creator>Suzanne Simard</dc:creator>
            <dc:creator>Mary Austi</dc:creator>
            <dc:publisher>InTech</dc:publisher>
            <dc:date>2017-03-31T05:39:48Z</dc:date>
            <dc:type>creativework</dc:type>
            <dc:identifier>http://dx.doi.org/10.5772/9813</dc:identifier>
        </oai_dc:dc>
        ''',
        'no-names-only-name-parts': '''
        <oai_dc:dc
            xmlns:dc="http://purl.org/dc/elements/1.1/"
            xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"
        >
            <dc:title>The Role of Mycorrhizas in Forest Soil Stability with Climate Change</dc:title>
            <dc:creator>Suzanne Simard</dc:creator>
            <dc:creator>Mary Austi</dc:creator>
            <dc:date>2017-03-31T05:39:48Z</dc:date>
            <dc:type>creativework</dc:type>
            <dc:identifier>http://dx.doi.org/10.5772/9813</dc:identifier>
        </oai_dc:dc>
        ''',
        'with-is_deleted': None,
        'with-subjects': '''
        <oai_dc:dc
            xmlns:dc="http://purl.org/dc/elements/1.1/"
            xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"
        >
          <dc:title>Assorted chair</dc:title>
          <dc:creator>Some Rando</dc:creator>
          <dc:subject>Architecture</dc:subject>
          <dc:subject>Business</dc:subject>
          <dc:subject>Custom biologyyyy</dc:subject>
          <dc:subject>Education</dc:subject>
          <dc:date>2019-01-23T20:34:21Z</dc:date>
          <dc:type>registration</dc:type>
          <dc:identifier>http://staging.osf.io/chair/</dc:identifier>
          <dc:relation>http://staging.osf.io/vroom/</dc:relation>
        </oai_dc:dc>
        ''',
        'with-osf-extra': '''
        <oai_dc:dc
            xmlns:dc="http://purl.org/dc/elements/1.1/"
            xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"
        >
          <dc:title>So open</dc:title>
          <dc:creator>Open McOperton</dc:creator>
          <dc:date>2017-03-31T05:39:48Z</dc:date>
          <dc:type>creativework</dc:type>
          <dc:identifier>https://example.com/open</dc:identifier>
        </oai_dc:dc>
        ''',
    }


text:
@implementation NSPExampleCategory

// Insert code here to add functionality to your managed object subclass

@end


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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<artifactId>geowave-parent</artifactId>
		<groupId>mil.nga.giat</groupId>
		<relativePath>../</relativePath>
		<version>0.8.9-SNAPSHOT</version>
	</parent>
	<artifactId>geowave-test</artifactId>
	<name>GeoWave Integration Tests</name>
	<description>A module for integration and functional tests of GeoWave</description>
	<dependencies>
		<dependency>
			<groupId>mil.nga.giat</groupId>
			<artifactId>geowave-service-client</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>mil.nga.giat</groupId>
			<artifactId>geowave-service-webapp</artifactId>
			<version>${project.version}</version>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>mil.nga.giat</groupId>
			<artifactId>geowave-analytic-mapreduce</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>mil.nga.giat</groupId>
			<artifactId>geowave-example</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
		</dependency>
		<dependency>
			<groupId>net.lingala.zip4j</groupId>
			<artifactId>zip4j</artifactId>
			<version>1.3.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-minicluster</artifactId>
			<version>${hadoop.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>jdk.tools</artifactId>
					<groupId>jdk.tools</groupId>
				</exclusion>
				<exclusion>
					<groupId>com.sun.jersey</groupId>
					<artifactId>jersey-core</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.sun.jersey</groupId>
					<artifactId>jersey-server</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.accumulo</groupId>
			<artifactId>accumulo-minicluster</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.kafka</groupId>
			<artifactId>${kafka.artifact}</artifactId>
			<version>${kafka.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.3.6</version>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.9</version>
				<executions>
					<execution>
						<id>unpack-wars</id>
						<goals>
							<goal>unpack</goal>
						</goals>
						<phase>pre-integration-test</phase>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>mil.nga.giat</groupId>
									<artifactId>geowave-service-webapp</artifactId>
									<version>${project.version}</version>
									<type>war</type>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/geowave-services</outputDirectory>
									<includes>**/*.class,**/*.config,**/*.xml</includes>
								</artifactItem>
								<artifactItem>
									<groupId>org.geoserver.web</groupId>
									<artifactId>gs-web-app</artifactId>
									<version>${geoserver.version}</version>
									<type>war</type>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/geoserver</outputDirectory>
									<excludes>**/commons-dbcp-1.4.jar,**/*1.7-SNAPSHOT.jar,**/*2.7-SNAPSHOT.jar,**/*20140915*.jar,**/*13-SNAPSHOT.jar,**/slf4j*.jar</excludes>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
					<execution>
						<id>setup-wps</id>
						<goals>
							<goal>copy</goal>
						</goals>
						<phase>pre-integration-test</phase>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.geoserver.extension</groupId>
									<artifactId>gs-web-wps</artifactId>
									<version>${geoserver.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/geoserver/WEB-INF/lib</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>org.geoserver.extension</groupId>
									<artifactId>gs-wps-core</artifactId>
									<version>${geoserver.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/geoserver/WEB-INF/lib</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>org.geotools</groupId>
									<artifactId>gt-process-geometry</artifactId>
									<version>${geotools.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/geoserver/WEB-INF/lib</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>org.geotools.xsd</groupId>
									<artifactId>gt-xsd-wps</artifactId>
									<version>${geotools.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/geoserver/WEB-INF/lib</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>org.geotools.ogc</groupId>
									<artifactId>net.opengis.wps</artifactId>
									<version>${geotools.version}</version>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/geoserver/WEB-INF/lib</outputDirectory>
								</artifactItem>
								<artifactItem>
									<groupId>xalan</groupId>
									<artifactId>serializer</artifactId>
									<version>2.7.1</version>
									<overWrite>true</overWrite>
									<outputDirectory>${project.build.directory}/geoserver/WEB-INF/lib</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.18.1</version>
				<executions>
					<execution>
						<configuration>
							<systemPropertyVariables>
								<zookeeperUrl>${zookeeperUrl}</zookeeperUrl>
								<instance>${instance}</instance>
								<username>${username}</username>
								<password>${password}</password>
								<geoserver.version>${geoserver.version}</geoserver.version>
							</systemPropertyVariables>
							<!-- Sonar currently just supports surefire so "trick" Sonar into
								thinking they are surefire reports -->
							<reportsDirectory>${sonar.surefire.reportsPath}</reportsDirectory>
							<argLine>${test.args} ${jacoco.failsafe.argline}</argLine>
							<excludes>
								<exclude>**/*IT.java</exclude>
							</excludes>
							<includes>
								<include>**/*ITSuite.java</include>
							</includes>
						</configuration>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<dependencies>
					<dependency>
						<groupId>org.jacoco</groupId>
						<artifactId>org.jacoco.ant</artifactId>
						<version>${jacoco.version}</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<phase>post-integration-test</phase>
						<configuration>
							<tasks xmlns:jacoco="antlib:org.jacoco.ant">
								<mkdir dir="${project.reporting.outputDirectory}" />
								<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml"
									classpathref="maven.plugin.classpath" />
								<jacoco:report>
									<executiondata>
										<fileset dir="../" includes="**/coverage-reports/*.exec" />
									</executiondata>

									<structure name="GeoWave">
										<classfiles>
											<fileset dir="../"
												includes="**/target/classes/**,**/target/munged/classes/**"
												excludes="**/analytics/api/target/classes/**,**/analytics/mapreduce/target/classes/**,**/accumulo/target/classes/**" />
										</classfiles>
										<sourcefiles>
											<fileset dir="../"
												includes="**/src/main/java/**,**/target/munged/main/**"
												excludes="**/analytics/api/src/main/java/**,**/analytics/mapreduce/src/main/java/**,**/accumulo/target/src/main/java/**" />
										</sourcefiles>
									</structure>

									<xml destfile="${project.reporting.outputDirectory}/jacoco.xml" />
								</jacoco:report>
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.eluder.coveralls</groupId>
				<artifactId>coveralls-maven-plugin</artifactId>
				<version>3.1.1-munge-hack</version>
				<configuration>
					<jacocoReports>
						<jacocoReport>${project.reporting.outputDirectory}/jacoco.xml</jacocoReport>
					</jacocoReports>
					<sourceDirectories>
						<sourceDirectory>../core/ingest/src/main/java</sourceDirectory>
						<sourceDirectory>../core/index/src/main/java</sourceDirectory>
						<sourceDirectory>../core/cli/src/main/java</sourceDirectory>
						<sourceDirectory>../core/store/src/main/java</sourceDirectory>
						<sourceDirectory>../core/geotime/src/main/java</sourceDirectory>
						<sourceDirectory>../extensions/datastores/accumulo/target/munged/main</sourceDirectory>
						<sourceDirectory>../extensions/adapters/vector/src/main/java</sourceDirectory>
						<sourceDirectory>../extensions/adapters/raster/src/main/java</sourceDirectory>
						<sourceDirectory>../extensions/formats/geotools-vector/src/main/java</sourceDirectory>
						<sourceDirectory>../extensions/formats/geotools-raster/src/main/java</sourceDirectory>
						<sourceDirectory>../extensions/formats/gpx/src/main/java</sourceDirectory>
						<sourceDirectory>../extensions/formats/geolife/src/main/java</sourceDirectory>
						<sourceDirectory>../extensions/formats/tdrive/src/main/java</sourceDirectory>
						<sourceDirectory>../analytics/api/target/munged/main</sourceDirectory>
						<sourceDirectory>../analytics/mapreduce/target/munged/main</sourceDirectory>
						<sourceDirectory>../services/api/src/main/java</sourceDirectory>
						<sourceDirectory>../services/client/src/main/java</sourceDirectory>
						<sourceDirectory>../services/webapp/src/main/java</sourceDirectory>
						<sourceDirectory>../deploy/src/main/java</sourceDirectory>
						<sourceDirectory>../examples/src/main/java</sourceDirectory>
						<sourceDirectory>../test/src/main/java</sourceDirectory>
					</sourceDirectories>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>


text:
class RedirectRequest < ActiveRecord::Base
  belongs_to :redirect_map, counter_cache: true
end


text:
The psuedocode on Wikipedia should be enough. HMAC is very easy.

Using the web framework of your choosing (Sinatra, web.py, whatever), write a tiny application that has a URL that takes a "file" argument and a "signature" argument, like so:
```
http://localhost:9000/test?file=foo&signature=46b4ec586117154dacd49d664e5d63fdc88efb51
```
Have the server generate an HMAC key, and then verify that the "signature" on incoming requests is valid for "file", using the "==" operator to compare the valid MAC for a file with the "signature" parameter (in other words, verify the HMAC the way any normal programmer would verify it).

Write a function, call it "insecure_compare", that implements the == operation by doing byte-at-a-time comparisons with early exit (ie, return false at the first non-matching byte).

In the loop for "insecure_compare", add a 50ms sleep (sleep 50ms after each byte).

Use your "insecure_compare" function to verify the HMACs on incoming requests, and test that the whole contraption works. Return a 500 if the MAC is invalid, and a 200 if it's OK.

Using the timing leak in this application, write a program that discovers the valid MAC for any file.

Why artificial delays? |
---------------------- |
Early-exit string compares are probably the most common source of cryptographic timing leaks, but they aren't especially easy to exploit. In fact, many timing leaks (for instance, any in C, C++, Ruby, or Python) probably aren't exploitable over a wide-area network at all. To play with attacking real-world timing leaks, you have to start writing low-level timing code. We're keeping things cryptographic in these challenges. |


text:
ItemFactory::ItemFactory()
{
    Bind<DefaultItem>( AutoId( "default_item" ) );
    SetDefault( AutoId( "default_item" ) );
    Bind( AutoId( "plasma_gun" ), &CreateItem<PlasmaGun> );
    Bind( AutoId( "pistol" ), &CreateItem<Pistol> );
    Bind( AutoId( "shotgun" ), &CreateItem<Shotgun> );
    Bind( AutoId( "rocket_launcher" ), &CreateItem<RocketLauncher> );
    Bind( AutoId( "ion_gun" ), &CreateItem<IonGun> );
    Bind( AutoId( "gatling_gun" ), &CreateItem<GatlingGun> );
    Bind( AutoId( "gauss_gun" ), &CreateItem<GaussGun> );
    Bind( AutoId( "lucky_rocket" ), &CreateItem<LuckyRocket> );
    Bind( AutoId( "rusty_reaper" ), &CreateItem<RustyReaper>);

    Bind<GrenadeNormalItem>( AutoId( "grenade_normal_item" ) );
    Bind<FlashNormalItem>( AutoId( "flash_normal_item" ) );
    Bind<CloakNormalItem>( AutoId( "cloak_normal_item" ) );
    Bind<BlueGrenadeNormalItem>( AutoId( "blue_grenade_normal_item" ) );
}


text:
    {{ alert.msg }}
    <button type="button" class="close" data-ng-click="alert.close()">×</button>


text:
#!/usr/bin/node

/*
 * http://nodejs.org/docs/v0.6.0/api/
 */

var fs = require('fs');
var path = require('path');
var spawn = require('child_process').spawn;

var configs    = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
var repository = path.dirname(process.argv[2]);
var build      = !!process.argv[3] && process.argv[3] === '--build';
var push       = !!process.argv[4] && process.argv[4] === '--push';
var homeDir    = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], 'shared');

function Variable(values) {

    this.values = values;
    this.length = values.length;

    var slf = this;

    this.get = function(index) {
        return slf.values[index];
    };

}

function Iterator(variables) {

    this.variables = variables;
    this.indicies = [new Array(variables.length)];
    this.currentIndex = 0;

    var slf = this;
    var copyArray = function(array) {
        var tmp = new Array(array.length);

        for(var i = 0; i < array.length; i++) {
            if(array[i] instanceof Array) {
                tmp[i] = copyArray(array[i]);
            } else {
                tmp[i] = array[i];
            }
        }

        return tmp;
    };

    for(var i = slf.variables.length - 1; i >= 0; i--) {
        var variable = slf.variables[i];
        var indexCount = slf.indicies.length;
        var newIndicies = slf.indicies.concat();

        for(var c = 1; c < variable.length; c++) {
            newIndicies = newIndicies.concat(copyArray(slf.indicies));
        }

        for(var d = 0; d < variable.length; d++) {
            for(var n = 0; n < indexCount; n++) {
                newIndicies[d * indexCount +  n][i] = d;
            }
        }

        slf.indicies = newIndicies;
    }

    this.hasNext = function() {
        return slf.currentIndex < slf.indicies.length;
    };

    this.next = function() {
        var values = [];

        for(var i = 0; i < slf.variables.length; i++) {
            values[i] = slf.variables[i].get(slf.indicies[slf.currentIndex][i]);
        }
        slf.currentIndex++;

        return values;
    };

}

var writeDockerfile = function(directory, templateFile, nameTemplate, values, resourceNamePattern) {
    var version = nameTemplate;
    var content = fs.readFileSync(templateFile, 'utf8');
    var resourceRegExp = resourceNamePattern;

    for(var i = 0; i < values.length; i++) {
        for(var placeholder in values[i]) {
            if(!!resourceRegExp) {
                resourceRegExp = resourceRegExp.replace(new RegExp('\\$\\{' + placeholder + '\\}', 'g'), values[i][placeholder]);
            }
            version = version.replace(new RegExp('\\$\\{' + placeholder + '\\}', 'g'), values[i][placeholder]);
            content = content.replace(new RegExp('\\$\\{' + placeholder + '\\}', 'g'), values[i][placeholder]);
        }
    }
    if(!!resourceRegExp) {
        resourceRegExp = new RegExp(resourceRegExp, 'g');
    }

    var targetDir = path.join(homeDir, directory, 'tmp');
    targetFile = path.join(targetDir, version);
    if(!fs.existsSync(targetDir)) {
        fs.mkdirSync(targetDir);
    }
    fs.writeFileSync(targetFile, content);
};

var getBuildCommand = function(directory, repository, nameTemplate, values) {
    var version = nameTemplate;
    var tag = repository + ':';

    for(var i = 0; i < values.length; i++) {
        for(var placeholder in values[i]) {
            version = version.replace(new RegExp('\\$\\{' + placeholder + '\\}', 'g'), values[i][placeholder]);
        }
    }

    tag += version;

    var targetDir = path.join(homeDir, directory, 'tmp');
    var logFile = path.join(homeDir, directory, 'tmp', version + '.log');

    return {
        dir: targetDir,
        log: logFile,
        cmd: ['docker', ['build', '--force-rm=true', '--rm', '-t', tag, '-f', path.join(targetDir, version), '.'], {
            cwd: targetDir
        }],
        tag: tag
    };
};

var getPushCommand = function(directory, repository, nameTemplate, values) {
    var version = nameTemplate;
    var tag = repository + ':';

    for(var i = 0; i < values.length; i++) {
        for(var placeholder in values[i]) {
            version = version.replace(new RegExp('\\$\\{' + placeholder + '\\}', 'g'), values[i][placeholder]);
        }
    }

    tag += version;

    var targetDir = path.join(homeDir, directory, 'tmp');
    var logFile = path.join(homeDir, directory, 'tmp', version + '.log');

    return {
        dir: targetDir,
        log: logFile,
        cmd: ['docker', ['push', tag]],
        tag: tag,
        type: 'push'
    };
};

var getDownloadCommand = function(directory, nameTemplate, values, filename, url) {
    var downloadFolder = path.resolve(path.join(homeDir, directory, 'tmp'));

    if(!fs.existsSync(path.resolve(downloadFolder))) {
        fs.mkdirSync(path.resolve(downloadFolder));
    }

    var downloadFile = path.join(downloadFolder, filename);
    var version = nameTemplate;

    for(var i = 0; i < values.length; i++) {
        for(var placeholder in values[i]) {
            version = version.replace(new RegExp('\\$\\{' + placeholder + '\\}', 'g'), values[i][placeholder]);
        }
    }

    var logFile = path.join(homeDir, directory, 'tmp', version + '.log');

    return {
        dir: downloadFolder,
        log: logFile,
        cmd: ['/usr/bin/wget', ['--output-document=' + downloadFile, url]],
        type: 'download',
        url: url,
        file: downloadFile
    };
};

var buildCommands = [];
for(var i = 0; i < configs.length; i++) {
    var config = configs[i];
    var variables = [];
    var template = path.join(repository, config.template);
    for(var variableIndex in config.variables) {
        variables.push(new Variable(config.variables[variableIndex]));
    }

    var iterator = new Iterator(variables);
    while(iterator.hasNext()) {
        var values = iterator.next();
        if(!fs.existsSync(path.resolve(homeDir))) {
            fs.mkdirSync(path.resolve(homeDir));
        }
        if(!fs.existsSync(path.resolve(path.join(homeDir, repository)))) {
            fs.mkdirSync(path.resolve(path.join(homeDir, repository)));
        }
        if(!!config.resources) {
            for(var filename in config.resources) {
                buildCommands.push(getDownloadCommand(repository, config.name, values, filename, config.resources[filename]));
            }
        }

        writeDockerfile(repository, template, config.name, values, config.resourceNamePattern);

        if(build) {
            buildCommands.push(getBuildCommand(repository, config.repository, config.name, values));
            if(push) {
                buildCommands.push(getPushCommand(repository, config.repository, config.name, values));
            }
        }
    }
}

var commandIndex = 0;
var executeNextBuild = function() {
    var command = buildCommands[commandIndex++];
    if(!fs.existsSync(command.dir)) {
        fs.mkdirSync(command.dir);
    }

    if(!!command.type && command.type === 'download') {
        if(fs.existsSync(command.file)) {
            if(commandIndex < buildCommands.length) {
                executeNextBuild();
            }
            return;
        }
    }

    var logFileStream = fs.createWriteStream(command.log);
    var process = spawn.apply(null, command.cmd);

    process.stdout.pipe(logFileStream);
    process.stderr.pipe(logFileStream);
    process.on('exit', function (code) {
        if(!!command.type && command.type === 'push') {
            console.log(command.tag + (code === 0 ? ' pushed' : ' not pushed'));
        } else if(!!command.type && command.type === 'download') {
            console.log(command.url + (code === 0 ? ' downloaded' : ' not downloaded'));
        } else {
            console.log(command.tag + (code === 0 ? ' built' : ' not built'));
        }
        if(commandIndex < buildCommands.length) {
            executeNextBuild();
        }
    });
};

if(build && buildCommands.length > 0) {
    executeNextBuild();
}


text: Find max number of living people from data and when they were all alive


text:
cmapi.channel["map.feature.update"] = {
    schema: {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "map.feature.update",
        "description": "Update an existing feature on the map.",
        "type": "object",
        "properties": {
                  "overlayId": {
                    "description": "The ID of the overlay where the feature to be updated is currently found. If no overlayId is included, default overlay with ID equal to sending widget's ID is assumed.",
                    "type": "string",
					"default": "sending widget's ID"
                },
                "featureId": {
                    "description": "The ID of the feature to be updated",
                    "type": "string",
					"default": "N/A"
                },
                "name": {
                    "description": "If the name provided differs from the feature's current name, the display value will be changed to show the new value.  If no value is provided, the feature name will remain unchanged.",
                    "type": "string",
					"default": "N/A"
                },
                "newOverlayId": {
                    "description": "This represents the ID of an overlay to move the feature to.  If this attribute is provided, the feature MUST be removed from its current overlay and added to the overlay with this ID.  If an overlay with an ID of newOverlayId does not exist, a new overlay will be created with an ID of newOverlayId, and the feature to be updated will be moved to the overlay identified by newOverlayId.",
                    "type": "string",
					"default": "N/A"
                }
        },
        "required": ["featureId"]
    },
    notes: [
    'In order to update the feature data itself, use the map.feature.plot or map.feature.plot.url message and use the existing featureId'
    ]
}


text:
module Api
  class Assemblies < APIDispatch
    include MarketplaceHelper

    attr_reader :assemblies_grouped
    attr_reader :apps, :services

    TORPEDO             =  'TORPEDO'.freeze
    APP                 =  'APP'.freeze
    SERVICE             =  'SERVICE'.freeze
    ANALYTICS           =  'ANALYTICS'.freeze
    MICROSERVICES       =  'MICROSERVICES'.freeze
    COLLABORATION       =  'COLLABORATION'.freeze
    CATTYPES            =  [TORPEDO, APP, SERVICE, MICROSERVICES, ANALYTICS, COLLABORATION]

    START               =  'start'.freeze
    STOP                =  'stop'.freeze
    RESTART             =  'restart'.freeze
    REBOOT              =  'reboot'.freeze
    DESTROY             =  'delete'.freeze
    TERMINATED          =  'destroying'.freeze
    LAUNCHING           =  'LAUNCHING'.freeze
    SOURCE              = 'source'.freeze
    DOCKERCONTAINER     = 'DockerContainer'.freeze

    def initialize
      @assemblies_grouped = {}
      @apps = []
      @services = []
      super(true) # swallow 404 errors for assemblies.
    end

    # The list returns a list of assemblies, apps, services.
    # we also need the spun vms, apps, services
    # here is the  tree for us.
    # You can have as many assembly inside assemblies.
    # for the sake of a simple verbosology, we call plural assemblys as assembly_collection.
    # There exists a need to cyclically dug inside as we only retrieve the ids of our assemblies structure.
    # The following has 1 assembly and 2 components.
    #  -- assemblies :
    #      --assembly
    #           ---components
    #                   -- component1 : app
    #                   -- component2 : service
    # currently if there are no components then we consider it a plain VM.
    # an additional field in assembly indicates if its a plain VM (INSTANCE) or not.
    def list(api_params, &_block)
      raw = api_request(ASSEMBLIES, LIST, api_params)
      dig_assembly(raw[:body], api_params) unless raw.nil?
      @apps = flying_apps(APP) unless api_params[:flying_apps].nil?
      @services = flying_apps(SERVICE) unless api_params[:flying_service].nil?
      yield self  if block_given?
      self
    end

    def create(api_params, &_block)
      bld_data = build_data(api_params)
	    api_request(ASSEMBLIES, CREATE, api_params.merge(bld_data))
      yield self if block_given?
      self
    end

   def build_data(api_params)
    { name: '',
      assemblies: [Megam::Mixins::Assemblies.new(api_params).to_hash],
      inputs: [],
      org_id: api_params[:org_id]
    }
   end
    private
    # The /assemblies just returns an id of assembly. dig recursively to get the full content of it.
    #     assemblies : :id  => ASM0001
    #          assembly: :id => ASC0001
    #              component :id => CMP0001
    def dig_assembly(tmp_assemblies_collection, api_params)
      # First step A[A[H1], A[H2]] => A[H1, H2..Hn]
      a2 = tmp_assemblies_collection.map do |one_assemblies|
        a1 = one_assemblies.assemblies.map do |one_assembly|
          unless one_assembly.empty?
            Api::Assembly.new.show(api_params.merge(id: one_assembly, asms_id: one_assemblies.id)).by_cattypes
          end
        end
        a1.reduce { |acc, h| acc.merge(h || {}) }
      end
      # A[H1, H2, ... Hn] => H[:CATTYPE => [H1, H2, ... Hn]]
      a3 = a2.group_by { |j| j.keys.join }

      # [:CATTYPE => [H1, H2, ... Hn]] => H[:CATTYPE => [A1, A2]]
      a3.each do |k, v|
        @assemblies_grouped[k] ||= []

        @assemblies_grouped[k] << v.map { |u| u.map { |_k1, v1| v1 } }
      end

      Rails.logger.debug "\033[36m>-- ASB'S: #{@assemblies_grouped.class} START\33[0m"
      Rails.logger.debug "\033[1m#{@assemblies_grouped.to_yaml}\33[22m"
      Rails.logger.debug "\033[36m> ASB'S: END\033[0m"
    end

    # provides the flying apps which is used by the bind app screen.
    def flying_apps(assembly_type)
      tmp_apps = []
      if !@assemblies_grouped.empty? && !@assemblies_grouped[assembly_type].nil?
        @assemblies_grouped[assembly_type].flatten.each do |one_assembly|
          one_assembly.components.flatten.map do |u|
            unless u.nil?
              u.each do |com|
                tmp_apps << { name: "#{one_assembly.name}.#{parse_key_value_pair(com.inputs, 'domain')}/#{com.name}", aid: one_assembly.id, cid: com.id }
              end
            end
          end
        end
      end
      tmp_apps
    end
  end
end


text:
package org.mdbda.diagrameditor.features.resources;

import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.features.context.ICreateContext;
import org.mdbda.model.MDBDAModelRoot;
import org.mdbda.model.Task;
import org.mdbda.model.Resource;
import org.mdbda.model.Workflow;
import org.mdbda.diagrameditor.features.AbstractCreateMDBDAFeature;

public abstract class CreateResourceFeature extends AbstractCreateMDBDAFeature {

	public CreateResourceFeature(IFeatureProvider fp, String name,
			String description) {
		super(fp, name, description);
		// TODO Auto-generated constructor stub
	}

	@Override
	public boolean canCreate(ICreateContext context) {
		if( getBusinessObjectForPictogramElement(context.getTargetContainer()) instanceof Workflow ){
			return true;
		}
		if( getBusinessObjectForPictogramElement(context.getTargetContainer()) instanceof MDBDAModelRoot ){
			return true;
		}

		return false;
	}

	protected void addToTargetBO(ICreateContext context,Resource eInst) {
		Object bo =  getBusinessObjectForPictogramElement(context.getTargetContainer());

		if(bo instanceof Workflow){
			((Workflow) bo).getInternalDataResources().add(eInst);
		}
		if(bo instanceof MDBDAModelRoot){
			((MDBDAModelRoot) bo).getResources().add(eInst);
		}
	}

	protected void addToWorkflow(Workflow wf, Task eInst) {
		//wf.eResource().getContents().add(eInst);
		eInst.setWorkflow(wf);
	}

}


text:
"""Test the base widget."""

from dal.widgets import Select

from django import forms
from django import http
from django import test
from django.conf.urls import url
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.utils import six

import mock

urlpatterns = [
    url(
        r'^test-url/$',
        mock.Mock(),
        name='test_url'
    ),
]

@override_settings(ROOT_URLCONF='tests.test_widgets')
class SelectTest(test.TestCase):  # noqa
    """Test case for the Select widget."""

    def test_widget_renders_only_selected_with_url(self):
        """Assert that it won't render unselected choices, if given a url."""
        class Form(forms.Form):
            test = forms.ChoiceField(
                choices=[(i, 'label for %s' % i) for i in range(0, 100)],
                widget=Select(url=reverse('test_url')),
                required=False
            )

        form = Form(http.QueryDict('test=4'))
        expected = '''
<select data-autocomplete-light-url="/test-url/" id="id_test" name="test">
<option value="4" selected="selected">label for 4</option>
</select>
        '''.strip()

        self.assertEquals(six.text_type(form['test'].as_widget()), expected)


text:
using System;

public class Program
{
    public static void Main(string[] args)
    {
        Console.WriteLine("ハローレディリン");
        Console.WriteLine(@"ハローレディリン");
    }
}


text:
package com.intellij.build.events;

import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author Vladislav.Soroka
 */
public interface BuildEvent {
  /**
   * Returns an id that uniquely identifies the event.
   *
   * @return The event id.
   */
  @NotNull
  Object getId();

  /**
   * Returns the parent event id, if any.
   *
   * @return The parent event id.
   */
  @Nullable
  Object getParentId();

  /**
   * Returns the time this event was triggered.
   *
   * @return The event time, in milliseconds since the epoch.
   */
  long getEventTime();

  /**
   * Returns textual representation of the event.
   *
   * @return The event text message.
   */
  @NotNull
  @BuildEventsNls.Message
  String getMessage();

  @Nullable
  @BuildEventsNls.Hint
  String getHint();

  @Nullable
  @BuildEventsNls.Description
  String getDescription();
}


text:
<?php

namespace backend\models;

use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\ticket\Ticket;

/**
 * TicketSearch represents the model behind the search form about `common\models\ticket\Ticket`.
 */
class TicketSearch extends Ticket
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['ID', 'CategoryTicketID', 'Text', 'UpdateTime'], 'integer'],
            [['Name', 'About', 'Style', 'Place', 'Address', 'ShortText', 'DateTime', 'Afisha', 'Cover', 'Photo1', 'Photo2', 'Photo3', 'Video'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function scenarios()
    {
        // bypass scenarios() implementation in the parent class
        return Model::scenarios();
    }

    /**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
    public function search($params)
    {
        $query = Ticket::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            // uncomment the following line if you do not want to return any records when validation fails
            // $query->where('0=1');
            return $dataProvider;
        }

        $query->andFilterWhere([
            'ID' => $this->ID,
            'CategoryTicketID' => $this->CategoryTicketID,
            'DateTime' => $this->DateTime,
            'Text' => $this->Text,
            'UpdateTime' => $this->UpdateTime,
        ]);

        $query->andFilterWhere(['like', 'Name', $this->Name])
            ->andFilterWhere(['like', 'About', $this->About])
            ->andFilterWhere(['like', 'Style', $this->Style])
            ->andFilterWhere(['like', 'Place', $this->Place])
            ->andFilterWhere(['like', 'Address', $this->Address])
            ->andFilterWhere(['like', 'ShortText', $this->ShortText])
            ->andFilterWhere(['like', 'Afisha', $this->Afisha])
            ->andFilterWhere(['like', 'Cover', $this->Cover])
            ->andFilterWhere(['like', 'Photo1', $this->Photo1])
            ->andFilterWhere(['like', 'Photo2', $this->Photo2])
            ->andFilterWhere(['like', 'Photo3', $this->Photo3])
            ->andFilterWhere(['like', 'Video', $this->Video]);

        return $dataProvider;
    }
}


text:
<?php

class Model_KbArticleCategory extends \RedBean_SimpleModel
{

}


text:
layout: post
title: "Never Felt More Appreciated"
excerpt: "Had to share how happy I was"
tags: [LA Tech, FRC]

---

In our last meeting for the 2014-2015 FRC season, I received this gift from the team.

I was pretty speechless. Thanks team.


text:
layout: default
permalink: /about/government/
title: Government
published: true
---
Gov


text:
Sequel.migration do
  up do
    drop_table?(:uk_hoc_tutorials) # Drop DataMapper version of the table if still around.

    create_table(:uk_tutorials, charset: 'utf8') do
      primary_key :id
      String :code, index: true, null: false, unique: true
      String :short_code, index: true, null: false, unique: true
      Integer :displayweight, null: false
      String :name, null: false
      String :orgname, null: false
      String :contact
      String :url, size: 2000, null: false
      String :shortdescription, null: false
      Text :longdescription, null: false
      String :platformtext, null: false
      String :gradelevel, null: false
      String :image, null: false
      String :tags, null: false
      String :teachers_notes
      String :language
      String :languages_supported
    end
  end

  down do
    drop_table(:uk_tutorials)
  end
end


text:
package main

import (
	"github.com/insionng/makross"
	//"github.com/insionng/makross/access"
	//"github.com/insionng/makross/file"
	"github.com/insionng/makross/gonder"
	//"github.com/insionng/makross/logger"
	//"github.com/insionng/makross/recover"
	"github.com/insionng/makross/static"
	//"log"
)

func main() {
	v := makross.New()

	//v.Use(recover.Recover())
	//v.Use(logger.Logger())
	//v.Use(access.Logger(log.Printf))
	v.Use(static.Static("static"))
	//v.Use(file.Server(file.PathMap{"/static": "/static"}))

	v.SetRenderer(gonder.Renderor(gonder.Option{
		DelimLeft:  "{{",
		DelimRight: "}}",
	}))

	v.Get("/", func(self *makross.Context) error {
		var data = make(map[string]interface{})
		data["name"] = "Insion Ng"
		self.SetStore(data)

		self.SetStore(map[string]interface{}{
			"title": "你好,世界",
			"oh":    "no",
		})
		self.Set("oh", "yes") //覆盖前面指定KEY
		return self.Render("index")
	})

	v.Listen(":9000")
}


text:
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Globalization;
using System.Linq;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Text.Shared.Extensions;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;

namespace Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.Completion.Presentation
{
    /// <summary>
    /// See comment on <see cref="VisualStudio15CompletionSet"/> for an explanation of how
    /// these types fit together and where code should go in them.
    ///
    /// This class is where all code that would normally be in our derived type of
    /// <see cref="CompletionSet2"/> should go.  <see cref="VisualStudio15CompletionSet"/>
    /// should then just forward all calls to us and we can share all our Dev14 logic with
    /// <see cref="Roslyn14CompletionSet"/>.
    /// </summary>
    internal class Roslyn15CompletionSet : Roslyn14CompletionSet
    {
        private CompletionHelper _completionHelper;
        public IReadOnlyList<IntellisenseFilter2> Filters;

        private readonly bool _highlightMatchingPortions;
        private readonly bool _showFilters;

        public Roslyn15CompletionSet(
            IVisualStudioCompletionSet vsCompletionSet,
            CompletionPresenterSession completionPresenterSession,
            ITextView textView,
            ITextBuffer subjectBuffer)
            : base(vsCompletionSet, completionPresenterSession, textView, subjectBuffer)
        {
            var document = GetDocument();

            if (document != null)
            {
                var options = document.Project.Solution.Options;
                _highlightMatchingPortions = options.GetOption(CompletionOptions.HighlightMatchingPortionsOfCompletionListItems, document.Project.Language);
                _showFilters = options.GetOption(CompletionOptions.ShowCompletionItemFilters, document.Project.Language);
            }
        }

        protected override void SetupFilters(ImmutableArray<CompletionItemFilter> completionItemFilters)
        {
            // If more than one filter was provided, then present it to the user.
            if (_showFilters && Filters == null && completionItemFilters.Length > 1)
            {
                Filters = completionItemFilters.Select(f => new IntellisenseFilter2(this, f))
                                               .ToArray();
            }
        }

        private CompletionHelper GetCompletionHelper()
        {
            this.AssertIsForeground();
            if (_completionHelper == null)
            {
                var document = GetDocument();
                if (document != null)
                {
                    _completionHelper = CompletionHelper.GetHelper(document);
                }
            }

            return _completionHelper;
        }

        public IReadOnlyList<Span> GetHighlightedSpansInDisplayText(string displayText)
        {
            if (_highlightMatchingPortions && !string.IsNullOrWhiteSpace(FilterText))
            {
                var completionHelper = this.GetCompletionHelper();
                if (completionHelper != null)
                {
                    var completionItem = this.CompletionItemMap.Keys.FirstOrDefault(k => k.DisplayText == displayText);

                    if (completionItem != null && completionItem != SuggestionModeItem)
                    {
                        var highlightedSpans = completionHelper.GetHighlightedSpans(
                            completionItem, FilterText, CultureInfo.CurrentCulture);
                        if (highlightedSpans != null)
                        {
                            return highlightedSpans.Select(s => s.ToSpan()).ToArray();
                        }
                    }
                }
            }

            return null;
        }

        internal void OnIntelliSenseFiltersChanged()
        {
            this.CompletionPresenterSession.OnIntelliSenseFiltersChanged(
                Filters.ToImmutableDictionary(f => f.CompletionItemFilter, f => f.IsChecked));
        }
    }
}


text:
#if defined(VISION_P6)

#include <cstdint>

#include "tensorflow/lite/c/builtin_op_data.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/kernels/internal/common.h"
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
#include "tensorflow/lite/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/conv.h"
#include "tensorflow/lite/micro/kernels/kernel_util.h"
#include "tensorflow/lite/micro/kernels/xtensa/xtensa.h"
#include "tensorflow/lite/micro/kernels/xtensa/xtensa_fully_connected.h"

namespace tflite {

void NormalizeFCDims(uint32_t* dims, int rank) {
  if (rank < 4) {
    dims[3] = dims[rank - 1];
    dims[rank - 1] = 1;
  }
  dims[0] *= dims[1] * dims[2];
  dims[1] = 1;
  dims[2] = 1;
  return;
}

inline void OperandDims4D(uint32_t* dims, const TfLiteTensor* opnd) {
  for (int i = NumDimensions(opnd) - 1, j = 0; i >= 0; i--, j++) {
    dims[j] = SizeOfDimension(opnd, i);
  }
  return;
}
TfLiteStatus FullyConnectedPrepareVision(TfLiteContext* context,
                                         TfLiteNode* node) {
  TFLITE_DCHECK(node->user_data != nullptr);
  TFLITE_DCHECK(node->builtin_data != nullptr);
  XtensaFullyConnectedOpData* data =
      reinterpret_cast<XtensaFullyConnectedOpData*>(node->user_data);

  MicroContext* micro_context = GetMicroContext(context);
  TfLiteTensor* output = micro_context->AllocateTempOutputTensor(
      node, kFullyConnectedOutputTensor);
  TF_LITE_ENSURE(context, output != nullptr);
  TfLiteTensor* input =
      micro_context->AllocateTempInputTensor(node, kFullyConnectedInputTensor);
  TF_LITE_ENSURE(context, input != nullptr);
  TfLiteTensor* filter = micro_context->AllocateTempInputTensor(
      node, kFullyConnectedWeightsTensor);
  TF_LITE_ENSURE(context, filter != nullptr);
  TfLiteTensor* bias =
      micro_context->AllocateTempInputTensor(node, kFullyConnectedBiasTensor);

  uint32_t inputDims[4] = {1, 1, 1, 1};
  uint32_t outputDims[4] = {1, 1, 1, 1};
  uint32_t filterDims[4] = {1, 1, 1, 1};

  OperandDims4D(inputDims, input);
  OperandDims4D(outputDims, output);
  OperandDims4D(filterDims, filter);

  NormalizeFCDims(inputDims, NumDimensions(input));
  NormalizeFCDims(filterDims, NumDimensions(filter));
  NormalizeFCDims(outputDims, NumDimensions(output));

  uint32_t context_size = 0;
  uint32_t status = xiFullyConnectedGetMemReqd_Context(&context_size);
  if (!status && context_size) {
    void* context_data =
        context->AllocatePersistentBuffer(context, context_size);
    if (context_data == nullptr) {
      return kTfLiteError;
    }
    data->p_context = reinterpret_cast<uint8_t*>(context_data);
    data->context_size = context_size;
  }

  status = xiFullyConnectedSetContext(
      data->p_context, data->context_size, inputDims, outputDims, filterDims, 1,
      input->params.zero_point, filter->params.zero_point,
      output->params.zero_point, data->reference_op_data.output_multiplier,
      data->reference_op_data.output_shift,
      data->reference_op_data.output_activation_min,
      data->reference_op_data.output_activation_max,
      (uint8_t*)GetTensorData<uint8_t>(filter));

  if (status) {
    return kTfLiteError;
  }

  uint32_t coefficient_size = 0;
  status = xiFullyConnectedGetMemReqd_Coeff(data->p_context, data->context_size,
                                            &coefficient_size);
  if (status || coefficient_size == 0) {
    return kTfLiteError;
  }

  void* coefficient_data =
      context->AllocatePersistentBuffer(context, coefficient_size);
  if (coefficient_data == nullptr) {
    return kTfLiteError;
  }
  data->reorder_coefficient_bias = reinterpret_cast<int8_t*>(coefficient_data);
  data->reorder_coefficient_bias_size = coefficient_size;

  status = xiFullyConnectedDoCoeffReorder(
      data->p_context, data->context_size,
      reinterpret_cast<uint8_t*>(data->reorder_coefficient_bias),
      data->reorder_coefficient_bias_size,
      const_cast<uint8_t*>(GetTensorData<uint8_t>(filter)),
      const_cast<int32_t*>(GetTensorData<int32_t>(bias)));
  if (status) {
    return kTfLiteError;
  }

  micro_context->DeallocateTempTfLiteTensor(output);
  micro_context->DeallocateTempTfLiteTensor(input);
  micro_context->DeallocateTempTfLiteTensor(filter);
  if (bias != nullptr) {
    micro_context->DeallocateTempTfLiteTensor(bias);
  }
  return kTfLiteOk;
}

TfLiteStatus FullyConnectedEvalVision(TfLiteContext* context, TfLiteNode* node,
                                      const TfLiteConvParams& params,
                                      const XtensaFullyConnectedOpData& data,
                                      const TfLiteEvalTensor* input,
                                      const TfLiteEvalTensor* filter,
                                      const TfLiteEvalTensor* bias,
                                      TfLiteEvalTensor* output) {
  const uint32_t input_size = NumElements(input->dims);
  const uint32_t output_size = NumElements(output->dims);
  const int num_channels = filter->dims->data[kConvQuantizedDimension];

  xiFullyConnected(
      data.p_context, data.context_size,
      const_cast<int8_t*>(tflite::micro::GetTensorData<int8_t>(input)),
      input_size, tflite::micro::GetTensorData<int8_t>(output), output_size,
      data.reorder_coefficient_bias, data.reorder_coefficient_bias_size, NULL,
      NULL, num_channels);
  return kTfLiteOk;
}
}  // namespace tflite
#endif  // defined(VISION_P6)


text:
=head1 LICENSE

Copyright [1999-2014] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=cut

package XrefParser::MGI_Desc_Parser;

use strict;
use warnings;
use Carp;
use File::Basename;

use base qw( XrefParser::BaseParser );

use Bio::EnsEMBL::DBSQL::DBAdaptor;

sub run {

  my ($self, $ref_arg) = @_;
  my $source_id    = $ref_arg->{source_id};
  my $species_id   = $ref_arg->{species_id};
  my $files        = $ref_arg->{files};
  my $verbose      = $ref_arg->{verbose};

  if((!defined $source_id) or (!defined $species_id) or (!defined $files) ){
    croak "Need to pass source_id, species_id and files as pairs";
  }
  $verbose |=0;

  my $file = @{$files}[0];

  my $mgi_io = $self->get_filehandle($file);

  if ( !defined $mgi_io ) {
    print STDERR "ERROR: Could not open $file\n";
    return 1;    # 1 is an error
  }

  my $xref_count =0;
  my $syn_count = 0;
  my %acc_to_xref;

    my $header = $mgi_io->getline(); #discard header line

    chomp($header);
    # crude emergency check for potentially altered file format.
    my $header_template = qq(MGI Accession ID\tChr\tcM Position\tgenome coordinate start\tgenome coordinate end\tstrand\tMarker Symbol\tStatus\tMarker Name\tMarker Type\tFeature Type\tMarker Synonyms (pipe-separated));
    if ($header ne $header_template) {die "File header has altered from format parser expects. Check MGI "};

    while ( my $line = $mgi_io->getline() ) {

        chomp($line);
        my ($accession, $chromosome, $position, $start, $end, $strand,$label,
            $status, $marker, $marker_type, $feature_type, $synonym_field) = split(/\t/,$line);

        $position =~ s/^\s+// if ($position);

        my @synonyms = split(/\|/,$synonym_field) if ($synonym_field);

        my $desc;
	if ($marker) {
	    $desc = $marker;
	}

        $acc_to_xref{$accession} = $self->add_xref({ acc        => $accession,
    	                           		             label      => $label,
    					                             desc       => $desc,
    					                             source_id  => $source_id,
    					                             species_id => $species_id,
    					                             info_type  => "MISC"} );
        if($verbose and !$desc){
    	   print "$accession has no description\n";
        }
        $xref_count++;

        if(defined($acc_to_xref{$accession})){

            foreach my $syn (@synonyms) {
                $self->add_synonym($acc_to_xref{$accession}, $syn);
                $syn_count++;
            }

        }

    }

    $mgi_io->close();

    print $xref_count." MGI Description Xrefs added\n" if($verbose);
    print $syn_count." synonyms added\n" if($verbose);

    return 0; #successful
}

1;


text:
.. meta-raspberrypi documentation master file, created by
   sphinx-quickstart on Tue May 23 09:51:24 2017.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to meta-raspberrypi's documentation!
============================================

Contents:

.. toctree::
   :maxdepth: 2

   readme
   layer-contents
   extra-build-config
   extra-apps
   ipcompliance
   contributing

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`


text:
module m3 {
    export module m2 {
        export interface connectModule {
            (res, req, next): void;
        }
        export interface connectExport {
            use: (mod: connectModule) => connectExport;
            listen: (port: number) => void;
        }

    }

    export var server: {
        (): m2.connectExport;
        test1: m2.connectModule;
        test2(): m2.connectModule;
    };
}

import m = m3
export = m;

//// [declFileExportAssignmentImportInternalModule.js]
var m3;
(function (m3) {
})(m3 || (m3 = {}));
var m = m3;
module.exports = m;

//// [declFileExportAssignmentImportInternalModule.d.ts]
declare module m3 {
    module m2 {
        interface connectModule {
            (res: any, req: any, next: any): void;
        }
        interface connectExport {
            use: (mod: connectModule) => connectExport;
            listen: (port: number) => void;
        }
    }
    var server: {
        (): m2.connectExport;
        test1: m2.connectModule;
        test2(): m2.connectModule;
    };
}
import m = m3;
export = m;


text:
bossSandbox
===========

A sandbox to try out ChicagoBoss, a web framework using Erlang. http://www.chicagoboss.org/

Dependencies
============
* Erlang
* ChicagoBoss 0.8.7


text:
package com.moilioncircle.redis.replicator.cmd.parser;

import static com.moilioncircle.redis.replicator.cmd.CommandParsers.toBytes;
import static com.moilioncircle.redis.replicator.cmd.CommandParsers.toLong;
import static com.moilioncircle.redis.replicator.cmd.CommandParsers.toRune;
import static com.moilioncircle.redis.replicator.util.Strings.isEquals;

import com.moilioncircle.redis.replicator.cmd.CommandParser;
import com.moilioncircle.redis.replicator.cmd.impl.XSetIdCommand;

/**
 * @author Leon Chen
 * @since 2.6.1
 */
public class XSetIdParser implements CommandParser<XSetIdCommand> {

    @Override
    public XSetIdCommand parse(Object[] command) {
        int idx = 1;
        byte[] key = toBytes(command[idx]);
        idx++;
        byte[] id = toBytes(command[idx]);
        idx++;
        Long entriesAdded = null;
        byte[] maxDeletedEntryId = null;
        while (idx < command.length) {
            String next = toRune(command[idx++]);
            if (isEquals(next, "ENTRIESADDED")) {
                entriesAdded = toLong(command[idx++]);
            } else if (isEquals(next, "MAXDELETEDID")) {
                maxDeletedEntryId = toBytes(command[idx++]);
            } else {
                throw new UnsupportedOperationException(next);
            }
        }
        return new XSetIdCommand(key, id, entriesAdded, maxDeletedEntryId);
    }
}


text:
"""
Heap of constants used in the training of models.
"""
__author__ = "Steve DiCristofaro"

# Module paths
PYTHON_TENSORFLOW_PATH = 'tensorflow.python.'
CONTINUOUS_ACTIVATION_MODULE = PYTHON_TENSORFLOW_PATH + 'ops.gen_nn_ops'
NONLINEAR_ACTIVATION_MODULE = PYTHON_TENSORFLOW_PATH + 'ops.math_ops'
REGULARIZER_ACTIVATION_MODULE = PYTHON_TENSORFLOW_PATH + 'ops.nn_ops'
RMSPROP_OPTIMIZER_MODULE = PYTHON_TENSORFLOW_PATH + 'training.rmsprop'
GRADIENT_OPTIMIZER_MODULE = PYTHON_TENSORFLOW_PATH + 'training.gradient_descent'

# Neural network configuration file
DEFAULT_NEURAL_NET_CONFIG_PATH = 'nn_config.json'

# Training defaults
DEFAULT_TRAIN_SIZE = 0.7
DEFAULT_VALIDATION_SIZE = 0.1
DEFAULT_SEED = 12345
DEFAULT_BATCH_SIZE = 100
DEFAULT_NETWORK_ITER = 1000

# Dataset Keys
IRIS_DATASET_KEY = 'IRIS'
BOSTON_DATASET_KEY = 'BOS'
DIGITS_DATASET_KEY = 'DIGITS'
VALID_DATASET_KEYS = [IRIS_DATASET_KEY, BOSTON_DATASET_KEY, DIGITS_DATASET_KEY]

# Model Keys
KNN_MODEL_KEY = 'KNN'
SVM_MODEL_KEY = 'SVM'
RF_MODEL_KEY = 'RF'
NEURAL_NET_MODEL_KEY = 'NEURAL'
VALID_MODEL_KEYS = [KNN_MODEL_KEY, SVM_MODEL_KEY, RF_MODEL_KEY, NEURAL_NET_MODEL_KEY]

# Tensorflow layers
CONTINUOUS_ACTIVATIONS = ['relu', 'relu6', 'crelu', 'relu_x']
NONLINEAR_ACTIVATIONS = ['sigmoid', 'tanh', 'elu', 'softplus', 'softsign']
REGLARIZER_ACTIVATIONS = ['dropout']

# Optimizer parameters
GRADIENT_OPT_TYPE = 'gradient_descent'
GRADIENT_OPTIMIZER = 'GradientDescentOptimizer'
RMSPROP_OPTIMIZER = 'RMSPropOptimizer'

# Model Hyperparameter Defaults
DEFAULT_KNN_GRID = {
    "n_neighbors": [1, 5, 10, 15, 20]
}
DEFAULT_SVM_GRID = {
    "kernel": ["linear", "rbf"],
    "C": [0.001, 0.01, 0.1],
    "gamma": [0.5, 1, 2]
}
DEFAULT_RF_GRID = {
    "n_estimators": [1, 5, 10, 15, 20]
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Fail: (1202) A 'substance' UnitDefinition may only have a single Unit
of kind 'mole' or 'item' and the Unit's exponent must be '1'.
-->
<sbml xmlns="http://www.sbml.org/sbml/level1" level="1" version="2">
	<model>
		<listOfUnitDefinitions>
			<unitDefinition name="substance">
				<listOfUnits>
					<unit kind="mole" exponent="2"/>
				</listOfUnits>
			</unitDefinition>
		</listOfUnitDefinitions>
		<listOfCompartments>
			<compartment name="c"/>
		</listOfCompartments>
	</model>
</sbml>


text:
namespace DKFramework::Private::Vulkan
{
    class Semaphore : public DKGpuEvent
    {
#if DKGL_VULKAN_SEMAPHORE_AUTO_INCREMENTAL_TIMELINE
        mutable DKAtomicNumber64 waitValue;
        mutable DKAtomicNumber64 signalValue;
#endif
    public:
        Semaphore(DKGraphicsDevice*, VkSemaphore);
        ~Semaphore();

        DKObject<DKGraphicsDevice> device;
        VkSemaphore semaphore;

#if DKGL_VULKAN_SEMAPHORE_AUTO_INCREMENTAL_TIMELINE
        uint64_t NextWaitValue() const;
        uint64_t NextSignalValue() const;
#else
        uint64_t NextWaitValue() const { return 0; }
        uint64_t NextSignalValue() const { return 0; }
#endif
    };
}

#endif //#if DKGL_ENABLE_VULKAN


text:
'use strict';

function escapeArgument(arg, quote) {
    // Convert to string
    arg = '' + arg;

    // If we are not going to quote the argument,
    // escape shell metacharacters, including double and single quotes:
    if (!quote) {
        arg = arg.replace(/([()%!^<>&|;,"'\s])/g, '^$1');
    } else {
        // Sequence of backslashes followed by a double quote:
        // double up all the backslashes and escape the double quote
        arg = arg.replace(/(\\*)"/g, '$1$1\\"');

        // Sequence of backslashes followed by the end of the string
        // (which will become a double quote later):
        // double up all the backslashes
        arg = arg.replace(/(\\*)$/, '$1$1');

        // All other backslashes occur literally

        // Quote the whole thing:
        arg = '"' + arg + '"';
    }

    return arg;
}

module.exports = escapeArgument;


text:
/**
 * Version Service
 */

var _ = require('lodash');
var semver = require('semver');

var VersionService = {};

// Normalize version name
VersionService.normalizeName = function(name) {
  if (name[0] == 'v') name = name.slice(1);
  return name;
};

// Compare two versions
VersionService.compare = function(v1, v2) {
  if (semver.gt(v1.tag, v2.tag)) {
    return -1;
  }
  if (semver.lt(v1.tag, v2.tag)) {
    return 1;
  }
  return 0;
};

module.exports = VersionService;


text:
spawnmenu_border = CreateConVar( "spawnmenu_border",	"0.1", { FCVAR_ARCHIVE } )

include( 'toolmenu.lua' )
include( 'contextmenu.lua' )
include( 'CreationMenu.lua' )

local PANEL = {}

--[[---------------------------------------------------------
   Name: Paint
-----------------------------------------------------------]]
function PANEL:Init()

	self.ToolMenu = vgui.Create( "ToolMenu", self )
	self.ToolMenu:Dock( RIGHT );
	self.ToolMenu:DockMargin( 0, 20, 3, 10 )

	self.CreateMenu = vgui.Create( "CreationMenu", self )
	self.CreateMenu:Dock( FILL );
	self.CreateMenu:DockMargin( 3, 20, 3, 10 )

	self.m_bHangOpen = false

	self:SetMouseInputEnabled( true )

	self.ToolToggle = vgui.Create( "DImageButton", self )
	self.ToolToggle:SetMaterial( "gui/spawnmenu_toggle" )
	self.ToolToggle:SetSize( 16, 16 );
	self.ToolToggle.DoClick = function()

		self.ToolMenu:SetVisible( !self.ToolMenu:IsVisible() );
		self:InvalidateLayout()

		if ( self.ToolMenu:IsVisible() ) then
			self.ToolToggle:SetMaterial( "gui/spawnmenu_toggle" )
		else
			self.ToolToggle:SetMaterial( "gui/spawnmenu_toggle_back" )
		end

	end

end

function PANEL:OpenCreationMenuTab( name )

	self.CreateMenu:SwitchToName( name )

end

function PANEL:GetToolMenu()
	return self.ToolMenu;
end

--[[---------------------------------------------------------
   Name: OnClick
-----------------------------------------------------------]]
function PANEL:OnMousePressed()

	self:Close()

end

--[[---------------------------------------------------------
   Name: HangOpen
-----------------------------------------------------------]]
function PANEL:HangOpen( bHang )
	self.m_bHangOpen = bHang
end

--[[---------------------------------------------------------
   Name: HangingOpen
-----------------------------------------------------------]]
function PANEL:HangingOpen()
	return self.m_bHangOpen
end

--[[---------------------------------------------------------
   Name: Paint
-----------------------------------------------------------]]
function PANEL:Open()

	RestoreCursorPosition()

	self.m_bHangOpen = false

	-- If the context menu is open, try to close it..
	if ( g_ContextMenu:IsVisible() ) then
		g_ContextMenu:Close( true )
	end

	if ( self:IsVisible() ) then return end

	CloseDermaMenus()

	self:MakePopup()
	self:SetVisible( true )
	self:SetKeyboardInputEnabled( false )
	self:SetMouseInputEnabled( true )
	self:SetAlpha( 255 )

	achievements.SpawnMenuOpen()

end

--[[---------------------------------------------------------
   Name: Paint
-----------------------------------------------------------]]
function PANEL:Close( bSkipAnim )

	if ( self.m_bHangOpen ) then
		self.m_bHangOpen = false
		return
	end

	RememberCursorPosition()

	CloseDermaMenus()

	self:SetKeyboardInputEnabled( false )
	self:SetMouseInputEnabled( false )
	self:SetVisible( false )

end

--[[---------------------------------------------------------
   Name: PerformLayout
-----------------------------------------------------------]]
function PANEL:PerformLayout()

	self:SetSize( ScrW(), ScrH() )
	self:SetPos( 0, 0 )

	local MarginX = math.Clamp( (ScrW() - 1024) * spawnmenu_border:GetFloat(), 25, 256 )
	local MarginY = math.Clamp( (ScrH() - 768) * spawnmenu_border:GetFloat(), 25, 256 )

	self:DockPadding( 0, 0, 0, 0 )

	self.CreateMenu:DockMargin( MarginX, MarginY, 1, MarginY )
	self.ToolMenu:DockMargin( 0, MarginY, MarginX, MarginY )

	self.ToolToggle:AlignRight( 2 )
	self.ToolToggle:AlignTop( 2 )

end

--[[---------------------------------------------------------
   Name: StartKeyFocus
-----------------------------------------------------------]]
function PANEL:StartKeyFocus( pPanel )

	self.m_pKeyFocus = pPanel
	self:SetKeyboardInputEnabled( true )
	self:HangOpen( true )

	g_ContextMenu:StartKeyFocus( pPanel )

end

--[[---------------------------------------------------------
   Name: EndKeyFocus
-----------------------------------------------------------]]
function PANEL:EndKeyFocus( pPanel )

	if ( self.m_pKeyFocus != pPanel ) then return end
	self:SetKeyboardInputEnabled( false )

	g_ContextMenu:EndKeyFocus( pPanel )

end

vgui.Register( "SpawnMenu", PANEL, "EditablePanel" )

--[[---------------------------------------------------------
   Called to create the spawn menu..
-----------------------------------------------------------]]
local function CreateSpawnMenu()

	-- If we have an old spawn menu remove it.
	if ( g_SpawnMenu ) then

		g_SpawnMenu:Remove()
		g_SpawnMenu = nil

	end

	-- Start Fresh
	spawnmenu.ClearToolMenus()

	-- Add defaults for the gamemode. In sandbox these defaults
	-- are the Main/Postprocessing/Options tabs.
	-- They're added first in sandbox so they're always first
	hook.Run( "AddGamemodeToolMenuTabs" )

	-- Use this hook to add your custom tools
	-- This ensures that the default tabs are always
	-- first.
	hook.Run( "AddToolMenuTabs" )

	-- Use this hook to add your custom tools
	-- We add the gamemode tool menu categories first
	-- to ensure they're always at the top.
	hook.Run( "AddGamemodeToolMenuCategories" )
	hook.Run( "AddToolMenuCategories" )

	-- Add the tabs to the tool menu before trying
	-- to populate them with tools.
	hook.Run( "PopulateToolMenu" )

	g_SpawnMenu = vgui.Create( "SpawnMenu" )
	g_SpawnMenu:SetVisible( false )

	CreateContextMenu()

	hook.Run( "PostReloadToolsMenu" )

end

function GM:OnSpawnMenuOpen()

	-- Let the gamemode decide whether we should open or not..
	if ( !hook.Call( "SpawnMenuOpen", GAMEMODE ) ) then return end

	if ( g_SpawnMenu ) then

		g_SpawnMenu:Open()
		menubar.ParentTo( g_SpawnMenu )

	end

end

function GM:OnSpawnMenuClose()

	if ( g_SpawnMenu ) then g_SpawnMenu:Close() end

	-- We're dragging from the spawnmenu but the spawnmenu is closed
	-- so keep the dragging going using the screen clicker
	if ( dragndrop.IsDragging() ) then
		gui.EnableScreenClicker( true )
	end

end

-- Hook to create the spawnmenu at the appropriate time (when all sents and sweps are loaded)
hook.Add( "OnGamemodeLoaded", "CreateSpawnMenu", CreateSpawnMenu )

--[[---------------------------------------------------------
   Name: HOOK SpawnMenuKeyboardFocusOn
		Called when text entry needs keyboard focus
-----------------------------------------------------------]]
local function SpawnMenuKeyboardFocusOn( pnl )

	if ( !ValidPanel( g_SpawnMenu ) && !ValidPanel( g_ContextMenu ) ) then return end
	if ( IsValid( pnl ) && !pnl:HasParent( g_SpawnMenu ) && !pnl:HasParent( g_ContextMenu ) ) then return end

	g_SpawnMenu:StartKeyFocus( pnl )

end

hook.Add( "OnTextEntryGetFocus", "SpawnMenuKeyboardFocusOn", SpawnMenuKeyboardFocusOn )

--[[---------------------------------------------------------
   Name: HOOK SpawnMenuKeyboardFocusOff
		Called when text entry stops needing keyboard focus
-----------------------------------------------------------]]
local function SpawnMenuKeyboardFocusOff( pnl )

	if ( !ValidPanel( g_SpawnMenu ) && !ValidPanel( g_ContextMenu ) ) then return end
	if ( IsValid( pnl ) && !pnl:HasParent( g_SpawnMenu ) && !pnl:HasParent( g_ContextMenu ) ) then return end

	g_SpawnMenu:EndKeyFocus( pnl )

end

hook.Add( "OnTextEntryLoseFocus", "SpawnMenuKeyboardFocusOff", SpawnMenuKeyboardFocusOff )

--[[---------------------------------------------------------
   Name: HOOK SpawnMenuOpenGUIMousePressed
		Don't do context screen clicking if spawnmenu is open
-----------------------------------------------------------]]
local function SpawnMenuOpenGUIMousePressed()

	if ( !ValidPanel( g_SpawnMenu ) ) then return end
	if ( !g_SpawnMenu:IsVisible() ) then return end

	return true

end

hook.Add( "GUIMousePressed", "SpawnMenuOpenGUIMousePressed", SpawnMenuOpenGUIMousePressed )

--[[---------------------------------------------------------
   Name: HOOK SpawnMenuOpenGUIMousePressed
		Close spawnmenu if it's open
-----------------------------------------------------------]]
local function SpawnMenuOpenGUIMouseReleased()

	if ( !ValidPanel( g_SpawnMenu ) ) then return end
	if ( !g_SpawnMenu:IsVisible() ) then return end

	g_SpawnMenu:Close()

	return true

end

hook.Add( "GUIMouseReleased", "SpawnMenuOpenGUIMouseReleased", SpawnMenuOpenGUIMouseReleased )


text:
package ro.androidiasi.codecamp.internal.aa;

/**
 * Created by andrei on 08/04/16.
 */
public interface IEnhancedView extends IEnhancedBean {

    void afterViewsInject();
    void afterViews();

}


text:
from __future__ import absolute_import, unicode_literals

import os

from setuptools import find_packages, setup

version = __import__('filer').__version__

def read(fname):
    # read the contents of a text file
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
    name="django-filer",
    version=version,
    url='http://github.com/divio/django-filer',
    license='BSD',
    platforms=['OS Independent'],
    description="A file management application for django that makes handling "
                "of files and images a breeze.",
    long_description = read('README.rst'),
    author='Stefan Foulis',
    author_email='stefan@foulis.ch',
    packages=find_packages(),
    install_requires=(
        'Django>=1.5,<1.9.999',  # Django is known to use rc versions
        'easy-thumbnails>=1.0,<2.4',
        'django-mptt>=0.6,<0.9',  # the exact version depends on Django
        'django_polymorphic>=0.7,<0.9',
        'Unidecode>=0.04,<0.05',
    ),
    include_package_data=True,
    zip_safe=False,
    # https://pypi.python.org/pypi?%3Aaction=list_classifiers
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Internet :: WWW/HTTP',
        'Framework :: Django',
        'Framework :: Django :: 1.5',
        'Framework :: Django :: 1.6',
        'Framework :: Django :: 1.7',
        'Framework :: Django :: 1.8',
        'Framework :: Django :: 1.9',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],
)


text:
package com.hannesdorfmann.adapterdelegates4;

import android.view.View;
import android.view.ViewGroup;

import junit.framework.Assert;

import org.junit.Test;
import org.mockito.Mockito;

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

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

/**
 * @author Hannes Dorfmann
 */
public class AbsListItemAdapterDelegateTest {

    @Test
    public void invokeMethods() {

        List<Animal> items = new ArrayList<>();
        items.add(new Cat());

        CatAbsListItemAdapterDelegate delegate = new CatAbsListItemAdapterDelegate();

        delegate.isForViewType(items, 0);
        Assert.assertTrue(delegate.isForViewTypeCalled);

        ViewGroup parent = Mockito.mock(ViewGroup.class);
        CatViewHolder vh = delegate.onCreateViewHolder(parent);
        Assert.assertTrue(delegate.onCreateViewHolderCalled);

        delegate.onBindViewHolder(items, 0, vh, new ArrayList<Object>());
        Assert.assertTrue(delegate.onBindViewHolderCalled);

    }

    interface Animal {
    }

    class Cat implements Animal {
    }

    class CatViewHolder extends RecyclerView.ViewHolder {
        public CatViewHolder(View itemView) {
            super(itemView);
        }
    }

    class CatAbsListItemAdapterDelegate
            extends AbsListItemAdapterDelegate<Cat, Animal, CatViewHolder> {
        public boolean isForViewTypeCalled = false;
        public boolean onCreateViewHolderCalled = false;
        public boolean onBindViewHolderCalled = false;
        public boolean onViewDetachedFromWindow = false;

        @Override
        protected boolean isForViewType(@NonNull Animal item, @NonNull List<Animal> items, int position) {
            isForViewTypeCalled = true;
            return false;
        }

        @NonNull
        @Override
        public CatViewHolder onCreateViewHolder(@NonNull ViewGroup parent) {
            onCreateViewHolderCalled = true;
            return new CatViewHolder(Mockito.mock(View.class));
        }

        @Override
        protected void onBindViewHolder(@NonNull Cat item, @NonNull CatViewHolder holder, @NonNull List payloads) {
            onBindViewHolderCalled = true;
        }

        @Override
        public void onViewDetachedFromWindow(@NonNull RecyclerView.ViewHolder holder) {
            super.onViewDetachedFromWindow(holder);
            onViewDetachedFromWindow = true;
        }
    }
}


text:
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Tests](https://github.com/BrianLusina/brianlusina.github.io/actions/workflows/tests.yml/badge.svg)](https://github.com/BrianLusina/brianlusina.github.io/actions/workflows/tests.yml)
[![codecov](https://codecov.io/gh/BrianLusina/brianlusina.github.io/branch/staging/graph/badge.svg?token=4rhyJnYoKO)](https://codecov.io/gh/BrianLusina/brianlusina.github.io)
[![Lint](https://github.com/BrianLusina/brianlusina.github.io/actions/workflows/lint.yml/badge.svg)](https://github.com/BrianLusina/brianlusina.github.io/actions/workflows/lint.yml)
[![Build](https://github.com/BrianLusina/brianlusina.github.io/actions/workflows/build_app.yml/badge.svg)](https://github.com/BrianLusina/brianlusina.github.io/actions/workflows/build_app.yml)

Personal site built with [ReactJS](https://reactjs.org/).

**Why document and open source my site?**

Part of the belief that OSS is the future and also fosters a community of developers, on top of which not only allows growth, but learnings. And with any OSS, it is important that a document is created to allow contributors to jump on board easily.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Clone the repository:

```bash
# if using ssh
git clone git@github.com:BrianLusina/brianlusina.github.io.git
# or if using https
git clone https://github.com/BrianLusina/brianlusina.github.io.git
```

## Prerequisites

A couple of things you will need to install in order to run this project:

1. [Node and NPM](https://nodejs.org/en/)

   Node is a JavaScript Runtime Environment. Installation instructions can be found in the link provided. By installing Node, you will also be installing npm. Node version used is **10.x**

2. [Yarn](https://yarnpkg.com) - (Optional)

   Yarn is an alternative package manager to npm. It is not necessary to use, but, if you prefer using yarn, then follow the instructions set out in the download section of the link provided. It is advised, that one package manager is picked due to how differently the dependency graph is managed by both.

## Installing

Installing dependencies is straight forward:

```bash
npm install
# or
yarn install
```

This should set you up to install the dependencies as needed and get you running.

## Running tests

Tests have been written with [Jest](https://facebook.github.io/jest/). Running the tests can be done as follows:

```bash
yarn test
# or
npm run test
```

To generate a coverate report:

```bash
yarn test:coverage
# or
npm run test:coverage
```

## Deployment

Deployment has been configured to work on any system or static server as necessary. Therefore deployment can be to either a microservice application with this running in its own container, or to a static site or to even github pages.

The pipeline set here is to deploy this to a seperate static server when in development in order to do testing and to [github pages](https://pages.github.com/) when finally moving to production. Ideally,this being a blog site which primarily serves static content, that should not matter where it is deployed, as long as it is accessible and can handle incoming traffic.

Tools used for deployment:

- [Docker](https://www.docker.com/)

  There is a [Dockerfile](./Dockerfile) available at the root of the project. Which entails instructions on how to deploy this to a system/server that supports running dockerized applications.

- [Surge](https://surge.sh)

  Surge is a static hosting site and is used when deploying in development. In order to use this, ensure that you have an account with surge and have the necessary credentials in order to deployto a static site. In its place, any other static hosting site can be used, e.g. [Netlify](https://www.netlify.com/).

  To publish directly, you can use:

  ```bash
  yarn deploy:staging
  ```

  > this will run a build and then publish to surge, ensure you change the domain name to something else though :). Current Staging URL is [here](https://fenestra.surge.sh/)

- [Github Pages](https://pages.github.com/)

  Github Pages has been used as the production site for the blog. This can be changed to something else however. In its place, anything else can be used.

  > this runs a buld and publishes to github pages.
  > NB: Ensure that you change the [homepage](./package.json#homepage) attribute in the [package.json](./package.json) file to something else however.

  You may add a Google Analytics Tracking ID, however,this is not necessary. To do so you will need to add it as an environment variable ANALYTICS_TRACKING_ID in any of the `.env.<ENVIRONMENT>` of your choice. Sample environments have been provided to give more context:

  ```plain
  .
  └── .env.sample
  ```

  In order to use the sample, simply rename the file by removing the `.sample` suffix.

  The environment variables will be picked up at build time.

## Built With

1. [JavaScript Language](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript) - Programming language
2. [TypeScript](https://www.typescriptlang.org/) - Programming language
3. [ReactJS](https://reactjs.org/) - JavaScript library for building declarative UI.

## Versioning

[SemVer](https://semver.org/) is used for versioning. For the versions available, see the [tags](https://github.com/BrianLusina/brianlusina.github.io/tags) on this repository.

## License

This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.

## Acknowledgements

A hat tip to [Unsplash](https://unsplash.com) for images and [Html5Up](https://html5up.net) for themes.


text:
import datetime

import mock
from oslo.utils import timeutils

from ironic.db import api as db_api
from ironic import objects
from ironic.objects import utils as obj_utils
from ironic.tests.db import base
from ironic.tests.db import utils

class TestConductorObject(base.DbTestCase):

    def setUp(self):
        super(TestConductorObject, self).setUp()
        self.fake_conductor = utils.get_test_conductor(
                                        updated_at=timeutils.utcnow())
        self.dbapi = db_api.get_instance()

    def test_load(self):
        host = self.fake_conductor['hostname']
        with mock.patch.object(self.dbapi, 'get_conductor',
                               autospec=True) as mock_get_cdr:
            mock_get_cdr.return_value = self.fake_conductor
            objects.Conductor.get_by_hostname(self.context, host)
            mock_get_cdr.assert_called_once_with(host)

    def test_save(self):
        host = self.fake_conductor['hostname']
        with mock.patch.object(self.dbapi, 'get_conductor',
                               autospec=True) as mock_get_cdr:
            mock_get_cdr.return_value = self.fake_conductor
            c = objects.Conductor.get_by_hostname(self.context, host)
            c.hostname = 'another-hostname'
            self.assertRaises(NotImplementedError,
                              c.save, self.context)
            mock_get_cdr.assert_called_once_with(host)

    def test_touch(self):
        host = self.fake_conductor['hostname']
        with mock.patch.object(self.dbapi, 'get_conductor',
                               autospec=True) as mock_get_cdr:
            with mock.patch.object(self.dbapi, 'touch_conductor',
                               autospec=True) as mock_touch_cdr:
                mock_get_cdr.return_value = self.fake_conductor
                c = objects.Conductor.get_by_hostname(self.context, host)
                c.touch(self.context)
                mock_get_cdr.assert_called_once_with(host)
                mock_touch_cdr.assert_called_once_with(host)

    def test_refresh(self):
        host = self.fake_conductor['hostname']
        t0 = self.fake_conductor['updated_at']
        t1 = t0 + datetime.timedelta(seconds=10)
        returns = [dict(self.fake_conductor, updated_at=t0),
                   dict(self.fake_conductor, updated_at=t1)]
        expected = [mock.call(host), mock.call(host)]
        with mock.patch.object(self.dbapi, 'get_conductor',
                               side_effect=returns,
                               autospec=True) as mock_get_cdr:
            c = objects.Conductor.get_by_hostname(self.context, host)
            # ensure timestamps have tzinfo
            self.assertEqual(obj_utils.datetime_or_none(t0), c.updated_at)
            c.refresh()
            self.assertEqual(obj_utils.datetime_or_none(t1), c.updated_at)
            self.assertEqual(expected, mock_get_cdr.call_args_list)
            self.assertEqual(self.context, c._context)


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="https://dc-js.github.io/dc.js/css/dc.css" />